Customizing Management Center to display custom objects in change history

From the preceding tutorial (Extending a Management Center tool to support workspaces for a custom object), changes made to recipe objects are captured in the CMPRMYOBJ table in the database. Next you need to modify the Management Center code to display recipe objects in the task group or task History pane.

About this task

To display custom objects in the History pane, you must define the display name and icon used by your custom objects. You must also add your custom object type to GetTaskGroupHistory.jsp. GetTaskGroupHistory.jsp checks the history entry type against a list of known types. If you do not add your custom object type to the list of known objects, the object is displayed as an unknown object.

Procedure

  1. To display the custom object name and icon in the History pane:
    1. Open /LOBTools/WebContent/config/commerce/workspace/objectDefinitions/TaskGroupChildObjectDefinition.def.
    2. For each custom noun, add <PropertyValue> tags. Specify values for the following attributes:
      • value – The noun name.
      • displayName – The object type to be displayed.
      • icon – The icon to be displayed in the change history pane.
    For the Recipe and Recipe Collection objects, enter:
    <PropertyValue value="Recipe" displayName="${extRecipeResources.recipe_DisplayName}" icon="recipeIcon"/>
    <PropertyValue value="RecipeCollection" displayName="${extRecipeResources.recipeCollection_DisplayName}" icon="recipeIcon"/>
  2. To display your custom type in the History pane:
    1. Browse to and open /LOBTools/WebContent/jsp/commerce/workspace/GetTaskGroupHistory.jsp.
      Tip: A sample GetTaskGroupHistory.jsp file is included in ChangeHistorySource.zip.
    2. Within the JSP when test section, enter: || type == 'Project' || type == 'ProjectCollection'
    For the recipe object, enter:
    || type == 'Recipe' || type == 'RecipeCollection'
    For example:
    <c:when test="${type == 'Catalog' || type == 'InheritedCatalog' || type == 'Product' ||   type == 'InheritedProduct' ||
        type == 'Kit' || type == 'InheritedKit' || type == 'ProductSKU' || type == 'InheritedProductSKU' ||  
        type == 'Bundle' ||  type == 'InheritedBundle' ||  type == 'CatalogGroupSKU' ||  type == 'InheritedCatalogGroupSKU' ||
          type == 'CatalogGroup' ||  
        type == 'InheritedCatalogGroup' ||  type == 'SalesCatalogGroup' ||  type == 'InheritedSalesCatalogGroup' ||  type == 
          'SalesCatalog' ||  type == 'InheritedSalesCatalog' ||  
        type == 'Promotion' ||  type == 'InheritedPromotion' ||  type == 'Attachment' ||  type == 'InheritedAttachment' ||  type 
          == 'ManagedFile' ||  
        type == 'InheritedManagedFile' ||  type == 'InstallmentRule' ||  type == 'InheritedInstallmentRule' ||  type == 
          'SearchTermAssociation' ||  type == 'InheritedSearchTermAssociation' ||  
        type == 'PriceList' ||  type == 'InheritedPriceList' ||  type == 'RefInheritedPriceList' ||  type == 'Campaign' ||  
          type == 'InheritedCampaign' ||  
        type == 'EMarketingSpot' ||  type == 'CustomerSegment' ||  type == 'EmailTemplate' ||  type == 'InheritedEmailTemplate' ||
        type == 'WebActivity' ||  type == 'WebActivityTemplate' ||  type == 'DialogActivity' ||  type == 'DialogActivityTemplate' 
          ||  type == 'EmailActivity' ||
        type == 'InheritedEMarketingSpot' ||  type == 'MarketingContent' ||  type == 'InheritedMarketingContent' ||  type == 
          'SearchActivity' ||  type == 'InheritedSearchActivity' ||  
        type == 'SearchActivityTemplate' ||  type == 'InheritedSearchActivityTemplate' ||  type == 'AttributeDictionary
          AttributeWithAllowedValues' ||  
        type == 'InheritedAttributeDictionaryAttributeWithAllowedValues' ||  type == 'AttributeDictionaryAttributeWith
          AssignedValues' ||  type == 'InheritedAttributeDictionaryAttributeWithAssignedValues'  || type == 'Recipe' || type 
          == 'RecipeCollection'}">
  3. Save and close the file.

Results

Now, when you change a recipe object within a workspace context, the change history record displays correctly in Management Center.