Tutorials > Management Center > Add new search conditions in the advanced search of the Catalogs tool
Test the customizations
In this section we will test the customization result.
You can test the result of the customized code by:
- Verify the customized code with the Management Center user interface
- Verify the customized code by viewing BOD messages in the trace
Test the customization by verifying with the Management Center user interface:
- Verify the WebSphere Commerce Server is running.
- In the Web browser, type https://hostname:8000/lobtools.
- Log on to the Management Center using the category manager user ID you previously registered.
- From the Management Center menu, select Catalogs to open the Catalogs tool.
- From the Store list, select Select Store > ConsumerDirect store.
- From the Find area list, select Advanced Search.
- The Warranty Term and Warranty Type appear in the Advanced Search dialog as search conditions that are specified using a list. These were added when you extended the Catalog Advanced Search dialog to include extended properties as search conditions.
- Specify the search conditions that to use and click Search to launch the search. For example, to search all of the Catalog Entries with the Warranty Term as 30 and the Warranty Type as limited, from the Warranty Term list, select 30 and from the Warranty Type list, select limited. The search result appears in the Catalog Search Result list view, showing the FULO-01 product with its warranty term and warranty type displayed in the Warranty Term and Warranty Type columns.
Verify the user-defined data customization by viewing BOD messages in the traceIn addition to using the Management Center user interface, you can also verify the customization by viewing BOD messages in the trace. When you issue a search in the Management Center user interface, the LOBTools Web application and client library fetches the search parameters, packages them into BOD messages, and then sends the request to the server to invoke the corresponding Web service. After the query is executed on the server side, the query result is also packaged into response BOD messages and returned to the Management Center user interface. You can read these BOD messages in the trace to determine if the customization is working correctly.
By default, the trace of BOD messages is turned off.
To turn the trace on:
- In a Web browser, type http://hostname:9060/ibm/console/ to open the Admin Console.
- Click Login to log in with the user ID information.
- Navigate to Troubleshooting > Logs and Trace.
- Select Server 1 to display the Logging and tracing page.
- Select Change Log detail Levels.
- Enable the trace "com.ibm.commerce.foundation.server.command.bod" in the Runtime tab.
- Click OK and close the Admin Console.
- After the trace is turned on, complete the search scenario again, and then locate the request and respond BOD messages in the WCDE_INSTALL\wasprofile\logs\server1\trace.log file. The following code snippet shows an example of the request BOD message:
<_cat:GetCatalogEntry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:Oagis9="http://www.openapplications.org/oagis/9" xmlns:_cat="http://www.ibm.com/xmlns/prod/commerce/9/catalog" xmlns:_wcf="http://www.ibm.com/xmlns/prod/commerce/9/foundation" versionID="6.0.0.4"> <Oagis9:ApplicationArea xsi:type="_wcf:ApplicationAreaType"> <Oagis9:CreationDateTime>2008-02-14T15:13:32.328Z</Oagis9:CreationDateTime> <Oagis9:BODID>501a9350-db39-11dc-9be3-837747b497a5</Oagis9:BODID> <_wcf:BusinessContext> <_wcf:ContextData name="storeId">10001</_wcf:ContextData> <_wcf:ContextData name="catalogId">10001</_wcf:ContextData> </_wcf:BusinessContext> </Oagis9:ApplicationArea> <_cat:DataArea> <Oagis9:Get maxItems="25"> <Oagis9:Expression expressionLanguage="_wcf:XPath">{_wcf.ap=MyCompany_All}/CatalogEntry[(@catalogEntryTypeCode='ProductBean' or @catalogEntryTypeCode='BundleBean' or @catalogEntryTypeCode='PackageBean' or @catalogEntryTypeCode='DynamicKitBean') and search(UserData/UserDataField/Warterm='45') and ParentCatalogGroupIdentifier[ExternalIdentifier[GroupIdentifier='']]]</Oagis9:Expression> </Oagis9:Get> </_cat:DataArea> </_cat:GetCatalogEntry>The following code snippet shows an example of part of the respond BOD message:
...... <_wcf:UserData> <_wcf:UserDataField name="catentry_id">10001</_wcf:UserDataField> <_wcf:UserDataField name="warterm">45</_wcf:UserDataField> <_wcf:UserDataField name="wartype">LIMITED</_wcf:UserDataField> <_wcf:UserDataField name="optcounter">1</_wcf:UserDataField> </_wcf:UserData> ......