com.ibm.commerce.marketing.commands.marketingspot

Class RetrieveCatalogEntryTaskCmdImpl

  • All Implemented Interfaces:
    MarketingSpotCommandBaseTaskCmd, RetrieveCatalogEntryTaskCmd, 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 RetrieveCatalogEntryTaskCmdImpl
    extends MarketingSpotCommandBaseTaskCmdImpl
    implements RetrieveCatalogEntryTaskCmd, com.ibm.websphere.cache.Sizeable
    This command populates data objects for the specified catalog entries. When a marketing activity says "Recommend product SKU FULO-01", then the corresponding catentry_id 123456 is stored in the marketing rule. When the e-Marketing Spot calls the GetMarketingSpotData service, the command RetrieveCatalogEntryTaskCmd is called to load the product data. The following CatalogEntry web service is called: /CatalogEntry[CatalogEntryIdentifier[(UniqueID=)] and Description[Attributes[published=1]]]. The access profile is specified in wc-admin-component.xml under catalogEntryAccessProfile. If you want to return different catalog entry 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 CatalogEntry SDO is then returned to the eMarketing Spot JSP snippet (wrapped in a MarketingSpotActivityCatalogEntryDataType SDO).
    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
    • Constructor Detail

      • RetrieveCatalogEntryTaskCmdImpl

        public RetrieveCatalogEntryTaskCmdImpl()
        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.
      • getCatalogEntrySDOObjects

        public java.util.List getCatalogEntrySDOObjects()
        This method returns a list of catalog entry objects (MarketingSpotActivityCatalogEntryDataType) that are being populated in this command.
        Specified by:
        getCatalogEntrySDOObjects in interface RetrieveCatalogEntryTaskCmd
        Returns:
        A list of catalog entry objects (MarketingSpotActivityCatalogEntryDataType).
      • getCatalogEntryObjects

        public byte[][] getCatalogEntryObjects()
        This method returns a byte array of serialized catalog entry objects (MarketingSpotActivityCatalogEntryDataType) that are being populated in this command.
        Specified by:
        getCatalogEntryObjects in interface RetrieveCatalogEntryTaskCmd
        Returns:
        A byte array of serialized catalog entry objects (MarketingSpotActivityCatalogEntryDataType).
      • 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 IDs of catalog entry set as the parameter, and uses them to populate the data objects for the catalog entries.
        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 RetrieveCatalogEntryTaskCmd
        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.