com.ibm.commerce.catalogmanagement.commands

Class AttributeValueUpdateCmdImpl

  • All Implemented Interfaces:
    AttributeValueUpdateCmd, 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 AttributeValueUpdateCmdImpl
    extends ControllerCommandImpl
    implements AttributeValueUpdateCmd
    The AttributeValueUpdateCmd is a URL and controller command that updates an existing attribute value.
    Note that a parent attribute value is an attribute value with a store default language ID. A child attribute value is an attribute value with a language ID other than the store default language ID. A product attribute value is an attribute value where the catalog entry ID = 0. An item attribute value is an attribute value where the catalog entry ID = the catalog entry ID of an item.
    As a controller command, the caller can use the setProductAttributeValue(value) to find the parent product attribute value ID. For example, the command will find the attribute value ID with the specified attribute ID, catalog entry ID = 0, language ID = store default language ID, and value of the attribute value. The attribute value ID will be assigned and passed back into the command. This option is not available to the URL command.
    • Update a parent product attribute value. All the item attribute values will be updated. The item attribute values will have the same attribute ID, language ID, and attribute values (depending on the attribute value type, the value can be string, float, or integer) as the parent product attribute value.
    • Update a parent item attribute value:
      • If the parent item attribute value does not exist, it will be created.
      • If the parent item attribute value exists, then:
        • If the unique index is being updated:
          • Recreate the attribute value, use the new key (attribute value ID), and create the rest of the attribute values in other supported languages. Then delete the old attribute value of all languages. A common case is changing the existing attribute value of an item from "Red" to another existing attribute value such as "Blue". The command will change the attribute value in all languages (from "fr_Red" to "fr_Blue").
        • If the unique index is not being changed:
          • Update the item attribute value (such as the noncritical fields).
    • Update a child product attribute value:
      • If the child product attribute value does not exist, it will be created.
      • If the child product attribute value exists, then update it. All the changes will be reflected in the child item attribute value.
    • Update a child item attribute value:
      • If the child item attribute value does not exists, it will be created.
      • If the child item attribute value exists:
        • If the parent item attribute value does not exists, it will be created.
    Parameters:
    • Most fields in the ATTRVALUE table except for Market Place Edition related columns and IBM internal use columns.
    Tables:
    • AttributeValue
    Task Commands: UpdateAttributeValueCmd
    Other Controller Commands: None
    Mandatory Parameters: attrvalueId, or attributeId + catentryId + name
    Additional Parameters: none
    Optional Parameters: field1, field2, field3, image1, image2, seq, value (or floatValue, integerValue, stringValue), descLangId, URL
    Default Value: descLangId = language ID from command contact. name = value
    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.AttributeValueUpdateCmdImpl".
        See Also:
        Constant Field Values
    • Constructor Detail

      • AttributeValueUpdateCmdImpl

        public AttributeValueUpdateCmdImpl()
    • Method Detail

      • getDescLanguage

        public java.lang.Integer getDescLanguage()
        Get the description language
        Returns:
        java.lang.Integer
      • getField1

        public java.lang.Integer getField1()
        Get field 1 of the attribute value
        Returns:
        java.lang.Integer
      • getField2

        public java.lang.String getField2()
        Get field 2 of the attribute value
        Returns:
        java.lang.String
      • getField3

        public java.lang.String getField3()
        Get field 3 of the attribute value
        Returns:
        java.lang.String
      • getFloatvalue

        public java.lang.Double getFloatvalue()
        Get the float value of the attribute value
        Returns:
        java.lang.Double
      • getImage1

        public java.lang.String getImage1()
        Get image 1 of the attribute value
        Returns:
        java.lang.String
      • getImage2

        public java.lang.String getImage2()
        Get image 2 of the attribute value
        Returns:
        java.lang.String
      • getIntegervalue

        public java.lang.Integer getIntegervalue()
        Get the integer value of the attribute value
        Returns:
        java.lang.Integer
      • getName

        public java.lang.String getName()
        Get the attribute value name
        Returns:
        java.lang.String
      • getOID

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

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

        public java.lang.String getStringvalue()
        Get the string value of the attribute value
        Returns:
        java.lang.String
      • getURL

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

        public java.lang.String getValue()
        Get value of the attribute value If value is get, then there is no need to use getFloatvalue, getIntegervalue, getStringvalue. Depending on what attribute type the attribute value is, the value will set the corresponding type.
        Returns:
        java.lang.String
      • performExecute

        public void performExecute()
                            throws ECException
        The main program for AttributeValueUpdate command. This method calls the UpdateAttributeValueCmd task command and then sets attribute value ID, attribute ID, catalog entry ID, and description language 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 AttributeValueUpdate 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 AttributeValueUpdateCmd
        Parameters:
        anAttributeId - java.lang.Long
      • setAttrvalueId

        public void setAttrvalueId(java.lang.Long anAttrvalueId)
        Set the attribute value Id
        Specified by:
        setAttrvalueId in interface AttributeValueUpdateCmd
        Parameters:
        anAttrvalueId - java.lang.Long
      • setCatentryId

        public void setCatentryId(java.lang.Long anCatentryId)
        Set a catalog entry Id
        Specified by:
        setCatentryId in interface AttributeValueUpdateCmd
        Parameters:
        anCatentryId - java.lang.Long
      • setDescLanguage

        public void setDescLanguage(java.lang.Integer anDescLanguage)
        Set language Id of the attribute value
        Specified by:
        setDescLanguage in interface AttributeValueUpdateCmd
        Parameters:
        anDescLanguage - java.lang.Integer
      • setField1

        public void setField1(java.lang.Integer anField1)
        Set field 1 of the attribute value
        Specified by:
        setField1 in interface AttributeValueUpdateCmd
        Parameters:
        anField1 - java.lang.Integer
      • setField2

        public void setField2(java.lang.String astrField2)
        Set field 2 of the attribute value
        Specified by:
        setField2 in interface AttributeValueUpdateCmd
        Parameters:
        astrField2 - java.lang.String
      • setField3

        public void setField3(java.lang.String astrField3)
        Set field 3 of the attribute value
        Specified by:
        setField3 in interface AttributeValueUpdateCmd
        Parameters:
        astrField3 - java.lang.String
      • setFloatvalue

        public void setFloatvalue(java.lang.Double adFloatvalue)
        Set the float value of the attribute value
        Specified by:
        setFloatvalue in interface AttributeValueUpdateCmd
        Parameters:
        adFloatvalue - java.lang.Double
      • setImage1

        public void setImage1(java.lang.String astrImage1)
        Set image 1 of the attribute value
        Specified by:
        setImage1 in interface AttributeValueUpdateCmd
        Parameters:
        astrImage1 - java.lang.String
      • setImage2

        public void setImage2(java.lang.String astrImage2)
        Set image 2 of the attribute value
        Specified by:
        setImage2 in interface AttributeValueUpdateCmd
        Parameters:
        astrImage2 - java.lang.String
      • setIntegervalue

        public void setIntegervalue(java.lang.Integer anIntegervalue)
        Set the integer value of the attribute value
        Specified by:
        setIntegervalue in interface AttributeValueUpdateCmd
        Parameters:
        anIntegervalue - java.lang.Integer
      • setName

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

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

        public void setProductAttributeValue(java.lang.String astrProductAttributeValue)
        Set the value of the product attribute value It is used to determine the attribute value ID if it is not given by the user.
        Specified by:
        setProductAttributeValue in interface AttributeValueUpdateCmd
        Parameters:
        astrProductAttributeValue - java.lang.String
      • setSequence

        public void setSequence(java.lang.Double adSequence)
        Set the sequence number
        Specified by:
        setSequence in interface AttributeValueUpdateCmd
        Parameters:
        adSequence - java.lang.Double
      • setStringvalue

        public void setStringvalue(java.lang.String astrStringvalue)
        Set the string value of the attribute value
        Specified by:
        setStringvalue in interface AttributeValueUpdateCmd
        Parameters:
        astrStringvalue - java.lang.String
      • setURL

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

        public void setValue(java.lang.String astrValue)
        Set the value of the attribute value. If value is set, then there is no need to use setFloatvalue, setIntegervalue, setStringvalue. Depending on what attribute type the attribute value is, the value will set the corresponding type.
        Specified by:
        setValue in interface AttributeValueUpdateCmd
        Parameters:
        astrValue - java.lang.String