atg.droplet.multisite
Class SiteIdForItemDroplet

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.multisite.SiteIdForItemDroplet
All Implemented Interfaces:
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 SiteIdForItemDroplet
extends DynamoServlet

The SiteIdForItemDroplet will call SiteTools to return the most appropriate site id for a given repository item. The input parameters for this droplet are as follows: item - the item that the site selection is going to be based on currentSiteFirst - a value of true indicates a preference for the current site to be returned as the best possible match by looking for it in the item's site list. This is also dependent on the site being active (or the appropriate include flags being set). shareableTypeId - id of the shareable that will be used to get the list of potential sites siteId - a user defined siteId value that will be used as a preference in the matching process. includeInactiveSites - a value of true indicates a preference for a site in an inactive state to be considered for inclusion in the site matching process includeDisabledSites - a value of true indicates a preference for a site in a disabled state to be considered for inclusion in the site matching process. Note, that by definition, a disabled site is inactive so in order to include a disabled site, both this flag and the includeInactiveSites should be set to true. The output parameters for this droplet are as follows: output siteId - the calculated siteId, which represents the best match for the given item offSite - will be set to true if the derived siteId value is not equal to the current site active - will be set to true if the selected site is active enabled - will be set to true if the selected site is enabled inGroup - will be set to true if the selected site and current site are within the same sharing group defined by the shareableTypeId. If a valid shareableTypeId is provided, both sites will be checked to see whether they share the same shareable type. In case a valid shareableTypeId is not provided, then all sites in the system share the same sharing group. error errorMessage - if an error occurred it will be detailed here


Field Summary
static ParameterName ACTIVE
           
static java.lang.String CLASS_VERSION
          Class version string
static ParameterName CURRENT_SITE_FIRST
           
static ParameterName ENABLED
           
static ParameterName ERROR
           
static ParameterName ERROR_MESSAGE
           
static ParameterName IN_GROUP
           
static ParameterName INCLUDE_DISABLED_SITES
           
static ParameterName INCLUDE_INACTIVE_SITES
           
static ParameterName ITEM
           
static ParameterName OFFSITE
           
static ParameterName OUTPUT
           
static ParameterName SHAREABLE_TYPE_ID
           
static ParameterName SITE_ID
           
static ParameterName SITES_PROPERTY_NAME
           
 
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.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
SiteIdForItemDroplet()
           
 
Method Summary
protected  void createError(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, java.lang.String message)
          Logs the error if the correct logging level is set and sets the error message in the request.
 java.lang.String getShareableTypeId()
          Returns the mShareableTypeId property.
 java.lang.String getSitesPropertyName()
          Returns the mSitesPropertyName property.
 atg.multisite.SiteTools getSiteTools()
          Returns property mSiteTools.
 boolean isCurrentSiteFirst()
          Returns the mCurrentSiteFirst property.
 boolean isIncludeDisabledSites()
          Returns the mIncludeDisabledSites property.
 boolean isIncludeInactiveSites()
          Returns the mIncludeInactiveSites property.
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method provides the default implementation of service, by dispatching to conventionally named methods which begin with "do".
 void setCurrentSiteFirst(boolean pCurrentSiteFirst)
          Sets the mCurrentSiteFirst property.
 void setIncludeDisabledSites(boolean pIncludeDisabledSites)
          Sets the mIncludeDisabledSites property.
 void setIncludeInactiveSites(boolean pIncludeInactiveSites)
          Sets the mIncludeInactiveSites property.
 void setShareableTypeId(java.lang.String pShareableTypeId)
          Sets the mDefaultSite property.
 void setSitesPropertyName(java.lang.String pSitesPropertyName)
          Sets the mSitesPropertyName property.
 void setSiteTools(atg.multisite.SiteTools pSiteTools)
          Sets property mSiteTools.
 
Methods inherited from class atg.servlet.DynamoServlet
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, init, service, service, setParameter
 
Methods inherited from class atg.nucleus.servlet.ServletService
destroy, getServletConfig, getServletInfo, 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
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


ITEM

public static final ParameterName ITEM

CURRENT_SITE_FIRST

public static final ParameterName CURRENT_SITE_FIRST

SHAREABLE_TYPE_ID

public static final ParameterName SHAREABLE_TYPE_ID

SITE_ID

public static final ParameterName SITE_ID

SITES_PROPERTY_NAME

public static final ParameterName SITES_PROPERTY_NAME

INCLUDE_INACTIVE_SITES

public static final ParameterName INCLUDE_INACTIVE_SITES

INCLUDE_DISABLED_SITES

public static final ParameterName INCLUDE_DISABLED_SITES

OUTPUT

public static final ParameterName OUTPUT

OFFSITE

public static final ParameterName OFFSITE

ACTIVE

public static final ParameterName ACTIVE

ENABLED

public static final ParameterName ENABLED

IN_GROUP

public static final ParameterName IN_GROUP

ERROR

public static final ParameterName ERROR

ERROR_MESSAGE

public static final ParameterName ERROR_MESSAGE
Constructor Detail

SiteIdForItemDroplet

public SiteIdForItemDroplet()
Method Detail

isCurrentSiteFirst

public boolean isCurrentSiteFirst()
Returns the mCurrentSiteFirst property. A value of true indicates a preference for the current site to be returned as the best possible match by looking for it in the item's site list. This is also dependent on the site being active (or the appropriate include flags being set).

Returns:
true indicates a preference for the current site to be returned as the best possible match by looking for it in the item's site list.

setCurrentSiteFirst

public void setCurrentSiteFirst(boolean pCurrentSiteFirst)
Sets the mCurrentSiteFirst property. A value of true indicates a preference for the current site to be returned as the best possible match by looking for it in the item's site list. This is also dependent on the site being active (or the appropriate include flags being set).

Parameters:
pCurrentSiteFirst - true indicates a preference for the current site to be returned as the best possible match by looking for it in the item's site list.

getShareableTypeId

public java.lang.String getShareableTypeId()
Returns the mShareableTypeId property.

Returns:
the mShareableTypeId property.

setShareableTypeId

public void setShareableTypeId(java.lang.String pShareableTypeId)
Sets the mDefaultSite property.

Parameters:
pShareableTypeId - id of the shareable type to use to get list of potential shareable sites

getSitesPropertyName

public java.lang.String getSitesPropertyName()
Returns the mSitesPropertyName property.

Returns:
the mSitesPropertyName property.

setSitesPropertyName

public void setSitesPropertyName(java.lang.String pSitesPropertyName)
Sets the mSitesPropertyName property.

Parameters:
pSitesPropertyName - property name to use to retrieve list of item sites

isIncludeInactiveSites

public boolean isIncludeInactiveSites()
Returns the mIncludeInactiveSites property.

Returns:
the mIncludeInactiveSites property.

setIncludeInactiveSites

public void setIncludeInactiveSites(boolean pIncludeInactiveSites)
Sets the mIncludeInactiveSites property.

Parameters:
pIncludeInactiveSites - whether or not to include inactive sites in the matching process

isIncludeDisabledSites

public boolean isIncludeDisabledSites()
Returns the mIncludeDisabledSites property.

Returns:
the mIncludeDisabledSites property.

setIncludeDisabledSites

public void setIncludeDisabledSites(boolean pIncludeDisabledSites)
Sets the mIncludeDisabledSites property.

Parameters:
pIncludeDisabledSites - whether or not to include disabled sites in the matching process

setSiteTools

public void setSiteTools(atg.multisite.SiteTools pSiteTools)
Sets property mSiteTools.

Parameters:
pSiteTools - the SiteTools

getSiteTools

public atg.multisite.SiteTools getSiteTools()
Returns property mSiteTools. The default path will be resolved if this property has not been set.

Returns:
property mSiteTools.

service

public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
Description copied from class: DynamoServlet
This method provides the default implementation of service, by dispatching to conventionally named methods which begin with "do".

Overrides:
service in class DynamoServlet
Parameters:
pRequest - The request
pResponse - The response
Throws:
javax.servlet.ServletException - The ServletException
java.io.IOException - The IOException
See Also:
DynamoServlet.service(atg.servlet.DynamoHttpServletRequest, atg.servlet.DynamoHttpServletResponse)

createError

protected void createError(DynamoHttpServletRequest pRequest,
                           DynamoHttpServletResponse pResponse,
                           java.lang.String message)
                    throws java.io.IOException,
                           javax.servlet.ServletException
Logs the error if the correct logging level is set and sets the error message in the request.

Parameters:
pRequest - The request
pResponse - The response
message - error message
Throws:
java.io.IOException
javax.servlet.ServletException