atg.commerce.collections.filter
Class ItemSiteFilter

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.service.collections.filter.CachedCollectionFilter
              extended by atg.commerce.collections.filter.ItemSiteFilter
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class ItemSiteFilter
extends CachedCollectionFilter

Implementation of CachedCollectionFilter which filters input products collection by their site IDs. This filter will return only products whose site IDs intersect with site IDs from the current sharing group defined by the shareableTypeId property.


Field Summary
static java.lang.String CLASS_VERSION
          Class version
protected  boolean mIncludeDisabledSites
          mIncludeDisabledSites; a value of true indicates that items should be retained in the collection even if all their sites are disabled
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  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
ItemSiteFilter()
           
 
Method Summary
 java.util.Collection generateFilteredCollection(java.util.Collection pUnfilteredCollection, java.lang.String pCollectionIdentifierKey, RepositoryItem pProfile)
          This method filters the passed in collection by the current site.
 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.
 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 isIncludeDisabledSites()
          Returns the includeDisabledSites property.
 boolean isIncludeInactiveSites()
          Returns the includeInactiveSites property.
 void setIncludeDisabledSites(boolean pIncludeDisabledSites)
          Sets the includeDisabledSites property.
 void setIncludeInactiveSites(boolean pIncludeInactiveSites)
          Sets the includeInactiveSites property.
 void setShareableTypeId(java.lang.String pShareableTypeId)
           
 void setSiteGroupManager(atg.multisite.SiteGroupManager pSiteGroupManager)
           
 void setSiteManager(atg.multisite.SiteManager pSiteManager)
           
 void setSitesPropertyName(java.lang.String pSitesPropertyName)
           
 
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, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, 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, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
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

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version


mShareableTypeId

protected java.lang.String mShareableTypeId

mIncludeDisabledSites

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


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


mSitesPropertyName

protected java.lang.String mSitesPropertyName

mSiteGroupManager

protected atg.multisite.SiteGroupManager mSiteGroupManager

mSiteManager

protected atg.multisite.SiteManager mSiteManager
Constructor Detail

ItemSiteFilter

public ItemSiteFilter()
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)

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

getSitesPropertyName

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

Returns:
'siteIds' property name

setSitesPropertyName

public void setSitesPropertyName(java.lang.String pSitesPropertyName)

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)

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)

generateFilteredCollection

public java.util.Collection generateFilteredCollection(java.util.Collection pUnfilteredCollection,
                                                       java.lang.String pCollectionIdentifierKey,
                                                       RepositoryItem pProfile)
                                                throws FilterException
This method filters the passed in collection by the current site.

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