com.ibm.commerce.marketing.commands.marketingspot

Class RetrieveCategoryTaskCmdImpl

  • All Implemented Interfaces:
    MarketingSpotCommandBaseTaskCmd, RetrieveCategoryTaskCmd, 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 RetrieveCategoryTaskCmdImpl
    extends MarketingSpotCommandBaseTaskCmdImpl
    implements RetrieveCategoryTaskCmd, com.ibm.websphere.cache.Sizeable
    This command populates data objects for the specified categories. When a marketing activity says "Recommend category Furniture", then the corresponding catgroup_id 123456 is stored in the marketing rule. When the e-Marketing Spot calls the GetMarketingSpotData service, the command RetrieveCategoryTaskCmd is called to load the category data. The following CatalogGroup web service is called: /CatalogGroup[CatalogGroupIdentifier[(UniqueID=)] and Description[Attributes[published=1]]]. The access profile is specified in wc-admin-component.xml under categoryAccessProfile. If you want to return different catalog group 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 CatalogGroup SDO is then returned to the eMarketing Spot JSP snippet (wrapped in a MarketingSpotActivityCatalogGroupDataType 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

      • RetrieveCategoryTaskCmdImpl

        public RetrieveCategoryTaskCmdImpl()
        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 RetrieveCategoryTaskCmd
        Returns:
        The data beans containing the results that the e-Marketing Spot displays.
      • getCategorySDOObjects

        public java.util.List getCategorySDOObjects()
        This method returns a list of category objects (MarketingSpotActivityCatalogGroupDataType) that are being populated in this command.
        Specified by:
        getCategorySDOObjects in interface RetrieveCategoryTaskCmd
        Returns:
        A list of category objects (MarketingSpotActivityCatalogGroupDataType).
      • getCategoryObjects

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