public abstract class MarketingSpotCommandBaseTaskCmdImpl
extends com.ibm.commerce.command.MeasuredCacheableCommandImpl
implements com.ibm.websphere.cache.Sizeable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
MarketingSpotCommandBaseTaskCmdImpl() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getActiveOrg()
This method gets the active organization in the session.
|
java.lang.String[] |
getActivityId()
This method returns the IDs of the activities associated with the loaded data.
|
java.lang.String |
getAdditionalParameter(java.lang.String paramName)
This method gets the value of an additional parameter used for evaluation of the e-Marketing Spot.
|
java.util.Map<java.lang.String,java.lang.String> |
getAdditionalParameters()
This method gets the map of additional parameters used for evaluation of the e-Marketing Spot.
|
java.lang.String |
getCacheId()
Returns the Dynamic Cache cache identifier
or null if this command was not cached.
|
java.lang.String |
getCatalogId()
This method gets the current catalog set in the session.
|
java.lang.String |
getContracts()
This method gets the current contracts in the session.
|
java.lang.String[] |
getDataType()
This method returns the data types associated with the loaded data.
|
java.lang.String[] |
getExperimentId()
This method returns the IDs of the experiments associated with the loaded data.
|
java.lang.String |
getLanguageId()
This method gets the language ID in which the data should be retrieved.
|
java.lang.String |
getMarketingSpotBehavior()
This method gets the caching behavior for the associated e-Marketing Spot.
|
java.lang.String[] |
getMemberGroups()
This method gets the member groups to which the user explicitly belongs.
|
java.lang.Long[] |
getMemberIdsForPersonalizationId()
This method returns the set of member IDs associated with the customer.
|
long |
getObjectSize()
Returns the estimated footprint size in bytes
of this object and the objects it contains.
|
java.util.List |
getPreviewReport()
This method gets the list of information about the activity evaluation on the e-Marketing Spot.
|
java.lang.Integer |
getSpecificLanguageId()
This method gets the language ID in which the data should be retrieved.
|
java.lang.Integer |
getSpecificStoreeId()
This method gets the store ID in which the data should be retrieved.
|
java.lang.String[] |
getSpotCacheKey(EMarketingSpotDataBean[] spotDataBeans)
This method generates a key to enable command caching.
|
java.lang.String |
getStoreId()
This method gets the store for which the data should be retrieved.
|
java.lang.String[] |
getTestElementId()
This method returns the IDs of the experiment test elements associated with the loaded data.
|
boolean |
isCacheHit()
Returns true if the setOutputProperties method was called.
|
boolean |
isReadyToCallExecute()
This method returns true.
|
void |
performExecute()
The business logic for the command.
|
static void |
populateActivityData(BaseMarketingSpotActivityDataType marketingSpotObject,
EMarketingSpotDataBean resultDataBean,
MarketingFactory marketingFactory,
CommerceFoundationFactory commerceFoundationFactory)
This method populates the
BaseMarketingSpotActivityDataType with the
common activity, campaign, and experiment data. |
void |
populateUserData(BaseMarketingSpotActivityDataType marketingSpotObject,
EMarketingSpotDataBean resultDataBean,
MarketingFactory marketingFactory,
CommerceFoundationFactory commerceFoundationFactory)
This method should be implemented by customizations to add custom information to
the
BaseMarketingSpotActivityDataType SDO. |
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 |
preExecute()
This method is called by the Dynamic Cache when the execute method is called,
and a cache miss occurs,
before the performExecute method is called.
|
java.util.ArrayList |
randomize(java.util.ArrayList arrayToRandomize,
java.util.List priorityList,
int totalPriority)
Returns an array containing a randomized ordering of the items in the passed in array.
|
void |
reset()
Re-initializes the command for re-execution.
|
void |
setAdditionalParameters(java.util.Map<java.lang.String,java.lang.String> newAdditionalParameters)
This method sets any additional parameters used for evaluation of the e-Marketing Spot.
|
void |
setMarketingSpotBehavior(java.lang.String behavior)
This method sets the caching behavior for the associated e-Marketing Spot.
|
void |
setOutputProperties(com.ibm.websphere.command.TargetableCommand fromCommand)
Sets the output properties by copying them from another instance of this command.
|
void |
setPreviewReport(java.util.List newPreviewReport)
This method sets the list of information about the activity evaluation on the e-Marketing Spot.
|
void |
setSpecificLanguageId(java.lang.Integer langId)
This method sets the language ID in which the data should be retrieved.
|
void |
setSpecificStoreId(java.lang.Integer storeId)
This method sets the store ID in which the data should be retrieved.
|
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, setCaller, setObjectSize, unionDependencies, updateCache
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setTargetPolicy
public static final java.lang.String COPYRIGHT
public boolean isReadyToCallExecute()
isReadyToCallExecute
in interface com.ibm.websphere.command.Command
isReadyToCallExecute
in class com.ibm.websphere.command.TargetableCommandImpl
public long getObjectSize()
getObjectSize
in interface com.ibm.websphere.cache.Sizeable
getObjectSize
in class com.ibm.websphere.command.CacheableCommandImpl
public void setPreviewReport(java.util.List newPreviewReport)
newPreviewReport
- A list of information about the activity evaluation on the e-Marketing Spot.public java.util.List getPreviewReport()
public void setAdditionalParameters(java.util.Map<java.lang.String,java.lang.String> newAdditionalParameters)
newAdditionalParameters
- A map of additional parameters used for evaluation of the e-Marketing Spot.public java.util.Map<java.lang.String,java.lang.String> getAdditionalParameters()
public java.lang.String getAdditionalParameter(java.lang.String paramName)
paramName
- The name of the parameter.public void reset()
reset
in interface com.ibm.websphere.command.Command
reset
in class com.ibm.websphere.command.CacheableCommandImpl
Command.reset()
public boolean preExecute()
This method is called by the Dynamic Cache when the execute method is called, and a cache miss occurs, before the performExecute method is called.
preExecute
in interface com.ibm.websphere.command.CacheableCommand
preExecute
in class com.ibm.websphere.command.CacheableCommandImpl
CacheableCommand.preExecute()
public void performExecute() throws java.lang.Exception
The business logic for the command.
This method is intended to be called by the cacheable command framework. Do not call this method directly.
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class com.ibm.websphere.command.TargetableCommandImpl
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 com.ibm.websphere.command.CacheableCommandImpl
CacheableCommand.postExecute()
public final boolean isCacheHit()
public final java.lang.String getCacheId()
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 com.ibm.websphere.command.TargetableCommandImpl
TargetableCommand.setOutputProperties(com.ibm.websphere.command.TargetableCommand)
public java.lang.String[] getSpotCacheKey(EMarketingSpotDataBean[] spotDataBeans)
spotDataBeans
- The data beans from which to create the cache key.public java.lang.String[] getActivityId()
public java.lang.String[] getDataType()
EMarketingSpotDataBean
.public java.lang.String[] getExperimentId()
public java.lang.String[] getTestElementId()
public java.lang.String getContracts()
public java.lang.String getStoreId()
public void setSpecificLanguageId(java.lang.Integer langId)
RetrieveContentTaskCmd
. If the
specific language is not set, then the language in the current context is used.langId
- The language ID of the language in which to retrieve the data.public java.lang.Integer getSpecificLanguageId()
RetrieveContentTaskCmd
. If the
specific language is not set, then the language in the current context is used.public void setSpecificStoreId(java.lang.Integer storeId)
RetrieveContentTaskCmd
. If the
specific store is not set, then the store in the current context is used.storeId
- The store ID of the store in which to retrieve the data.public java.lang.Integer getSpecificStoreeId()
RetrieveContentTaskCmd
. If the
specific store is not set, then the store in the current context is used.public void setMarketingSpotBehavior(java.lang.String behavior)
behavior
- Set a value of 1 if the e-Marketing Spot
is dynamic, and a value of 0 if it is static.public java.lang.String getMarketingSpotBehavior()
public java.lang.String getLanguageId()
public java.lang.String getCatalogId()
public java.lang.String getActiveOrg()
public java.lang.String[] getMemberGroups()
public java.util.ArrayList randomize(java.util.ArrayList arrayToRandomize, java.util.List priorityList, int totalPriority)
arrayToRandomize
- the array containing the items to randomize.priorityList
- a list of priorities that represent the weight each item has when being ordered. The
higher the weight the greater the chance of the item being selected over those items with lower weight.totalPriority
- the sum of all priority weightings in priorityVector.public void populateUserData(BaseMarketingSpotActivityDataType marketingSpotObject, EMarketingSpotDataBean resultDataBean, MarketingFactory marketingFactory, CommerceFoundationFactory commerceFoundationFactory)
BaseMarketingSpotActivityDataType
SDO. This method is called by
RetrieveCatalogEntryCmdImpl
, RetrieveCategoryCmdImpl
, and RetrieveContentCmdImpl
.
The default implementation does nothing.
As an example of a customization, the following code illustrates how to add the activity description
to the data returned to the e-Marketing Spot for a catalog entry. In an extension to the
RetrieveCatalogEntryCmdImpl
command, the following method is implemented.
public void populateUserData(BaseMarketingSpotActivityDataType marketingSpotObject, EMarketingSpotDataBean resultDataBean, MarketingFactory marketingFactory, CommerceFoundationFactory commerceFoundationFactory) { if (marketingSpotObject.getUserData() == null) { marketingSpotObject.setUserData(commerceFoundationFactory.createUserDataType()); } marketingSpotObject.getUserData().getUserDataField().put("ActivityDescription", MarketingEngineCache.singleton().getActivity(resultDataBean.getActivityId()).getDescription()); }In the store e-Marketing Spot JSP snippet, the activity description can be retrieved as follows: ${marketingSpotData.userData.userDataField['ActivityDescription']}
marketingSpotObject
- The BaseMarketingSpotActivityDataType
object to return to the e-Marketing Spot.resultDataBean
- The EMarketingSpotDataBean
returned from the marketing runtime.marketingFactory
- The factory used to create objects defined by Marketing.commerceFoundationFactory
- The factory used to create objects defined by the Commerce Foundation.public static void populateActivityData(BaseMarketingSpotActivityDataType marketingSpotObject, EMarketingSpotDataBean resultDataBean, MarketingFactory marketingFactory, CommerceFoundationFactory commerceFoundationFactory)
BaseMarketingSpotActivityDataType
with the
common activity, campaign, and experiment data.marketingSpotObject
- The BaseMarketingSpotActivityDataType
object to return to the eMarketing Spot.resultDataBean
- The EMarketingSpotDataBean
returned from the marketing runtime.marketingFactory
- The factory used to create objects defined by Marketing.commerceFoundationFactory
- The factory used to create objects defined by the Commerce Foundation.public java.lang.Long[] getMemberIdsForPersonalizationId()