For page requests, a request-scoped /atg/endeca/assembler/SiteState component must be resolved. This component contains the siteId for the current request as well as the page URI, or contentPath, being requested. Page requests begin when a ContentInclude object is passed to the NucleusAssembler component, after which the ContentIncludeHandler is invoked to resolve the SiteState component and the page content.

The SiteState component has the following properties:

To resolve the ContentIncludeHandler component’s reference to the SiteState component, Nucleus calls the createSiteState() method of the com.endeca.infront.site.SiteStateBuilder class. The SiteStateBuilder class is a factory class that constructs a SiteState component for the current request. To create the SiteState component, the SiteStateBuilder class determines both the site context and the contentPath of the Experience Manager page being requested, as described below.

To establish the site context, the SiteStateBuilder component uses a series of parsers. Each parser contains logic that determines the Guided Search site ID for the current request and then returns a SiteState object with a populated siteId property. A parser must implement the atg.endeca.assembler.multisite.SiteStateParser interface, which has the following core method:

public interface SiteStateParser {
    public SiteState parseSiteState(HttpServletRequest request, SiteManager
                                    siteManager);
}

The SiteStateBuilder.siteStateParsers property contains a list of parsers that are executed in the configured order to resolve the site context. Out of the box, this property is set to a single parser, the /atg/endeca/assembler/multisite/SiteStateParser component, which looks at the site context for the request and extracts the Guided Search Site ID from that site’s definition in the Site repository.

In the event that the parsers defined in the siteStateParsers property fail to determine a Guided Search site ID and return a SiteState object, the SiteStateBuilder.defaultSiteStateParser property references a default SiteStateParser. Out of the box, the defaultSiteStateParser property references the /atg/endeca/assembler/multisite/DefaultSiteStateParser component. This component uses the default site configured for the EAC application to determine the site context. Note that it is the Experience Manager administrator’s responsibility to specify the default site when creating an EAC application. If a default site is not specified for an EAC application, one of the following scenarios occurs:

Assuming one of the parsers executed successfully, the result is a SiteState object with the Guided Search site ID stored in its siteId property.

After determining the site context, the SiteStateBuilder class invokes the /atg/endeca/assembler/multisite/ContentPathTranslator component specified in the SiteStateBuilder.contentPathTranslator property. This component translates the original request URL into an Experience Manager content path, for example, /browse. To calculate the content path, the ContentPathTranslator component calls the AssemblerTools.getContentPath() method. This method encapsulates the Oracle Commerce Core Platform’s logic for calculating the content path from the request URL (note that this logic could be replaced by a different application-specific class and method). See the Calculating the Content Path from the Page Request URL section for details on how the getContentPath() method works.

After the SiteStateParser and ContentPathTranslator components have executed, a SiteState component exists for the current request and it has the site context and content path information the ContentIncludeHandler needs to locate the correct content in the Experience Manager pages hierarchy.


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