JSP code snippet: Store catalog display

This JSP code snippet displays all available catalogs (master catalog and sales catalogs) associated with a store. It uses the StoreDataBean to retrieve all the CatalogDataBeans that contain the catalog information.

The StoreCatalogDisplay.jsp file is available under the following directory:

  • WC_installdir/samples/Snippets/web/Catalog\SalesCatalog
  • WebSphere Commerce Developer WCDE_installdir\samples\Snippets\web\Catalog\SalesCatalog

Prerequisites

  1. Your store must have at least one master catalog and one sales catalog.
  2. The properties file used by this snippet is WCDE_installdir /samples/Snippets/properties/Catalog/CatalogJSPCodeSnippetText.properties.
  3. Copy this file (StoreCatalogDisplay.jsp) to the directory WCDE_installdir/workspace/Stores/Web Content/ store/include.

You may want to copy the properties to the proper location for your store, for example, WCDE_installdir /workspace/Stores/Web Content/WEB_INF/classes/ storedir or merge it with your own properties files.

Usage

  1. Add the following line to the jsp file to which you want to add this snippet: <c:import url="${jspStoreDir}include/StoreCatalogDisplay.jsp" />

    Using ConsumerDirect as an example, you can add the above c:import statement into WCDE_installdir/workspace/Stores/Web Content/ConsumerDirect/include/styles/style1/CachedSidebarDisplay.jsp if you are using style1.

  2. In the code, uncomment the section marked by [Data Bean Activation].