public class SearchClickThroughServlet extends InsertableServletImpl
This class is used to create components for inserting into servlet pipeline to get search click identifier (query id and document id) from the request. After getting searchClickId value and parsing it into queryId and documentId values it perform lookup for document and cacheElement objects in cache/history components. In case of all objects where found, we can treat such activity as a successful click-through action and fire SearchClickThroughMessage JMS event with required information.
Component is implemented to proceed only with configured list of page URLs and configured request parameter names.
Enabled property controls whether servlet should process request or transfer its execution to the next one in a chain. SearchClickIdQueryArgs property contains query parameter names which we will look for searchClickId value in request. ClickThroughPages property controls the list of pages which will be processed by servlet and we will look for searchClickIdQueryArgs for them. Wildcard characters can be used. If this property is null, then searchClickIdQueryArgs are looked for all pages.
The use of the clickThroughPages configuration is shown in the following example:
clickThroughPages=/*/*/productDetailWithPicker.jsp,/*/*/productDetail.jsp,/*/*/giftCertificateProduct.jsp,/*/facet/facetGlossary.jsp
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
SearchClickThroughServlet() |
Modifier and Type | Method and Description |
---|---|
void |
doStartService()
This is called after a Service has been created, placed into the
naming hierarchy, and initialized with its configured property
values.
|
java.lang.String |
findQueryArgument(DynamoHttpServletRequest pRequest,
java.lang.String[] pQueryArgs)
Return the first
pQueryArgs that is found in the request. |
Cache |
getClickThroughPageCache()
Returns clickThroughPageCache property.
|
protected PagePattern[] |
getClickThroughPagePatterns()
Returns clickThroughPagePatterns property compiled from the elements in the clickThroughPages
property.
|
java.lang.String[] |
getClickThroughPages()
Returns clickThroughPages property.
|
java.lang.String |
getHistoryComponentPath()
Returns historyComponentPath property.
|
java.lang.String |
getSearchClickIdDelimiter()
Returns searchClickIdDelimiter property.
|
java.lang.String[] |
getSearchClickIdQueryArgs()
Returns searchClickIdQueryArgs property.
|
atg.search.events.SearchMessageSource |
getSearchMessageSource()
Returns searchMessageSource property.
|
java.lang.String |
getSearchQueryCachePath()
Returns searchQueryCachePath property.
|
boolean |
isEnabled()
Returns property 'enabled' which specifies whether servlet should process
request
|
boolean |
pathMatchesPattern(java.lang.String pPath,
PagePattern[] pPatterns,
Cache pCache)
This method will determine if the given path fits one of the
patterns.
|
void |
service(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
The service method looks for the searchClickId parameter value in request.
|
void |
setClickThroughPageCache(Cache pClickThroughPageCache)
Sets clickThroughPageCache property.
|
protected void |
setClickThroughPagePatterns(PagePattern[] pClickThroughPagePatterns)
Sets clickThroughPagePatterns property compiled from the elements in the clickThroughPages
property.
|
void |
setClickThroughPages(java.lang.String[] pClickThroughPages)
Sets clickThroughPages property.
|
void |
setEnabled(boolean pEnabled)
Sets property 'enabled' which specifies whether servlet should process
request
|
void |
setHistoryComponentPath(java.lang.String pHistoryComponentPath)
Sets historyComponentPath property.
|
void |
setSearchClickIdDelimiter(java.lang.String pSearchClickIdDelimiter)
Sets searchClickIdDelimiter property.
|
void |
setSearchClickIdQueryArgs(java.lang.String[] pSearchClickIdQueryArgs)
Sets searchClickIdQueryArgs property.
|
void |
setSearchMessageSource(atg.search.events.SearchMessageSource pSearchMessageSource)
Sets searchMessageSource property.
|
void |
setSearchQueryCachePath(java.lang.String pSearchQueryCachePath)
Sets searchQueryCachePath property.
|
getInsertAfterServlet, setInsertAfterServlet
createAdminServlet, destroy, getAdminServlet, getNextServlet, getServletConfig, getServletInfo, init, isUsePathInfo, passRequest, passRequest, service, service, setNextServlet, setServletInfo, setUsePathInfo
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
addLogListener, doStopService, getAbsoluteName, 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, toString
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getNextServlet, passRequest, setNextServlet
public void setSearchClickIdQueryArgs(java.lang.String[] pSearchClickIdQueryArgs)
pSearchClickIdQueryArgs
- New value for searchClickIdQueryArgs
propertypublic java.lang.String[] getSearchClickIdQueryArgs()
public void setClickThroughPages(java.lang.String[] pClickThroughPages)
pClickThroughPages
- New value for clickThroughPages propertypublic java.lang.String[] getClickThroughPages()
protected void setClickThroughPagePatterns(PagePattern[] pClickThroughPagePatterns)
pClickThroughPagePatterns
- New value for clickThroughPagePatterns propertyprotected PagePattern[] getClickThroughPagePatterns()
public void setClickThroughPageCache(Cache pClickThroughPageCache)
pClickThroughPageCache
- New value for clickThroughPageCache propertypublic Cache getClickThroughPageCache()
public void setEnabled(boolean pEnabled)
pEnabled
- New value for property 'enabled'public boolean isEnabled()
public java.lang.String getSearchClickIdDelimiter()
public void setSearchClickIdDelimiter(java.lang.String pSearchClickIdDelimiter)
pSearchClickIdDelimiter
- New value for searchClickIdDelimiter
propertypublic void setSearchQueryCachePath(java.lang.String pSearchQueryCachePath)
pSearchQueryCachePath
- New value for searchQueryCachePath propertypublic java.lang.String getSearchQueryCachePath()
public void setHistoryComponentPath(java.lang.String pHistoryComponentPath)
pHistoryComponentPath
- New value for historyComponentPath propertypublic java.lang.String getHistoryComponentPath()
public void setSearchMessageSource(atg.search.events.SearchMessageSource pSearchMessageSource)
pSearchMessageSource
- New value for searchMessageSource propertypublic atg.search.events.SearchMessageSource getSearchMessageSource()
public void doStartService() throws ServiceException
doStartService
in class InsertableServletImpl
ServiceException
- if the Service had a problem
starting uppublic boolean pathMatchesPattern(java.lang.String pPath, PagePattern[] pPatterns, Cache pCache) throws java.lang.Exception
pPath
- The URL to search forpPatterns
- The URL patternspCache
- Cached results of previous pathsjava.lang.Exception
public java.lang.String findQueryArgument(DynamoHttpServletRequest pRequest, java.lang.String[] pQueryArgs)
pQueryArgs
that is found in the request.
Return null if none of them are found.public void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws java.io.IOException, javax.servlet.ServletException
service
in class PipelineableServletImpl
pRequest
- The request to be processed.pResponse
- Response object for this request.javax.servlet.ServletException
- An application specific error
occurred processing this request.java.io.IOException
- An error occurred reading data from the request
or writing data to the response.