The /atg/endeca/assembler/cartridge/manager/DefaultActionPathProvider
component, of class atg.endeca.assembler.navigation.DefaultActionPathProvider
, creates the action path portion of the action strings that are stored in ContentItem
objects. The action path is defined as the combination of the site root path and the content path. For example, in the link below:
/pages/browse?N=4294967263
The site root path is /pages
and the content path is /browse
(the remainder of the URL represents the query parameters that define the request). The DefaultActionPathProvider
class generates both the site root and the content path values to be used in the action string. To do so, the DefaultActionPathProvider
class implements the com.endeca.infront.navigation.url.ActionPathProvider
interface and its four methods:
getDefaultNavigationActionContentPath()
: Returns the content path for a navigation request.getDefaultNavigationActionSiteRootPath()
: Returns the site root path for a navigation request.getDefaultRecordActionContentPath()
: Returns the content path for a record request.getDefaultRecordActionSiteRootPath()
: Returns the site root path for a record request.
The DefaultActionPathProvider
component also has the following properties that support action 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/brand
action path can be replaced with a/pages/browse
action 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 like 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 theAssemblerTools
component. The default site root paths are defined by this component’s properties. Defaults to/atg/endeca/assembler/AssemblerTools
.currentRequest
: Provides access to the current request’s details. Defaults to/OriginatingRequest
.contentSource
: A reference to theWorkbenchContentSource
component used to connect with the correct Workbench application. Defaults to/atg/endeca/assembler/cartridge/manager/WorkbenchContentSource
. See Connecting to Endeca for details on this component.
Calculating the Content Path
To calculate the content path for a navigation request, the getDefaultnavigationActionContentPath()
method is invoked. This method, in turn, 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 the defaultGuidedSearchNavigationActionPath
property, which defaults to /guidedsearch
.
To calculate the content path to use for navigation requests when Experience Manager is in use, the DefaultActionPathProvider
component checks the current request to determine if it contains an Endeca-specific URL. If it does, the DefaultActionPathProvider
component extracts the entire action path from the URL 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 portion from the current request’s action path. If it cannot resolve a content path from either the current request 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 requests when Experience Manager is in use is very similar to that for navigation requests. The getDefaultRecordActionContentPath()
method is invoked and it performs the same URL checking, extraction, and comparison process, however, it uses the recordActionUriMap
property for the lookup instead. Also, if a content path cannot be resolved from either the current request or the navigationActionUriMap
, this method returns the value specified in the DefaultActionPathProvider.defaultExperienceManagerNavigationActionPath
property, which defaults to /product
.
Calculating the Site Root Path
To calculate the site root path for a navigation request, the getDefaultNavigationActionSiteRootPath()
method is invoked. First, this method checks the current request to determine if it contains an Endeca-specific URL. If it does, the DefaultActionPathProvider
component extracts the entire action path from the URL and looks for a match in the keys of its navigationActionUriMap
property. If a match is found, the DefaultActionPathProvider
component returns the site root portion of the matching entry’s value. If no match is found, the DefaultActionPathProvider
component returns the site root portion from the current request’s action path.
If it cannot resolve a content path from either the current request or the navigationActionUriMap
, the DefaultActionPathProvider
component calls the AssemblerTools.isExperienceManager()
method to determine if Experience Manager is in use. If so, the DefaultActionPathProvider
component invokes the AssemblerTools.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 /pages
and /service
, respectively.
The process for calculating the site root path for record requests is very similar to that for navigation requests. The getDefaultRecordActionSiteRootPath()
method is invoked. This method performs the same URL checking, extraction and comparison process, 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 either the current request or the recordActionUriMap
is the same; a call is made to the AssemblerTools.assemblerSettings()
method to retrieve the default site root prefix.
Also, if the DefaultActionPathProvider
component cannot resolve a content path from either the current request or the navigationActionUriMap
, it returns the value specified in its defaultExperienceManagerNavigationActionPath
property, which defaults to /product
.
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 action path 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 action 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="/pages/mobile/browse"/> <dsp:oparam name="output"> <dsp:getvalueof var="contentItem" vartype="com.endeca.infront.assembler.ContentItem" param="contentItem" /> </dsp:oparam> </dsp:droplet>