Introduced in Feature Pack 2

Customizing the Business Object Mediator to map the new warranty columns from the search index to the user data field of the CatalogEntryView noun

Introduced in Feature Pack 2 In this lesson, the Business Object Mediator is modified to map the new search results to the user data field of the CatalogEntryView noun. You do this by extending the business object mediator configuration to include the 3 new warranty fields warterm, wartype and careinstruction.

About this task

Procedure

  1. Navigate to the com.ibm.commerce.catalog-ext directory. You must create this directory if it does not already exist.
    • WC\xml\config\com.ibm.commerce.catalog-ext
  2. Open the wc-business-object-mediator.xml file. You must create this file if it does not already exist.

    For an example of BOM configuration changes, see the tutorial: Adding new properties to a WebSphere Commerce service using the data service layer.

  3. Copy the following snippet into the file:
    
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    In this file we map the warranty data from the search results into the CatalogEntryView noun for use on the storefront.
    The Name field is the name in the returned noun, the value field is the name we defined in the search index for warranty data. 
    -->
    <_config:BusinessObjectMediatorConfiguration
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://www.ibm.com/xmlns/prod/commerce/foundation/config ../xsd/wc-business-object-mediator.xsd" xmlns:_config="http://www.ibm.com/xmlns/prod/commerce/foundation/config">
    
      <_config:object logicalType="com.ibm.commerce.catalog.facade.datatypes.CatalogNavigationViewType"
    physicalType="com.ibm.commerce.catalog.facade.server.services.search.metadata.solr.SolrCatalogNavigationViewImpl">
    <_config:mediator interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ReadBusinessObjectMediator"
    className="com.ibm.commerce.catalog.facade.server.services.dataaccess.bom.mediator.solr.SolrReadCatalogNavigationViewMediator">
    
    <_config:mediator-properties>
    
    <_config:mediator-property name="CatalogEntryView/UserData[(Name='WARRANTYTERM')]" value="warterm" />
    <_config:mediator-property name="CatalogEntryView/UserData[(Name='WARRANTYTYPE')]" value="wartype" />
    <_config:mediator-property name="CatalogEntryView/UserData[(Name='CAREINSTRUCTION')]" value="careinstruction" />
    </_config:mediator-properties>
    
    </_config:mediator>
    </_config:object>
    	 
    </_config:BusinessObjectMediatorConfiguration>
    
  4. Save your changes and close the file.

Results