public abstract class MarketingSpotCommandBaseTaskCmdImpl
extends MeasuredCacheableCommandImpl
implements com.ibm.websphere.cache.Sizeable
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String | CALCODE_ID
Constant for Calculation Code Id
|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
protected static java.lang.String | FILTER_OFF
Constant for a filter set to off.
|
protected static java.lang.String | FILTER_ON
Constant for a filter set to on.
|
protected static java.lang.String | PROMOTION_ID
Constant for Promotion id
|
protected static java.lang.String | PSTORE_ID
Constant for Promotion Store Id
|
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.
|
protected CatalogFactory | getCatalogFactory()
This method will return the default instance of the Catalog Factory.
|
java.lang.String | getCatalogId()
This method gets the current catalog set in the session.
|
protected CommerceFoundationFactory | getCommerceFoundationFactory()
This method will return the default instance of the Commerce Foundation Factory.
|
java.lang.String | getContracts()
This method gets the current contracts in the session.
|
protected java.lang.Object | getData()
Returns the data property, or null if it has disappeared.
|
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.
|
protected MarketingFactory | getMarketingFactory()
This method will return the default instance of the Marketing Factory.
|
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.
|
protected void | setData(java.lang.Object aobjData)
Use the data property to store non-serializable data.
|
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.
|
public static final java.lang.String COPYRIGHT
protected static final java.lang.String FILTER_ON
protected static final java.lang.String FILTER_OFF
protected static final java.lang.String PROMOTION_ID
protected static final java.lang.String CALCODE_ID
protected static final java.lang.String PSTORE_ID
public boolean isReadyToCallExecute()
public long getObjectSize()
public void setPreviewReport(java.util.List newPreviewReport)
public java.util.List getPreviewReport()
public void setAdditionalParameters(java.util.Map<java.lang.String,java.lang.String> newAdditionalParameters)
public java.util.Map<java.lang.String,java.lang.String> getAdditionalParameters()
public java.lang.String getAdditionalParameter(java.lang.String paramName)
protected final void setData(java.lang.Object aobjData)
protected final java.lang.Object getData()
Returns the data property, or null if it has disappeared.
Since this data can be referenced concurrently by cache hits, make sure never to change the data returned by this method.
For performance, and to avoid having to de-serialize them on each cache hit, this class normally keeps copies of the SDO objects in a static WeakHashMap, and returns them from the getData method.
This code is made fairly complex due to the fact that the SDO objects know their container, and are therefore modified every time they are added to a container. Since it is normal for a caller to place the SDO in a container, this effectively means that the SDO objects returned by the getData method cannot be used concurrently by different threads. Therefore, this class remembers the SDO objects it has returned during the previous transaction, and returns them to the WeakHashMap at the beginning of a new database transaction. For this to work, all callers of the getData method must have finished with the SDO object by the time the next database transaction is started. Since as far as we know this will always be the case, we are able to keep this performance enhancement.
However, if it ever becomes necessary to disable it, either for problem determination, or because new code is written that breaks this assumption, it can be disabled by adding the following lines to the WC instance configuration file, in the <InstanceProperties> tag:
<com.ibm.commerce.marketing.commands.marketingspot.MarketingSpotCommandBaseTaskCmdImpl cacheSDOData="false"/>
public void 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.
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.
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.
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.
public java.lang.String[] getSpotCacheKey(EMarketingSpotDataBean[] spotDataBeans)
public java.lang.String[] getActivityId()
public java.lang.String[] getDataType()
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)
public java.lang.Integer getSpecificLanguageId()
public void setSpecificStoreId(java.lang.Integer storeId)
public java.lang.Integer getSpecificStoreeId()
public void setMarketingSpotBehavior(java.lang.String behavior)
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)
protected MarketingFactory getMarketingFactory()
protected CommerceFoundationFactory getCommerceFoundationFactory()
protected CatalogFactory getCatalogFactory()
public void populateUserData(BaseMarketingSpotActivityDataType marketingSpotObject, EMarketingSpotDataBean resultDataBean, MarketingFactory marketingFactory, CommerceFoundationFactory commerceFoundationFactory)
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']}
public static void populateActivityData(BaseMarketingSpotActivityDataType marketingSpotObject, EMarketingSpotDataBean resultDataBean, MarketingFactory marketingFactory, CommerceFoundationFactory commerceFoundationFactory)
public java.lang.Long[] getMemberIdsForPersonalizationId()