Component: /atg/commerce/catalog/custom/AncestorGeneratorService

The AncestorGeneratorService component generates data for various category, product and SKU relationships.

The AncestorGeneratorService, which is automatically executed after deployment, updates the following property values for each of the catalog item types. This service should be executed after making catalog updates in order for catalog navigation and search to work correctly.

Item Type

Property Names

Categories

computedCatalogs
ancestorCategories
parentCategoriesForCatalog
siteIds

Products

computedCatalogs
ancestorCategories
parentCategoriesForCatalog
siteIds

SKUs

computedCatalogs
sideIds

If you have extended the Core Commerce catalog schema, you can still use AncestorGeneratorService to generate relationship data, provided that:

Available Functions

AGS_GENCATALOGS: generates the catalogs properties
AGS_GENPARENTCATS: generates the parentCategoriesForCatalog property
AGS_GENANCESTORS: generates the ancestorCategories property
AGS_GENPROPERTIES: generates all properties for all items
AGS_GENPROPERTIES_FOR_CATEGORY: generates all properties for categories
AGS_GENPROPERTIES_FOR_PRODUCT: generates all properties for categories and products

Product and SKU Relationships

Product and SKU relationships are generated on demand by the database using tables that are installed and configured by CIM. Using stored procedures, the database not only determines product and SKU relationships, but also identifies ancestry relationships and dynamic relationships.

Note: You can disable database-generated relationships using the awaysWalkTree property. This tells CMS to obtain relationships by referencing the catalog tree. Refer to the AncestorGeneratorService Properties section for additional information on this property.

Product relationships are generated when CMS functions include at least one of the following functions:

  • AGS_GENPROPERTIES_FOR_PRODUCT

  • AGS_GENPARENTCATS

  • AGS_GENCATALOGS

SKU relationships are generated when CMS functions include at least one of the AGS_GENPROPERTIES or AGS_GENCATALOGS functions.

Product and SKU relationships are generated under the following conditions:

  1. The computedCatalogs relationships are only generated if the updateCatalogsProperty flag is set to true.

  2. The ancestorCatagories relationships are only generated if the service functions include at least one AGS_GENPROPERTIES_FOR_PRODUCT, AGS_GENPROPERTIES, AGS_GENPROPERTIES_FOR_CATEGORY or AGS_GENANCESTORS function.

  3. Site relationships are only generated if the updateSitesProperty is set to true.

Cache Invalidation

When a stored procedure makes a change to a product or a SKU relationship, it stores the ID of the changed product or SKU in a database table. The AncestorGeneratorService then runs through all the IDs in the table to invalidate the items in the cache. Note that this process does not occur when catalog or category relationships are updated, and is specific only to product and SKU relationship changes.

When working with cache invalidation, you can specify the size of the threshold, which indicates the maximum number of items to invalidate before the entire cache is invalidated. To do this, configure the cacheInvalidationThreshold property as described in the AncestorGeneratorService Properties section.

AncestorGeneratorService-Related Schema Details

When you install Core Commerce with CIM, the following tables are installed. For information on performing an installation using CIM, refer to the Platform Installation and Configuration Guide. The create_cms_procedure.xml file creates the stored procedures that are used by your database.

Note: Stored procedures are invoked only when the alwaysWalkTree flag in the AncestorGeneratorService is set to false. Refer to the AncestorGeneratorService Properties section for additional information.

Table

Description

dcs_invalidated_prd_ids

dcs_invalidated_sku-ids

Used for cache invalidation, these tables store the list of product or SKU IDs whose relationships have been changed. The AncestorGeneratorService then runs through the items in these tables to invalidate items in the cache.

dcs_cat_dynprd

Categories can have dynamic products, which are determined by evaluating content group rules. Dynamic product children for categories are stored in this table when the includeDynamicChildren flag is set to true.

dcs_prd_anc_cats

Contains the list of product ancestor categories. A product can be related to a number of ancestor categories. If you have set the alwaysWalkTree flag in the AncestorGeneratorService to false, this table is populated by the pr_dcs_prd_anc_cats stored procedure.

dcs_prd_catalogs

Stores products relationships to catalogs. Products can be related to a number of catalogs. If you have set the alwaysWalkTree flag in the AncestorGeneratorService to false, this table is populated by the pr_dcs_prd_catalogs stored procedure.

dcs_prd_prnt_cats

Identifies the product parent category for a catalog. A product is related to a single parent category for each parent catalog. This property allows you to specifically set the parent category for a catalog. If you have set the alwaysWalkTree flag in the AncestorGeneratorService to false, this table is populated by the pr_dcs_prd_prnt_cats stored procedure.

dcs_product_sites

Products can be associated with a number of sites. This table identifies the sites associated with a product. If you have set the alwaysWalkTree flag in the AncestorGeneratorService to false, this table is populated by the pr_dcs_product_sites stored procedure.

dcs_sku_catalogs

A SKU can be related to a number of catalogs. The relationships between SKUs and catalogs is stored in this table. If you have set the alwaysWalkTree flag in the AncestorGeneratorService to false, this table is populated by the pr_dcs_sku_catalogs stored procedure.

dcs_sku_sites

This table stores the relationships between SKUs and sites. A SKU can be related to a number of sites. If you have set the alwaysWalkTree flag in the AncestorGeneratorService to false, this table is populated by the pr_dcs_sku_sites stored procedure.

AncestorGeneratorService Properties

The AncestorGeneratorService uses the following properties:

Table

Description

alwaysWalkTree

Boolean. If set to true, the category tree will not be generated by the database and asset relationships will be generated by referencing the catalog tree. Set to false by default.

cacheInvalidationThreshold

The cacheInvalidationThreshold property identifies the threshold for which individual IDs will no longer be invalidated. Instead, the entire cache for all changed item-types will be invalidated. By default, this property is set to -1, which means that there is no threshold and all items are individually invalidated.

Note: If you are using selective cache invalidation for catalog repositories, it is best to set the cacheInvalidationThreshold value to be in sync with the selective cache invalidation threshold value. For information on selective cache invalidation, refer to the Content Administration Programming Guide.

categoryChildProductsSQL

Gets the fixed child products for a category, not including the dynamic child products, from the dcs_cat_chldprd table.

categoryChildProductsWithDynamicSQL

Gets both the fixed and dynamic child products for a category from the dcs_cat_chldprd table.

categoryChildSkusSQL

Gets the child SKUs of fixed child products for a category, not including dynamic child products, from the dcs_prd_chldsku table.

categoryChildSkusWithDynamicSQL

Gets the child SKU of both fixed and dynamic child products for a category from the dcs_prd_chldsku

includeDynamicChildren

Boolean. If set to true, dynamic product children of categories is supported. The default is false.

insertDynamicProductsSQL

Inserts dynamic child products for a category into the dcs_cat_dynprd table.

truncateDynamicProductsSQL

Truncates the dcs_cat_dynprd table that holds dynamic child products.

updateCatalogsProperty

Boolean. If set to true, the catalog properties are calculated, returning product and SKU computedCatalog relationships.

updateProductAncestorCategoriesSQL

Updates the product ancestor categories relationship, pr_dcs_prd_anc_cats.

updateProductCatalogsSQL

Generates the computed product catalogs relationships by calling the prd_cds_prd_catalogs stored procedure.

updateProductParentCategoriesFor
  CatalogsSQL

Updates the product parent categories for catalog relationships by calling the pr_dcs_prd_prnt_cats stored procedure.

updateProductSitesSQL

Calls the stored procedure that generates the product sites relationship, pr_dcs_product_sites.

updateSitesProperty

Boolean. If set to true, site relationships are calculated.

updateSkuCatalogsSQL

Updates the SKU catalog relationships by calling the pr_dcs_sku_catalogs stored procedure.

UpdateSkuSitesSQL

Updates the SKU sites relationships by calling the pr_dcs_sku_sites stored procedure.


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