Site map integration template

Use the Sitemap.jsp file to generate all of the URLs that you want a search engine, such as Google, to index. The .jsp file is located under the root of each store for which you have generated a site map; for example, WC_eardir/Stores.war.

The Sitemap.jsp file uses a storeId, or a list of catalog IDs as its parameters, and generates URLs that access all the categories and catalog entries of the store, in all the languages supported by the store. The Sitemap.jsp files provided are samples based on the URLs in the ConsumerDirect and AdvancedB2BDirect starter stores only. You can add or update any URLs in these files provided that they conform with the Sitemap Protocol v0.9.

If you have customized your store, and have to create your own Sitemap.jsp file, you must adhere to the following conventions outlined at the Sitemap Protocol v0.9:

  • The Sitemap.jsp file must be encoded in UTF-8.
  • Each URL must be absolute such as http://example.com.
  • Use the W3C Date and time formats such as YYYY-MM-DD.
  • All URLs should be properly escaped using entity escape codes, and follow the RFC 3986 standard for URIs, the RFC 3987 standard for IRIs, and the XML standard.
  • The generated site map does not contain URLs that start with HTTPS protocol. URLs starting with https are ignored if they are in a site map whose URL starts with http, and vice versa. For example, if the site map is under http://example.com, any URL that starts with https://example.com in the site map is ignored. To avoid incomplete crawling, you must list only one type of URL.
  • If the catalogIds are not passed by the command, the master catalog for the store is used to generate the URLs. In the following example the catalogIds are provided, and the site map is generated using the URLs of the pages in those catalogs.
    /Sitemap.jsp?storeId=10101&catalogId=10101&catalogId=10151&hostName=chutes.torolab.ibm.com
    
    Where:
    storeId_i
    The ID of the store for which the site map is generated, such as 10101.
    catalogId_i
    The catalogId for a store with storeId_i. Multiple values can be provided for the same i, such as catalogId_i=value1&catalogId_i=value2
    hostname
    The host name of the production server later used to host the sitemap.xml files. This parameter is required when the command is executed on a staging server and the sitemap.xml file is hosted on a production server. Specify the host name as name.domain .
The following example shows how a Sitemap.jsp generates an XML file:
<?xml version="1.0" encoding="UTF-8"?>
  <urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
   <url>
    <loc>http://www.example.com/</loc>
    <lastmod>2005-01-01</lastmod>
   </url>  
  </urlset> 
Where:
<loc>
URL of the page. All the URLs that the merchants want the Google search engine to index. The following views are included in the site map for WebSphere Commerce:
  • TopCategoriesDisplay
  • CategoryDisplay: the URLs for CategoryDisplay are generated for each top category and subcategory.
  • ProductDisplay: the URLs for ProductDisplay are generated for each product, item, bundle, and package.
  • PrivacyView
  • ContactView
  • HelpView
<lastmod>
The date the JSP page was modified last. For the CategoryDisplay page, the field LASTUPDATE of the table CATGROUP can be used as the last modification date. For the ProductDisplay page, the field LASTUPDATE of the table CATENTRY can be used as the last modification date.