Active Site Evaluation

The SiteManager determines whether a site is active through its SiteStateProcessor component, which is referenced by the SiteManager'ssiteStateProcessor property—by default, /atg/multisite/DefaultSiteStateProcessor. This component implements interface atg.multisite.SiteStateProcessor. The Oracle ATG Web Commerce 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

ignoreEnabled

If set to true, nullifies the site’s enabled property setting and enables the site.

Default: false

ignoreOpenDate

If set to true, nullifies the site’s openDate property setting, and leaves the site’s opening date unspecified.

Default: false

ignoreClosingDate

If set to true, nullifies the site’s closingDate property setting and leaves the site’s closing date unspecified.

Default: false

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'signoreClosingDate 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'ssiteStateProcessor 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 override InactiveSiteHandlerImpl.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'ssiteStateProcessor 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.