Tutorial: Extending simple search in the Catalogs tool

In this tutorial, you extend simple search in the Catalogs tool in the Management Center. Simple search is a function that is performed in the search widget of the Management Center. It provides the capability to search on a single property, such as the price or size of a product. The Catalogs tool provides several simple searches such as search catalog entries by name and search category by name. In this tutorial, you extend simple search on catalog entries by warranty term, warranty type, and care instruction. In the storefront, customers could search for more properties of your products.

In this tutorial module, you use the data service layer to generate your parametric Simple catalog search search queries for you. The queries are specified by using configuration files that are called query template files. This method of creating search queries is appropriate for developers who do not want to write their own SQL.

This tutorial is the continuation of Tutorial: Adding fields in the Catalogs tool and Tutorial: Adding search conditions for advanced search in the Catalogs tool. You continue customizing the Management Center, to perform cross-column wildcard searches on warranty and care instruction information of catalog entries and catalog entry descriptions. This information is stored in the columns of two tables: XWARRANTY and XCAREINSTRUCTION. These tables are created in Tutorial: Adding fields in the Catalogs tool.

The following diagram outlines the schema-related warranty information. The columns for wildcard search are marked with red underline.
Diagram displaying warranty schema information.

Extending simple catalog search consists of two steps:

  • Extend the DSL configuration to support searches on the data in the new custom tables.
  • Extend the search widget in Catalogs tool to include the new search definition so that it sends the new XPath queries to the server for processing.

To create a search definition, see Changing the search definition for a business object.

As a result of the extension, the new search widget looks like the following screen capture, in which "All Catalog Entries By Warranty" is added:
Screen capture that shows the search widget after customization.
Note: In this tutorial, the DSL is used to generate your parametric search SQL. If you do not want DSL to generate parametric search SQL, you can override this behavior. For more information, see Overriding generated parametric search SQL.

Learning objectives

After completing this tutorial, you should be familiar with the following concepts:

  • Simple catalog search
  • Catalog queries
  • The expression builder
  • wcfSearchDefinition
  • wcfSearchService

After you complete this tutorial, you understand how to complete the following tasks:

  • Configure parametric search to include custom tables
  • Update the search widget in the Catalogs tool to include new search definition
  • Create a controller JSP file to retrieve and mediate the Management Center object
  • Create an ExpressionBuilder in get-data-config.xml to call the new query and pass query parameters.

Time required

Expect this tutorial to take two hours to complete.

Skill level

This tutorial is intended for advanced WebSphere Commerce developers who are responsible for creating and customizing WebSphere Commerce SOA services and customizing the Management Center user interface. To complete this tutorial, familiarize yourself with the following terms and concepts:

System requirements

Before you start this tutorial, complete the following tasks:

Tutorial resources

You can download the completed tutorial code for this tutorial for your reference: