atg.knowledgebase.adc
Class KnowledgeBaseFindPageUrlProcessor

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.adc.pipeline.ADCPipelineProcessor
              extended by atg.adc.pipeline.PatternMappingProcessor
                  extended by atg.knowledgebase.adc.KnowledgeBaseFindPageUrlProcessor
All Implemented Interfaces:
atg.naming.AbsoluteNameable, atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameContextParentable, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.Configured, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, atg.service.pipeline.PipelineProcessor, java.util.EventListener

public class KnowledgeBaseFindPageUrlProcessor
extends atg.adc.pipeline.PatternMappingProcessor

This processor performs a look up for the page urls configured and persists the page details into ADCRequestData object for the use in the remaining pipeline processors. The processor extends atg.adc.pipeline.PatternMappingProcessor to perform a lookup for the URL parameter value for the configured set of pages. If the URL of the requested page matches an entry in the configured widgetDisplayPages property, it is set to the ADC request data.

Author:
Gayathri Sasidharan

Field Summary
static java.lang.String CLASS_VERSION
           
protected static java.lang.String ERROR_PERF_MONITOR
          Performance Monitor Error.
static java.lang.String PERFORM_OPERATION_NAME
           
 
Fields inherited from class atg.adc.pipeline.ADCPipelineProcessor
MADE_CHANGE, NO_CHANGE
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.service.pipeline.PipelineProcessor
STOP_CHAIN_EXECUTION, STOP_CHAIN_EXECUTION_AND_COMMIT, STOP_CHAIN_EXECUTION_AND_ROLLBACK
 
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
KnowledgeBaseFindPageUrlProcessor()
           
 
Method Summary
 void doStartService()
          Initializes searchResultsPagePatterns property with compiled page patterns corresponding to widgetDisplayPages list.
protected  java.lang.String findPageUrl(atg.adc.pipeline.ADCPipelineArgs pArgs)
          Finds the Page URL in the query arguments in the request.
 atg.core.util.PagePattern[] getWidgetDisplayPagePatterns()
          Gets widget display page patterns
 java.lang.String[] getWidgetDisplayPages()
          Get search results pages
 atg.service.cache.Cache getWidgetDisplayPagesCache()
          Gets the widget display pages cache
 boolean pathMatchesPattern(java.lang.String pPath, atg.core.util.PagePattern[] pPatterns, atg.service.cache.Cache pCache)
          This method determines if the given path matches any of the page patterns defined.
 void setWidgetDisplayPagePatterns(atg.core.util.PagePattern[] pWidgetDisplayPagePatterns)
          Sets widget display page patterns
 void setWidgetDisplayPages(java.lang.String[] pWidgetDisplayPages)
          Set widget display pages
 void setWidgetDisplayPagesCache(atg.service.cache.Cache pWidgetDisplayPagesCache)
          Sets the widget display pages cache
 int updateADCData(atg.adc.pipeline.ADCPipelineArgs pArgs)
          Checks if the current URL matches one of the widgetDisplayPages configured and if a matching url is found then it is set to the ADCRequestData.
 
Methods inherited from class atg.adc.pipeline.PatternMappingProcessor
createPatternMappings, findMappingForPath
 
Methods inherited from class atg.adc.pipeline.ADCPipelineProcessor
getRetCodes, isEnabled, runProcess, setEnabled
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, 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

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
See Also:
Constant Field Values

PERFORM_OPERATION_NAME

public static final java.lang.String PERFORM_OPERATION_NAME
See Also:
Constant Field Values

ERROR_PERF_MONITOR

protected static final java.lang.String ERROR_PERF_MONITOR
Performance Monitor Error.

See Also:
Constant Field Values
Constructor Detail

KnowledgeBaseFindPageUrlProcessor

public KnowledgeBaseFindPageUrlProcessor()
Method Detail

getWidgetDisplayPages

public java.lang.String[] getWidgetDisplayPages()
Get search results pages

Returns:
the array of search results pages

setWidgetDisplayPages

public void setWidgetDisplayPages(java.lang.String[] pWidgetDisplayPages)
Set widget display pages

Parameters:
pWidgetDisplayPages - the array of search results pages

getWidgetDisplayPagesCache

public atg.service.cache.Cache getWidgetDisplayPagesCache()
Gets the widget display pages cache

Returns:
the widget display pages cache

setWidgetDisplayPagesCache

public void setWidgetDisplayPagesCache(atg.service.cache.Cache pWidgetDisplayPagesCache)
Sets the widget display pages cache

Parameters:
pWidgetDisplayPagesCache - the widget display pages cache

getWidgetDisplayPagePatterns

public atg.core.util.PagePattern[] getWidgetDisplayPagePatterns()
Gets widget display page patterns

Returns:
the widget display page patterns

setWidgetDisplayPagePatterns

public void setWidgetDisplayPagePatterns(atg.core.util.PagePattern[] pWidgetDisplayPagePatterns)
Sets widget display page patterns

Parameters:
pWidgetDisplayPagePatterns - the widget display page patterns

doStartService

public void doStartService()
                    throws atg.nucleus.ServiceException
Initializes searchResultsPagePatterns property with compiled page patterns corresponding to widgetDisplayPages list.

Overrides:
doStartService in class atg.nucleus.GenericService
Throws:
atg.nucleus.ServiceException - if the Service had a problem starting up

updateADCData

public int updateADCData(atg.adc.pipeline.ADCPipelineArgs pArgs)
Checks if the current URL matches one of the widgetDisplayPages configured and if a matching url is found then it is set to the ADCRequestData.

Specified by:
updateADCData in class atg.adc.pipeline.ADCPipelineProcessor
Parameters:
pArgs - The pipeline arguments
Returns:
NO_CHANGE pipeline result code

findPageUrl

protected java.lang.String findPageUrl(atg.adc.pipeline.ADCPipelineArgs pArgs)
Finds the Page URL in the query arguments in the request. If the URL for the current request matches an entry in widgetDisplayPages, each argument name in pArgs is checked for a matching page url.

Parameters:
pArgs - The pipeline arguments
Returns:
The url of the page , or null if nothing is found

pathMatchesPattern

public boolean pathMatchesPattern(java.lang.String pPath,
                                  atg.core.util.PagePattern[] pPatterns,
                                  atg.service.cache.Cache pCache)
                           throws java.lang.Exception
This method determines if the given path matches any of the page patterns defined.

Parameters:
pPath - The url to search for
pPatterns - The url patterns
pCache - Cached results of previous paths
Returns:
boolean indicating if the path fits one of the patterns
Throws:
java.lang.Exception