Introduced in Feature Pack 2

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 WC_eardir\xml\config\com.ibm.commerce.catalog\wc-content-version.xml file to remove the UI object configuration.

Procedure

  1. Open WebSphere Commerce Developer and 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 > config > commerce > catalog > objectDefinitions.
      The following table shows which definition file corresponds to the business objects.
      Business objects File
      Category CatalogGroupPrimaryObjectDefinition.def
      Sales Category SalesCatalogGroupPrimaryObjectDefinition.def
      Sales Catalog SalesCatalogPrimaryObjectDefinition.def
      Product ProductPrimaryObjectDefinition.def
      SKU ProductSKUPrimaryObjectDefinition.def
      Catalog Group SKU CatalogGroupSKUPrimaryObjectDefinition.def
      Bundle BundlePrimaryObjectDefinition.def
      Kit KitPrimaryObjectDefinition.def
    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 > config > commerce > catalog > propertiesViews.
      Business objects File
      Category CategoryPropertiesView.def
      Sales Category SalesCategoryPropertiesView.def
      Sales Catalog SalesCatalogPropertiesView.def
      Product ProductPropertiesView.def
      SKU ProductSKUPropertiesView.def
      Catalog Group SKU CatalogGroupSKUPropertiesView.def
      Bundle BundlePropertiesView.def
      Kit KitPropertiesView.def
    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.

What to do next

After you complete your customization:
  1. Right-click LOBTools Project; then click Build OpenLaszlo Project to produce an updated ManagementCenter.swf file under the workspace_dir\LOBTools\WebContent directory. This setting is the default environment setting.
  2. Test your changes by viewing them in the Management Center, using this URL: https://hostname:8000/lobtools.
  3. Deploy your changes to your production environment.