atg.commerce.gifts
Class GiftlistSiteFilter

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.gifts.GiftlistSiteFilter
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, java.util.EventListener

public class GiftlistSiteFilter
extends CachedCollectionFilter

This filter filters gift list and gift list items in the collection depending on whether they belong to the specified site / shareable or not.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  GiftlistManager mGiftlistManager
           
protected  boolean mIncludeDisabledSites
           
protected  boolean mIncludeInactiveSites
           
protected  SiteGroupManager mSiteGroupManager
           
protected  SiteManager mSiteManager
           
 
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
GiftlistSiteFilter()
           
 
Method Summary
protected  java.util.Collection generateFilteredCollection(java.util.Collection pUnfilteredCollection, java.lang.String pCollectionIdentifierKey, RepositoryItem pProfile, java.util.Map pExtraParameters)
          This method does filtering in the following way: Retrieves site ID and shareable type from extra parameters map passed to the method.
 GiftlistManager getGiftlistManager()
          Returns SiteGroupManager instance
protected  SiteGroupManager getSiteGroupManager()
          Returns the SiteGroupManager instance
 SiteManager getSiteManager()
          This property contains a reference to SiteManager to be used when determining active and disabled sites.
 boolean isIncludeDisabledSites()
          Returns the includeDisabledSites property.
 boolean isIncludeInactiveSites()
          Returns the includeInactiveSites property.
 void setGiftlistManager(GiftlistManager giftlistManager)
          Sets the GiftlistManager instance
 void setIncludeDisabledSites(boolean pIncludeDisabledSites)
          Sets the includeDisabledSites property.
 void setIncludeInactiveSites(boolean pIncludeInactiveSites)
          Sets the includeInactiveSites property.
 void setSiteGroupManager(SiteGroupManager pSiteGroupManager)
          Sets the SiteGroupManager instance
 void setSiteManager(SiteManager pSiteManager)
          Sets the SiteManager instance
 
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 java.lang.String CLASS_VERSION
Class version string


mIncludeDisabledSites

protected boolean mIncludeDisabledSites

mIncludeInactiveSites

protected boolean mIncludeInactiveSites

mSiteGroupManager

protected SiteGroupManager mSiteGroupManager

mSiteManager

protected SiteManager mSiteManager

mGiftlistManager

protected GiftlistManager mGiftlistManager
Constructor Detail

GiftlistSiteFilter

public GiftlistSiteFilter()
Method Detail

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. A value of true indicates that items should be retained in the collection even if all their sites are disabled.

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. A value of true indicates that items should be retained in the collection even if all their sites are inactive.

getSiteGroupManager

protected SiteGroupManager getSiteGroupManager()
Returns the SiteGroupManager instance

Returns:
the SiteGroupManager

setSiteGroupManager

public void setSiteGroupManager(SiteGroupManager pSiteGroupManager)
Sets the SiteGroupManager instance

Parameters:
pSiteGroupManager - the siteGroupManager to set

getSiteManager

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

Returns:
SiteManager instance

setSiteManager

public void setSiteManager(SiteManager pSiteManager)
Sets the SiteManager instance

Parameters:
pSiteManager - the SiteManager to set

getGiftlistManager

public GiftlistManager getGiftlistManager()
Returns SiteGroupManager instance

Returns:
the giftlistManager

setGiftlistManager

public void setGiftlistManager(GiftlistManager giftlistManager)
Sets the GiftlistManager instance

Parameters:
giftlistManager - the giftlistManager to set

generateFilteredCollection

protected java.util.Collection generateFilteredCollection(java.util.Collection pUnfilteredCollection,
                                                          java.lang.String pCollectionIdentifierKey,
                                                          RepositoryItem pProfile,
                                                          java.util.Map pExtraParameters)
                                                   throws FilterException
This method does filtering in the following way:
  • Retrieves site ID and shareable type from extra parameters map passed to the method.
  • If shareable type is specified then it will filter out gift lists / gift items that don't belong to the sites that share the specified shareable type with the specified site.
  • If shareable type is not passed to the filter then the GiftlistManager component will be used to determine which gift lists are compatible with the passed site ID.
  • If no site ID is passed in the extra parameters map, the current site will be used.

    Overrides:
    generateFilteredCollection in class CachedCollectionFilter
    Parameters:
    pUnfilteredCollection - Unfiltered collection of elements
    pCollectionIdentifierKey - Identifier key
    pProfile - Profile
    pExtraParameters - A map of extra parameters
    Returns:
    List of items, which sites are in the same cart-sharing group as current site, otherwise empty list.
    Throws:
    FilterException
    See Also:
    GiftlistManager.areSitesCompatible(String, String)