public class FilterCatalogEntryTaskCmdImpl extends MarketingSpotCommandBaseTaskCmdImpl implements FilterCatalogEntryTaskCmd, com.ibm.websphere.cache.Sizeable
RetrieveCatalogEntryTaskCmd
command. Then this command checks if the specified catalog entry qualifies for the defined filtering
criteria or not. To enable or disable
a filter, register the appropriate CMDREG table entry, and set the filter settings in the
PROPERTIES column.
See the file samples/samples/dynacache/marketing/cachespec.xml
for details about
caching this command. Filters that can be cached (such as check if in the current catalog)
are evaluated in the performExecute
method. Filters that cannot be cached
(such as check if in current shopping cart) are evaluated in the postFilter
method. If a custom filter is added, and the evaluation can be cached, then extend the
method removeCatalogEntry
. If a custom filter is added, and the evaluation
cannot be cached, then extend the method postFilter
.
The following is the process to add a new catalog entry filter:
FilterCatalogEntryTaskCmdImpl
, and register a new CMDREG entry for your store.boolean removeCatalogEntry(MarketingSpotActivityCatalogEntryDataType catalogEntry);
In this method, do the checking for the new filter (use getMyFilter
to get the value of the setting).
This method should return true if the filter checking determines that the catalog entry should not be displayed to
the customer. Otherwise return false, and the catalog entry will get displayed in the eMarketing Spot.boolean postFilter(MarketingSpotActivityCatalogEntryDataType catalogEntry);
In this method, do the checking for the new filter (use getMyFilter
to get the value of the setting).
This method should return true if the filter checking determines that the catalog entry should not be displayed to
the customer. Otherwise return false, and the catalog entry will get displayed in the eMarketing Spot.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASSNAME
The name of this class.
|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
defaultCommandClassName, NAME
Constructor and Description |
---|
FilterCatalogEntryTaskCmdImpl()
Default constructor for this command.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
getCacheKey()
This method generates a key to enable command caching.
|
java.util.ArrayList |
getCatalogEntries()
This method returns an array of filtered catalog entry data objects that will be displayed
in the e-Marketing Spot.
|
long |
getObjectSize()
Returns the estimated footprint size in bytes
of this object and the objects it contains.
|
java.lang.String |
getRemoveIfExistInPurchaseHistory()
This method returns if catalog entries should not be displayed if they
are currently in the shopper's purchase history.
|
java.lang.String |
getRemoveIfExistInShopcart()
This method returns if catalog entries should not be displayed if they
are currently in the shopper's shopping cart.
|
java.lang.String |
getRemoveIfNoInventory()
This method gets if catalog entries should not be displayed if their inventory
level is below the specified value.
|
java.lang.String |
getRemoveIfNotEntitled()
This method gets if catalog entries should not be displayed if they are
not entitled to being viewed by the customer.
|
java.lang.String |
getRemoveIfNotInCurrentCatalog()
This method gets if catalog entries should not be displayed if they are
not in the catalog currently being viewed by the customer.
|
java.lang.String |
getRemoveIfPastEndDate()
This method gets if catalog entries should not be displayed if their end
date is before the current date.
|
EMarketingSpotDataBean[] |
getResultDataBeans()
This method sets the data beans containing the results that the e-Marketing Spot displays.
|
boolean |
isReadyToCallExecute()
This method checks if this command is ready to be executed or not.
|
void |
performExecute()
This method performs all the logic that needs to be executed in this command.
|
void |
postExecute()
This method is called by the Dynamic Cache when the execute method is called,
and a cache miss occurs,
after the performExecute method is called.
|
boolean |
postFilter(MarketingSpotActivityCatalogEntryDataType catentry)
This method checks the filters that need to be evaluated every time and
cannot be cached when this command is cached.
|
void |
reset()
Re-initializes the command for re-execution.
|
void |
setOutputProperties(com.ibm.websphere.command.TargetableCommand fromCommand)
Sets the output properties by copying them from another instance of this command.
|
void |
setRemoveIfExistInPurchaseHistory(java.lang.String setting)
This method sets if catalog entries should not be displayed if they
are currently in the shopper's purchase history.
|
void |
setRemoveIfExistInShopcart(java.lang.String setting)
This method sets if catalog entries should not be displayed if they
are currently in the shopper's shopping cart.
|
void |
setRemoveIfNoInventory(java.lang.String setting)
This method sets if catalog entries should not be displayed if their inventory
level is below the specified value.
|
void |
setRemoveIfNotEntitled(java.lang.String setting)
This method sets if catalog entries should not be displayed if they are
not entitled to being viewed by the customer.
|
void |
setRemoveIfNotInCurrentCatalog(java.lang.String setting)
This method sets if catalog entries should not be displayed if they are
not in the catalog currently being viewed by the customer.
|
void |
setRemoveIfPastEndDate(java.lang.String setting)
This method sets if catalog entries should not be displayed if their end
date is before the current date.
|
void |
setResultDataBeans(EMarketingSpotDataBean[] resultDataBeans)
This method sets the data beans containing the results that the e-Marketing Spot displays.
|
getActiveOrg, getActivityId, getAdditionalParameter, getAdditionalParameters, getCacheId, getCatalogId, getContracts, getDataType, getExperimentId, getLanguageId, getMarketingSpotBehavior, getMemberGroups, getMemberIdsForPersonalizationId, getPreviewReport, getSpecificLanguageId, getSpecificStoreeId, getSpotCacheKey, getStoreId, getTestElementId, isCacheHit, populateActivityData, populateUserData, preExecute, randomize, setAdditionalParameters, setMarketingSpotBehavior, setPreviewReport, setSpecificLanguageId, setSpecificStoreId
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, setCaller, setObjectSize, unionDependencies, updateCache
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setTargetPolicy
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setAdditionalParameters, setMarketingSpotBehavior, setPreviewReport, setSpecificLanguageId, setSpecificStoreId
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, preExecute, setCaller, updateCache
public static final java.lang.String COPYRIGHT
public static final java.lang.String CLASSNAME
public FilterCatalogEntryTaskCmdImpl()
public long getObjectSize()
getObjectSize
in interface com.ibm.websphere.cache.Sizeable
getObjectSize
in class MarketingSpotCommandBaseTaskCmdImpl
public void setRemoveIfNoInventory(java.lang.String setting)
setting
- Set "0" if the inventory level should not be checked, otherwise
set the inventory level which needs to be met in order for the catalog entry
to be displayed to the customer.public java.lang.String getRemoveIfNoInventory()
public void setRemoveIfExistInShopcart(java.lang.String setting)
setting
- Set "1" if catalog entries should not be displayed if they
are currently in the shopper's shopping cart, otherwise set "0".public java.lang.String getRemoveIfExistInShopcart()
public void setRemoveIfExistInPurchaseHistory(java.lang.String setting)
setting
- Set "1" if catalog entries should not be displayed if they
are currently in the shopper's purchase history, otherwise set "0".public java.lang.String getRemoveIfExistInPurchaseHistory()
public void setRemoveIfPastEndDate(java.lang.String setting)
setting
- Set "1" if catalog entries should not be displayed if the
end date has passed, otherwise set "0".public java.lang.String getRemoveIfPastEndDate()
public void setRemoveIfNotInCurrentCatalog(java.lang.String setting)
setting
- Set "1" if catalog entries should not be displayed if they are
not in the catalog currently being viewed by the customer, otherwise set "0".public java.lang.String getRemoveIfNotInCurrentCatalog()
public void setRemoveIfNotEntitled(java.lang.String setting)
setting
- Set "1" if catalog entries should not be displayed if they are
not entitled to being viewed by the customer, otherwise set "0".public java.lang.String getRemoveIfNotEntitled()
public java.util.ArrayList getCatalogEntries()
getCatalogEntries
in interface FilterCatalogEntryTaskCmd
public EMarketingSpotDataBean[] getResultDataBeans()
getResultDataBeans
in interface FilterCatalogEntryTaskCmd
public boolean isReadyToCallExecute()
isReadyToCallExecute
in interface com.ibm.websphere.command.Command
isReadyToCallExecute
in class MarketingSpotCommandBaseTaskCmdImpl
public void reset()
reset
in interface com.ibm.websphere.command.Command
reset
in class MarketingSpotCommandBaseTaskCmdImpl
Command.reset()
public boolean postFilter(MarketingSpotActivityCatalogEntryDataType catentry)
postFilter
in interface FilterCatalogEntryTaskCmd
catentry
- The catalog entry to check.public void performExecute() throws java.lang.Exception
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class MarketingSpotCommandBaseTaskCmdImpl
java.lang.Exception
TargetableCommand.performExecute()
public void postExecute()
This method is called by the Dynamic Cache when the execute method is called, and a cache miss occurs, after the performExecute method is called.
postExecute
in interface com.ibm.websphere.command.CacheableCommand
postExecute
in class MarketingSpotCommandBaseTaskCmdImpl
CacheableCommand.postExecute()
public void setOutputProperties(com.ibm.websphere.command.TargetableCommand fromCommand)
Sets the output properties by copying them from another instance of this command.
This method is intended to be called by the cacheable command framework. Do not call this method directly.
setOutputProperties
in interface com.ibm.websphere.command.TargetableCommand
setOutputProperties
in class MarketingSpotCommandBaseTaskCmdImpl
TargetableCommand.setOutputProperties(com.ibm.websphere.command.TargetableCommand)
public void setResultDataBeans(EMarketingSpotDataBean[] resultDataBeans)
EMarketingSpotDataBean
can be set.
This is to allow for the appropriate command caching.setResultDataBeans
in interface FilterCatalogEntryTaskCmd
resultDataBeans
- The data beans containing the results that the e-Marketing Spot displays.public java.lang.String[] getCacheKey()