
Enabling change control for a noun
You can enable change control for a noun by registering a change control mediator for the noun. No Java coding is required. All change control uses a common change control mediator implementation which is provided for you by default. 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 modifying the object.
Procedure
- Open HCL Commerce Developer.
-
Create a business object mediator configuration file, if one does not already
exist:
-
Mediators for a noun are defined in 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 the noun. 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.Remember: You should never modify default HCL Commerce business object mediator configuration files, as they can be overwritten when you apply updates to WebSphere Commerce. -
Create a
<_config:mediator>
element with aclassName
of com.ibm.commerce.context.content.locking.ChangeControlBusinessObjectMediatorImpl and aninterfaceName
of com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ChangeControlBusinessObjectMediator.For example:
<_config:mediator className="com.ibm.commerce.context.content.locking.ChangeControlBusinessObjectMediatorImpl" interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ChangeControlBusinessObjectMediator">
-
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. An explanation of the values, and a sample set of configuration elements, are provided:- uniqueIDproperty
- The property of the noun that resolves the identifier. Set this value to StoreIdentifier/UniqueID. This is the value found in BOKEY1 column of the CMMETADATA table.
- resourceManagerId and resourceContainerId
- You define the resource containers and managers when you perform the
steps in Enabling workspaces support for a custom table in an existing HCL Commerce BOD service module. The resource container
ID and resource manager ID must be a defined resource container or
resource manager for the service module, found in one of the
following files:
workspace_dir\wc\xml\content-management\ servicemodulename.resource-managers.xml
- workspace_dir\WC\xml\content-management\servicemodulename.resource-managers.xml
workspace_dir\wc\xml\content-management\servicemodulename.resource-managers-ext.xml
- workspace_dir\WC\xml\content-management\servicemodulename.resource-managers-ext.xml
The following example shows a noun registered with a value of 10001 for the resource container value and 1 for the resource manager value.
<_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="StoreIdentifier/UniqueID"/> <_config:mediator-property name="resourceManagerId" value="1"/> <_config:mediator-property name="resourceContainerId" value="10001"/> </_config:mediator-properties> </_config:mediator>
Example
<_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">
<_config:object logicalType="com.mycompany.commerce.tutorialstore.facade.datatypes.TutorialStoreType"
physicalType="com.mycompany.commerce.tutorialstore.facade.server.entity.datatypes.Storeent">
<_config:mediator interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ReadBusinessObjectMediator"
className="com.mycompany.commerce.tutorialstore.facade.server.services.dataaccess.bom.mediator.ReadTutorialStoreMediator">
<_config:part-mediator interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ReadBusinessObjectPartMediator">
<_config:part-mediator-implementation className="com.mycompany.commerce.tutorialstore.facade.server.services.dataaccess.bom.mediator.ReadTutorialStoreDescriptionMediator"/>
<_config:part-mediator-implementation className="com.mycompany.commerce.tutorialstore.facade.server.services.dataaccess.bom.mediator.ReadTutorialStoreSupportedLanguagesMediator"/>
<_config:part-mediator-implementation className="com.mycompany.commerce.tutorialstore.facade.server.services.dataaccess.bom.mediator.ReadTutorialStoreSupportedCurrenciesMediator"/>
</_config:part-mediator>
</_config:mediator>
<_config:mediator interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ChangeBusinessObjectMediator"
className="com.mycompany.commerce.tutorialstore.facade.server.services.dataaccess.bom.mediator.ChangeTutorialStoreMediator">
<_config:part-mediator interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ChangeBusinessObjectPartMediator">
<_config:part-mediator-implementation className="com.mycompany.commerce.tutorialstore.facade.server.services.dataaccess.bom.mediator.ChangeTutorialStoreDescriptionMediator"/>
<_config:part-mediator-implementation className="com.mycompany.commerce.tutorialstore.facade.server.services.dataaccess.bom.mediator.ChangeTutorialStoreBasePartMediator"/>
</_config:part-mediator>
</_config:mediator>
<_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="StoreIdentifier/UniqueID"/>
<_config:mediator-property name="resourceManagerId" value="1"/>
<_config:mediator-property name="resourceContainerId" value="10001"/>
</_config:mediator-properties>
</_config:mediator>
</_config:object>
</_config:BusinessObjectMediatorConfiguration>