com.ibm.commerce.tools.catalog.commands

Class AttributeUpdateControllerCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, AttributeUpdateControllerCmd, ToolsControllerCommand, 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 AttributeUpdateControllerCmdImpl
    extends ToolsControllerCommandImpl
    implements AttributeUpdateControllerCmd
    This is the default implementation of the interface AttributeUpdateControllerCmd. This tool controller command updates attributes and attribute values associated to a catalog entry of type ProductBean as returned by the defining attribute update dialog. This class is not a primary customization point, and it is recommended that customization occurs at the controller and task command level.
    This command is used by the user interface dialog in the tooling used to update defining attributes and the associated set of values for a product.
    A sample of the hashtable (string representation) used by this command is as follows:
    {
                                    
    fr_FR=
            {                               
                    status=STATIC           
                    name=definingAttribute1_french
                    type=STRING
                    description=definingAttribute1_french_description
                    attributeValues=
                    [
                            {
                                    status=STATIC
                                    original=valeur1
                                    value=valeur1
                                    image=/image/valeur1
                                    sequence=1
                                    id=13901
                            }
                            
                            {
                                    status=STATIC
                                    original=valeur2
                                    value=valeur2
                                    image=image/valeur2
                                    sequence=2
                                    id=13902
                            }
                                                                                            
                            {
                                    status=STATIC
                                    original=valeur3
                                    value=valeur3
                                    image=/image/valeur3
                                    sequence=3
                                    id=13903
                            }
                            
                            {
                                    status=ADD
                                    value=valeur0
                                    image=/image/valeur0
                                    sequence=4
                                    id=-1
                            }
                    ]
                                    id=11451
            }
            XMLFile=catalog.attributeDetailDialog
            productrfnbr=14751
            en_US=
                    {
                            status=UPDATE
                            name=definingAttribute1_required_updated
                            type=STRING
                            description=definingAttribute1_description_updated
                            attributeValues=
                            [
                                    {
                                            status=ADD
                                            value=value0
                                            image=/image/value0
                                            sequence=1
                                            id=-1
                                    }
                                                                                            
                                    {
                                            status=UPDATE
                                            original=value1
                                            value=value1
                                            image=/image/value1
                                            sequence=2
                                            id=13901
                                    }
                                                                            
                                    {
                                            status=UPDATE
                                            original=value2
                                            value=value2
                                            image=/image/value2
                                            sequence=3
                                            id=13902
                                    }
                                                                            
                                    {
                                            status=UPDATE
                                            original=value3
                                            value=value3
                                            image=/image/value3
                                            sequence=4
                                            id=13903
                                    }
                            ]
                            id=11451
            }
    attributeId=11451
    isNewAttribute=false
    }
     
    Access Beans:
    • Store, CatalogEntryRelation
    Task Commands: none
    Controller Commands: AttributeValueAdd, AttributeValueDelete, AttributeValueUpdate
    See Also:
    Serialized Form
    • Constructor Detail

      • AttributeUpdateControllerCmdImpl

        public AttributeUpdateControllerCmdImpl()
    • Method Detail

      • attributeValueCreate

        public java.lang.Long attributeValueCreate(java.lang.Long attributeId,
                                                   com.ibm.commerce.tools.catalog.beans.ProductAttributeValue avalueDB)
                                            throws ECException
        Create the attribute values for the specified attribute id. The attribute values are contained in the ProductAttributeValue bean. Since these are defining attributes values for a ProductBean, the catalog entry id used is 0. This method calls the command AttributeValueAddCmd.
        Parameters:
        attributeId - The attribute ID.
        avalueDB - The ProductAttributeValue bean.
        Returns:
        The attribute value ID created.
        Throws:
        ECException - if the attribute value creation failed.
      • attributeValueDelete

        public void attributeValueDelete(java.lang.Long attributeId,
                                         com.ibm.commerce.tools.catalog.beans.ProductAttributeValue avalueDB)
                                  throws ECException
        Delete the attribute values for the specified attribute id. The attribute values are contained in the ProductAttributeValue bean. Since these are defining attributes values for a ProductBean, the catalog entry id used is 0. This method calls the command AttributeValueDeleteCmd.
        Parameters:
        attributeId - The attribute ID.
        avalueDB - The ProductAttributeValue bean.
        Throws:
        ECException - if the attribute value deletion fails.
      • attributeValueUpdate

        public void attributeValueUpdate(java.lang.Long attributeId,
                                         com.ibm.commerce.tools.catalog.beans.ProductAttributeValue avalueDB)
                                  throws ECException
        Update the attribute values for the specified attribute id. The attribute values are contained in the ProductAttributeValue bean. Since these are defining attributes values for a ProductBean, the catalog entry id used is 0. This method calls the command AttributeValueUpdateCmd.
        Parameters:
        attributeId - The attribute ID.
        avalueDB - The ProductAttributeValue bean.
        Throws:
        ECException - if the attribute value update fails.
      • performExecute

        public void performExecute()
                            throws ECException
        Update a defining attribute and its values for a product. Depending on the XML string received, the defining attribute and its value will be created in one or more languages.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException - if 1) the resource properties is not found or 2) the ProductAttributeForAllLanguagesDataBean cannot be populated or 3) the XML string is null or 4) a duplicate key exception occurs or 5) a resource locked exception occurs or 6) an exception occurs when updating the attribute.