|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.service.collections.filter.CachedCollectionFilter atg.service.collections.filter.StartEndDateFilter
public class StartEndDateFilter
This filter will filter objects in the collection by the startDate and endDate properties. If the current date falls between the startDate and endDate values then the object is included in the filtered collection.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
protected java.lang.String |
mEndDatePropertyName
|
protected java.lang.String |
mStartDatePropertyName
|
Fields inherited from class atg.service.collections.filter.CachedCollectionFilter |
---|
FILTER_CACHE_COMPONENT, mCache, mCacheEnabled |
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 | |
---|---|
StartEndDateFilter()
|
Method Summary | |
---|---|
java.lang.Object |
generateContextKey(java.util.Collection pUnfilteredCollection,
java.lang.String pCollectionIdentifierKey,
RepositoryItem pProfile)
Generates a context key. |
protected java.util.Collection |
generateFilteredCollection(java.util.Collection pUnfilteredCollection,
java.lang.String pCollectionIdentifierKey,
RepositoryItem pProfile)
Generates a filtered collection based on the start and end date properties. |
protected java.util.Date |
getDatePropertyFromObject(java.lang.Object pObject,
java.lang.String pDatePropertyName)
This method is called by generateFilteredCollection to extract the value from a date property using DynamicBeans.getPropertyValue(pObject,pDatePropertyName) |
java.lang.String |
getEndDatePropertyName()
Returns the property name used to get the end date |
java.lang.String |
getStartDatePropertyName()
Returns the property name used to get the start date |
void |
setEndDatePropertyName(java.lang.String pEndDatePropertyName)
Sets the property name used to get the end date |
void |
setStartDatePropertyName(java.lang.String pStartDatePropertyName)
Sets the property name used to get the start date |
boolean |
shouldApplyFilter(java.util.Collection pUnfilteredCollection,
java.lang.String pKey,
RepositoryItem pProfile)
This method is called by filterCollection prior to looking up the filtered collection in the cache or generating a new filtered collection. |
Methods inherited from class atg.service.collections.filter.CachedCollectionFilter |
---|
dumpCache, filterCollection, filterCollection, filterCollection, filterCollection, flushCache, generateCacheKey, generateCacheKey, generateContextKey, generateFilteredCollection, generateNewCollectionObject, getCache, getDefaultProfile, isCacheEnabled, setCache, setCacheEnabled, shouldApplyFilter, stringIt |
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 |
Field Detail |
---|
public static final java.lang.String CLASS_VERSION
protected java.lang.String mStartDatePropertyName
protected java.lang.String mEndDatePropertyName
Constructor Detail |
---|
public StartEndDateFilter()
Method Detail |
---|
public void setStartDatePropertyName(java.lang.String pStartDatePropertyName)
public java.lang.String getStartDatePropertyName()
public void setEndDatePropertyName(java.lang.String pEndDatePropertyName)
public java.lang.String getEndDatePropertyName()
public boolean shouldApplyFilter(java.util.Collection pUnfilteredCollection, java.lang.String pKey, RepositoryItem pProfile)
CachedCollectionFilter
shouldApplyFilter
in class CachedCollectionFilter
pUnfilteredCollection
- the unfiltered collectionpKey
- the key param as passed to filterCollectionpProfile
- the user profile
CachedCollectionFilter.shouldApplyFilter(java.util.Collection, java.lang.String, atg.repository.RepositoryItem)
public java.lang.Object generateContextKey(java.util.Collection pUnfilteredCollection, java.lang.String pCollectionIdentifierKey, RepositoryItem pProfile)
generateContextKey
in class CachedCollectionFilter
protected java.util.Date getDatePropertyFromObject(java.lang.Object pObject, java.lang.String pDatePropertyName)
If the date property does not exist or it is not a type of Date, then null is returned.
Extend this method if the date property is not of type java.util.Date, such as a string, and convert the property value to an appropriate Date object.
protected java.util.Collection generateFilteredCollection(java.util.Collection pUnfilteredCollection, java.lang.String pCollectionIdentifierKey, RepositoryItem pProfile) throws FilterException
All objects in the collection are expected to have a start and end date property.
Objects that have a startDate less than or equal to the current date, and an endDate greater than or equal to the current date are added to the filter collection.
A null startDate or missing startDate property is considered to be always started
A null endDate or missing endDate property is considered to be never ending.
A startDate and/or endDate property that is not of type java.util.Date is considered to be always started or never ending respectively. This behavior can be changed by overriding getDatePropertyFromObject If the new filtered collection is the same size as the unfiltered collection, the filtered collection is disgarded and the unfiltered collection is returned.
generateFilteredCollection
in class CachedCollectionFilter
pUnfilteredCollection
- the unfiltered collectionpCollectionIdentifierKey
- the key the uniquely identifies the unfiltered collection.pProfile
- Repository item
FilterException
getDatePropertyFromObject(java.lang.Object, java.lang.String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |