|
|||||||||
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.commerce.collections.filter.ExcludeItemsInCartFilter
public class ExcludeItemsInCartFilter
This filter generates filtered results based on the products in the current order. All products in the unfiltered collection that are in the current order are excluded from the filtered results.
This filter is useful for filtering upsell products or related products etc. to prevent promoting a product that is already in the cart.
It is strongly recommended that cache not be enabled for this filter because the contents on the shopping cart can change frequently. To enable cache would require that the cache contents, for a given order, be cleared each time a product is either added or removed.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
protected CatalogTools |
mCatalogTools
|
protected java.lang.String |
mShoppingCartPath
|
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 | |
---|---|
ExcludeItemsInCartFilter()
|
Method Summary | |
---|---|
protected java.util.Collection |
createProductIdCollection(Order pOrder)
This method creates a collection of product ids. |
protected java.lang.String |
findCommerceItemProductId(CommerceItem pCommerceItem)
This method returns the product id associated with a commerce item. |
Order |
findOrder()
Finds the current order using the nucleus specified by the shoppginCartPath property. |
java.lang.Object |
generateContextKey(java.util.Collection pUnfilteredCollection,
java.lang.String pCollectionIdentifierKey,
RepositoryItem pProfile)
Generates a context key for this filter. |
protected java.util.Collection |
generateFilteredCollection(java.util.Collection pUnfilteredCollection,
java.lang.String pCollectionIdentifierKey,
RepositoryItem pProfile)
Generates a filtered collection based on the products in the current order. |
CatalogTools |
getCatalogTools()
Returns the CatalogTools |
java.lang.String |
getShoppingCartPath()
Returns property ShoppingCartPath |
void |
setCatalogTools(CatalogTools pCatalogTools)
Sets the CatalogTools |
void |
setShoppingCartPath(java.lang.String pShoppingCartPath)
Sets property ShoppingCartPath |
boolean |
shouldApplyFilter(java.util.Collection pUnfilteredCollection,
java.lang.String pKey,
RepositoryItem pProfile)
|
Methods inherited from class atg.service.collections.filter.CachedCollectionFilter |
---|
dumpCache, filterCollection, filterCollection, flushCache, generateCacheKey, generateNewCollectionObject, getCache, getDefaultProfile, isCacheEnabled, setCache, setCacheEnabled, 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 mShoppingCartPath
protected CatalogTools mCatalogTools
Constructor Detail |
---|
public ExcludeItemsInCartFilter()
Method Detail |
---|
public void setShoppingCartPath(java.lang.String pShoppingCartPath)
public java.lang.String getShoppingCartPath()
public void setCatalogTools(CatalogTools pCatalogTools)
public CatalogTools getCatalogTools()
public Order findOrder()
public java.lang.Object generateContextKey(java.util.Collection pUnfilteredCollection, java.lang.String pCollectionIdentifierKey, RepositoryItem pProfile)
generateContextKey
in class atg.service.collections.filter.CachedCollectionFilter
pUnfilteredCollection
- the collection to be filteredpCollectionIdentifierKey
- the key that uniquely identifies the unfiltered collection.
public boolean shouldApplyFilter(java.util.Collection pUnfilteredCollection, java.lang.String pKey, RepositoryItem pProfile)
shouldApplyFilter
in class atg.service.collections.filter.CachedCollectionFilter
CachedCollectionFilter.shouldApplyFilter(java.util.Collection, java.lang.String, atg.repository.RepositoryItem)
protected java.lang.String findCommerceItemProductId(CommerceItem pCommerceItem)
protected java.util.Collection createProductIdCollection(Order pOrder)
pOrder
- the order
protected java.util.Collection generateFilteredCollection(java.util.Collection pUnfilteredCollection, java.lang.String pCollectionIdentifierKey, RepositoryItem pProfile) throws atg.service.collections.filter.FilterException
Products in the unfiltered collection that are in the current order are excluded from the filtered results.
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 atg.service.collections.filter.CachedCollectionFilter
pUnfilteredCollection
- the unfiltered collectionpCollectionIdentifierKey
- the key the uniquely identifies the unfiltered collection.
atg.service.collections.filter.FilterException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |