The /atg/endeca/assembler/cartridge/manager/DefaultActionPathProvider component, of class atg.endeca.assembler.navigation.DefaultActionPathProvider, calculates the site root path and the content path for follow-on links. For example, in the link below, the site root path is /pages and the content path is /browse, while the remainder of the URL represents the query parameters that define the request.
/pages/browse?N=4294967263
The combination of the site root path and the content path is called the action path.
To calculate the site root path and the content path, the DefaultActionPathProvider class implements the com.endeca.infront.navigation.url.ActionPathProvider interface and its four methods:
getDefaultNavigationActionContentPath(): Returns the content path for a navigation action.getDefaultNavigationActionSiteRootPath(): Returns the site root path for a navigation action.getDefaultRecordActionContentPath(): Returns the content path for a record action.getDefaultRecordActionSiteRootPath(): Returns the site root path for a record action.
The DefaultActionPathProvider component also has the following properties that support site root and content path generation:
defaultExperienceManagerNavigationActionPath: The content path to use for navigation requests when Experience Manager is installed and no other content path can be resolved, defaults to/browse.defaultExperienceManagerRecordActionPath: The content path to use for record requests when Experience Manager is installed and no other path can be resolved, defaults to/product.defaultGuidedSearchNavigationActionPath: The content path to use for navigation requests when Guided Search is installed, defaults to/guidedsearch.defaultGuidedSearchRecordActionPath: The content path to use for record requests when Guided Search is installed, defaults to/recorddetails.navigationActionUriMap: A map whose keys are navigation request action paths and whose values are replacement action paths that should be substituted for the key action paths. For example, a/pages/[site]/brandaction path can be replaced with a/pages/[site]/browseaction path. This map can be used when overriding the action path of the current request is necessary. The keys are in regular expression form, so things such as query parameters are ignored.recordActionUriMap: Analogous tonavigationActionUriMap, this is a map whose keys represent record request action paths and whose values are replacement action paths that should be substituted for the key action paths. The keys are in regular expression form.assemblerTools: A reference to theAssemblerToolscomponent. TheAssemblerToolscomponent provides a reference to theAssemblerSettingscomponent, where the default site root paths are defined. Defaults to/atg/endeca/assembler/AssemblerTools.currentRequest: Provides access to the current request’s details. Defaults to/OriginatingRequest.contentSource: A reference to theWorkbenchContentSourcecomponent used to connect with the correct Workbench server and application. Defaults to/atg/endeca/assembler/cartridge/manager/WorkbenchContentSource. See Connecting to the Workbench and MDEX for details on this component.
Calculating the Content Path
To calculate the content path for a navigation action, the DefaultActionPathProvider.getDefaultNavigationActionContentPath() method is invoked. This method calls the AssemblerTools.isExperienceManager() method to determine if Experience Manager is in use. If so, the DefaultActionPathProvider component calculates the content path to return using the process described in the next paragraph. If Experience Manager is not in use, the DefaultActionPathProvider component returns the value of its defaultGuidedSearchNavigationActionPath property, which defaults to /guidedsearch.
To calculate the content path for navigation actions when Experience Manager is in use, the DefaultActionPathProvider component retrieves the value of the /atg/endeca/assembler/multisite/SiteState.contentPath property and looks for a match in the keys of its navigationActionUriMap property. If a match is found, the DefaultActionPathProvider component returns the content path portion of the matching entry’s value. If no match is found, the DefaultActionPathProvider component returns the content path it retrieved from the SiteState object. If it cannot resolve a content path from either the SiteState object or the navigationActionUriMap, the DefaultActionPathProvider component returns the value specified in its defaultExperienceManagerNavigationActionPath property, which defaults to /browse.
The process for calculating the content path for record actions when Experience Manager is in use is very similar to that for navigation actions. The DefaultActionPathProvider component retrieves the value of the SiteState.contentPath property, however, it uses the recordActionUriMap property for the lookup instead. Also, if a content path cannot be resolved from either the SiteState object or the recordActionUriMap, this method returns the value specified in the DefaultActionPathProvider.defaultExperienceManagerRecordActionPath property, which defaults to /product.
Calculating the Site Root Path
To calculate the site root path for a navigation action, the DefaultActionPathProvider.getDefaultNavigationActionSiteRootPath() method uses a combination of the /atg/endeca/assembler/cartridge/manager/WorkbenchContentSource component and com.endeca.infront.content.source.ContentLocator objects. The WorkbenchContentSource component provides access to the ContentLocator objects, and the ContentLocator objects provide the site root path. Specifically, the DefaultActionPathProvider does the following:
Passes the
SiteState.contentPathvalue to theWorkbenchContentSourcecomponent to get aContentLocatorobject for that path. ThisContentLocatorobject has two properties:A
contentPathproperty that contains the absolute path for the associated content, for example,/pages/[site]/browse.A
siteRootPathproperty that contains the site root for the associated content.
DefaultActionPathProvidercompares the value of theContentLocator.contentPathproperty to the keys in itsnavigationActionUriMapmap to determine if a replacement is needed.If a match is found,
DefaultActionPathProvidermakes another request to theWorkbenchContentSourcefor a newContentLocator, this time using the value for the matching key. This newContentLocatorobject’ssiteRootPathis then used as theSiteRootPathfor the follow-on links.If no match is found,
DefaultActionPathProvideruses thesiteRootPathfrom theContentLocatorretrieved in step 1.If step 1 did not return a
ContentLocatorobject, theDefaultActionPathProvidercomponent calls theAssemblerTools.isExperienceManager()method to determine if Experience Manager is in use. If so, theDefaultActionPathProvidercomponent invokes theAssemblerTools.assemblerSettings()method to retrieve the default site root prefix. This prefix is dependent on whether or not Experience Manager or Guided Search is installed and defaults to/pagesand/service, respectively.
The process for calculating the site root path for record actions is very similar to that for navigation actions. The getDefaultRecordActionSiteRootPath() method is invoked. This method performs similarly to the getDefaultNavigationActionSiteRootPath() method, however, it uses the recordActionUriMap property for the lookup instead. The process for retrieving a default site root in cases where one cannot be resolved from a ContentLocator object is the same; a call is made to the AssemblerTools.assemblerSettings() method to retrieve the default site root prefix.
DefaultActionPathProvider and the InvokeAssembler Servlet Bean
When using the /atg/endeca/assembler/droplet/InvokeAssembler servlet bean to retrieve content from the Assembler, there is no concept of a “current request.” Because the DefaultActionPathProvider logic uses the current request’s site root and content path values to do its calculations, the InvokeAssembler servlet bean provides navActionContentPath and recordActionContentPath parameters for passing in a value that can function as the current request’s site root and content path. These parameters are used for navigation requests and record requests, respectively. The code sample below shows the use of the navActionContentPath.
<dsp:droplet name="InvokeAssembler"> <dsp:param name="contentCollection" value="/content/Shared/Guided Navigation"/> <dsp:param name="navActionContentPath" value="/browse"/> <dsp:oparam name="output"> <dsp:getvalueof var="contentItem" vartype="com.endeca.infront.assembler.ContentItem" param="contentItem" /> </dsp:oparam> </dsp:droplet>

