Customizing site maps integration

You can customize site maps integration.

Procedure

Generating site map catalog page URLs does not occur in a JSP file. The URLs are instead generated using the CatalogTreeSiteMapGenerateCmd command. The CatalogTreeSiteMapGenerateCmd command generates the site map catalog page URLs in the XML file. By default, the URLs constructed for products and categories are hierarchical (URL includes category hierarchy), and for top categories, a canonical URL is constructed.

To customize the site map generation utility so that different URL patterns are constructed for the product and category pages, specify a different URL pattern for products and categories:

  1. Extend the CatalogTreeSiteMapGenerateCmdImpl class and override the following methods to return different URL patterns:
    • For products: getSEOURLPatternNameForCatalogEntry(CatalogNodeDataBean, Integer)
    • For categories: getSEOURLPatternNameForCategory(CatalogNodeDataBean, Integer)
    For example to change the URL pattern used to generate category URLs:
    
      protected String getSEOURLPatternNameForCatalogEntry(CatalogNodeDataBean next, Integer languageId) {
        	return "ProductURLWithParentCategory";
        }
    
    Where ProductURLWithParentCategory is the name of the URL pattern.
  2. Update the entry in the CMDREG table to use the extended catalog tree site map generate class.

    Modify the classname of the interfacename com.ibm.commerce.seo.commands.CatalogTreeSiteMapGenerateCmd, to the name of the extended class, com.mycompany.commerce.seo.sitemap.commands.classname