atg.projects.store.collections.filter
Class SiteGroupFilter

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.service.collections.filter.CachedCollectionFilter
              extended by atg.projects.store.collections.filter.SiteGroupFilter
All Implemented Interfaces:
atg.naming.AbsoluteNameable, atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameContextParentable, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.Configured, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener

public class SiteGroupFilter
extends atg.service.collections.filter.CachedCollectionFilter

Filters a collection of (repository) items on their sites/siteGroup properties.

A Set of the (repository) items site ids and siteGroups site ids is constructed and compared to the site ids of the current sites mShareableTypeId siteGroup site ids. If any sites from the items Set match then the item will be returned in the filtered collection.

Author:
ATG

Field Summary
static java.lang.String CLASS_VERSION
          Class version
protected  java.lang.String mIdPropertyName
           
protected  boolean mIncludeDisabledSites
           
protected  boolean mIncludeInactiveSites
          mIncludeInactiveSites; a value of true indicates that items should be retained in the collection even if all their sites are inactive
protected  java.lang.String mShareableTypeId
           
protected  atg.multisite.SiteGroupManager mSiteGroupManager
           
protected  java.lang.String mSiteGroupPropertyName
           
protected  atg.multisite.SiteManager mSiteManager
           
protected  java.lang.String mSitesPropertyName
           
 
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
SiteGroupFilter()
           
 
Method Summary
 java.util.Collection generateFilteredCollection(java.util.Collection pUnfilteredCollection, java.lang.String pCollectionIdentifierKey, atg.repository.RepositoryItem pProfile)
          This method filters the passed in collection (of repository items) based on whether or not any of its items sites/siteGroups.sites exist in the current mShareableTypeId siteGroup
 java.lang.String getIdPropertyName()
          This property contains the name of the property that holds references to an item's id.
 java.lang.String getShareableTypeId()
          This property contains a shareable ID to be used when determining sharing sites.
 atg.multisite.SiteGroupManager getSiteGroupManager()
          This property contains a reference to SiteGroupManager to be used when determining sharing sites.
 java.lang.String getSiteGroupPropertyName()
          This property contains the name of the property that holds references to an item's siteGroups.
protected  java.util.Set<java.lang.String> getSiteGroupSiteIds(atg.repository.RepositoryItem pItem)
          Gets the siteIds from all pItems siteGroups and returns them in a Set.
protected  java.util.Set<java.lang.String> getSiteIds(atg.repository.RepositoryItem pItem)
          Gets the siteIds property from the passed in RepositoryItem and returns them in a Set.
 atg.multisite.SiteManager getSiteManager()
          This property contains a reference to SiteManager to be used when determining active sites.
 java.lang.String getSitesPropertyName()
          This property contains the name of the property that holds references to an item's sites.
 boolean isAllowAllSite()
           
 boolean isIncludeDisabledSites()
          Returns the includeDisabledSites property.
 boolean isIncludeInactiveSites()
          Returns the includeInactiveSites property.
 void setAllowAllSite(boolean pAllowAllSite)
          If set to true and there are no sites/siteGroups configured for a particular item in the collection to be filtered, the item is treated as all-site and will be returned in the filtered collection.
 void setIdPropertyName(java.lang.String pIdPropertyName)
          Sets the mIdPropertyName
 void setIncludeDisabledSites(boolean pIncludeDisabledSites)
          Sets the includeDisabledSites property.
 void setIncludeInactiveSites(boolean pIncludeInactiveSites)
          Sets the includeInactiveSites property.
 void setShareableTypeId(java.lang.String pShareableTypeId)
          Sets the mSharableTypeId
 void setSiteGroupManager(atg.multisite.SiteGroupManager pSiteGroupManager)
          Sets the mSiteGroupManager
 void setSiteGroupPropertyName(java.lang.String pSiteGroupPropertyName)
          Sets the mSiteGroupPropertyName
 void setSiteManager(atg.multisite.SiteManager pSiteManager)
          Sets the mSiteManager
 void setSitesPropertyName(java.lang.String pSitesPropertyName)
          Sets the mSitesPropertyName
 
Methods inherited from class atg.service.collections.filter.CachedCollectionFilter
dumpCache, filterCollection, filterCollection, filterCollection, filterCollection, flushCache, generateCacheKey, generateCacheKey, generateContextKey, generateContextKey, generateFilteredCollection, generateNewCollectionObject, getCache, getDefaultProfile, isCacheEnabled, setCache, setCacheEnabled, shouldApplyFilter, shouldApplyFilter, stringIt
 
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 final java.lang.String CLASS_VERSION
Class version

See Also:
Constant Field Values

mShareableTypeId

protected java.lang.String mShareableTypeId

mSitesPropertyName

protected java.lang.String mSitesPropertyName

mSiteGroupPropertyName

protected java.lang.String mSiteGroupPropertyName

mIdPropertyName

protected java.lang.String mIdPropertyName

mSiteGroupManager

protected atg.multisite.SiteGroupManager mSiteGroupManager

mSiteManager

protected atg.multisite.SiteManager mSiteManager

mIncludeDisabledSites

protected boolean mIncludeDisabledSites

mIncludeInactiveSites

protected boolean mIncludeInactiveSites
mIncludeInactiveSites; a value of true indicates that items should be retained in the collection even if all their sites are inactive

Constructor Detail

SiteGroupFilter

public SiteGroupFilter()
Method Detail

getShareableTypeId

public java.lang.String getShareableTypeId()
This property contains a shareable ID to be used when determining sharing sites.

Returns:
current shareable type ID

setShareableTypeId

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

Parameters:
pShareableTypeId - SharableTypeId to set

getSitesPropertyName

public java.lang.String getSitesPropertyName()
This property contains the name of the property that holds references to an item's sites.

Returns:
'mSitesPropertyName' property name

setSitesPropertyName

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

Parameters:
pSitesPropertyName - Value to set

getSiteGroupPropertyName

public java.lang.String getSiteGroupPropertyName()
This property contains the name of the property that holds references to an item's siteGroups.

Returns:
'mSiteGroupPropertyName' property name

setSiteGroupPropertyName

public void setSiteGroupPropertyName(java.lang.String pSiteGroupPropertyName)
Sets the mSiteGroupPropertyName

Parameters:
pSiteGroupPropertyName - Value to set

getIdPropertyName

public java.lang.String getIdPropertyName()
This property contains the name of the property that holds references to an item's id.

Returns:
'mIdPropertyName' property name

setIdPropertyName

public void setIdPropertyName(java.lang.String pIdPropertyName)
Sets the mIdPropertyName

Parameters:
pIdPropertyName - Value to set

getSiteGroupManager

public atg.multisite.SiteGroupManager getSiteGroupManager()
This property contains a reference to SiteGroupManager to be used when determining sharing sites.

Returns:
SiteGroupManager instance

setSiteGroupManager

public void setSiteGroupManager(atg.multisite.SiteGroupManager pSiteGroupManager)
Sets the mSiteGroupManager

Parameters:
pSiteGroupManager - Value to set

getSiteManager

public atg.multisite.SiteManager getSiteManager()
This property contains a reference to SiteManager to be used when determining active sites.

Returns:
SiteManager instance

setSiteManager

public void setSiteManager(atg.multisite.SiteManager pSiteManager)
Sets the mSiteManager

Parameters:
pSiteManager - Value to set

isIncludeDisabledSites

public boolean isIncludeDisabledSites()
Returns the includeDisabledSites property.

Returns:
the includeDisabledSites property.

setIncludeDisabledSites

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

Parameters:
pIncludeDisabledSites - whether or not to filter out items that exist only on disabled sites

isIncludeInactiveSites

public boolean isIncludeInactiveSites()
Returns the includeInactiveSites property.

Returns:
the includeInactiveSites property.

setIncludeInactiveSites

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

Parameters:
pIncludeInactiveSites - whether or not to filter out items that exist only on inactive sites

isAllowAllSite

public boolean isAllowAllSite()
Returns:
allowAllSite boolean

setAllowAllSite

public void setAllowAllSite(boolean pAllowAllSite)
If set to true and there are no sites/siteGroups configured for a particular item in the collection to be filtered, the item is treated as all-site and will be returned in the filtered collection.

Parameters:
pAllowAllSite - Indicates whether or not to return an item if it has no sites/siteGroups configured

generateFilteredCollection

public java.util.Collection generateFilteredCollection(java.util.Collection pUnfilteredCollection,
                                                       java.lang.String pCollectionIdentifierKey,
                                                       atg.repository.RepositoryItem pProfile)
                                                throws atg.service.collections.filter.FilterException
This method filters the passed in collection (of repository items) based on whether or not any of its items sites/siteGroups.sites exist in the current mShareableTypeId siteGroup

Overrides:
generateFilteredCollection in class atg.service.collections.filter.CachedCollectionFilter
Parameters:
pUnfilteredCollection - the collection to be filtered
pCollectionIdentifierKey - unused
pProfile - unused
Returns:
a collection items that have the current site or siteGroup
Throws:
atg.service.collections.filter.FilterException - if the item does not have a sites property

getSiteIds

protected java.util.Set<java.lang.String> getSiteIds(atg.repository.RepositoryItem pItem)
Gets the siteIds property from the passed in RepositoryItem and returns them in a Set.

Parameters:
pItem - A RepositoryItem
Returns:
A Set of pItems siteIds

getSiteGroupSiteIds

protected java.util.Set<java.lang.String> getSiteGroupSiteIds(atg.repository.RepositoryItem pItem)
Gets the siteIds from all pItems siteGroups and returns them in a Set.

Parameters:
pItem - A RepositoryItem
Returns:
A Set of siteIds constructed from the siteGroups of pItem