WebSphere Commerce EnterpriseWebSphere Commerce Professional

Enabling change control for a noun part

In cases where the noun can be divided into parts that can be independently modified, the change control information can also be independent. Part mediators can be registered to change control mediators that manage the noun part by extending the wc-business-object-mediator.xml file.

Feature Pack 6 or laterNote: The wc-business-object-mediator.xml file cannot be extended to customize the part mediator in Feature Pack 6 and above.

Before you begin

  1. Enabling workspaces support for a custom table in an existing WebSphere Commerce BOD service module
  2. Enabling change control for a noun

About this task

A changed noun part will inherit the change control information of its parent noun by default. However, if that part has been explicitly configured to have independent change control, then a separate CMMETADATA record is used to manage change control information for that part of the noun.

To configure change control on a specific part of a noun:

Procedure

  1. Launch WebSphere Commerce Developer.
  2. Identify the business object mediator configuration file where you will configure this noun part. In most cases, you will have already created the file following the steps in Enabling change control for a noun. However, if you are enabling additional change control for a noun part that is part of a default WebSphere Commerce noun that is already configured in default configuration files, you need to create a new file for your extensions.
    1. Determine the correct location for the configuration file to work with, based on the following criteria:
      • If you are enabling change control for a noun part that is part of a default WebSphere Commerce service module, right-click on the WC\config\com.ibm.commerce.myservicemodulename-ext folder.
      • If you are enabling change control for a noun part that is part of a custom service module, right-click on the WC\config\com.ibm.commerce.myservicemodulename folder.
    2. If wc-business-object-mediator.xml does not already exist in that directory, select New > Other > XML > XML > Next. If the file already exists, proceed to the next step.
    3. Select Create an XML file from scratch.
    4. Click Next.
    5. Name the file: wc-business-object-mediator.xml.
    6. Click Finish.
  3. Mediators for a noun are defined within the <_config:object> element for the noun. In extensions to existing business object mediator configurations, you will need to copy over this element in order to add mediators for nouns and noun parts. In many customizations, this file (and the appropriate <_config:object> element) will already have been generated for you as part of running the Data Service Layer Wizard. 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. Mediators for a noun part are defined within the <_config:mediator> element for the noun mediator. In extensions to existing business object mediator configurations, you will need to copy over this element in order to add mediators for noun parts. In many customizations, this file (and the appropriate <_config:mediator> element) will already have been generated for you as part of running the Data Service Layer Wizard.
  5. Add a <_config:part-mediator> element to the <_config:mediator> element. Set the interfaceName attribute to com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.BusinessObjectMediator. Because the part mediator implementation is coupled to the change control mediator implementation for the noun, there is no unique interface required.

    For example:

    <_config:part-mediator interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.BusinessObjectMediator">
    
  6. Create a <_config:part-mediator-implementation> element with a className of com.ibm.commerce.context.content.locking.ChangeControlBusinessObjectPartMediatorImpl. This is the part mediator implementation which the change control mediator is expecting and dependent on. Any change control part mediator must either be this class or a subclass of this class.
    For example:
    		<_config:part-mediator-implementation className="com.ibm.commerce.context.content.locking.ChangeControlBusinessObjectPartMediatorImpl">
    
  7. Add a <_config:mediator-properties> element and, within it, <_config:mediator-property> elements for the part mediator implementation. An explanation of the values, and a sample set of configuration elements, are provided:
    objectPath
    A mandatory property that identifies the noun part you are applying change control to. The value is the XPath expression pointing to the noun part.
    uniqueIDProperty
    The property of the noun that resolves the identifier. Set this value to uniqueID. This is the value found in BOKEY1 column of the CMMETADATA table.
    resourceManagerId
    The resourceManagerId is a mandatory property which is the value used in the CMRESMGR_ID column of the CMMETADATA table. The resource manager ID must be a defined resource manager (which maps to a table) for the service module, found in one of the following files:
    • WebSphere Commerce Developer workspace_dir\wc\xml\content-management\ servicemodulename.resource-managers.xml
    • WebSphere Commerce EnterpriseWebSphere Commerce - ExpressWebSphere Commerce ProfessionalWC_installdir\wc.ear\xml\content-management\servicemodulename.resource-managers.xml
    • WebSphere Commerce Developerworkspace_dir\wc\xml\content-management\servicemodulename.resource-managers-ext.xml
    • WebSphere Commerce EnterpriseWebSphere Commerce - ExpressWebSphere Commerce ProfessionalWC_installdir\wc.ear\xml\content-management\servicemodulename.resource-managers-ext.xml

    You define the resourceManagerId when you perform the steps in Enabling workspaces support for a custom table in an existing WebSphere Commerce BOD service module.

    The following code sample shows a complete definition:
    			 <_config:mediator-properties>
    			 	<_config:mediator-property name="objectPath" value="Association"/>
    			 	<_config:mediator-property name="uniqueIDProperty" value="uniqueID"/>
    			 	<_config:mediator-property name="resourceManagerId" value="18"/>
    			 </_config:mediator-properties>
    
  8. Optional: Additional properties of the change control part mediation can be specified:
    1. A uniqueIDProperty can be specified to indicate the property of the object that indicates the value that is stored in the BOKEY2 column of the CMMETADATA</apiname > table. Specify this property if the object property is a list and each list item has separate change control information associated with it. If the entire list shares the same change control information, then this property is not required.</cmd></substep> <substep><cmd>A resourceContainerId property can be specified on the change control part mediation implementation if the <xref keyref=