Adding the new search definition into the search widget in the Catalogs tool

After you define the new search definition, you need to add it into the search widget of the Catalogs tool as a new search option. There are several existing search options in the current Catalogs tool, such as All Catalog Entries Except SKU, All Catalog Entries, Categories, Products.

These options are already defined in:
  • WebSphere Commerce Version 7.0.0.0Feature Pack 1The Catalogs tool search definition class.
  • Feature Pack 2Feature Pack 3The Catalogs tool definition.

About this task

In this lesson, you complete the following steps:
  • WebSphere Commerce Version 7.0.0.0Feature Pack 1Locate the Catalogs tool search definition class and add your new search definition class into the search definitions section.
  • Feature Pack 2Feature Pack 3Locate the Catalogs tool definition and add your new search definition into the search definitions section.

Procedure

  1. Complete one of the following steps:
    • WebSphere Commerce Version 7.0.0.0Feature Pack 1In the Enterprise Explorer view, navigate to LOBTools > WebContent > WEB-INF > src > lzx > commerce > catalog.
    • Feature Pack 2Feature Pack 3In the Enterprise Explorer view, navigate to LOBTools > WebContent > config > commerce > catalog.
  2. Double-click one of the following files to open it in the default editor:
    OptionDescription
    WebSphere Commerce Version 7.0.0.0Feature Pack 1CatalogManagementToolDefinition.lzx WebSphere Commerce Version 7.0.0.0Feature Pack 1In this class file:
    1. Locate the search definitions section:
      <!-- Catalog Search Definitions -->
      <catFindAllCatalogEntriesSearchDefinition isDefault="true" displayName="${catalogResources.findAllCatalogEntriesSearchDefinition_DisplayName.string}"/>
      <catFindAllCatalogEntriesExceptSKUsSearchDefinition/>
      <catFindAllCategoriesSearchDefinition/>
      <catFindProductsSearchDefinition/>
      <catFindSKUsSearchDefinition/>
      <catFindBundlesSearchDefinition/>
      <catFindKitsSearchDefinition/> 
    2. Add your new search definition. You can insert the new search definition anywhere in the list of search definitions in the search widget. The search definitions are displayed in reverse order. If you add your definition to the bottom of the section, it is displayed as the first option in the search widget. The updated search definition section should look similar to the following sample:
      <!-- Catalog Search Definitions -->
      <catFindAllCatalogEntriesSearchDefinition isDefault="true" displayName="${catalogResources.findAllCatalogEntriesSearchDefinition_DisplayName.string}"/>
      <catFindAllCatalogEntriesExceptSKUsSearchDefinition/>
      <catFindAllCategoriesSearchDefinition/>
      <catFindProductsSearchDefinition/>
      <catFindSKUsSearchDefinition/>
      <catFindBundlesSearchDefinition/>
      <catFindKitsSearchDefinition/>
      <!-- Extended search definition -->
      <extFindAllCatalogEntriesByWarrantySearchDefinition/>
      
    3. Save and close the file.
    Feature Pack 2Feature Pack 3CatalogManagementToolDefinition.def Feature Pack 2Feature Pack 3In this definition file:
    1. Locate the search definitions section:
      <!-- Catalog Search Definitions -->
      <SearchDefinition baseDefinitionName="FindAllCatalogEntries" displayName="${catalogResources.findAllCatalogEntriesSearchDefinition_DisplayName}" isDefault="true"/>
      <SearchDefinition baseDefinitionName="FindAllCatalogEntriesExceptSKUs"/>
      <SearchDefinition baseDefinitionName="FindCategories"/>
      <SearchDefinition baseDefinitionName="FindProducts"/>
      <SearchDefinition baseDefinitionName="FindSKUs"/>
      <SearchDefinition baseDefinitionName="FindBundles"/>
      <SearchDefinition baseDefinitionName="FindKits"/>
    2. Add your new search definition. The updated search definition section should look similar to the following sample:
      <!-- Catalog Search Definitions -->
      <SearchDefinition baseDefinitionName="FindAllCatalogEntries" displayName="${catalogResources.findAllCatalogEntriesSearchDefinition_DisplayName}" isDefault="true"/>
      <SearchDefinition baseDefinitionName="FindAllCatalogEntriesExceptSKUs"/>
      <SearchDefinition baseDefinitionName="FindCategories"/>
      <SearchDefinition baseDefinitionName="FindProducts"/>
      <SearchDefinition baseDefinitionName="FindSKUs"/>
      <SearchDefinition baseDefinitionName="FindBundles"/>
      <SearchDefinition baseDefinitionName="FindKits"/>
      <!-- Extended search definition -->
      <SearchDefinition baseDefinitionName="FindAllCatalogEntriesByWarranty"/>
    3. Save and close the file.
  3. WebSphere Commerce Version 7.0.0.0Feature Pack 1Build the project, right-click LOBTools. Click Build OpenLaszlo Project.