

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.
Note: The wc-business-object-mediator.xml file cannot be extended to customize
the part mediator.
Before you begin
About this task
To configure change control on a specific part of a noun:
Procedure
- Launch WebSphere Commerce Developer.
-
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.
-
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. -
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. -
Add a
<_config:part-mediator>
element to the<_config:mediator>
element. Set theinterfaceName
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">
-
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">
-
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:
workspace_dir\wc\xml\content-management\ servicemodulename.resource-managers.xml
- WC_installdir\wc.ear\xml\content-management\servicemodulename.resource-managers.xml
workspace_dir\wc\xml\content-management\servicemodulename.resource-managers-ext.xml
- WC_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>
- Optional:
Additional properties of the change control part mediation can be specified:
- 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 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.
-