To set up the sitemap generation process, you must create and configure:
One
SitemapGeneratorService
componentOne or more
StaticSitemapGenerator
componentsOne or more
DynamicSitemapGenerator
componentsOne
SitemapIndexGenerator
componentOne
SitemapWriterService
component on each page-serving Oracle Commerce Platform instance
Configuring the SitemapGeneratorService
The atg.sitemap.SitemapGeneratorService
class manages the process of generating sitemaps and sitemap indexes. The Oracle Commerce Platform includes a component of this class, /atg/sitemap/SitemapGeneratorService
. To configure a SitemapGeneratorService
component, set the following properties:
Property | Description |
---|---|
| An array of components of classes that implement the |
| A component of class |
| The repository that stores the sitemaps and the sitemap index. This should be set to |
| A component that maps properties in the |
| A component with utility methods for looking up and modifying items in the |
| The maximum number of URLs to be stored in a single sitemap file. If this property is not set explicitly, it defaults to 50000, the maximum allowed by |
| Maximum size of a single sitemap file, in bytes. If this property is not set explicitly, it defaults to 10485760 (10 Mb), the maximum allowed by |
| String to prepend to the URL entries produced by the generator components. This property is not actually used by the |
| The Nucleus pathname for the component of class |
| The operating-system pathname of the deployed WAR file that the sitemap is generated for. This property is not actually used by the |
There are additional properties that need to be configured for a multisite application. See Additional Configuration for Multisite Applications.
In addition to these sitemap-related properties, SitemapGeneratorService
also has several properties it inherits from atg.service.scheduler.SingletonSchedulableService
. See Invoking Sitemap Generation and Writing for more information.
A properties file for a SitemapGeneratorService
component might look like this:
$class=atg.sitemap.SitemapGeneratorService $scope=global schedule=calendar * * . . 1 . scheduler=/atg/dynamo/service/Scheduler clientLockManager=/atg/dynamo/service/ClientLockManager lockName=SitemapGeneratorService sitemapGenerators=\ /atg/sitemap/ProductSitemapGenerator,\ /atg/sitemap/CategorySitemapGenerator,\ /atg/sitemap/StaticSitemapGenerator sitemapIndexGenerator=/atg/sitemap/SitemapIndexGenerator sitemapRepository=/atg/sitemap/SitemapRepository sitemapPropertiesManager=/atg/sitemap/SitemapPropertiesManager sitemapTools=/atg/sitemap/SitemapTools maxUrlsPerSitemap=10000 maxSitemapSize=5000000
Configuring the StaticSitemapGenerator
The atg.sitemap.StaticSitemapGenerator
class generates sitemaps for static pages. This class has a staticPages
property that you use to specify a list of static pages to be included in the sitemap. For example:
staticPages=/index.jsp,\ /support/contact.jsp,\ /company/news.jsp,\ /company/aboutUs.jsp
The entries in the list can use wildcards in the following ways:
A single asterisk (
*
) matches a filename of any length in the specified directory, but does not include files in subdirectories. For example,/company/*.jsp
matches any JSP file in the/company/
directory, but not in the/company/about/
subdirectory.Two asterisks (
**
) match subdirectories to any depth. For example,/company/**/*.jsp
matches any JSP file in the/company/
directory or any subdirectory of it.A question mark (
?
) matches any single character in a filename. For example,/company/news?.jsp
matchesnews1.jsp
,news2.jsp
, etc., in the/company/
directory.
The StaticSitemapGenerator
class has changeFrequency
and priority
properties for setting the default values of the <changefreq>
and <priority>
tags for each URL in the static pages sitemap. You can override these values for an individual page or group of pages by explicitly setting the values in the entry for the page or pages, as in this example:
staticPages=/index.jsp,\ /support/contact.jsp:monthly:0.8,\ /company/*.jsp:weekly
To configure a StaticSitemapGenerator
component, set the following properties:
Property | Description |
---|---|
| The default value to use for the |
| The default value to use for the |
| A list of static pages to be included in the sitemap (see above). |
| A String used to form the names of the static sitemap files. If a single file is generated, |
| String to prepend to the filenames found using
|
| The Nucleus pathname for the component of class
The |
| The operating-system pathname of the deployed WAR file that the sitemap is generated for; for example:
The |
Configuring the DynamicSitemapGenerator
The atg.sitemap.DynamicSitemapGenerator
class generates sitemaps for dynamic pages. This class uses a URL template to translate dynamic URLs to static URLs for inclusion in the sitemaps. For example, suppose the URL for a product detail page looks like this:
http://mywebsite.com/mywebapp/productDetail.jsp?productId=id
DynamicSitemapGenerator
iterates through all of the product
repository items in the ProductCatalog
repository and for each item generates a static URL, such as:
http://mywebsite.com/mywebapp/jump/product/12345/Oxford+Shirt/
See the Using URL Templates section for more information about URL templates.
To configure a DynamicSitemapGenerator
component, set the following properties:
Property | Description |
---|---|
| The value to use for the |
| The value to use for the |
| The repository whose items are used to construct the dynamic sitemap URLs. For example, for a Core Commerce site, this is typically |
| The name of the type of item to retrieve from the source repository to use for constructing URLs. For example, for a product detail page on a Core Commerce site, this would typically be |
| The transaction manager to use. Typically |
| The number of repository items to process in each transaction. |
| A URL template component that translates URLs for inclusion in sitemaps. Typically this is a component of class |
| A String used to form the names of the dynamic sitemap files. If a single file is generated, |
| String to prepend to the URLs created by the URL template. This should include the protocol, domain, and port (if needed). If the
|
| The Nucleus pathname for the component of class
The |
Configuring the SitemapIndexGenerator
The atg.sitemap.SitemapIndexGenerator
class generates sitemap indexes. This class creates a sitemap index containing a list of all of the sitemap files generated by the corresponding SitemapGenerator
components.
To configure a SitemapIndexGenerator
component, set the following properties:
Property | Description |
---|---|
| The name of the generated sitemap index file; for example, |
| String to prepend to the sitemap filenames to form the URL entries included in the sitemap index. This should include the protocol, domain, and port (if needed). If the
|
| The Nucleus pathname for the component of class
The |