atg.projects.b2bstore.servlet
Class WASetCurrentLocation

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
                          extended by atg.projects.b2bstore.servlet.WASetCurrentLocation
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, InsertableServlet, PipelineableServlet, java.util.EventListener, javax.servlet.Servlet

public class WASetCurrentLocation
extends SetCurrentLocation

A subclass of the SetCurrentLocation servlet that is aware of web applications. Rather than specifying the absolute URL's to map to virtual locations within the store, this subclass lets you specify URL's relative to the web application's context root and converts these to absolute URL's at runtime. It can therefore handle location mapping for a web application no matter where that web application is deployed.

To use this servlet you must specify the following properties:

insertAfterServlet
Specifies where in the servlet pipeline to insert this servlet.

webAppRegistry
Specifies the Dynamo web application registry where the web app is registered.

webApplicationName
Specifies the name by which this web application is known to the registry

relativePathMap
Specifies the mapping between URL's and virtual parts of the store, using URL's relative to the web app context root

See Also:
SetCurrentLocation

Field Summary
static java.lang.String CLASS_VERSION
           
static java.lang.String MY_RESOURCE_NAME
           
 
Fields inherited from class atg.projects.b2bstore.servlet.SetCurrentLocation
JHTML_EXTENSION, JSP_EXTENSION, 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
WASetCurrentLocation()
           
 
Method Summary
protected  java.util.Properties createLocationMap()
          Return a Properties object suitable for use as the value of locationMap by prepending the web application's context root to each path in relativePathMap.
protected  java.lang.String errorMsg(java.lang.String pResourceKey)
          Get a formatted error message string based on an error message resource key.
protected  java.lang.String errorMsg(java.lang.String pResourceKey, java.lang.Object pArg)
          Get a formatted error message string based on an error message resource key and a single message argument.
protected  java.lang.String errorMsg(java.lang.String pResourceKey, java.lang.Object[] pArgs)
          Get a formatted error message string based on an error message resource key and an array of message arguments.
 java.util.Properties getRelativePathMap()
          Specify the mapping from URL's to virtual locations within the store.
 java.lang.String getWebApplicationName()
          Return the name by this web applicaiton is known to the web application registry.
 WebAppRegistry getWebAppRegistry()
          Return the Dynamo Web Application Registry that knows about the web application whose URL's we are mapping to locations.
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Examine the current request URL and set the current location property to the corresponding virtual location within the store.
 void setRelativePathMap(java.util.Properties pRelativePathMap)
          Specify the mapping from URL's to virtual locations within the store, using URL's relative to the web app's context root.
 void setWebApplicationName(java.lang.String pWebApplicationName)
          Specify the name by this web applicaiton is known to the web application registry.
 void setWebAppRegistry(WebAppRegistry pWebAppRegistry)
          Specify the Dynamo Web Application Registry that knows about the web application whose URL's we are mapping to locations.
 
Methods inherited from class atg.projects.b2bstore.servlet.SetCurrentLocation
getLocationMap, getLocationProperty, setLocation, setLocationMap, setLocationProperty, setUserLocation, sortLocationMap
 
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

MY_RESOURCE_NAME

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

WASetCurrentLocation

public WASetCurrentLocation()
Method Detail

setWebAppRegistry

public void setWebAppRegistry(WebAppRegistry pWebAppRegistry)
Specify the Dynamo Web Application Registry that knows about the web application whose URL's we are mapping to locations.


getWebAppRegistry

public WebAppRegistry getWebAppRegistry()
Return the Dynamo Web Application Registry that knows about the web application whose URL's we are mapping to locations.


setWebApplicationName

public void setWebApplicationName(java.lang.String pWebApplicationName)
Specify the name by this web applicaiton is known to the web application registry.


getWebApplicationName

public java.lang.String getWebApplicationName()
Return the name by this web applicaiton is known to the web application registry.


setRelativePathMap

public void setRelativePathMap(java.util.Properties pRelativePathMap)
Specify the mapping from URL's to virtual locations within the store, using URL's relative to the web app's context root. This value is used to set the property locationMap in the base class by prepending the web application's context root to each URL in relativePathMap


getRelativePathMap

public java.util.Properties getRelativePathMap()
Specify the mapping from URL's to virtual locations within the store.


service

public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws java.io.IOException,
                    javax.servlet.ServletException
Examine the current request URL and set the current location property to the corresponding virtual location within the store.

This method simply converts the relative location map to an absolute location map (if necessary) and then calls the superclass service method to handle the request.

Overrides:
service in class SetCurrentLocation
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

createLocationMap

protected java.util.Properties createLocationMap()
                                          throws javax.servlet.ServletException
Return a Properties object suitable for use as the value of locationMap by prepending the web application's context root to each path in relativePathMap.

Throws:
javax.servlet.ServletException

errorMsg

protected java.lang.String errorMsg(java.lang.String pResourceKey)
Get a formatted error message string based on an error message resource key.


errorMsg

protected java.lang.String errorMsg(java.lang.String pResourceKey,
                                    java.lang.Object pArg)
Get a formatted error message string based on an error message resource key and a single message argument.


errorMsg

protected java.lang.String errorMsg(java.lang.String pResourceKey,
                                    java.lang.Object[] pArgs)
Get a formatted error message string based on an error message resource key and an array of message arguments.