Processing of site accessibility is divided between two components:
The component
/atg/multisite/SiteManager
determines whether a site is active.The request pipeline’s
SiteContextPipelineServlet
redirects requests for disabled and inactive sites.
Active Site Evaluation
The SiteManager
determines whether a site is active through its SiteStateProcessor
component, which is referenced by the SiteManager's
siteStateProcessor
property—by default, /atg/multisite/DefaultSiteStateProcessor
. This component implements interface atg.multisite.SiteStateProcessor
. The Oracle Commerce Platform installation provides one implementation class, atg.multisite.DefaultSiteStateProcessorImpl
. This class defines the method isSiteActive()
, which evaluates the RepositoryItem
of a given site and returns true
(active) or false
(inactive).
DefaultSiteStateProcessorImpl
has several properties that let individual servers determine whether a site is enabled and active, regardless of its site repository settings:
Property | Description |
---|---|
| If set to Default: |
| If set to Default: |
| If set to Default: |
In its default implementation, isSiteActive()
reads these properties when it determines whether a site is enabled and active. By default, these Boolean properties are set to false; in this case, isSiteActive()
reports to the SiteManager
on a site’s availability solely on the basis of its repository settings. For example, if a site’s closingDate
precedes the current date, the SiteManager
regards the site as inactive and denies access to it. However, if the siteStateProcessor's
ignoreClosingDate
property is set to true
, the SiteManager
ignores the closingDate
setting and regards the site as active.
Customizing Active Site Evaluation
You can modify and extend the logic of active site evaluation as follows:
Create a class that implements the
atg.multisite.SiteStateProcessor
interface.Create a Nucleus component from the new class.
Set the
SiteManager's
siteStateProcessor
property to the new Nucleus component.
Customizing Redirection
The SiteContextPipelineServlet
redirects requests for disabled and inactive sites through its DefaultInactiveSiteHandler
property. This property is set to a component that is based, by default, on the class atg.multisite.InactiveSiteHandlerImpl
. This component redirects requests to the appropriate URL. You can customize redirect handling as follows:
Create a class that extends
atg.multisite.InactiveSiteHandlerImpl
. The subclass should overrideInactiveSiteHandlerImpl.determineRedirectURL()
. This method should return a String that contains the redirect URL, or null in order to return the default 404 error code.Create a Nucleus component from the new subclass.
Set the
SiteManager's
siteStateProcessor
property to the new Nucleus component.
Note: If you use your own implementation of the SiteStateProcessor
interface, you should also customize the DefaultInactiveSiteHandler
to reflect those changes. The SiteStateProcessor
only determines whether a site is active; it supplies no information why the site is inactive.