com.ibm.commerce.marketing.commands.elements

Class ViewSearchEMarketingSpotTriggerTaskCmdImpl

  • All Implemented Interfaces:
    MarketingCampaignElementTaskCmd, ViewSearchEMarketingSpotTriggerTaskCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    public class ViewSearchEMarketingSpotTriggerTaskCmdImpl
    extends MarketingCampaignElementTaskCmdImpl
    implements ViewSearchEMarketingSpotTriggerTaskCmd
    This class validates if all the required name value pairs have been set in the View Search E-Marketing Spot trigger campaign element when an activity is activated. For each searchKeyword name value pair, the campaign element will be associated with the Search e-Marketing Spot of the same name. If an existing Search e-Marketing Spot cannot be found, then a Search e-Marketing Spot is created. This class has a performExecute method that is unique for trigger campaign elements. It is called for search e-Marketing Spots to check if the current customer search term (found from the searchTerm URL parameter) matches the e-Marketing Spot name by the specified operator (=, contain, start, end).
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
      • CLASSNAME

        public static final java.lang.String CLASSNAME
        The name of this class.
        See Also:
        Constant Field Values
      • PARAM_SEARCH_KEYWORD

        public static final java.lang.String PARAM_SEARCH_KEYWORD
        The constant for the Search e-marketing spot name/value pair for the spot name.
        See Also:
        Constant Field Values
      • PARAM_SEARCH_PARAMETER

        public static final java.lang.String PARAM_SEARCH_PARAMETER
        The constant for the Search e-marketing spot name/value pair for the search term parameter that is on the URL.
        See Also:
        Constant Field Values
      • PARAM_SEARCH_OPERATOR

        public static final java.lang.String PARAM_SEARCH_OPERATOR
        The constant for the Search e-marketing spot name/value pair for the search name matching operator.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ViewSearchEMarketingSpotTriggerTaskCmdImpl

        public ViewSearchEMarketingSpotTriggerTaskCmdImpl()
    • Method Detail

      • resolveSearchEMarketingSpot

        public void resolveSearchEMarketingSpot(java.lang.String spotName,
                                                java.util.Map elementParameters,
                                                java.util.List validationErrors)
        This method associates a Search e-Marketing Spot with a View e-Marketing Spot campaign element. The campaign element needs to have a name-value pair with the name searchKeyword. This method tries to find an existing e-Marketing Spot with the corresponding name. If an existing e-Marketing Spot is found, then a new entry is created in the DMELEMENTNVP database table with a name of emsId and a value with the corresponding e-Marketing Spot unique ID. If an existing e-Marketing Spot is not found, then a new Search e-Marketing Spot is created, and then the DMELEMENTNVP database table entry is created. If the store has an asset store, then the e-Marketing Spot is created in the asset store in order to share the e-Marketing Spot with the extended site stores.
        Parameters:
        spotName - The name of the Search e-Marketing Spot.
        elementParameters - The name value pairs for this element.
        validationErrors - The list of ApplicationError exceptions that contains any validation errors. The list may be empty.
      • getStoreIdToCreateSearchEMarketingSpot

        public java.lang.Integer getStoreIdToCreateSearchEMarketingSpot(java.lang.Integer[] relatedStores)
        This method returns the unique ID of the store in which to create the Search e-Marketing Spot. The default implementation of this method will return the first asset store found along the com.ibm.commerce.campaigns store relationship. If there is no asset store, then the ID of the current store is returned.
        Parameters:
        relatedStores - The ordered list of stores on the com.ibm.commerce.campaigns store relationship.
        Returns:
        This method returns the ID of the store in which the Search e-Marketing Spot will be created.
      • validateParameters

        public java.util.List validateParameters(java.util.Map elementParameters)
        This method validates that all the required name value pairs have been set for the campaign element. It checks that searchKeyword has been set and associates the campaign element with a Search e-Marketing Spot. If an existing Search e-Marketing Spot cannot be found, then one is created.
        Specified by:
        validateParameters in interface MarketingCampaignElementTaskCmd
        Overrides:
        validateParameters in class MarketingCampaignElementTaskCmdImpl
        Parameters:
        elementParameters - The name value pairs for this element.
        Returns:
        This method returns a list of ApplicationError exceptions that contains any validation errors. The list may be empty or be null.
      • performExecute

        public void performExecute()
        This method is used when the e-Marketing Spot is a search e-Marketing Spot. The Marketing Services have already determined that the customer's search term has a keyword for which there is an associated search activity. However, the search activity may specify that there is only a match if the customer's search terms starts with, ends with, or contains a specific keyword. This method checks if the customer's search term matches the criteria specified in the campaign element. The name-value pair searchOperator can be one of: =, contain, start, end. The customer's search term is found from the trigger parameters from the name-value pair of searchTerm. This can be overridden by updating the implementation xml for the viewSearchEMarketingSpot element template and change the value of searchParameter.
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class MarketingCampaignElementTaskCmdImpl