com.ibm.commerce.marketing.commands.marketingspot

Class RetrieveContentTaskCmdImpl

  • All Implemented Interfaces:
    MarketingSpotCommandBaseTaskCmd, RetrieveContentTaskCmd, 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 RetrieveContentTaskCmdImpl
    extends MarketingSpotCommandBaseTaskCmdImpl
    implements RetrieveContentTaskCmd, com.ibm.websphere.cache.Sizeable
    This command populates data objects for the specified marketing content. When a marketing activity says "Recommend marketing content Free Shipping Ad", then the corresponding collateral_id 123456 is stored in the marketing rule. When the e-Marketing Spot calls the GetMarketingSpotData service, the command RetrieveContentTaskCmd is called to load the marketing content data. The following MarketingContent web service is called: /MarketingContent[MarketingContentIdentifier[(UniqueID=)]]. The access profile is specified in wc-admin-component.xml under marketingContentAccessProfile. If you want to return different marketing content data to the e-Marketing Spot, then create the file wc-admin-component.xml under the com.ibm.commerce.marketing-ext directory and specify the applicable access profile. The MarketingContent SDO is then returned to the eMarketing Spot JSP snippet (wrapped in a MarketingSpotActivityMarketingContentDataType SDO).
    See Also:
    Serialized Form
    • Field Detail

      • SHORT_COPYRIGHT

        public static final java.lang.String SHORT_COPYRIGHT

        The short version of the WebSphere Commerce copyright statement.

        (c) Copyright International Business Machines Corporation 1996,2008
        See Also:
        Constant Field Values
      • 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
    • Constructor Detail

      • RetrieveContentTaskCmdImpl

        public RetrieveContentTaskCmdImpl()
        Default constructor for this command.
    • Method Detail

      • getObjectSize

        public long getObjectSize()
        Returns the estimated footprint size in bytes of this object and the objects it contains.
        Specified by:
        getObjectSize in interface com.ibm.websphere.cache.Sizeable
        Overrides:
        getObjectSize in class MarketingSpotCommandBaseTaskCmdImpl
        Returns:
        the estimated footprint size in bytes or -1 if a size cannot be determined.
      • getResultDataBeans

        public EMarketingSpotDataBean[] getResultDataBeans()
        This method sets the data beans containing the results that the e-Marketing Spot displays.
        Specified by:
        getResultDataBeans in interface RetrieveContentTaskCmd
        Returns:
        The data beans containing the results that the e-Marketing Spot displays.
      • getMarketingContentSDOObjects

        public java.util.List getMarketingContentSDOObjects()
        This method returns a list of marketing content objects (MarketingSpotActivityMarketingContentDataType) that are being populated in this command.
        Specified by:
        getMarketingContentSDOObjects in interface RetrieveContentTaskCmd
        Returns:
        A list of marketing content objects (MarketingSpotActivityMarketingContentDataType).
      • getMarketingContentObjects

        public byte[][] getMarketingContentObjects()
        This method returns a byte array of serialized marketing content objects (MarketingSpotActivityMarketingContentDataType) that are being populated in this command.
        Specified by:
        getMarketingContentObjects in interface RetrieveContentTaskCmd
        Returns:
        A byte array of serialized marketing content objects (MarketingSpotActivityMarketingContentDataType).
      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        This method checks if this command is ready to be executed or not.
        Specified by:
        isReadyToCallExecute in interface com.ibm.websphere.command.Command
        Overrides:
        isReadyToCallExecute in class MarketingSpotCommandBaseTaskCmdImpl
        Returns:
        True if this command is ready to be executed; false otherwise.
      • reset

        public void reset()
        Re-initializes the command for re-execution. Call this method before preparing it for re-execution (for example, by setting its properties).
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class MarketingSpotCommandBaseTaskCmdImpl
        See Also:
        Command.reset()
      • performExecute

        public void performExecute()
                            throws java.lang.Exception
        This method performs all the logic that needs to be executed in this command. It takes the ID of the marketing content set as the parameter, and uses it to populate the data object for that marketing content.
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class MarketingSpotCommandBaseTaskCmdImpl
        Throws:
        java.lang.Exception
        See Also:
        TargetableCommand.performExecute()
      • postExecute

        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.

        Specified by:
        postExecute in interface com.ibm.websphere.command.CacheableCommand
        Overrides:
        postExecute in class MarketingSpotCommandBaseTaskCmdImpl
        See Also:
        CacheableCommand.postExecute()
      • setOutputProperties

        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.

        Specified by:
        setOutputProperties in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        setOutputProperties in class MarketingSpotCommandBaseTaskCmdImpl
        See Also:
        TargetableCommand.setOutputProperties(com.ibm.websphere.command.TargetableCommand)
      • setResultDataBeans

        public void setResultDataBeans(EMarketingSpotDataBean[] resultDataBeans)
        This method sets the data beans containing the results that the e-Marketing Spot displays.
        Specified by:
        setResultDataBeans in interface RetrieveContentTaskCmd
        Parameters:
        resultDataBeans - The data beans containing the results that the e-Marketing Spot displays.
      • getCacheKey

        public java.lang.String[] getCacheKey()
        This method generates a key to enable command caching.
        Returns:
        This method returns a key to enable command caching.
      • getMarketingContent

        public MarketingContentType getMarketingContent(java.lang.String marketingContentId)
                                                 throws java.lang.Exception
        This method gets the marketing content specified by the marketing content ID. If a description cannot be found in the language in the current context, then the alternate languages for the store are checked for the marketing content description.
        Parameters:
        marketingContentId - The ID of the marketing content to load from the database.
        Returns:
        This method returns the marketing content SDO business object.
        Throws:
        java.lang.Exception
      • replaceUrlParameters

        public java.lang.String replaceUrlParameters(java.lang.String currentUrl,
                                                     java.lang.String promotionId)
        This method gets the URL link to associated with the content. Any substitute parameters will be replaced.
        Parameters:
        currentUrl - The current URL link.
        promotionId - The promotion Id
        Returns:
        This method returns the modified URL link.
      • setMarketingSpotIdAndContentType

        public void setMarketingSpotIdAndContentType(java.lang.Integer newEmsId,
                                                     boolean newTitleContent)
        This method sets the e-Marketing Spot ID and content type associated with the content being loaded.
        Specified by:
        setMarketingSpotIdAndContentType in interface RetrieveContentTaskCmd
        Parameters:
        newEmsId - The e-Marketing Spot ID associated with the content being loaded.
        newTitleContent - True if the content is associated with an e-Marketing Spot title.