The ProductListHandler form handler manages product comparison lists.

By default, Core Commerce includes a request-scoped instance of ProductListHandler, which is located in Nucleus at /atg/commerce/catalog/comparison/. The 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

handleAddProduct

Adds the product specified by productID to the product comparison list, applying optional category and SKU information if supplied in categoryID and skuID.

handleAddProductAllSkus

Adds all of the SKUs for the product specified by productID to the product comparison list, applying optional category information if supplied in categoryID.

handleAddProductList

Adds all of the products specified by productIDList to the product comparison list, applying optional category information if supplied in categoryID and the default SKU for each product, if any.

handleAddProductListAllSkus

Adds all of the SKUs for all of the products specified by productIDList to the product comparison list, applying optional category information if supplied in categoryID.

handleCancel

Resets the form handler by setting productID, categoryID, and skuID to null.

handleClearList

Clears the product comparison list and redirects the user to the clearListSuccessURL on success.

handleRefreshInventoryData

Updates the inventory information in the product comparison list.

Note that ProductListHandler has two optional properties, refreshInventoryDataSuccessURL and refreshInventoryDataErrorURL, which you can set to redirect the user when the handle method succeeds or fails, respectively.

handleRemoveCategory

Removes all entries for the category specified by categoryID from the product comparison list.

handleRemoveEntries

Removes the list entries whose ids are specified in entryIds from the product comparison list.

handleRemoveProduct

Removes the product specified by productID from the product comparison list, applying the optional category and SKU information if supplied in categoryID and skuID, respectively.

handleRemoveProductAllSkus

Removes all entries for the product specified by productID from the product comparison list.

handleSetProductList

Sets the product comparison list to the products specified by productIDList, applying optional category information if supplied in categoryID and the default SKU for each product, if any.

handleSetProductListAllSkus

Sets the product comparison list to contain all the SKUs for all the products specified by productIDList, applying optional category information if supplied in categoryID.

Note that all of ProductListHander’s handle methods manage optional category and SKU information in the same way. If a product’s category information is not 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 is not 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 Platform API Reference. For JSP examples of ProductListHandler, refer to the next section, Examples of Product Comparison Pages.


Copyright © 1997, 2015 Oracle and/or its affiliates. All rights reserved. Legal Notices