The Oracle Commerce Platform installation provides the following SiteContextRuleFilter components for identifying a site:

RequestParameterRuleFilter

Based on the class atg.multisite.PushedSiteParamFilter, the component /atg/multisite/RequestParameterRuleFilter is the first rule filter to execute. This filter processes request query parameters that set the current site, and specify it as a sticky site that persists throughout the session of that request. This filter is typically useful for testing and previewing sites that are under development; it should be disabled for production sites.

RequestParameterRuleFilter checks the request URL for these query parameters:

Note: Sticky sites cannot be used together with profile realms as a conflict occurs. Sticky sites rely on obtaining the current session information before determining the current site, while profile realms rely on getting the current site information before determining the session to use for a request.

A sticky site remains valid for the current session until another request URL sets one of the following query parameters:

  • pushSite specifies another site ID, which becomes the current site. If stickySite is also set to setSite, this SiteContext becomes the new sticky site.

  • stickySite is set to unsetSite. This unsets the sticky site, and the RequestParameterRuleFilter returns null. The SiteContextPipelineServlet executes subsequent rule filters in its ruleFilters property until one returns a valid site.

RequestParameterRuleFilter is enabled through two properties:

  • enabled specifies whether the filter is active within the filter chain. If set to false, SiteContextPipelineServlet skips over this filter when processing a request. By default, this property is set to true.

  • enableStickySite disables sticky site functionality if set to false. The filter remains active and supports use of the pushSite query parameter; it ignores the stickySite query parameter. By default, this property is set to false.

    Note: Sticky site functionality is always enabled on preview servers through the SiteURLManager property autoAppendStickySiteParams. For more about the SiteURLManager, see Multisite URL Management later in this chapter.

If desired, you can change the names of the query parameters that RequestParameterRuleFilter expects by setting these properties:

Note: Changing these properties on an asset management or preview server might disrupt preview functionality.

URLPatternMatchingRuleFilter

Based on the class atg.multisite.SiteContextRuleFilter, the filter component /atg/multisite/URLPatternMatchingRulefilter encapsulates rules for obtaining a site ID from a request URL. The filter implements two algorithms for determining the site ID:

Several Boolean properties determine whether the URLPatternMatchingRuleFilter is enabled and how it executes:

Property

Description

enabled

The filter is enabled.

enableSimpleAlgorithm

Use the URLs property to look up the URL request.

enableSiteURLManagerAlgorithm

Pass the request URL to the SiteURLManager for processing.

By default, all properties are set to true.

URLPatternMatchingRuleFilter also checks the request for the context parameter atg.multisite.URLPatternMatchingEnabled, which the application’s web.xml file can set to true or false. If the parameter is set to false, the filter does not execute and returns null to the SiteContextPipelineServlet. If web.xml omits this context parameter, the URLPatternMatchingRuleFilter behaves as if it were set to true.

DefaultSiteRuleFilter

Based on the class atg.multisite.DefaultSiteContextRuleFilter, the component /atg/multisite/DefaultSiteRuleFilter is configured by a single property, defaultSiteId, which identifies the server’s default site ID. This filter executes after all filters that are specified in the ruleFilters property execute, and only if none of them returns a site ID.


Copyright © 1997, 2016 Oracle and/or its affiliates. All rights reserved. Legal Notices