Custom catalogs include catalog items in addition to the category, product, and SKU items that make up the standard catalog. Each user is assigned a catalog, and sees the navigational structure, product and SKU items, and property values associated with that catalog. A given product may appear in multiple catalogs. The product repository item type for custom catalogs includes an additional property, catalogs, which is an array of the catalogs the product is included in.

In addition to introducing a new organizational structure, custom catalogs also offer the ability to customize the view of a catalog entity such as a category, product, or SKU, so that its property values can vary depending on the catalog that is associated with the user. For example, if you assign catalogs to users based on the region they live in, you might want the product descriptions to be tailored to the region. This means that when you index the catalog, you will need to generate multiple XHTML documents for each product (one for each catalog a product is included in).

If your site uses custom catalogs, you should be sure to include the DCS.Search.CustomCatalogs module when you assemble your application. This module creates several Nucleus components that are used when indexing catalog data on a site that uses custom catalogs, including these key components:

The DCS.Search.CustomCatalogs module makes the following modifications to the configuration of the ProductCatalogOutputConfig component to support custom catalogs:

  • Adds the catalogs property to the product item type in the product-catalog-output-config.xml definition file, and specifies that the CustomCatalogPropertyAccessor component should be used to determine the value of this property.

  • Adds the /atg/commerce/search/CustomCatalogVariantProducer component to the component’s variantProducers property.

Note that if a user is not assigned a custom catalog, search queries and facets may not work properly for that user. This is generally not an issue for actual site customers, who should all have custom catalogs assigned to them, but it may affect internal users testing the site. If your site uses custom catalogs, make sure any internal users accessing the site have custom catalogs assigned to them.

Generating Multiple XHTML Documents for Each Product

The CustomCatalogPropertyAccessor and the CustomCatalogVariantProducer work together to generate a separate XHTML document for each catalog a product is in.

ProductCatalogOutputConfig uses the CustomCatalogVariantProducer to generate, for an individual product, a separate XHTML document for each catalog listed in the catalogs property of the product. The value of this property in the catalog repository is an array of all the catalogs the product is included in. The variant producer iterates through these catalogs individually, so that each XHTML document will contain, for other properties of the product, only the values associated with a single catalog.

The values of the product’s properties are obtained by the CustomCatalogPropertyAccessor, based on the catalog associated with the current variant. Note that these properties must be derived properties that use the CatalogDerivationMap class to derive their catalog-specific values.

Note: If your custom catalog does not use catalog-specific values, you should disable the CustomCatalogVariantProducer by removing it from the variantProducers property of ProductCatalogOutputConfig. This will reduce the number of XHTML documents generated, decreasing the time it takes to index the data.

loading table of contents...