Enabling the version services for custom object
You update the primary object definition for
the custom object you want to version. In the primary object definition
file, you add the functionality to create versions, update versions,
and retrieve the list of versions for your custom object.
Procedure
- Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
- In the Enterprise Explorer view, expand LOBTools > WebContent > config > Management_Center_component > objectDefinitions; where Management_Center_component is the name of the tool you want to customize.
- Locate the primary object definition for your custom object and open this file for editing.
- Add the
GetContentVersion
service. This service retrieves the different versions of your custom object.The following code snippet shows a sampleGetContentVersions
service for a Category object.
Replace the attributes values as follows:<GetChildrenService objectTypes="ContentVersion" url="/cmc/GetContentVersions"> <ServiceParam name="storeId"/> 1<ServiceParam name="objectId" propertyName="catgroupId"/> 2<ServiceParam name="objectType" value="CatalogGroup"/> <ServiceParam name="basedOnVersionNumber" propertyName="basedOnVersionNumber"/> </GetChildrenService>
- 1 The
propertyName
represents the name of the property of the UI object that uniquely identifies the object. This is usually the same as the primary key of thetopTable
specified in the content versioning configuration file. - 2 The
objectType
value corresponds to the UI object type you want to version.
- 1 The
- Add the
ReferenceObjectDefinition
service.The following code snippet shows a sample reference object definition for Category object type:
Replace the value of the<ReferenceObjectDefinition baseDefinitionName="wcfBaseContentVersion" referencedType="CatalogGroup"/>
referencedType
attribute with the UI object type you want to version. - Add the
CreateContentVersion
client action.This action calls the service to create versions of your custom object.The following code snippet shows the create version client action:<CreateContentVersionClientAction/>
- Save and close the primary object definition file.