Tutorials > Management Center > Extend simple search in the Catalogs tool
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:
- The Catalogs tool search definition class.
- The Catalogs tool definition.
In this lesson, you complete the following steps:
- Locate the Catalogs tool search definition class and add the new search definition class into the search definitions section.
- Locate the Catalogs tool definition and add your new search definition into the search definitions section.
Procedure
- 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.
- Double-click one of the following files to open it in the default editor:
Option Description CatalogManagementToolDefinition.lzx In this class file:
- Locate the search definitions section:
<!-- Catalog Search Definitions --> <catFindAllCatalogEntriesSearchDefinition isDefault="true" displayName="${catalogResources.findAllCatalogEntriesSearchDefinition_DisplayName.string}"/> <catFindAllCatalogEntriesExceptSKUsSearchDefinition/> <catFindAllCategoriesSearchDefinition/> <catFindProductsSearchDefinition/> <catFindSKUsSearchDefinition/> <catFindBundlesSearchDefinition/> <catFindKitsSearchDefinition/>
- 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"/>
- Save and close the file.
CatalogManagementToolDefinition.def In this definition file:
- 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"/>
- 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"/>
- Save and close the file.
- Build the project, right-click LOBTools; then click Build OpenLaszlo Project.