The ProductListHandler
form handler manages product comparison lists.
By default, ATG Commerce includes a request-scoped instance of ProductListHandler
, which is located in Nucleus at /atg/commerce/catalog/comparison/
. ProductListHandler
is configured to operate on the product comparison list that is managed by the ProductList
component located at /atg/commerce/catalog/comparison/
. That is, the ProductList
component (class atg.commerce.catalog.comparison.ProductComparisonList
) is specified in ProductListHandler.productList
.
If your application uses multiple instances of ProductComparisonList
to manage multiple product comparison lists (for example, a list to compare cameras, a different list to compare televisions, and so on), then you may want to configure multiple instances of ProductListHandler
to manage the contents of each list.
If your application uses alternate product catalogs for different locales, you can specify the product catalog to use when operating on a product comparison list. To do so, set the ProductListHandler.repositoryKey
property to the key to pass to CatalogTools
. CatalogTools
uses the given key and its key-to-catalog mapping to select a product catalog repository. Typically, you would set the ProductListHandler.repositoryKey
property via a hidden input field in a form. If the repositoryKey
property is unset, then the default product catalog repository is used.
The following table describes ProductListHandler
’s handle methods for managing a product comparison list:
Handle Method | Description |
---|---|
| Adds the product specified by |
| Adds all of the SKUs for the product specified by |
| Adds all of the products specified by |
| Adds all of the SKUs for all of the products specified by |
| Resets the form handler by setting |
| Clears the product comparison list and redirects the user to the |
| Updates the inventory information in the product comparison list. Note that |
| Removes all entries for the category specified by |
| Removes the list entries whose ids are specified in |
| Removes the product specified by |
| Removes all entries for the product specified by |
| Sets the product comparison list to the products specified by |
| Sets the product comparison list to contain all the SKUs for all the products specified by |
Note that all of ProductListHander
’s handle methods manage optional category and SKU information in the same way. If a product’s category information isn’t specified in categoryID
, then the form handler looks for the default category of the product. If no default value exists, then the property is set to null. Similarly, if a product’s SKU information isn’t specified in skuID
, then the form handler looks for the product’s first child SKU (that is, the default SKU). If no default value exists, then the property is set to null.
For additional information on ProductListHandler
’s methods, refer to the ATG API Reference. For JSP examples of ProductListHandler
, refer to the next section, Examples of Product Comparison Pages.