Extend the navigation suggestion web service to include the new suggestion grouping

Feature Pack 4Feature Pack 3In this lesson, you are creating a class that returns all of the possible values for your navigation suggestion grouping for warranty type. This class is responsible for finding all of the possible values for your new suggestion group (WARRANTY, COMPREHENSIVE). This class populates the information that the storefront needs into the business objects the storefront JSPs understand.

About this task

The determination of the all possible values of warranty type can be done a few ways such as a database query with select distinct specified. This tutorial demonstrates how to fetch this information from the search engine by using a search query with a facet column. Faceting returns all possible unique values for a column, and a count that is associated with it.

Procedure

  1. Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
  2. Create a class:
    1. Expand WebSphereCommerceServerExtensionsLogic > src.
    2. Right-click the src folder; click New > Class.
    3. In the Package field, type com.mycompany.commerce.search.
    4. In the Name field, type WarrantySuggestion.
    5. Click Finish.
  3. Copy all of the code from the Warranty suggestion Java class file into the new WarrantySuggestion.java file you just created, overwriting the existing content.
  4. Save and close the WarrantySuggestion.java file.