com.ibm.commerce.tools.campaigns

Class CampaignInitiativeEvaluateCmdImpl

  • java.lang.Object
    • com.ibm.websphere.command.CacheableCommandImpl
      • com.ibm.commerce.command.MeasuredCacheableCommandImpl
        • com.ibm.commerce.command.AbstractECTargetableCommand
          • com.ibm.commerce.command.TaskCommandImpl
            • com.ibm.commerce.tools.campaigns.CampaignInitiativeEvaluateCmdImpl
  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, com.ibm.commerce.command.ECCommand, com.ibm.commerce.command.ECTargetableCommand, com.ibm.commerce.command.TaskCommand, com.ibm.commerce.condition.ConditionConstants, com.ibm.commerce.condition.Evaluator, com.ibm.commerce.rule.ActionHandler, CampaignConstants, CampaignInitiativeEvaluateCmd, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command


    public class CampaignInitiativeEvaluateCmdImpl
    extends com.ibm.commerce.command.TaskCommandImpl
    implements CampaignInitiativeEvaluateCmd, CampaignConstants, com.ibm.commerce.condition.ConditionConstants
    This class implements the CampaignInitiativeEvaluateCmd interface to provide the task command that evaluates a campaign initiative. Different implementations of this interface can be provided for different stores.
    • Field Detail

      • COMPONENT_MARKETING_EXPERIMENT

        public static final java.lang.String COMPONENT_MARKETING_EXPERIMENT
        The element tag constant in the instance_name.xml file which identifies the marketing experimentation component.
        See Also:
        Constant Field Values
      • COMPONENT_RULE_BASED_DISCOUNT

        public static final java.lang.String COMPONENT_RULE_BASED_DISCOUNT
        The element tag constant in the instance_name.xml file which identifies the rule-based discount component.
        See Also:
        Constant Field Values
      • COMPONENT_TAG

        public static final java.lang.String COMPONENT_TAG
        The element tag constant in the instance.xml to identify tools components.
        See Also:
        Constant Field Values
      • COMPONENT_USER_TRAFFIC_EVENT_LISTENER

        public static final java.lang.String COMPONENT_USER_TRAFFIC_EVENT_LISTENER
        The element tag constant in the instance_name.xml file which identifies the user traffic event listener component.
        See Also:
        Constant Field Values
      • COPYRIGHT

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

        public static final java.lang.String KEY_PREVIEWCONTEXT
        The key string for PreviewContext object.
        See Also:
        Constant Field Values
    • Constructor Detail

      • CampaignInitiativeEvaluateCmdImpl

        public CampaignInitiativeEvaluateCmdImpl()
    • Method Detail

      • evaluate

        public boolean evaluate(java.lang.String name,
                                com.ibm.commerce.condition.OpenCondition.Parameter[] parameters)
        This evaluate method is used to evaluate open conditions using different evaluate methods in this command, or using rule service if it is enabled. This method returns a flag which indicates whether the evaluation of all of the conditions was successful.
        Specified by:
        evaluate in interface com.ibm.commerce.condition.Evaluator
        Parameters:
        name - The name of the condition.
        parameters - The parameters of the condition.
        Returns:
        True if the evaluation is successful; false otherwise.
      • evaluate

        public boolean evaluate(java.lang.String variable,
                                java.lang.String operator,
                                java.lang.String value,
                                com.ibm.commerce.condition.SimpleCondition.Qualifier[] qualifiers)
        This evaluate method is used to evaluate simple conditions. This method returns a flag which indicates whether the evaluation of all of the conditions was successful.
        Specified by:
        evaluate in interface com.ibm.commerce.condition.Evaluator
        Parameters:
        variable - The condition variable, indicates the type of WHICH condition to be evaluated.
        operator - The operator of the condition.
        value - The value of the condition.
        qualifiers - The qualifiers of the condition.
        Returns:
        True if the evaluation is successful; false otherwise.
      • getEMarketingSpotName

        public java.lang.String getEMarketingSpotName()
        Returns the name of the eMarketingSpot that is evaluated by an instance of this command.
        Returns:
        the name of the eMarketingSpot that is evaluated by an instance of this command.
      • getExperimentId

        public java.lang.String getExperimentId()
        This method gets the ID of the experiment associated with the e-Marketing Spot. This method is used to help cache the CampaignInitiativeEvaluateCmd controller command, and the e-Marketing Spot JSP snippet.
        Specified by:
        getExperimentId in interface CampaignInitiativeEvaluateCmd
        Returns:
        The ID of the experiment associated with the e-Marketing Spot. If there is no experiment associated with the e-Marketing Spot, then "NONE" is returned.
      • getMaximumNumberOfAssociateCatalogEntries

        public int getMaximumNumberOfAssociateCatalogEntries()
        Returns the maximum number of associate catalog entries an instance of this command has been configured to return.
        Returns:
        the maximum number of associate catalog entries an instance of this command has been configured to return.
      • getMaximumNumberOfCatalogEntries

        public int getMaximumNumberOfCatalogEntries()
        Returns the maximum number of catalog entries an instance of this command has been configured to return.
        Returns:
        the maximum number of catalog entries an instance of this command has been configured to return.
      • getMaximumNumberOfCategories

        public int getMaximumNumberOfCategories()
        Returns the maximum number of categories an instance of this command has been configured to return.
        Returns:
        the maximum number of categories an instance of this command has been configured to return.
      • getMaximumNumberOfCollateral

        public int getMaximumNumberOfCollateral()
        Returns the maximum number of collateral an instance of this command has been configured to return.
        Returns:
        the maximum number of collateral instance of this command has been configured to return.
      • getMemberGroups

        public java.lang.String getMemberGroups()
        This method gets the member groups to which the user belongs. This method is used for generating the appropriate cache key for the e-Marketing spot.
        Returns:
        This method returns a comma separated string representing the member groups to which the user belongs.
      • getTestElementId

        public java.lang.String getTestElementId()
        This method gets the ID of the test element associated with the experiment running on the e-Marketing Spot. This method is used to help cache the CampaignInitiativeEvaluateCmd controller command, and the e-Marketing Spot JSP snippet.
        Specified by:
        getTestElementId in interface CampaignInitiativeEvaluateCmd
        Returns:
        The ID of the test element associated with the experiment running on the e-Marketing Spot. If there is no experiment associated with the e-Marketing Spot, then "NONE" is returned.
      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        Checks to see if the command is ready to call. This method will returns false if the e-Marketing Spot name is null.
        Overrides:
        isReadyToCallExecute in class com.ibm.commerce.command.AbstractECTargetableCommand
        Returns:
        true if the command is ready to be called.
      • performAction

        public void performAction(com.ibm.commerce.rule.Action action)
        Performs the execution of the command.
        Specified by:
        performAction in interface com.ibm.commerce.rule.ActionHandler
        Parameters:
        action - The type of action to be executed.
      • performExecute

        public void performExecute()
                            throws com.ibm.commerce.exception.ECException
        Performs the execution of the command.
        Specified by:
        performExecute in interface com.ibm.commerce.command.ECCommand
        Overrides:
        performExecute in class com.ibm.commerce.command.AbstractECTargetableCommand
        Throws:
        com.ibm.commerce.exception.ECException
        See Also:
        ECCommand#performExecute()
      • refreshCommandContext

        public void refreshCommandContext(com.ibm.commerce.command.CommandContext commandContext)
        This method must be called immediately after a call to execute() when campaign caching is enabled. Failure to call this method after a call to execute() will result in NullPointerException problems when this command is cached.
        Specified by:
        refreshCommandContext in interface CampaignInitiativeEvaluateCmd
        Parameters:
        commandContext - A CommandContext to reset on the command. This will normally be the same CommandContext that was set before a call to execute().
      • setCurrentCatalogId

        public void setCurrentCatalogId(java.lang.Long currentCatalogId)
        Sets the ID of the catalog that the customer is currently viewing. If this is not set, then the system assumes that the master catalog of the current store is in use.
        Specified by:
        setCurrentCatalogId in interface CampaignInitiativeEvaluateCmd
        Parameters:
        currentCatalogId - The ID of the catalog that the customer is currently viewing.
      • setEMarketingSpotName

        public void setEMarketingSpotName(java.lang.String eMarketingSpotName)
        Sets the name of the e-Marketing Spot.
        Specified by:
        setEMarketingSpotName in interface CampaignInitiativeEvaluateCmd
        Parameters:
        eMarketingSpotName - The name of the e-Marketing Spot.
      • setExperimentId

        public void setExperimentId(java.lang.String expId)
        This method sets the ID of the experiment associated with the e-Marketing Spot. This method is used to help cache the CampaignInitiativeEvaluateCmd controller command, and the e-Marketing Spot JSP snippet.
        Specified by:
        setExperimentId in interface CampaignInitiativeEvaluateCmd
        Parameters:
        expId - The ID of the experiment associated with the e-Marketing Spot. This is determined by the CampaignsFilter.
      • setMaximumNumberOfAssociateCatalogEntries

        public void setMaximumNumberOfAssociateCatalogEntries(int maximumNumberOfAssociateCatalogEntries)
        Sets the maximum number of associated catalog entries can be displayed in an e-Marketing Spot.
        Specified by:
        setMaximumNumberOfAssociateCatalogEntries in interface CampaignInitiativeEvaluateCmd
        Parameters:
        maximumNumberOfAssociateCatalogEntries - The maximum number of associated catalog entries that can be displayed in an e-Marketing Spot.
      • setMaximumNumberOfCatalogEntries

        public void setMaximumNumberOfCatalogEntries(int maximumNumberOfCatalogEntries)
        Sets the maximum number of catalog entries can be displayed in an e-Marketing Spot.
        Specified by:
        setMaximumNumberOfCatalogEntries in interface CampaignInitiativeEvaluateCmd
        Parameters:
        maximumNumberOfCatalogEntries - The maximum number of catalog entries can be displayed in an e-Marketing Spot.
      • setMaximumNumberOfCategories

        public void setMaximumNumberOfCategories(int maximumNumberOfCategories)
        Sets the maximum number of categories can be displayed in an e-Marketing Spot.
        Specified by:
        setMaximumNumberOfCategories in interface CampaignInitiativeEvaluateCmd
        Parameters:
        maximumNumberOfCategories - The maximum number of categories can be displayed in an e-Marketing Spot.
      • setMaximumNumberOfCollateral

        public void setMaximumNumberOfCollateral(int maximumNumberOfCollateral)
        Sets the maximum number of ad copies can be displayed in an e-Marketing Spot.
        Specified by:
        setMaximumNumberOfCollateral in interface CampaignInitiativeEvaluateCmd
        Parameters:
        maximumNumberOfCollateral - The maximum number of ad copies can be displayed in an e-Marketing Spot.
      • setResultFilter

        public void setResultFilter(java.util.Vector resultFilter)
        Sets the flags that indicate which result filter needs to be turned off. By default, all result filters are turned on.
        Specified by:
        setResultFilter in interface CampaignInitiativeEvaluateCmd
        Parameters:
        resultFilter - A vector of flags which indicate which result filter needs to be turned off.
      • setResultOrder

        public void setResultOrder(int resultOrder)
        Sets the flag that indicates the ordering logic to be applied to the results by the evaluate command. By default, the result order will be randomized.
        Specified by:
        setResultOrder in interface CampaignInitiativeEvaluateCmd
        Parameters:
        resultOrder - Result ordering flag.
      • setSourceCatalogEntryIds

        public void setSourceCatalogEntryIds(java.util.Vector sourceCatalogEntryIds)
        Sets the list of source catalog entry IDs.
        Specified by:
        setSourceCatalogEntryIds in interface CampaignInitiativeEvaluateCmd
        Parameters:
        sourceCatalogEntryIds - The list of source catalog entry IDs in a vector object.
      • setSourceCatalogGroupIds

        public void setSourceCatalogGroupIds(java.util.Vector sourceCatalogGroupIds)
        Sets the list of source catalog group IDs.
        Specified by:
        setSourceCatalogGroupIds in interface CampaignInitiativeEvaluateCmd
        Parameters:
        sourceCatalogGroupIds - The list of source catalog group IDs in a vector object.
      • setTestElementId

        public void setTestElementId(java.lang.String testElemId)
        This method sets the ID of the test element associated with the experiment running on the e-Marketing Spot. This method is used to help cache the CampaignInitiativeEvaluateCmd controller command, and the e-Marketing Spot JSP snippet.
        Specified by:
        setTestElementId in interface CampaignInitiativeEvaluateCmd
        Parameters:
        testElemId - The ID of the test element associated with the experiment running on the e-Marketing Spot. If the test element is not yet determined, then do not call this method, or set the value to null.