You can run the Sitemap Generator from the command line using
RunSitemapGen.bat (on Windows) or
RunSitemapGen.sh (on UNIX).
The
Sitemap Generator runs using the configuration files stored in the
sitemap_generator directory. To create sitemap pages
for each site in an EAC application, you need to set up configurations for each
site. For example, if you are creating sitemaps for a Canon and Sony site in
the Discover reference application, you would make two copies of the
sitemap_generator/conf directory and give the new
conf directories unique names.
sitemap_generator/conf
sitemap_generator/conf_canon
sitemap_generator/conf_sony
Edit the
conf.xmlfile in each site configuration directory.Specify the type of template file,
orhtml_template.xml, in thexml_template.xmlTEMPLATE_FILEelement.In the MDEX engines section, specify the
hostandportof the machine that the MDEX engine is running on.Specify a
ROOT_QUERYelement that restricts the search and navigation query to the records filtered by site. You must specify aROOT_QUERYelement that matches the filter parameters specified in thefilterState.xmlfile.The following example shows the
filterState.xmlfile and the corresponding Sitemap Generatorconf.xmlfile for a site that restricts itself to only display Canon-branded items.The
filterState.xmlfile shows a configuration with a record filter that only includes records with the Canon brand.<Item class="com.endeca.infront.navigation.model.FilterState" xmlns="http://endeca.com/schema/xavia/2010"> <Property name="recordFilters"> <List> <String>product.brand.name:Canon</String> </List> </Property> </Item>The MDEX engine section of the
conf.xmlfile has the host and port of the MDEX engine and aROOT_QUERYelement that has been updated to reflect a site restricted to the Canon brand. TheROOT_QUERYelement specifies the query string for the Sitemap Generator to use when submitting the bulk export query against the specified index.<MDEX_ENGINES> <ENGINE> <HOST>myhost.example.com</HOST> <PORT>15000</PORT> <ROOT_QUERY><![CDATA[N=4294967266]]></ROOT_QUERY> <ROLLUP_KEY>product.code</ROLLUP_KEY> </ENGINE> </MDEX_ENGINES>See the Oracle Commerce Administrator's Guide for more information on site-based filters.
Specify an output directory in the
INDEXelement so that it specifies the name of the site index file that the Sitemap Generator creates. This setting determines the relative path and extension for other output files for the site as well.For example, the index element for a Canon site could look like this:
<INDEX_FILE>../sitemap_canon/index.xml</INDEX_FILE>
Edit the template configuration files in each site configuration directory. These configuration files are named
html_template.xmlorxml_template.xml.Specify the
localhostwith the hostname of the server, or the domain pattern information for each site if your site uses a domain pattern.If your site uses URI patterns, specify the site URI pattern for navigation links, detail links, static pages links, and search term links.
In the following examples, the URI pattern is
/Canon.Here is the URI pattern in a navigation link for navigation pages:
<NAVIGATION_LINK><![CDATA[ <url> <loc>http://localhost:8006/discover/Canon/browse**FORMATTED_URL|XmlEscape**</loc> <lastmod>**TIMESTAMP**</lastmod> </url> ]]></NAVIGATION_LINK>Here is the URI pattern in a link for record detail pages:
<DETAIL_LINK><![CDATA[ <url> <loc>http://localhost:8006/discover/Canon/detail**FORMATTED_URL|XmlEscape**</loc> <lastmod>**TIMESTAMP**</lastmod> </url> ]]></DETAIL_LINK>Here is the URI pattern in a link in for a static page. This example assumes that the static pages are site specific.
<STATIC_PAGE_LINK><![CDATA[ <url> <loc>http://localhost:8006/discover/Canon/**STATIC_PAGE|XmlEscape**</loc> <lastmod>**TIMESTAMP**</lastmod> </url> ]]></STATIC_PAGE_LINK>Here is the URI pattern in a link for search terms:
<SEARCH_TERM_LINK><![CDATA[ <url> <loc>http://localhost:8006/discover/Canon/browse**FORMATTED_URL|XmlEscape**</loc> <lastmod>**TIMESTAMP**</lastmod> </url> ]]></SEARCH_TERM_LINK>
If you want to add additional search terms for your sites, edit the
searchterms.xmlfile in each site configuration directory.Go to the
sitemap_generator/bindirectory and runRunSitemapGen.bat(on Windows) orRunSitemapGen.sh(on UNIX) for each site, specifying the uniqueconf.xmlfor that site. For example:RunSitemapGen.bat ..\conf_canon\conf.xml RunSitemapGen.bat ..\conf_sony\conf.xml
The output appears in the
sitemap_generator/sitemap_canonandsitemap_generator/sitemap_sonyfolders.

