To translate URLs from dynamic to static (or vice versa) requires some complex parsing logic and pattern matching. Both the ItemLink
servlet bean and the SEO jump servlet construct URLs using properties that specify the format of the URL and the type of visitor viewing the page.
An important aspect of the SEO feature is the use of URL templates. These templates are Nucleus components that the ItemLink
servlet bean and the jump servlet use when they construct URLs. URL templates include properties that specify the format of the URLs, the browser types supported, and how to parse requests.
The URL template classes consist of atg.repository.seo.UrlTemplate
, which is an abstract base class, and its two subclasses:
atg.repository.seo.DirectUrlTemplate
defines the format of the direct (dynamic) URLs created by theItemLink
servlet bean for human site visitors.atg.repository.seo.IndirectUrlTemplate
defines the format of the indirect (static) URLs created byItemLink
servlet bean for web spiders. It is also used by the SEO jump servlet to determine how to translate these static URLs back to dynamic URLs.
In addition, the atg.repository.seo
package has a UrlTemplateMapper
interface that is used by ItemLink
to map repository item descriptors to URL templates. The package also includes a UrlTemplateMapperImpl
implementation class for this interface.
The next section describes how to configure DirectUrlTemplate
, IndirectUrlTemplate
, and UrlTemplateMapperImpl
components.