atg.droplet.multisite
Class SiteContextDroplet

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.TimedOperationService
              extended by atg.nucleus.servlet.ServletService
                  extended by atg.nucleus.servlet.HttpServletService
                      extended by atg.servlet.DynamoServlet
                          extended by atg.droplet.ContextAffectingDropletImpl
                              extended by atg.droplet.multisite.SiteContextDroplet
All Implemented Interfaces:
atg.droplet.ContextAffectingDroplet, 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, ParameterServlet, java.util.EventListener, javax.servlet.Servlet

public class SiteContextDroplet
extends atg.droplet.ContextAffectingDropletImpl

The SiteContextDroplet wraps the output in the context of a particular site. The given siteId is pushed to the SiteContextManager before the output oparam is serviced and then popped afterward. If emptySite is set to true, the siteId param is ignored and an empty site context is pushed. The siteContext parameter is set with the context that was pushed. If the the siteId parameter is null or there is a problem pushing the site context, the error oparam will be serviced and the errorMessage set.

The output parameters for this Droplet are:

output
This parameter is rendered for once in the context of the specified site.
error
This optional parameter is rendered if there was an error setting the site context or if the siteId is null.
errorMessage
This parameter is set with an error message if there is one.
siteContext
This parameter is set to the SiteContext object for the given siteId


Nested Class Summary
 
Nested classes/interfaces inherited from class atg.droplet.ContextAffectingDropletImpl
atg.droplet.ContextAffectingDropletImpl.TestContextAffectingDroplet
 
Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static ParameterName EMPTY_SITE
          ParameterName for emptySite
static ParameterName ERROR
          ParameterName for error
static java.lang.String ERROR_MSG_PROP_NAME
          Parameter name for errorMessage
static ParameterName OUTPUT
          ParameterName for output
static java.lang.String SITE_CONTEXT_PROP_NAME
          Parameter name for siteContext
static ParameterName SITE_ID
          ParameterName for siteId
 
Fields inherited from class atg.servlet.DynamoServlet
mAllowCleanupRequest, mParameters
 
Fields inherited from class atg.nucleus.servlet.ServletService
SERVLET_INFO_KEY
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.droplet.ContextAffectingDroplet
ATTRIBUTE_BEFORE_CONTENT_RESULT
 
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
SiteContextDroplet()
           
 
Method Summary
 void afterContent(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, java.lang.Object pBeforeContentResult, boolean pServiceThrewException)
          Pops the SiteContext from the SiteContextManager for the given site if it was pushed by the beforeContent method.
 java.lang.Object beforeContent(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
           
 void doService(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, java.lang.Object pBeforeContentResult)
          Services the error parameter if pBeforeContentResult is the static null place holder object.
 SiteContextManager getSiteContextManager()
          Gets the SiteContextManager.
 void setSiteContextManager(SiteContextManager pSiteContextManager)
          Sets the SiteContextManager
 
Methods inherited from class atg.droplet.ContextAffectingDropletImpl
service
 
Methods inherited from class atg.servlet.DynamoServlet
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, service, service, setParameter
 
Methods inherited from class atg.nucleus.servlet.ServletService
destroy, getServletConfig, getServletInfo, init, setServletInfo
 
Methods inherited from class atg.nucleus.TimedOperationService
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
 
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
 
Methods inherited from interface javax.servlet.Servlet
destroy, getServletConfig, getServletInfo, init, service
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


SITE_ID

public static final ParameterName SITE_ID
ParameterName for siteId


EMPTY_SITE

public static final ParameterName EMPTY_SITE
ParameterName for emptySite


OUTPUT

public static final ParameterName OUTPUT
ParameterName for output


ERROR

public static final ParameterName ERROR
ParameterName for error


ERROR_MSG_PROP_NAME

public static final java.lang.String ERROR_MSG_PROP_NAME
Parameter name for errorMessage

See Also:
Constant Field Values

SITE_CONTEXT_PROP_NAME

public static final java.lang.String SITE_CONTEXT_PROP_NAME
Parameter name for siteContext

See Also:
Constant Field Values
Constructor Detail

SiteContextDroplet

public SiteContextDroplet()
Method Detail

getSiteContextManager

public SiteContextManager getSiteContextManager()
Gets the SiteContextManager. The default path will be resolved if this property has not been set.

Returns:
the siteContextManager

setSiteContextManager

public void setSiteContextManager(SiteContextManager pSiteContextManager)
Sets the SiteContextManager

Parameters:
pSiteContextManager - the siteContextManager to set

afterContent

public void afterContent(DynamoHttpServletRequest pRequest,
                         DynamoHttpServletResponse pResponse,
                         java.lang.Object pBeforeContentResult,
                         boolean pServiceThrewException)
Pops the SiteContext from the SiteContextManager for the given site if it was pushed by the beforeContent method.

Specified by:
afterContent in interface atg.droplet.ContextAffectingDroplet
Specified by:
afterContent in class atg.droplet.ContextAffectingDropletImpl
Parameters:
pRequest - The DynamoHttpServletRequest
pResponse - The DynamoHttpServletResponse
pBeforeContentResult - The SiteContext that was pushed. A static null place holder object is passed if no SiteContext was pushed.
See Also:
atg.droplet.ContextAffectingDropletImpl#afterContent(atg.servlet.DynamoHttpServletRequest, atg.servlet.DynamoHttpServletResponse, java.lang.Object)

beforeContent

public java.lang.Object beforeContent(DynamoHttpServletRequest pRequest,
                                      DynamoHttpServletResponse pResponse)
                               throws javax.servlet.ServletException
Specified by:
beforeContent in interface atg.droplet.ContextAffectingDroplet
Specified by:
beforeContent in class atg.droplet.ContextAffectingDropletImpl
Parameters:
pRequest - The DynamoHttpServletRequest
pResponse - The DynamoHttpServletResponse
Returns:
The SiteContext that was pushed or a static null place holder object if a SiteContext could not be pushed.
Throws:
javax.servlet.ServletException
See Also:
ContextAffectingDropletImpl.beforeContent(atg.servlet.DynamoHttpServletRequest, atg.servlet.DynamoHttpServletResponse)

doService

public void doService(DynamoHttpServletRequest pRequest,
                      DynamoHttpServletResponse pResponse,
                      java.lang.Object pBeforeContentResult)
               throws javax.servlet.ServletException,
                      java.io.IOException
Services the error parameter if pBeforeContentResult is the static null place holder object. Services output otherwise.

Specified by:
doService in class atg.droplet.ContextAffectingDropletImpl
Parameters:
pRequest - The DynamoHttpServletRequest
pResponse - The DynamoHttpServletResponse
pBeforeContentResult - The SiteContext that was pushed. A static null place holder object is passed if no SiteContext was pushed.
Throws:
javax.servlet.ServletException
java.io.IOException
See Also:
ContextAffectingDropletImpl.doService(atg.servlet.DynamoHttpServletRequest, atg.servlet.DynamoHttpServletResponse, java.lang.Object)