Introduced in Feature Pack 2

Creating an extended content versioning configuration file

Introduced in Feature Pack 2 The content versioning configuration file tells you which UI objects are versionable, and how the system versions the UI object. In this lesson, you will learn how to create a custom content versioning configuration file for the corresponding Recipe objects.

About this task


  1. Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
  2. In the Enterprise Explorer view, WC > xml > config > com.mycompany.commerce.project. The com.mycompany.commerce.project is the service module directory created in the previous Recipe tutorial.
  3. Create the content versioning configuration file.
    1. Right-click the com.mycompany.commerce.project folder, then click New > File.
    2. In the Name field, enter wc-content-version.xml.
    3. Click Finish. The wc-content-version.xml file opens.
  4. Copy the following code into the newly create configuration file.
    		 xmlns:wc="" xmlns:xsi=""
    		 xsi:schemaLocation=" ../xsd/wc-content-version.xsd">
    		 <wc:ContentVersionContainer name="com.mycompany.commerce.project" id="1">
    		 		 <wc:ContentVersionNoun name="Project" topTable="XPROJECT">
    		 		 		 <wc:ConfigGroup id="123">
    		 		 		 		 <wc:ContentVersionUIObject name="Recipe" />
    		 		 		 		 <wc:ContentVersionRelatedTable name="XPROJECT" values="${objectId}, ${storeId}" 
    		 		 		 		 		 whereClause="XPROJECT_ID =? AND STOREENT_ID = ?" />
    		 		 		 		 <wc:ContentVersionRelatedTable name="XPRJDES" 
    		 		 		 		 		 whereClause="XPROJECT_ID=?" values="${objectId}" />
    		 		 		 		 <wc:ContentVersionRelatedTable name="XPRJMTR" 
    		 		 		 		 		 whereClause="XPROJECT_ID=?" values="${objectId}" keyColumns="XPRJMTR_ID" />
    		 		 		 		 <wc:ContentVersionRelatedTable name="XPRJMTRDES" values="${XPRJMTR_ID}"
    		 		 		 		 		 whereClause="XPRJMTR_ID in (?)" keyColumns="XPRJMTR_ID" />
    		 		 		 		 <wc:ContentVersionRelatedTable name="XPRJMTRCATREL" values="${XPRJMTR_ID}, ${storeId}"
    		 		 		 		 		 whereClause="XPRJMTR_ID in (?) and STOREENT_ID = ?" keyColumns="XPRJMTR_ID" />
    		 		 		 		 <wc:ContentVersionRelatedTable name="XPRJINS"
    		 		 		 		 		 whereClause="XPROJECT_ID=?" values="${objectId}" keyColumns="XPRJINS_ID" />
    		 		 		 		 <wc:ContentVersionRelatedTable name="XPRJINSDES"
    		 		 		 		 		 whereClause="XPRJINS_ID in (?)" keyColumns="XPRJINS_ID" />
    		 		 		 		 <wc:ContentVersionRelatedTable name="XPRJCATREL"
    		 		 		 		 		 whereClause="XPROJECT_ID=? AND STOREENT_ID=?" values="${objectId}, ${storeId}" />
    		 		 <wc:ContentVersionNoun name="ProjectCollection" topTable="XPRJCOL">
    		 		 		 <wc:ConfigGroup id="234">
    		 		 		 		 <wc:ContentVersionUIObject name="RecipeCollection" />
    		 		 		 		 <wc:ContentVersionRelatedTable name="XPRJCOL"
    		 		 		 		 		 whereClause="XPRJCOL_ID=? AND STOREENT_ID=?" values="${objectId}, ${storeId}" />
    		 		 		 		 <wc:ContentVersionRelatedTable name="XPRJCOLDES"
    		 		 		 		 		 whereClause="XPRJCOL_ID=?" values="${objectId}" />
    		 		 		 		 <wc:ContentVersionRelatedTable name="XPRJPRJCOLREL"
    		 		 		 		 		 whereClause="XPRJCOL_ID=? AND STOREENT_ID=?" values="${objectId}, ${storeId}" />
    • The 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:
      The name of the container: com.mycompany.commerce.project.
      An identifier for the container: Negative values are reserved for IBM use, while positive values can be used for customization
    • The 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:
      The name of the noun: In the previous Recipe tutorial, the Project and ProjectCollection nouns were predefined for you. You can review the information by referring to this topic: Reviewing the Project noun.
      This attribute defines which table contains the primary key of the UI objects being versioned. The topTable for the nouns Project and ProjectCollection is XPROJECT and XPRJCOL . You can review the corresponding information here: Defining the database schema.
      The value of this attribute contains the name of the class that implements the content versioning service for this noun. If you do not specify this attribute, a default class is used.
      <wc:ContentVersionNoun name="ProjectCollection"
    • The wc:ConfigGroup elements are used to create configuration groups. A configuration group is a group of objects that are versioned the same way. Specify the following attributes for this element:
      The unique numeric identifier for this group. For example, Project and ProjectCollection are different object types but are versioned the same way.
      Configuration group ID for Project:
      <wc:ConfigGroup id="123">
      Configuration group ID for ProjectCollection:
      <wc:ConfigGroup id="234">
      The name of the UI object as defined in Management Center.
      <wc:ContentVersionUIObject name="Recipe" />
      <wc:ContentVersionUIObject name="RecipeCollection" />
    • The 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:
      The name of the table to be stored. For example, XPROJECT, XPRJDES, and XPRJMTR. You can review the related table information defined in the previous Recipe tutorial in this topic: Defining the database schema.
      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.
      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:
      The primary key of the object you are versioning.
      The identifier of the store you are currently working on.
      The identifier of the member that owns the store.
      In this following sample code snippet, the system selects the primary key and store identifier rows from the XPROJECT table to be versioned.
      <wc:ContentVersionRelatedTable name="XPROJECT" values="${objectId}, ${storeId}" whereClause="XPROJECT_ID =? AND STOREENT_ID = ?" />
  5. Save your configuration file.