atg.endeca.assembler.navigation
Class DefaultActionPathProvider

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.endeca.assembler.navigation.DefaultActionPathProvider
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class DefaultActionPathProvider
extends GenericService

An implementation of the com.endeca.infront.navigaton.url.ActionPathProvider interface. Used to return information to the Assembler when constructing RecordAction objects. The following sequence is used to calculate the action paths.

  • Read the navActionContentPath and recordActionContentPath params that can be passed when using the InvokeAssembler droplet to specify the navigation and record action paths respectively
  • Check if the current request's content path, as calculated by AssemblerTools#getContentPath(), exists in navigationActionUriMap or recordActionUriMap. If it exists, use the value from the map.
  • Use the current request's content path, as calculated by AssemblerTools#getContentPath()
  • If the current request's content path doesn't resolve in the ContentSource, use defaultExperienceManagerNavigationActionPath or defaultExperienceManagerRecordActionPath property

  • Field Summary
    static java.lang.String ALWAYS_USE_DEFAULT_NAVIGATION_CONTENT_PATH
              The request parameter key to enforce that the default navigation action content path is used.
    static java.lang.String CLASS_VERSION
              Class version string
     
    Fields inherited from class atg.nucleus.GenericService
    SERVICE_INFO_KEY
     
    Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
    DEFAULT_LOG_TRACE_STATUS
     
    Fields inherited from interface atg.nucleus.logging.ApplicationLogging
    DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
     
    Constructor Summary
    DefaultActionPathProvider()
               
     
    Method Summary
    protected  java.lang.String attemptMatch(java.lang.String pUri, java.util.Map<java.lang.String,java.lang.String> pRegexps)
              Iterates through the given map, treating each key/value pair as a regular expression and a replacement string, respectively.
     AssemblerTools getAssemblerTools()
               
     ContentSource getContentSource()
               
     DynamoHttpServletRequest getCurrentRequest()
               
    protected  ContentLocator getDefaultContentLocator()
              Try and resolve the default ContentLocator.
     java.lang.String getDefaultExperienceManagerNavigationActionPath()
               
     java.lang.String getDefaultExperienceManagerRecordActionPath()
               
     java.lang.String getDefaultGuidedSearchNavigationActionPath()
               
     java.lang.String getDefaultGuidedSearchRecordActionPath()
               
     java.lang.String getDefaultNavigationActionContentPath()
              Implements com.endeca.infront.navigation.url.ActionPathProviders getDefaultNavigationActionContentPath to return the current content path.
     java.lang.String getDefaultNavigationActionSiteRootPath()
              Implements com.endeca.infront.navigation.url.ActionPathProviders getDefaultNavigationActionSiteRootPath to return the current default root path.
     java.lang.String getDefaultRecordActionContentPath()
              Implements com.endeca.infront.navigation.url.ActionPathProviders getDefaultRecordActionContentPath to return the current content path.
     java.lang.String getDefaultRecordActionSiteRootPath()
              Implements com.endeca.infront.navigation.url.ActionPathProviders getDefaultRecordActionSiteRootPath to return the current site root path.
    protected  java.lang.String getDefaultSiteRootPath()
              Gets the default site root path depending on whether we are using Experience Manager or Guided Search.
     ContentLocator getNavigationActionLocator()
               
     java.util.Map<java.lang.String,java.lang.String> getNavigationActionUriMap()
               
     ContentLocator getRecordActionLocator()
               
     java.util.Map<java.lang.String,java.lang.String> getRecordActionUriMap()
               
     java.lang.Boolean isExperienceManager()
               
     boolean isTriedResolveNavigationActionLocator()
               
     boolean isTriedResolveRecordActionLocator()
               
     void setAssemblerTools(AssemblerTools pAssemblerTools)
               
     void setContentSource(ContentSource pContentSource)
               
     void setCurrentRequest(DynamoHttpServletRequest pCurrentRequest)
               
     void setDefaultExperienceManagerNavigationActionPath(java.lang.String pDefaultExperienceManagerNavigationActionPath)
               
     void setDefaultExperienceManagerRecordActionPath(java.lang.String pDefaultExperienceManagerRecordActionPath)
               
     void setDefaultGuidedSearchNavigationActionPath(java.lang.String pDefaultGuidedSearchNavigationActionPath)
               
     void setDefaultGuidedSearchRecordActionPath(java.lang.String pDefaultGuidedSearchRecordActionPath)
               
     void setNavigationActionLocator(ContentLocator pNavigationActionLocator)
               
     void setNavigationActionUriMap(java.util.Map<java.lang.String,java.lang.String> pNavigationActionUriMap)
               
     void setRecordActionLocator(ContentLocator pRecordActionLocator)
               
     void setRecordActionUriMap(java.util.Map<java.lang.String,java.lang.String> pRecordActionUriMap)
               
     
    Methods inherited from class atg.nucleus.GenericService
    addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
     
    Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
    vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    ALWAYS_USE_DEFAULT_NAVIGATION_CONTENT_PATH

    public static final java.lang.String ALWAYS_USE_DEFAULT_NAVIGATION_CONTENT_PATH
    The request parameter key to enforce that the default navigation action content path is used.

    See Also:
    Constant Field Values

    CLASS_VERSION

    public static java.lang.String CLASS_VERSION
    Class version string

    Constructor Detail

    DefaultActionPathProvider

    public DefaultActionPathProvider()
    Method Detail

    getDefaultExperienceManagerNavigationActionPath

    public java.lang.String getDefaultExperienceManagerNavigationActionPath()
    Returns:
    The default navigation action path when using Experience Manager. A navigation action path is used when performing a navigation action such as viewing a dimension.

    setDefaultExperienceManagerNavigationActionPath

    public void setDefaultExperienceManagerNavigationActionPath(java.lang.String pDefaultExperienceManagerNavigationActionPath)
    Parameters:
    pDefaultExperienceManagerNavigationActionPath - Set a new defaultExperienceManagerNavigationActionPath.

    getDefaultExperienceManagerRecordActionPath

    public java.lang.String getDefaultExperienceManagerRecordActionPath()
    Returns:
    The default record action path when using Experience Manager. A record action path is used when performing a record action such as viewing a record.

    setDefaultExperienceManagerRecordActionPath

    public void setDefaultExperienceManagerRecordActionPath(java.lang.String pDefaultExperienceManagerRecordActionPath)
    Parameters:
    pDefaultExperienceManagerRecordActionPath - Set a new defaultExperienceManagerRecordActionPath.

    getDefaultGuidedSearchNavigationActionPath

    public java.lang.String getDefaultGuidedSearchNavigationActionPath()
    Returns:
    The default navigation action path when using Guided Search. A navigation action path is used when performing a navigation action such as viewing a dimension.

    setDefaultGuidedSearchNavigationActionPath

    public void setDefaultGuidedSearchNavigationActionPath(java.lang.String pDefaultGuidedSearchNavigationActionPath)
    Parameters:
    pDefaultGuidedSearchNavigationActionPath - Set a new defaultGuidedSearchNavigationActionPath.

    getDefaultGuidedSearchRecordActionPath

    public java.lang.String getDefaultGuidedSearchRecordActionPath()
    Returns:
    The default record action path when using Guided Search. A record action path is used when performing a record action such as viewing a record.

    setDefaultGuidedSearchRecordActionPath

    public void setDefaultGuidedSearchRecordActionPath(java.lang.String pDefaultGuidedSearchRecordActionPath)
    Parameters:
    pDefaultGuidedSearchRecordActionPath - Set a new defaultGuidedSearchRecordActionPath.

    getAssemblerTools

    public AssemblerTools getAssemblerTools()
    Returns:
    AssemblerTools component containing useful methods for use with the Assembler.

    setAssemblerTools

    public void setAssemblerTools(AssemblerTools pAssemblerTools)
    Parameters:
    mAssemblerTools - Set a new AssemblerTools.

    getNavigationActionLocator

    public ContentLocator getNavigationActionLocator()
    Returns:
    the navigationActionLocator. First we check the request for a navActionContentPath parameter and try to resolve the locator based on this. If thats not successful we use the default ContentLocator. This is only attempted once per request.

    setNavigationActionLocator

    public void setNavigationActionLocator(ContentLocator pNavigationActionLocator)
    Parameters:
    pNavigationActionLocator - the navigationActionLocator to set

    getRecordActionLocator

    public ContentLocator getRecordActionLocator()
    Returns:
    the recordActionLocator. First we check the request for a recordActionContentPath parameter and try to resolve the locator based on this. If thats not successful we use the default ContentLocator. This is only attempted once per request.

    setRecordActionLocator

    public void setRecordActionLocator(ContentLocator pRecordActionLocator)
    Parameters:
    pRecordActionLocator - the recordActionLocator to set

    getNavigationActionUriMap

    public java.util.Map<java.lang.String,java.lang.String> getNavigationActionUriMap()
    Returns:
    the navigationActionUriMap

    setNavigationActionUriMap

    public void setNavigationActionUriMap(java.util.Map<java.lang.String,java.lang.String> pNavigationActionUriMap)
    Parameters:
    pNavigationActionUriMap - the navigationActionUriMap to set

    getRecordActionUriMap

    public java.util.Map<java.lang.String,java.lang.String> getRecordActionUriMap()
    Returns:
    the recordActionUriMap

    setRecordActionUriMap

    public void setRecordActionUriMap(java.util.Map<java.lang.String,java.lang.String> pRecordActionUriMap)
    Parameters:
    pRecordActionUriMap - the recordActionUriMap to set

    getCurrentRequest

    public DynamoHttpServletRequest getCurrentRequest()
    Returns:
    the currentRequest

    setCurrentRequest

    public void setCurrentRequest(DynamoHttpServletRequest pCurrentRequest)
    Parameters:
    pCurrentRequest - the currentRequest to set

    getContentSource

    public ContentSource getContentSource()
    Returns:
    the contentSource

    setContentSource

    public void setContentSource(ContentSource pContentSource)
    Parameters:
    pContentSource - the contentSource to set

    isTriedResolveNavigationActionLocator

    public boolean isTriedResolveNavigationActionLocator()
    Returns:
    Indicates whether we have tried to resolve the navigationActionLocator in this request.

    isTriedResolveRecordActionLocator

    public boolean isTriedResolveRecordActionLocator()
    Returns:
    Indicates whether we have tried to resolve the recordActionLocator in this request.

    isExperienceManager

    public java.lang.Boolean isExperienceManager()
    Returns:
    Calls AssemblerTools.isExperienceManager and caches the result for this request.

    getDefaultNavigationActionSiteRootPath

    public java.lang.String getDefaultNavigationActionSiteRootPath()
    Implements com.endeca.infront.navigation.url.ActionPathProviders getDefaultNavigationActionSiteRootPath to return the current default root path. For example "/pages" or "/services" etc.


    getDefaultNavigationActionContentPath

    public java.lang.String getDefaultNavigationActionContentPath()
    Implements com.endeca.infront.navigation.url.ActionPathProviders getDefaultNavigationActionContentPath to return the current content path. For example "/browse" or "/guidedsearch" etc.


    getDefaultRecordActionSiteRootPath

    public java.lang.String getDefaultRecordActionSiteRootPath()
    Implements com.endeca.infront.navigation.url.ActionPathProviders getDefaultRecordActionSiteRootPath to return the current site root path. For example "/pages" or "/services" etc.


    getDefaultRecordActionContentPath

    public java.lang.String getDefaultRecordActionContentPath()
    Implements com.endeca.infront.navigation.url.ActionPathProviders getDefaultRecordActionContentPath to return the current content path. For example "/product" or "/recordetails" etc.


    getDefaultSiteRootPath

    protected java.lang.String getDefaultSiteRootPath()
    Gets the default site root path depending on whether we are using Experience Manager or Guided Search.

    Returns:

    attemptMatch

    protected java.lang.String attemptMatch(java.lang.String pUri,
                                            java.util.Map<java.lang.String,java.lang.String> pRegexps)
    Iterates through the given map, treating each key/value pair as a regular expression and a replacement string, respectively.

    If a key matches the given URI, replace the matches with the replacement string and return the result. Otherwise, proceed to the next pair. If no key matches, return null.


    getDefaultContentLocator

    protected ContentLocator getDefaultContentLocator()
    Try and resolve the default ContentLocator. We only want to try this once per request.