Tutorials > Management Center > Extend simple search in the Catalogs tool

< Previous | Next >


Add the new search definition into the Search Widget in the Catalogs tool

After defining 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:

In this lesson, you complete the following steps:


Procedure

  1. Complete one of the following steps:

    • In the Enterprise Explorer view, navigate to LOBTools > WebContent > WEB-INF > src > lzx > commerce > catalog.

    • In 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:

    Option Description
    CatalogManagementToolDefinition.lzx In 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. In this section, add the 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 the 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 -->
      <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.
    CatalogManagementToolDefinition.def In 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. In this section, add the 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 baseDefinition="FindAllCatalogEntriesByWarranty"/>
      

    3. Save and close the file.

  3. Build the project, right-click LOBTools; then click Build OpenLaszlo Project.

< Previous | Next >


+

Search Tips   |   Advanced Search