atg.service.collections.filter.droplet
Class CollectionFilter

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.service.collections.filter.droplet.CollectionFilter
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 CollectionFilter
extends DynamoServlet

This droplet is used to execute collection filters.

The filter can be configured or provided as a parameter.

The consultCache and updateCache values can be configured or provided as a parameter.

If a key parameter is not provided, the consultCache and updateCache values are ignored and false is used.

Input parameters:

collectionIdentifierKey
this string parameter is optional. this value is used for uniquely identifying the unfiltered collection. if this parameter is not provided, consultCache and updateCache are forced to false.
filter
this parameter is optional. the value can be any collection filter component.
profile
this parameter is optional. the value can be any profile repository item.
collection
this paramter is required. the unfiltered collection.
consultCache
this paramter is optional. the string value can be "true" or "false".
updateCache
this paramter is optional. the string value can be "true" or "false".

Output parameters:

filteredCollection
this output parameter references the filtered collection.
errorMsg
this output parameter contains an error message when processing errors occur.

Oparams:

output
this parameter is rendered once upon successful completion of the filter.
empty
this parameter is rendered if the filtered collection is null or contains no objects.
error
this parameter is rendered if an error occurs.

Configurable values

consultCache
this property contains the default consultCache value.
updateCache
this property contains the default updateCache value.
filter
this property contains the default filter.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static ParameterName COLLECTION_PARAM
          the parameter name for the collection parameter
static ParameterName CONSULTCACHE_PARAM
          the parameter name for the consultCache parameter
static java.lang.String EMPTY_OPARAM
          the name for the empty oparam
static java.lang.String ERROR_MSG_OUTPARAM
          the name for the errorMsg output parameter
static java.lang.String ERROR_OPARAM
          the name for the error oparam
static ParameterName FILTER_PARAM
          the parameter name for the filter parameter
static java.lang.String FILTERED_COLLECTION_OUTPARAM
          the name for the filtered collection output parameter
static ParameterName KEY_PARAM
          the parameter name for the key parameter
protected  java.lang.Boolean mConsultCache
           
protected  CachedCollectionFilter mFilter
           
protected  java.lang.Boolean mUpdateCache
           
static java.lang.String OUTPUT_OPARAM
          the name for the output oparam
static ParameterName PROFILE_PARAM
          the parameter name for the profile parameter
static ParameterName UPDATECACHE_PARAM
          the parameter name for the updateCache parameter
 
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
CollectionFilter()
           
 
Method Summary
protected  java.util.Collection getCollection(DynamoHttpServletRequest pRequest)
           
 java.lang.Boolean getConsultCache()
           
protected  boolean getConsultCache(DynamoHttpServletRequest pRequest)
           
 java.util.List getExtraParameterNames()
           
protected  java.util.Map getExtraParameters(DynamoHttpServletRequest pRequest)
          This method iterates through the list of extra parameter names
 CachedCollectionFilter getFilter()
           
protected  CachedCollectionFilter getFilter(DynamoHttpServletRequest pRequest)
           
protected  java.lang.String getKey(DynamoHttpServletRequest pRequest)
           
protected  RepositoryItem getProfile(DynamoHttpServletRequest pRequest)
           
 java.lang.Boolean getUpdateCache()
           
protected  boolean getUpdateCache(DynamoHttpServletRequest req)
           
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Executes the filter.
 void setConsultCache(java.lang.Boolean pConsultCache)
          Sets the default value for consultCache.
 void setExtraParameterNames(java.util.List pExtraParameterNames)
          Sets the list with extra parameter names
 void setFilter(CachedCollectionFilter pFilter)
          Sets the the default filter to execute
 void setUpdateCache(java.lang.Boolean pUpdateCache)
          Sets the default value for updateCache.
 
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
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


COLLECTION_PARAM

public static final ParameterName COLLECTION_PARAM
the parameter name for the collection parameter


PROFILE_PARAM

public static final ParameterName PROFILE_PARAM
the parameter name for the profile parameter


FILTER_PARAM

public static final ParameterName FILTER_PARAM
the parameter name for the filter parameter


KEY_PARAM

public static final ParameterName KEY_PARAM
the parameter name for the key parameter


CONSULTCACHE_PARAM

public static final ParameterName CONSULTCACHE_PARAM
the parameter name for the consultCache parameter


UPDATECACHE_PARAM

public static final ParameterName UPDATECACHE_PARAM
the parameter name for the updateCache parameter


ERROR_MSG_OUTPARAM

public static final java.lang.String ERROR_MSG_OUTPARAM
the name for the errorMsg output parameter

See Also:
Constant Field Values

FILTERED_COLLECTION_OUTPARAM

public static final java.lang.String FILTERED_COLLECTION_OUTPARAM
the name for the filtered collection output parameter

See Also:
Constant Field Values

ERROR_OPARAM

public static final java.lang.String ERROR_OPARAM
the name for the error oparam

See Also:
Constant Field Values

OUTPUT_OPARAM

public static final java.lang.String OUTPUT_OPARAM
the name for the output oparam

See Also:
Constant Field Values

EMPTY_OPARAM

public static final java.lang.String EMPTY_OPARAM
the name for the empty oparam

See Also:
Constant Field Values

mFilter

protected CachedCollectionFilter mFilter

mUpdateCache

protected java.lang.Boolean mUpdateCache

mConsultCache

protected java.lang.Boolean mConsultCache
Constructor Detail

CollectionFilter

public CollectionFilter()
Method Detail

setFilter

public void setFilter(CachedCollectionFilter pFilter)
Sets the the default filter to execute


getFilter

public CachedCollectionFilter getFilter()
Returns:
the default filter to execute.

getUpdateCache

public java.lang.Boolean getUpdateCache()
Returns:
the default value for updateCache.

setUpdateCache

public void setUpdateCache(java.lang.Boolean pUpdateCache)
Sets the default value for updateCache.


getExtraParameterNames

public java.util.List getExtraParameterNames()
Returns:
list with extra parameter names

setExtraParameterNames

public void setExtraParameterNames(java.util.List pExtraParameterNames)
Sets the list with extra parameter names


getConsultCache

public java.lang.Boolean getConsultCache()
Returns:
the default value for consultCache.

setConsultCache

public void setConsultCache(java.lang.Boolean pConsultCache)
Sets the default value for consultCache.


getProfile

protected RepositoryItem getProfile(DynamoHttpServletRequest pRequest)
                             throws FilterException
Returns:
the profile param from the request. if the param was not provided the current session profile is returned.
Throws:
FilterException

getFilter

protected CachedCollectionFilter getFilter(DynamoHttpServletRequest pRequest)
                                    throws FilterException
Returns:
the filter param from the request. if the param was not provided, the configured filter is returned.
Throws:
FilterException

getKey

protected java.lang.String getKey(DynamoHttpServletRequest pRequest)
                           throws FilterException
Returns:
the key param from the request.
Throws:
FilterException

getCollection

protected java.util.Collection getCollection(DynamoHttpServletRequest pRequest)
                                      throws FilterException
Returns:
the collection param from the request.
Throws:
FilterException

getConsultCache

protected boolean getConsultCache(DynamoHttpServletRequest pRequest)
                           throws FilterException
Returns:
the value of consultCache parameter. if the parameter was not provided, the configured consultCache value is returned.
Throws:
FilterException

getUpdateCache

protected boolean getUpdateCache(DynamoHttpServletRequest req)
                          throws FilterException
Returns:
the value of updateCache parameter. if the parameter was not provided, the configured updateCache value is returned.
Throws:
FilterException

service

public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
Executes the filter.

If a key is not provided, the consultCache and updateCache flags are forced to false.

Overrides:
service in class DynamoServlet
Parameters:
pRequest - the request to be processed
pResponse - the response object for this request
Throws:
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.

getExtraParameters

protected java.util.Map getExtraParameters(DynamoHttpServletRequest pRequest)
This method iterates through the list of extra parameter names

Parameters:
pExtraParameterNames - the list of preconfigured extra parameter names
pRequest - Dynamo http request
Returns:
map containing pairs of found extra parameters and their values