atg.projects.b2bstore.servlet
Class SetCurrentLocation

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.TimedOperationService
              extended by atg.servlet.pipeline.PipelineableServletImpl
                  extended by atg.servlet.pipeline.InsertableServletImpl
                      extended by atg.projects.b2bstore.servlet.SetCurrentLocation
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, InsertableServlet, PipelineableServlet, java.util.EventListener, javax.servlet.Servlet
Direct Known Subclasses:
WASetCurrentLocation

public class SetCurrentLocation
extends InsertableServletImpl

This servlet is inserted in request pipeline after DynamoServlet. This servlet checks the page accessed by the request and sets a location value in Profile.currentLocation property. A map containing page URLs or folders and values to be set is configured according to store rules. Based on the location property of Profile, corresponding location URL can be highlighted in Store. Location map can be configured in two ways.

Absolute path name of the page

ex: /Dynamo/solutions/Motorprise/en/home.jhtml
Whenever any request access this page then the value corresponding to this name in the map is updated in Profile.currentLocation

Any folder in document root.

ex: /Dyanmo/solutions/Motorprise/en/catalog/
if absolute file name of the request is not found in the map then folder of the file accessed is checked in the locationMap.
All the folder names are sorted in descending order so that the closest path of the file name requested is matched.

Profile.currentLocation is an enumerated property containing valid option values and codes. So all the values in locationMap has to exist in property definition of currentLocation.

See Also:
WASetCurrentLocation

Field Summary
static java.lang.String CLASS_VERSION
           
static java.lang.String JHTML_EXTENSION
           
static java.lang.String JSP_EXTENSION
           
static java.lang.String SLASH_EXTENSION
           
 
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
SetCurrentLocation()
           
 
Method Summary
 java.util.Properties getLocationMap()
          Returns Location Map.
 java.lang.String getLocationProperty()
          Returns name of the location property
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Services a DynamoHttpServletRequest/Response pair
protected  void setLocation(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method checks the path name of the file accessed against the locationMap and sets the value of path name in Profile
 void setLocationMap(java.util.Properties pLocationMap)
          Sets Location Map.
 void setLocationProperty(java.lang.String pLocationProperty)
          Sets name of the location property
protected  void setUserLocation(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, java.lang.String pLocation)
          This method sets the value passed in Profile.currentLocation property.
protected  void sortLocationMap()
          This method sorts the path names in locationMap in descending order and populates SortedNameList with these values.
 
Methods inherited from class atg.servlet.pipeline.InsertableServletImpl
doStartService, getInsertAfterServlet, setInsertAfterServlet
 
Methods inherited from class atg.servlet.pipeline.PipelineableServletImpl
createAdminServlet, destroy, getAdminServlet, getNextServlet, getServletConfig, getServletInfo, init, isUsePathInfo, passRequest, passRequest, service, service, setNextServlet, setServletInfo, setUsePathInfo
 
Methods inherited from class atg.nucleus.TimedOperationService
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, doStopService, getAbsoluteName, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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
 
Methods inherited from interface atg.servlet.pipeline.PipelineableServlet
getNextServlet, passRequest, setNextServlet
 
Methods inherited from interface javax.servlet.Servlet
destroy, getServletConfig, getServletInfo, init, service
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION

JHTML_EXTENSION

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

JSP_EXTENSION

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

SLASH_EXTENSION

public static final java.lang.String SLASH_EXTENSION
See Also:
Constant Field Values
Constructor Detail

SetCurrentLocation

public SetCurrentLocation()
Method Detail

setLocationProperty

public void setLocationProperty(java.lang.String pLocationProperty)
Sets name of the location property


getLocationProperty

public java.lang.String getLocationProperty()
Returns name of the location property


setLocationMap

public void setLocationMap(java.util.Properties pLocationMap)
Sets Location Map.


getLocationMap

public java.util.Properties getLocationMap()
Returns Location Map.


service

public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws java.io.IOException,
                    javax.servlet.ServletException
Description copied from class: PipelineableServletImpl
Services a DynamoHttpServletRequest/Response pair

Overrides:
service in class PipelineableServletImpl
Throws:
java.io.IOException - if an error occurred while reading or writing the servlet request
javax.servlet.ServletException - if an error occurred while processing the servlet request

setLocation

protected void setLocation(DynamoHttpServletRequest pRequest,
                           DynamoHttpServletResponse pResponse)
This method checks the path name of the file accessed against the locationMap and sets the value of path name in Profile

Parameters:
pRequest -
pResponse -

setUserLocation

protected void setUserLocation(DynamoHttpServletRequest pRequest,
                               DynamoHttpServletResponse pResponse,
                               java.lang.String pLocation)
This method sets the value passed in Profile.currentLocation property.

Parameters:
pRequest -
pResponse -
pLocation - the location value to be set in profile.

sortLocationMap

protected void sortLocationMap()
This method sorts the path names in locationMap in descending order and populates SortedNameList with these values.