In this lesson, you create
the getCatalogEntryViewWarrantyByID expression builder to retrieve
warranty information from the search index for display in the storefront.
You specify the MyCompany_Store_Warranty access profile created as
an accessProfile parameter, which controls the amount of data that
this expression builder returns. Later you will modify the storefront
to use this expression builder with a getData tag.
For
implementation details about XPath and access profiles, see Catalog storefront services programming model.
Procedure
- Create a new custom get data configuration file and call
it get-data-config.xml in the following directory:
- WCDE_installdir\workspace\Stores\WebContent\WEB-INF\config\com.ibm.commerce.catalog-ext
Note: If
this directory does not exist, create it. If get-data-config.xml already
exists in this directory, insert the custom <expression-builder>
data
below anywhere before the </_config:get-data-config>
snippet.
- Copy the following snippet into the file:
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file will map use of the getCatalogEntryViewWarrantyByID expression builder
to the /CatalogNavigationView[CatalogEntryView[(UniqueID=)]] XPath using the
MyCompany_Store_Warranty access profile
-->
<_config:get-data-config xmlns:_config="http://www.ibm.com/xmlns/prod/commerce/foundation/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/xmlns/prod/commerce/foundation/config ../../xsd/get-data-config.xsd ">
<expression-builder>
<name>getCatalogEntryViewWarrantyByID</name>
<data-type-name>CatalogNavigationView</data-type-name>
<class>com.ibm.commerce.foundation.internal.client.taglib.util.UniqueIDsExpressionBuilder</class>
<method>formatExpression</method>
<param>
<name>template</name>
<value>/CatalogNavigationView[CatalogEntryView[(UniqueID=)]]</value>
</param>
<!--
Pass the new MyCompany_Store_Warranty as an accessProfile parameter.
This allows the expression builder to use the new access profile
-->
<param>
<name>accessProfile</name>
<value>MyCompany_Store_Warranty</value>
</param>
</expression-builder>
</_config:get-data-config>
- Save your changes and close the file.