Disabling content versioning for a business object

You can disable content versioning for particular business objects. For example, you might want your business user to be able to manage versions of sales catalogs, and catalog entries but not categories.

To disable content versioning for a business object, you modify the definitions file for the object. The object definition file contains configuration information. The definitions are used by the Management Center framework to display all the tools, business objects, properties views, and list views in Management Center. You also modify the workspace_dir\WC\xml\config\com.ibm.commerce.catalog\wc-content-version.xml file to remove the UI object configuration.

Procedure

  1. Open HCL Commerce Developer. Switch to the Enterprise Explorer view.
  2. Update the object definition file that contains all the definition for the business object you want to disable content versioning for.
    1. Open the object definition file for the business object. The files are located in LOBTools > WebContent > WEB-INF > src > xml > commerce > catalog > objectDefinitions.
      The following table shows which definition file corresponds to the business objects.
      Business objects File
      Category CatalogGroupPrimaryObjectDefinition.xml
      Sales Category SalesCatalogGroupPrimaryObjectDefinition.xml
      Sales Catalog SalesCatalogPrimaryObjectDefinition.xml
      Product ProductPrimaryObjectDefinition.xml
      SKU ProductSKUPrimaryObjectDefinition.xml
      Catalog Group SKU CatalogGroupSKUPrimaryObjectDefinition.xml
      Bundle BundlePrimaryObjectDefinition.xml
      Kit KitPrimaryObjectDefinition.xml
    2. Locate the GetChildrenService class for content version, and comment out the content version service. This class is used to retrieve content versions from the server.
      The following code snippet is the content version service definition for the CatalogGroup business object.
      <GetChildrenService objectTypes="ContentVersion" url="/cmc/GetContentVersions">
      			<ServiceParam name="storeId"/>
      			<ServiceParam name="objectId" propertyName="catgroupId"/>
      			<ServiceParam name="objectType" value="CatalogGroup"/>
      			<ServiceParam name="basedOnVersionNumber" propertyName="basedOnVersionNumber"/>			
      		</GetChildrenService>
    3. Locate the ReferenceObjectDefinition class for content version, and comment out this class. This class defines the object definition for the content version.
      The following code snippet is the CatalogGroup business object definition for content version.
      <!---  
      	    Reference object definition for the versioned catalog group
      	-->
      	<ReferenceObjectDefinition baseDefinitionName="wcfBaseContentVersion" referencedType="CatalogGroup"/>
    4. Locate the CreateContentVersionClientAction class, and comment out the class. This class enables the create content version client action.
      <!---
      		Create Content Version Client Action
      	-->
      	<CreateContentVersionClientAction/>
    5. Save the file.
  3. Remove the Versions tab in the business object properties view.
    1. Open the properties view file for the business object. The files are located in the following directory: LOBTools > WebContent > WEB-INF > src > xml > commerce > catalog > propertiesViews.
      Business objects File
      Category CategoryPropertiesView.xml
      Sales Category SalesCategoryPropertiesView.xml
      Sales Catalog SalesCatalogPropertiesView.xml
      Product ProductPropertiesView.xml
      SKU ProductSKUPropertiesView.xml
      Catalog Group SKU CatalogGroupSKUPropertiesView.xml
      Bundle BundlePropertiesView.xml
      Kit KitPropertiesView.xml
    2. Comment out the following element:
      <PropertyTabPane name="manageVersionTab" text="${foundationResources.manageVersionTab}">
      ....
      	</PropertyTabPane>
    3. Save your changes.
  4. Update the server side.
    For the server side, content versioning is disabled on the UI object level. You must modify the wc-content-version.xml file.

Results

You cannot manage versions of the business object you disabled anymore. To re-enable content versioning for that business object, uncomment the code snippets you commented out.