|
|||||||||
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.InventoryFilter
public class InventoryFilter
This filter will filter products in the collection based on their inventory availability.
The availability state for each sku is checked against the InventoryManager. If any of a product's skus are considered available, the product is considered available and is added to the filtered results.
The inventory states that mean a sku is available are configurable using the inclludeInventoryStates property. See the InventoryManager for valid states.
The InventoryFilter cache should be disabled if your Inventory Manager is already caching inventory status information.
InventoryManager
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
protected CatalogServices |
mCatalogServices
|
protected CatalogTools |
mCatalogTools
|
protected java.lang.Integer[] |
mIncludeInventoryStates
Sets the array of possible inventory states that mean a sku is considered available. |
protected InventoryManager |
mInventoryManager
|
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 | |
---|---|
InventoryFilter()
|
Method Summary | |
---|---|
java.lang.Object |
generateContextKey(java.util.Collection pUnfilteredCollection,
java.lang.String pCollectionIdentifierKey,
RepositoryItem pProfile)
This filter does not produce a context key. |
protected java.util.Collection |
generateFilteredCollection(java.util.Collection pUnfilteredCollection,
java.lang.String pCollectionIdentifierKey,
RepositoryItem pProfile)
Generates a filtered collection based on Inventory availabilty. |
CatalogServices |
getCatalogServices()
Returns the CatalogServices |
CatalogTools |
getCatalogTools()
Returns the CatalogTools |
java.lang.Integer[] |
getIncludeInventoryStates()
Returns the array of possible inventory states that mean a sku is considered available. |
InventoryManager |
getInventoryManager()
Returns the InventoryMananager |
void |
setCatalogServices(CatalogServices pCatalogServices)
Sets the CatalogServices |
void |
setCatalogTools(CatalogTools pCatalogTools)
Sets the CatalogTools |
void |
setIncludeInventoryStates(java.lang.Integer[] pIncludeInventoryStates)
|
void |
setInventoryManager(InventoryManager pInventoryManager)
Sets the InventoryManager |
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.Integer[] mIncludeInventoryStates
protected InventoryManager mInventoryManager
protected CatalogTools mCatalogTools
protected CatalogServices mCatalogServices
Constructor Detail |
---|
public InventoryFilter()
Method Detail |
---|
public void setIncludeInventoryStates(java.lang.Integer[] pIncludeInventoryStates)
public java.lang.Integer[] getIncludeInventoryStates()
See the InventoryManager javadoc for all valid inventory states.
InventoryManager
public void setInventoryManager(InventoryManager pInventoryManager)
public InventoryManager getInventoryManager()
public void setCatalogTools(CatalogTools pCatalogTools)
public CatalogTools getCatalogTools()
public void setCatalogServices(CatalogServices pCatalogServices)
public CatalogServices getCatalogServices()
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)
public java.lang.Object generateContextKey(java.util.Collection pUnfilteredCollection, java.lang.String pCollectionIdentifierKey, RepositoryItem pProfile)
generateContextKey
in class atg.service.collections.filter.CachedCollectionFilter
protected java.util.Collection generateFilteredCollection(java.util.Collection pUnfilteredCollection, java.lang.String pCollectionIdentifierKey, RepositoryItem pProfile) throws atg.service.collections.filter.FilterException
A product is included in the filtered collection if it does not contain any skus, or any of its skus is considered available.
The availabilty state of the sku must be one of the preconfigured include states.
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 provided by the caller.
atg.service.collections.filter.FilterException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |