com.ibm.commerce.catalogmanagement.commands

Class ProductAttributeAddCmdImpl

  • All Implemented Interfaces:
    ProductAttributeAddCmd, AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, 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 ProductAttributeAddCmdImpl
    extends ControllerCommandImpl
    implements ProductAttributeAddCmd
    The ProductAttributeAddCmd is a URL and controller command that:
    • Adds a new product attribute to an existing catalog entry (Product) at the store default language.
    • Adds the product attribute to an existing catalog entry (Product) at a language other than the store default language. Product attribute at the store default language must exists before the attribute can be created at the secondary language.
    • By default, setDeleteItems is set to true, in which all items associated with the Product that the new attribute is creating to, will be deleted. Creating an existing on a secondary language will not delete the items.
    Parameters:
    • Unique index of the ATTRIBUTE table must be specified. Most fields in the ATTRIBUTE table except for Market Place Edition related columns and IBM internal use columns. A new attribute ID will be returned at the end of successfully calling the command.
    • Attribute ID and Language ID should be supplied. Most fields in the ATTRIBUTE table except for Market Place Edition related columns and IBM internal use columns.
    • By default, setDeleteItem is set to true.
    Access Beans: AttributeAccessBean
    Task Commands: AddAttributeCmd
    Other Controller Commands: None.
    Mandatory Parameters: catentryId, name, attrtypeId.
    Additional Parameters: None.
    Optional Parameters: desc, desc2, field1, descLangId, seq, usage, URL.
    Default Value: descLanguageId = langauge ID from the command context.
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

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

        public static final java.lang.String CLASSNAME
        The name of this interface is "com.ibm.commerce.catalogmanagement.commands.ProductAttributeAddCmdImpl".
        See Also:
        Constant Field Values
    • Constructor Detail

      • ProductAttributeAddCmdImpl

        public ProductAttributeAddCmdImpl()
    • Method Detail

      • getAttrLangId

        public java.lang.Integer getAttrLangId()
        Get the attribute language Id
        Returns:
        java.lang.Integer
      • getAttrtypeId

        public java.lang.String getAttrtypeId()
        Get the attribute type Id Attribute types included: 1. String 2. Integer 3. Float
        Returns:
        java.lang.String
      • getDescription

        public java.lang.String getDescription()
        Get the description of the attribute
        Returns:
        java.lang.String
      • getDescription2

        public java.lang.String getDescription2()
        Get the second description of the attribute
        Returns:
        java.lang.String
      • getField1

        public java.lang.String getField1()
        Get field 1 of the attribute
        Returns:
        java.lang.String
      • getName

        public java.lang.String getName()
        Get the attribute name
        Specified by:
        getName in interface ProductAttributeAddCmd
        Returns:
        java.lang.String
      • getOID

        public java.lang.String getOID()
        Get the object identifier of the attribute
        Returns:
        java.lang.String
      • getSequence

        public java.lang.Double getSequence()
        Get the sequence number
        Returns:
        java.lang.Double
      • getURL

        public java.lang.String getURL()
        Get the redirect URL
        Returns:
        java.lang.String
      • getUsage

        public java.lang.String getUsage()
        Get the usage of the attribute 1 .NULL or "1" indicates SKU-resolution. 2. "2" indicates a descriptive attribute and should not be used to resolve SKUs.
        Returns:
        java.lang.String
      • performExecute

        public void performExecute()
                            throws ECException
        The main program for ProductAttributeAdd command. This method calls the AddAttributeCmd task command, and then sets the attribute ID, attribute type ID, and sequence in the response properties.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
      • reset

        public void reset()
        This method reset all the variables used in ProductAttributeAdd command
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
      • setAttributeId

        public void setAttributeId(java.lang.Long anAttributeId)
        Set the attribute Id
        Specified by:
        setAttributeId in interface ProductAttributeAddCmd
        Parameters:
        anAttributeId - java.lang.Long
      • setAttrLangId

        public void setAttrLangId(java.lang.Integer anAttrLangId)
        Set the language Id of the attribute
        Specified by:
        setAttrLangId in interface ProductAttributeAddCmd
        Parameters:
        anAttrLangId - java.lang.Integer
      • setAttrtypeId

        public void setAttrtypeId(java.lang.String astrAttrtypeId)
        Set the attribute type Id Attribute types included: 1. String 2. Integer 3. Float
        Specified by:
        setAttrtypeId in interface ProductAttributeAddCmd
        Parameters:
        astrAttrtypeId - java.lang.String
      • setCatentryId

        public void setCatentryId(java.lang.Long anCatentryId)
        Set the catalog entry Id
        Specified by:
        setCatentryId in interface ProductAttributeAddCmd
        Parameters:
        anCatentryId - java.lang.Long
      • setDeleteItems

        public void setDeleteItems(java.lang.Boolean abDeleteItems)
        Set whether or not to delete the items when creating the attribute By default, it is set to true
        Specified by:
        setDeleteItems in interface ProductAttributeAddCmd
        Parameters:
        abDeleteItems - java.lang.Boolean
      • setDescription

        public void setDescription(java.lang.String astrDescription)
        Set the description of the attribute
        Specified by:
        setDescription in interface ProductAttributeAddCmd
        Parameters:
        astrDescription - java.lang.String
      • setDescription2

        public void setDescription2(java.lang.String astrDescription2)
        Set the second description of the attribute
        Specified by:
        setDescription2 in interface ProductAttributeAddCmd
        Parameters:
        astrDescription2 - java.lang.String
      • setField1

        public void setField1(java.lang.String astrField1)
        Set field 1 of the attribute
        Specified by:
        setField1 in interface ProductAttributeAddCmd
        Parameters:
        astrField1 - java.lang.String
      • setName

        public void setName(java.lang.String astrName)
        Set the attribute name
        Specified by:
        setName in interface ProductAttributeAddCmd
        Parameters:
        astrName - java.lang.String
      • setOID

        public void setOID(java.lang.String astrOID)
        Set the object identifier of the attribute
        Specified by:
        setOID in interface ProductAttributeAddCmd
        Parameters:
        astrOID - java.lang.String
      • setSequence

        public void setSequence(java.lang.Double anSequence)
        Set the sequence number
        Specified by:
        setSequence in interface ProductAttributeAddCmd
        Parameters:
        anSequence - java.lang.Double
      • setURL

        public void setURL(java.lang.String astrURL)
        Set a redirect URL
        Specified by:
        setURL in interface ProductAttributeAddCmd
        Parameters:
        astrURL - java.lang.String
      • setUsage

        public void setUsage(java.lang.String astrUsage)
        Set the usage of the attribute 1 .NULL or "1" indicates SKU-resolution. 2. "2" indicates a descriptive attribute and should not be used to resolve SKUs.
        Specified by:
        setUsage in interface ProductAttributeAddCmd
        Parameters:
        astrUsage - java.lang.String