Enabling change control for the noun

You can enable change control for a noun by registering a change control mediator for the noun. No Java coding is required. The data service layer uses the registration information and the change control mediator to validate whether the object can be modified and to create locks when the object is modified. All change control uses a common change control mediator implementation, which is provided for you by default.

About this task

When you lock a noun, its noun parts are also locked. However, you can provide separate change control for noun parts. For more information, see Enabling change control for a noun part.

To register a change control business object mediator for a noun:

Procedure

  1. Open WebSphere Commerce Developer.
  2. In the Enterprise Explorer view, navigate to WC > xml > config > com.mycompany.commerce.project.
  3. Double-click the file wc-business-object-mediator.xml to open the file.
    Note: Mediators for a noun are defined in the <_config:object> element for the noun. In extensions to existing business object mediator configurations, you must copy over this element to add mediators for the noun. In many customizations, this file and the appropriate <_config:object> element are generated as part of running the Data Service Layer Wizard. Keep in mind that you should never modify default WebSphere Commerce business object mediator configuration files, as they can be overwritten when you apply updates to WebSphere Commerce.
  4. Create a <_config:mediator> element with a className of com.ibm.commerce.context.content.locking.ChangeControlBusinessObjectMediatorImpl and an interfaceName of com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ChangeControlBusinessObjectMediator.
  5. Create a set of <_config:mediator-property> elements for the change control mediator, which indicates the resource container and manager ID used to represent this noun.
    <!-- Added for Workspace support for project -->
    <_config:mediator className="com.ibm.commerce.context.content.locking.ChangeControlBusinessObjectMediatorImpl"
    interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ChangeControlBusinessObjectMediator">
      <_config:mediator-properties>
        <_config:mediator-property name="uniqueIDProperty"     value="ProjectIdentifier/UniqueID" />
        <_config:mediator-property name="resourceManagerId" value="1" />
        <_config:mediator-property name="resourceContainerId" value="10005" />
      </_config:mediator-properties>
    </_config:mediator>
     
    <!-- Added for Workspace support for ProjectCollection -->
    <_config:mediator
    className="com.ibm.commerce.context.content.locking.ChangeControlBusinessObjectMediatorImpl"
    interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ChangeControlBusinessObjectMediator">
      <_config:mediator-properties>
        <_config:mediator-property name="uniqueIDProperty" value="ProjectCollectionIdentifier/UniqueID"/>
        <_config:mediator-property name="resourceManagerId" value="9" />
        <_config:mediator-property name="resourceContainerId" value="10005" />
      </_config:mediator-properties>
    </_config:mediator>
    Note: The resource container ID and resource manager ID must be a defined resource container or resource manager for the service module. This definition can be found in the com.mycompany.commerce.project.resource-managers.xml file.

Results

The following sample shows a complete configuration file that contains change control mediators for the Project noun and ProjectCollection noun:
<?xml version="1.0" encoding="UTF-8"?>
<_config:BusinessObjectMediatorConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://www.ibm.com/xmlns/prod/commerce/foundation/config ../xsd/wc-business-object-mediator.xsd" 
  xmlns:_config="http://www.ibm.com/xmlns/prod/commerce/foundation/config">
 
  <!-- Here are the read and change mediator for the Project -->
  <!-- ******************* TODO ******************** -->
  <!-- ******************* Below line is demo code, pls replace it with the physical type object as something like 
    <_config:object logicalType="com.mycompany.commerce.project.facade.datatypes.ProjectType" 
    physicalType="com.mycompany.commerce.project.facade.server.entity.datatypes.Project">  
  ******************** -->
  <_config:object logicalType="com.mycompany.commerce.project.facade.datatypes.ProjectType" 
    physicalType="com.mycompany.commerce.project.facade.server.entity.datatypes.Xproject">
    <_config:mediator interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ReadBusinessObjectMediator" 
    className="com.mycompany.commerce.project.facade.server.services.dataaccess.bom.mediator.ReadProjectMediator">
      <_config:part-mediator interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ReadBusinessObjectPartMediator">
        <_config:part-mediator-implementation 
        className="com.mycompany.commerce.project.facade.server.services.dataaccess.bom.mediator.ReadProjectDescriptionMediator" />
        <_config:part-mediator-implementation 
        className="com.mycompany.commerce.project.facade.server.services.dataaccess.bom.mediator.ReadProjectMaterialMediator" />
        <_config:part-mediator-implementation 
        className="com.mycompany.commerce.project.facade.server.services.dataaccess.bom.mediator.ReadProjectInstructionMediator" />
        <_config:part-mediator-implementation 
        className="com.mycompany.commerce.project.facade.server.services.dataaccess.bom.mediator.ReadProjectColRelMediator" />
        <_config:part-mediator-implementation 
        className="com.mycompany.commerce.project.facade.server.services.dataaccess.bom.mediator.ReadProjectToolMediator" />
      </_config:part-mediator>
    </_config:mediator>
    <_config:mediator interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ChangeBusinessObjectMediator" 
    className="com.mycompany.commerce.project.facade.server.services.dataaccess.bom.mediator.ChangeProjectMediator">
      <_config:part-mediator interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ChangeBusinessObjectPartMediator">
        <_config:part-mediator-implementation 
        className="com.mycompany.commerce.project.facade.server.services.dataaccess.bom.mediator.ChangeProjectBasePartMediator" />
        <_config:part-mediator-implementation 
        className="com.mycompany.commerce.project.facade.server.services.dataaccess.bom.mediator.ChangeProjectDescriptionMediator" />
        <_config:part-mediator-implementation 
        className="com.mycompany.commerce.project.facade.server.services.dataaccess.bom.mediator.ChangeProjectMaterialMediator" />
        <_config:part-mediator-implementation 
        className="com.mycompany.commerce.project.facade.server.services.dataaccess.bom.mediator.ChangeProjectInstructionMediator" />
        <_config:part-mediator-implementation 
        className="com.mycompany.commerce.project.facade.server.services.dataaccess.bom.mediator.ChangeProjectToolMediator" />
        <_config:part-mediator-implementation 
        className="com.mycompany.commerce.project.facade.server.services.dataaccess.bom.mediator.ChangeProjectPrjColRelMediator" />
        <_config:part-mediator-implementation 
        className="com.mycompany.commerce.project.facade.server.services.dataaccess.bom.mediator.ChangeProjectMaterialCatentryMediator" />
      </_config:part-mediator>
    </_config:mediator>

    <!-- Here is the example to enable property mapping to map Logical Data Object's User Data into Physical Data Object User Data 
      <_config:property-mapping logicalType="com.mycompany.commerce.project.facade.datatypes.ProjectType" 
      physicalType="com.mycompany.commerce.project.facade.server.entity.datatypes.Project">
        <_config:userDataProperty logicalPropertyName="Logical User Data name" physicalPropertyName="Physical User Data name" />
      </_config:property-mapping>
    -->
 
    <!-- Added for Workspace support  for project-->
    <_config:mediator className="com.ibm.commerce.context.content.locking.ChangeControlBusinessObjectMediatorImpl" 
    interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ChangeControlBusinessObjectMediator">
      <_config:mediator-properties>
        <_config:mediator-property name="uniqueIDProperty" value="ProjectIdentifier/UniqueID" />
        <_config:mediator-property name="resourceManagerId" value="1" />
        <_config:mediator-property name="resourceContainerId" value="10005" />
      </_config:mediator-properties>
    </_config:mediator>
  </_config:object>
  <_config:object logicalType="com.mycompany.commerce.project.facade.datatypes.ProjectCollectionType" 
  physicalType="com.mycompany.commerce.project.facade.server.entity.datatypes.Xprjcol">
    <_config:mediator interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ReadBusinessObjectMediator" 
    className="com.mycompany.commerce.project.facade.server.services.dataaccess.bom.mediator.ReadProjectCollectionMediator">
      <_config:part-mediator interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ReadBusinessObjectPartMediator">
        <_config:part-mediator-implementation 
        className="com.mycompany.commerce.project.facade.server.services.dataaccess.bom.mediator.ReadProjectCollectionDescriptionMediator" />
      </_config:part-mediator>
    </_config:mediator>
    <_config:mediator interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ChangeBusinessObjectMediator" 
    className="com.mycompany.commerce.project.facade.server.services.dataaccess.bom.mediator.ChangeProjectCollectionMediator">
      <_config:part-mediator interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ChangeBusinessObjectPartMediator">
        <_config:part-mediator-implementation 
        className="com.mycompany.commerce.project.facade.server.services.dataaccess.bom.mediator.ChangeProjectCollectionBasePartMediator" />
        <_config:part-mediator-implementation 
        className="com.mycompany.commerce.project.facade.server.services.dataaccess.bom.mediator.ChangeProjectCollectionDescriptionMediator" />
      </_config:part-mediator>
    </_config:mediator>
    <!-- Added for Workspace support for ProjectCollection-->
    <_config:mediator className="com.ibm.commerce.context.content.locking.ChangeControlBusinessObjectMediatorImpl" 
    interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ChangeControlBusinessObjectMediator">
      <_config:mediator-properties>
        <_config:mediator-property name="uniqueIDProperty" value="ProjectCollectionIdentifier/UniqueID"/>
        <_config:mediator-property name="resourceManagerId" value="9" />
        <_config:mediator-property name="resourceContainerId" value="10005" />
      </_config:mediator-properties>
    </_config:mediator>
  </_config:object>
</_config:BusinessObjectMediatorConfiguration>