Tutorials > Management Center > Extend the Recipes tool to support workspaces

< Previous | Next >


Enable 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 modifying the object. All change control uses a common change control mediator implementation, which is provided for you by default.

When you lock a noun, its noun parts are also locked. However, you can provide separate change control for noun parts. See Enable change control for a noun part for additional information.

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 Enterprise Applications > WC > config > com.mycompany.commerce.project.

  3. Double click on the file wc-business-object-mediator.xml to open the file.

    Mediators for a noun are defined in the <_config:object> element for the noun. In extensions to existing business object mediator configurations, we will need to copy over this element 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. 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>
    

    The resource container ID and resource manager ID must be a defined resource container or resource manager for the service module, which is found in the com.mycompany.commerce.project.resource-managers.xml file.

The following sample shows a complete configuration file containing 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>

< Previous | Next >


+

Search Tips   |   Advanced Search