Introduced in Feature Pack 2

Content Versioning configuration file (wc-content-version.xml)

The content versioning configuration file defines the configuration for the UI objects that are versionable. This file tells you which UI objects are versionable, and how the system versions the UI object. To change the default configuration for the UI objects, you must extend the configuration file by creating a file in the ext folder (WC_eardir\xml\config\com.ibm.commerce.servicemodule-ext); where com.ibm.commerce.servicemodule-ext contains all the extended files for a particular service module.

Multiple UI objects can map to the same noun. These UI objects are represented as the same noun but the Management Center interface creates different types for the different UI objects. For example, the Product, ProductSKU, CatalogGroupSKU, Bundle, and Kit UI objects map to the CatalogEntry noun.

If a service module manages UI objects that are versionable, it should have a wc-content-version.xml configuration file. In this file, you specify which parts of the UI objects to save when creating a version. The configuration file is located in WC_eardir\xml\config\com.ibm.commerce.servicemodulename\ or WC_eardir\xml\config\com.ibm.commerce.servicemodulename-fep\; where com.ibm.commerce.servicemodulename is the name of the service module. For example, the Catalog service module configuration file is located in the WC_eardir\xml\config\com.ibm.commerce.catalog\ directory or WC_eardir\xml\config\com.ibm.commerce.catalog-fep\ directory.
Important: You must not modify the wc-content-version.xml file in either of the preceding directories because WebSphere Commerce fix pack updates might remove your changes.
Sample code snippet of the Catalog service module wc-content-version.xml file:
<wc:ContentVersionConfiguration xmlns:wc="http://www.ibm.com/xmlns/prod/WebSphereCommerce"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/xmlns/prod/WebSphereCommerce ../xsd/wc-content-version.xsd">
1<wc:ContentVersionContainer name="com.ibm.commerce.catalog" id="-1">
2	<wc:ContentVersionNoun name="Catalog" topTable="CATALOG" className="com.ibm.commerce.catalog.version.CatalogContentVersionServiceImpl">
3		<wc:ConfigGroup id="-1">
4			<wc:ContentVersionUIObject name="SalesCatalog" />
5			<wc:ContentVersionRelatedTable name="CATALOG" whereClause="CATALOG_ID=? AND MEMBER_ID=?" values="${objectId}, ${storeOwnerId}"/>
     			<wc:ContentVersionRelatedTable name="CATALOGDSC" whereClause="CATALOG_ID=?" values="${objectId}"/>
      			<wc:ContentVersionRelatedTable name="STORECAT" whereClause="CATALOG_ID=? AND STOREENT_ID=?" values="${objectId}, ${storeId}"/>
      			<wc:ContentVersionRelatedTable name="ATCHREL" whereClause="OBJECT_ID=? AND ATCHOBJTYP_ID=?" values="${objectId}, 1"/>
		</wc:ConfigGroup>
	</wc:ContentVersionNoun>

	<wc:ContentVersionNoun name="CatalogGroup" topTable="CATGROUP" className="com.ibm.commerce.catalog.version.CatalogGroupContentVersionServiceImpl">
		<wc:ConfigGroup id="-1">
    			<wc:ContentVersionUIObject name="CatalogGroup" />
      			<wc:ContentVersionUIObject name="SalesCatalogGroup" />
      			<wc:ContentVersionRelatedTable name="CATGROUP" whereClause="CATGROUP_ID=? AND MEMBER_ID=?" values="${objectId}, ${storeOwnerId}"/>
      			<wc:ContentVersionRelatedTable name="CATGRPDESC" whereClause="CATGROUP_ID=?" values="${objectId}" />
     			<wc:ContentVersionRelatedTable name="CATTOGRP" whereClause="CATGROUP_ID=? AND CATALOG_ID IN 
			(SELECT CATALOG_ID FROM %CURRENT_SCHEMA%.STORECAT WHERE STOREENT_ID=?)" values="${objectId}, ${storeId}"/>
      			<wc:ContentVersionRelatedTable name="CATGRPREL" whereClause="CATGROUP_ID_CHILD=? AND CATALOG_ID IN 
			(SELECT CATALOG_ID FROM %CURRENT_SCHEMA%.STORECAT WHERE STOREENT_ID=?)" values="${objectId}, ${storeId}"/>
      			<wc:ContentVersionRelatedTable name="STORECGRP" whereClause="CATGROUP_ID=? AND STOREENT_ID=?" values="${objectId}, ${storeId}"/>
      			<wc:ContentVersionRelatedTable name="ATCHREL" whereClause="OBJECT_ID=? AND ATCHOBJTYP_ID=?" values="${objectId}, 2"/>
 		</wc:ConfigGroup>
   		<wc:ConfigGroup id="-2">
    			<wc:ContentVersionUIObject name="InheritedCatalogGroup" enabled="false" />
      			<wc:ContentVersionUIObject name="InheritedSalesCatalogGroup" enabled="false" />
      			<wc:ContentVersionRelatedTable name="CATTOGRP" whereClause="CATGROUP_ID=? AND CATALOG_ID IN 
			(SELECT CATALOG_ID FROM %CURRENT_SCHEMA%.STORECAT WHERE STOREENT_ID=?)" values="${objectId}, ${storeId}"/>
      			<wc:ContentVersionRelatedTable name="CATGRPREL" whereClause="CATGROUP_ID_CHILD=? AND CATALOG_ID IN 
			(SELECT CATALOG_ID FROM %CURRENT_SCHEMA%.STORECAT WHERE STOREENT_ID=?)" values="${objectId}, ${storeId}"/>
   		</wc:ConfigGroup>
	</wc:ContentVersionNoun>
    
	<wc:ContentVersionNoun name="CatalogEntry" topTable="CATENTRY" className="com.ibm.commerce.catalog.version.CatalogEntryContentVersionServiceImpl">
		<wc:ConfigGroup id="-1">
    			<wc:ContentVersionUIObject name="Product" />
     			<wc:ContentVersionRelatedTable name="CATENTRY" whereClause="CATENTRY_ID=? AND MEMBER_ID=?" values="${objectId}, ${storeOwnerId}"/>
      			<wc:ContentVersionRelatedTable name="CATENTDESC" whereClause="CATENTRY_ID=?" values="${objectId}"/>
      			<wc:ContentVersionRelatedTable name="CATENTSUBS" whereClause="CATENTRY_ID=?" values="${objectId}"/>
      			<wc:ContentVersionRelatedTable name="ATTRIBUTE" whereClause="CATENTRY_ID=?" values="${objectId}"/>
      			<wc:ContentVersionRelatedTable name="ATTRVALUE" whereClause="ATTRIBUTE_ID IN 
			(SELECT ATTRIBUTE_ID FROM ATTRIBUTE WHERE CATENTRY_ID = ?) AND (CATENTRY_ID = 0 OR CATENTRY_ID = ?)" values="${objectId}, ${objectId}"/>
      			<wc:ContentVersionRelatedTable name="CATENTRYATTR" whereClause="CATENTRY_ID=?" values="${objectId}"/>
      			<wc:ContentVersionRelatedTable name="CATENTSHIP" whereClause="CATENTRY_ID=?" values="${objectId}"/>
      			<wc:ContentVersionRelatedTable name="CATGPENREL" whereClause="CATENTRY_ID=?" values="${objectId}"/>
      			<wc:ContentVersionRelatedTable name="LISTPRICE" whereClause="CATENTRY_ID=?" values="${objectId}"/>
      			<wc:ContentVersionRelatedTable name="STORECENT" whereClause="CATENTRY_ID=? AND STOREENT_ID=?" values="${objectId}, ${storeId}"/>
      			<wc:ContentVersionRelatedTable name="CATENTREL" whereClause="CATENTRY_ID_CHILD=?" values="${objectId}"/>
      			<wc:ContentVersionRelatedTable name="ATCHREL" whereClause="OBJECT_ID=? AND ATCHOBJTYP_ID=?" values="${objectId}, 3"/>
      			<wc:ContentVersionRelatedTable name="MASSOCCECE" whereClause="CATENTRY_ID_FROM=? AND STORE_ID=?" values="${objectId}, ${storeId}" enabled="false"/>
		</wc:ConfigGroup>
 		<wc:ConfigGroup id="-2">
      			<wc:ContentVersionUIObject name="ProductSKU" />
     			<wc:ContentVersionUIObject name="CatalogGroupSKU" />
      			<wc:ContentVersionRelatedTable name="CATENTRY" whereClause="CATENTRY_ID=? AND MEMBER_ID=?" values="${objectId}, ${storeOwnerId}" />
      			<wc:ContentVersionRelatedTable name="CATENTDESC" whereClause="CATENTRY_ID=?" values="${objectId}"/>
      			<wc:ContentVersionRelatedTable name="CATENTSUBS" whereClause="CATENTRY_ID=?" values="${objectId}"/>
      			<wc:ContentVersionRelatedTable name="ATTRIBUTE" whereClause="CATENTRY_ID=?" values="${objectId}"/>
      			<wc:ContentVersionRelatedTable name="ATTRVALUE" whereClause="CATENTRY_ID=?" values="${objectId}"/>
      			<wc:ContentVersionRelatedTable name="CATENTRYATTR" whereClause="CATENTRY_ID=?" values="${objectId}"/>
      			<wc:ContentVersionRelatedTable name="CATENTSHIP" whereClause="CATENTRY_ID=?" values="${objectId}"/>
      			<wc:ContentVersionRelatedTable name="CATGPENREL" whereClause="CATENTRY_ID=?" values="${objectId}"/>
      			<wc:ContentVersionRelatedTable name="LISTPRICE" whereClause="CATENTRY_ID=?" values="${objectId}"/>
      			<wc:ContentVersionRelatedTable name="STORECENT" whereClause="CATENTRY_ID=? AND STOREENT_ID=?" values="${objectId}, ${storeId}"/>
      			<wc:ContentVersionRelatedTable name="CATENTREL" whereClause="CATENTRY_ID_CHILD=?" values="${objectId}"/>
      			<wc:ContentVersionRelatedTable name="ATCHREL" whereClause="OBJECT_ID=? AND ATCHOBJTYP_ID=?" values="${objectId}, 3"/>
      			<wc:ContentVersionRelatedTable name="MASSOCCECE" whereClause="CATENTRY_ID_FROM=? AND STORE_ID=?" values="${objectId}, ${storeId}" enabled="false"/>
 		</wc:ConfigGroup>
	</wc:ContentVersionNoun>
</wc:ContentVersionContainer>
</wc:ContentVersionConfiguration>
In the wc-content-version.xml file:
1The wc:ContentVersionContainer element is the root element of the content versioning configuration file. The wc:ContentVersionContainer element defines a container. Each service module must declare one container. A container contains all the configuration for the service module. Specify the following attributes for this element:
name
The name of the container.
id
An identifier for the container. Negative values are reserved for IBM use.
enabled
This attribute is optional. If the value of the attribute is false, objects in the container will not be versioned. The default is true.
2The wc.ContentVersionNoun element is used to define the configuration for the UI objects to be versioned for the specific noun. Specify the following attributes for this element:
name
The name of the noun.
topTable
This attribute defines which table contains the primary key of the UI objects being versioned.
className
This attribute value contains the name of the class that implements the content versioning service for this noun. If you do not specify a value for this attribute, a default class is used. To override the default content versioning service, you must create your own service by extending the default service, and then specify the class in this attribute value.
3The wc:ConfigGroup elements are used to create configuration groups. A configuration group is a group of objects that are versioned the same way. For example, CatalogGroup and SalesCatalogGroup are different object types but are versioned the same way. Specify the following attributes for this element:
id
The unique numeric identifier for this group. This identifier is used to identify if a particular version of the object is compatible with the current version, that is, if it can be restored. If you change the ConfigGroup ID in the configuration file, any versions created based on the old ConfigGroup ID cannot be restored. Negative values are reserved for IBM use.
4The wc:ContentVersionUIObject element is used to declare which UI objects are part of the configuration group. Specify the following attributes for this element:
name
The name of the UI object as defined in Management Center.
5The wc:ContentVersionRelatedTable elements are used to define which tables are stored when creating a version of a UI object. Each UI object can have multiple tables that are stored when a version is created. Specify the following attributes for this element:
name
The name of the table to be stored.
whereClause
This attribute is used in the select statement. The system selects rows from the specified table based on the information provided in the whereClause attribute. Within the whereClause attribute, you use "?" symbol where you want to have the system replace the symbol with values specified in the values attribute.
values
The values of the corresponding parameter marks "?" in the whereClause. You can specify a literal value or use the following built in variable in the values attribute:
${objectId}
The primary key of the object you are versioning.
${storeId}
The identifier of the store you are currently working on.
${storeOwnerId}
The identifier of the member that owns the store.
${catalogRelatedStoreId}
The catalog asset store ID for an extended site store. If the current store is not an extended site store, it is the same as the current store ID.
keyColumns
This attribute identifies which columns of the table to use as key if the table does not have a primary key.
enabled
This attribute is optional. If it is false, the table will not be versioned. The default is true.
In this following sample code snippet, the system selects the primary key and store identifier rows from the CATENTRY table to be versioned.
<wc:ContentVersionRelatedTable name="CATENTRY" whereClause="CATENTRY_ID=? AND MEMBER_ID=?" values="${objectId}, ${storeOwnerId}"/>