public class GetMarketingSpotDataCmdImpl extends AbstractGetBusinessObjectDocumentCmdImpl implements GetMarketingSpotDataCmd
Modifier and Type | Field and Description |
---|---|
static java.lang.String | DATA_TYPE_SEARCH_QUERY
A constant representing the type of data returned by the search marketing activities in the e-Marketing spot.
|
static java.lang.String | FILTER_RESULTS
The constant that the recommendation results should not be filtered.
|
static java.lang.String | NVP_KEY_DISPLAYSEQUENCE
Constant for EMarketingSpotDataBean nvp for order of default content
|
Constructor and Description |
---|
GetMarketingSpotDataCmdImpl()
This method is the default constructor.
|
Modifier and Type | Method and Description |
---|---|
void | addFilteredResult(EMarketingSpotDataBean emsDataBean)
This method sets an EMarketingSpotDataBean object into the list that contains the information of results that were returned by the marketing engine to display in the e-Marketing Spot, but the result is not being returned because it was filtered out by the object's filter logic.
|
protected boolean | canPerformExpression(SearchExpression selectionExpression)
This method returns true as all users are allowed to call the Get MarketingSpotData service.
|
protected void | createExperimentLogEntry(java.lang.String experimentId, java.lang.String testElementId, java.lang.String dataType, java.lang.String dataUniqueId, java.lang.String pznId, java.lang.Integer storeId)
This method creates an entry in the experiment log table.
|
protected void | filterNouns(java.util.List nouns)
This method performs no authorization checks as all users are allowed to call the Get MarketingSpotData service.
|
protected void | foundMatchForMarketingSpot(CampaignInitiativeCache.CachedEMarketingSpot eSpot, java.lang.Integer storeId, java.lang.String pznId)
This should is called when an e-Marketing Spot is found, and the associated activities should be processed for that 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.util.List | getEmsDataBeans()
This method gets the List of EMarketingSpotDataBeans returned by the marketing runtime.
|
java.lang.Integer | getEmsId()
This method gets the ID of the e-Marketing Spot.
|
java.lang.String | getEmsName()
This method gets the name of the e-Marketing Spot.
|
java.util.List | getEmsTitleDataBeans()
This method gets the List of EMarketingSpotDataBeans returned by the marketing runtime used for e-Marketing Spot title.
|
CampaignInitiativeCache.CachedEMarketingSpot | getESpot(java.lang.String emsName, java.lang.Integer storeId)
This method gets the cached information of an e-Marketing Spot.
|
CampaignInitiativeCache.CachedEMarketingSpot | getESpot(java.lang.String emsName, java.lang.String usage, java.lang.Integer storeId)
This method gets the cached information of an e-Marketing Spot.
|
java.util.List | getFilteredResults()
This method gets the list of EMarketingSpotDataBean objects that contain the information of results that were returned by the marketing engine to display in the e-Marketing Spot, but the result is not being returned because it was filtered out by the object's filter logic.
|
protected GetMarketingSpotDataType | getGetMarketingSpotData()
This method gets the GetMarketingSpotDataType business object document that this command will process.
|
protected MarketingFactory | getMarketingFactory()
This method returns the default instance of the Marketing Factory.
|
java.lang.String | getMarketingSpotBehaviorFromServiceCall()
This method gets the caching behavior for the associated e-Marketing Spot.
|
protected MarketingSpotDataType | getMarketingSpotDataObject(CampaignInitiativeCache.CachedEMarketingSpot eSpot, java.lang.String pznId, java.lang.Integer storeId)
This methods creates the data object results associated with the results from the marketing engine.
|
protected java.util.List | getMarketingSpotDatas()
This method returns a list of MarketingSpotData that are returned from the marketing runtime.
|
protected void | getMarketingSpotDataSDOs(java.util.List list)
This method goes through the EMarketingSpotDataBean data beans that are returned from the marketing engine.
|
MarketingSpotDataType | getMarketingSpotDataType(java.lang.String emsName, java.lang.String usage, java.lang.Integer storeId, java.lang.String pznId)
This method gets the MarketingSpotDataType object to return in the Get MarketingSpotData service call.
|
protected void | getMarketingSpotTitleDataSDOs(java.util.List list, java.util.List returnedContent)
This method goes through the EMarketingSpotDataBean data beans that are returned from the marketing engine for the Marketing Spot title.
|
java.util.List | getPreviewReport()
This method gets the list that will contain the information that can be used to understand the evaluation that occurred on an e-Marketing Spot.
|
BusinessObjectDocumentType | getResultBusinessObjectDocument()
This method returns the response business object document.
|
boolean | getReturnDefaultContentOnly()
This method gets the flag value to return default content only.
|
ShowMarketingSpotDataType | getShowMarketingSpotData()
This method gets the ShowMarketingSpotDataType business object document result.
|
java.lang.Integer | getStoreId()
This method gets the ID of the current store.
|
java.lang.String | getTriggerParameters()
This method gets the trigger parameters passed in the service call.
|
java.util.Map | getTriggerParametersMap()
This method gets the trigger parameters passed in the service call.
|
protected java.lang.String | getXpathKey(java.lang.String expression)
This method gets the XPATH key for the Get MarketingSpotData service call.
|
java.util.List | handleIdOnlyRequestForDefaultContent(java.util.List newEmsDataBeans)
This method processes a List of EMarketingSpotDataBeans returned by the marketing runtime as the default content to display in the e-Marketing Spot.
|
CampaignInitiativeCache.CachedEMarketingSpot | handleNoExactMatchForSearchMarketingSpot(java.lang.String emsName, java.lang.String usage, java.lang.Integer storeId, java.lang.String pznId)
This method returns the e-Marketing Spot object that corresponds to the e-Marketing Spot name used in the Get MarketingSpotData request.
|
protected BaseMarketingSpotActivityDataType | loadCatalogEntry(EMarketingSpotDataBean emsDataBean)
This method takes the catalog entry results from the marketing engine, and populates the data objects for the catalog entries to display in the e-Marketing Spot.
|
protected BaseMarketingSpotActivityDataType | loadCategory(EMarketingSpotDataBean emsDataBean)
This method takes the category result from the marketing engine, and populates the data object for the category to display in the e-Marketing Spot.
|
protected BaseMarketingSpotActivityDataType | loadContent(EMarketingSpotDataBean emsDataBean)
This method takes the marketing content result from the marketing engine, and populates the data object for the marketing content to display in the e-Marketing Spot.
|
protected BaseMarketingSpotActivityDataType | loadCustomData(EMarketingSpotDataBean emsDataBean)
This method takes the result from the marketing engine, and populates the BaseMarketingSpotActivityDataType data object to display in the e-Marketing Spot.
|
protected java.util.ArrayList | loadFilterAndOrder()
This method takes the results from the marketing engine, and populates the BaseMarketingSpotActivityDataType data objects to display in the e-Marketing Spot.
|
protected BaseMarketingSpotActivityDataType | loadFilterAndOrder(BaseMarketingSpotActivityDataType sdo, EMarketingSpotDataBean emsDataBean)
This method takes the results from the marketing engine, and populates the BaseMarketingSpotActivityDataType data objects to display in the e-Marketing Spot.
|
protected java.util.ArrayList | loadFilterAndOrderCatalogEntry()
This method takes the catalog entry results from the marketing engine, and populates the data objects for the catalog entries to display in the e-Marketing Spot.
|
protected java.util.ArrayList | loadFilterAndOrderCategory()
This method takes the category results from the marketing engine, and populates the data objects for the categories to display in the e-Marketing Spot.
|
protected java.util.ArrayList | loadFilterAndOrderContent()
This method takes the marketing content results from the marketing engine, and populates the data objects for the marketing content to display in the e-Marketing Spot.
|
protected void | performExpression()
This method calls getMarketingSpotDatas to get the data to display in the eMarketing Spot, and creates the return business object document.
|
protected java.util.ArrayList | personalizeContent(java.util.ArrayList contentSDOs)
This method will replace any substitution variables in the marketing text with the data set in the Get MarketingSpotData call.
|
protected java.lang.String | personalizeContent(MarketingSpotActivityMarketingContentDataType content, java.lang.String textToModify)
This method allows a customization to be able to personalize the marketing text in a marketing content.
|
protected java.lang.String | personalizePromotionProximity(MarketingSpotActivityMarketingContentDataType content, java.lang.String textToModify)
This method will modify the marketing text if the promotion proximity tag is contained within the content.
|
void | setAdditionalParameter(java.lang.String paramName, java.lang.String paramValue)
This method sets the value of an additional parameter used for evaluation of the e-Marketing Spot.
|
void | setEmsDataBeans(java.util.List newEmsDataBeans)
This method sets the List of EMarketingSpotDataBeans returned by the marketing runtime.
|
void | setEmsId(java.lang.Integer newEmsId)
This method sets the ID of the e-Marketing Spot.
|
void | setEmsName(java.lang.String newEmsName)
This method sets the name of the e-Marketing Spot.
|
void | setEmsTitleDataBeans(java.util.List newEmsTitleDataBeans)
This method sets the List of EMarketingSpotDataBeans returned by the marketing runtime used for e-Marketing Spot title.
|
void | setGetMarketingSpotData(GetMarketingSpotDataType getMarketingSpotData)
This method sets the GetMarketingSpotDataType business object document that this command will process.
|
void | setMarketingSpotBehaviorFromServiceCall(java.lang.String behavior)
This method sets the caching behavior for the associated e-Marketing Spot.
|
void | setPreviewReport(java.util.List newPreviewReport)
This method sets the list that will contain the information that can be used to understand the evaluation that occurred on an e-Marketing Spot.
|
void | setRequestBusinessObjectDocument(BusinessObjectDocumentType businessObjectDocument)
This method sets the business object document to process.
|
void | setReturnDefaultContentOnly(boolean newReturnDefaultContentOnly)
This method sets the flag to return default content only
|
protected void | setShowMarketingSpotData(ShowMarketingSpotDataType aShowMarketingSpotData)
This method sets the ShowMarketingSpotDataType business object document result.
|
void | setStoreId(java.lang.Integer newStoreId)
This method sets the ID of the current store.
|
void | setTriggerParameters(java.lang.String newTriggerParameters)
This method sets the trigger parameters passed in the service call.
|
protected void | validateExpression()
This method can validate the noun with in the business object document.
|
public static final java.lang.String DATA_TYPE_SEARCH_QUERY
public static final java.lang.String FILTER_RESULTS
public static final java.lang.String NVP_KEY_DISPLAYSEQUENCE
public GetMarketingSpotDataCmdImpl()
public java.util.List getEmsDataBeans()
public void setEmsDataBeans(java.util.List newEmsDataBeans)
public java.util.List getEmsTitleDataBeans()
public void setEmsTitleDataBeans(java.util.List newEmsTitleDataBeans)
public java.util.List handleIdOnlyRequestForDefaultContent(java.util.List newEmsDataBeans)
public java.lang.String getTriggerParameters()
public java.util.Map getTriggerParametersMap()
public void setTriggerParameters(java.lang.String newTriggerParameters)
public java.lang.Integer getStoreId()
public void setStoreId(java.lang.Integer newStoreId)
public java.lang.Integer getEmsId()
public void setEmsId(java.lang.Integer newEmsId)
public java.lang.String getEmsName()
public void setEmsName(java.lang.String newEmsName)
protected MarketingFactory getMarketingFactory()
public CampaignInitiativeCache.CachedEMarketingSpot getESpot(java.lang.String emsName, java.lang.Integer storeId)
public CampaignInitiativeCache.CachedEMarketingSpot getESpot(java.lang.String emsName, java.lang.String usage, java.lang.Integer storeId)
public CampaignInitiativeCache.CachedEMarketingSpot handleNoExactMatchForSearchMarketingSpot(java.lang.String emsName, java.lang.String usage, java.lang.Integer storeId, java.lang.String pznId)
The following is an example of how to find matches where the desired search term (which is stored in the search e-Marketing Spot names) can be found anywhere in the customer's search term (which is the emsName parameter passed into this method).
CampaignInitiativeCache.CachedEMarketingSpot returnESpot = null; Integer[] relatedStores = null; try { relatedStores = StoreUtil.getStorePath(storeId, MarketingMetadata.MARKETING_STORE_RELATIONSHIP); } catch (Exception e) { return null; } for (int i = 0; i < relatedStores.length; i++) { Map storeSearchSpots = MarketingEngineCache.singleton().getSearchEMarketingSpots(relatedStores[i]); Iterator storeSearchSpotsIterator = storeSearchSpots.keySet().iterator(); while (storeSearchSpotsIterator.hasNext()) { String spotName = (String)storeSearchSpotsIterator.next(); if (emsName.contains(spotName)) { CampaignInitiativeCache.CachedEMarketingSpot eSpot = MarketingEngineCache.singleton().getEmarketingSpot(spotName, usage, relatedStores[i]); if (eSpot != null) { // found a partial match spot foundMatchForMarketingSpot(eSpot, storeId, pznId); returnESpot = eSpot; } } } } return returnESpot;
protected void foundMatchForMarketingSpot(CampaignInitiativeCache.CachedEMarketingSpot eSpot, java.lang.Integer storeId, java.lang.String pznId)
protected void performExpression() throws java.lang.Exception
protected void validateExpression() throws java.lang.Exception
public void setGetMarketingSpotData(GetMarketingSpotDataType getMarketingSpotData)
protected GetMarketingSpotDataType getGetMarketingSpotData()
public ShowMarketingSpotDataType getShowMarketingSpotData()
protected void setShowMarketingSpotData(ShowMarketingSpotDataType aShowMarketingSpotData)
public BusinessObjectDocumentType getResultBusinessObjectDocument()
public void setRequestBusinessObjectDocument(BusinessObjectDocumentType businessObjectDocument)
protected java.lang.String getXpathKey(java.lang.String expression)
protected void filterNouns(java.util.List nouns)
protected boolean canPerformExpression(SearchExpression selectionExpression)
public void setPreviewReport(java.util.List newPreviewReport)
public java.util.List getFilteredResults()
public void addFilteredResult(EMarketingSpotDataBean emsDataBean)
public java.util.List getPreviewReport()
public java.util.Map<java.lang.String,java.lang.String> getAdditionalParameters()
public void setAdditionalParameter(java.lang.String paramName, java.lang.String paramValue)
public void setReturnDefaultContentOnly(boolean newReturnDefaultContentOnly)
public boolean getReturnDefaultContentOnly()
public void setMarketingSpotBehaviorFromServiceCall(java.lang.String behavior)
public java.lang.String getMarketingSpotBehaviorFromServiceCall()
protected java.util.List getMarketingSpotDatas()
public MarketingSpotDataType getMarketingSpotDataType(java.lang.String emsName, java.lang.String usage, java.lang.Integer storeId, java.lang.String pznId)
protected MarketingSpotDataType getMarketingSpotDataObject(CampaignInitiativeCache.CachedEMarketingSpot eSpot, java.lang.String pznId, java.lang.Integer storeId)
protected BaseMarketingSpotActivityDataType loadFilterAndOrder(BaseMarketingSpotActivityDataType sdo, EMarketingSpotDataBean emsDataBean)
if (emsDataBean.getType().equals(MY_CUSTOM_TYPE)) { // this is my custom type // Customization begin: fetch the custom object // the following two lines should be replaced with the data from the custom object String customObjectName = "customObjectName"; String customObjectUniqueID = "customObjectUniqueID"; sdo.setName(customObjectName); sdo.setUniqueID(customObjectUniqueID); // put any additional data from the custom object into the user data field UserDataType userData = getCommerceFoundationFactory().createUserDataType(); userData.getUserDataField().put("customData1", "value1"); userData.getUserDataField().put("customData2", "value2"); userData.getUserDataField().put("customData3", "value3"); sdo.setUserData(userData); // Customization end } // end if MY_CUSTOM_TYPE
protected java.util.ArrayList loadFilterAndOrder()
protected java.util.ArrayList loadFilterAndOrderCategory()
protected java.util.ArrayList loadFilterAndOrderCatalogEntry()
protected java.util.ArrayList loadFilterAndOrderContent()
protected java.lang.String personalizeContent(MarketingSpotActivityMarketingContentDataType content, java.lang.String textToModify)
protected java.lang.String personalizePromotionProximity(MarketingSpotActivityMarketingContentDataType content, java.lang.String textToModify)
The promotion proximity tag has the following syntax: [CartValueThreshold:CVT CUR,MinimumCartValue:MCV,PromotionId:PID] or [CartValueThreshold:CVT CUR,MinimumCartValue:MCV,PromotionName:PNAME]
protected java.util.ArrayList personalizeContent(java.util.ArrayList contentSDOs)
protected void createExperimentLogEntry(java.lang.String experimentId, java.lang.String testElementId, java.lang.String dataType, java.lang.String dataUniqueId, java.lang.String pznId, java.lang.Integer storeId)
protected BaseMarketingSpotActivityDataType loadCustomData(EMarketingSpotDataBean emsDataBean)
protected BaseMarketingSpotActivityDataType loadCategory(EMarketingSpotDataBean emsDataBean)
protected BaseMarketingSpotActivityDataType loadCatalogEntry(EMarketingSpotDataBean emsDataBean)
protected BaseMarketingSpotActivityDataType loadContent(EMarketingSpotDataBean emsDataBean)
protected void getMarketingSpotDataSDOs(java.util.List list)
protected void getMarketingSpotTitleDataSDOs(java.util.List list, java.util.List returnedContent)