com.ibm.commerce.tools.catalog.commands

Class AttributeCreateControllerCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, AttributeCreateControllerCmd, 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 AttributeCreateControllerCmdImpl
    extends ToolsControllerCommandImpl
    implements AttributeCreateControllerCmd
    This is the default implementation of the interface AttributeCreateControllerCmd. This tool controller command creates attributes and attribute values associated to a catalog entry of type ProductBean as returned by the defining attribute create dialog. This command is used by the user interface dialog in the tooling used to create 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=ADD, 
                            name=definingAttribute1_french, 
                            type=STRING, 
                            description=definingAttribute1_french_description, 
                            attributeValues=[
                            {
                                    status=ADD, 
                                    value=valeur1, 
                                    image=/image/valeur1, 
                                    sequence=1, 
                                    id=-1
                            }, 
                            {
                                    status=ADD, 
                                    value=valeur2, 
                                    image=image/valeur2, 
                                    sequence=2, 
                                    id=-2
                            }, 
                            {
                                    status=ADD, 
                                    value=valeur3, 
                                    image=/image/valeur3, 
                                    sequence=3, 
                                    id=-3
                            }], 
                            id=-1
                    }, 
                    
            XMLFile=catalog.attributeDetailCreateDialog, 
            productrfnbr=14751, 
            en_US=
                    {
                            status=ADD, 
                            name=definingAttribute1_required, 
                            type=STRING, 
                            description=definingAttribute1_description, 
                            attributeValues=[
                            {
                                    status=ADD, 
                                    value=value1, 
                                    image=/image/value1, 
                                    sequence=1, 
                                    id=-1
                            }, 
                            {
                                status=ADD, 
                                    value=value2, 
                                    image=/image/value2, 
                                    sequence=2, 
                                    id=-2
                            }, 
                            {
                                    status=ADD, 
                                    value=value3, 
                                    image=/image/value3, 
                                    sequence=3, 
                                    id=-3
                            }], 
                            id=-1
                    }, 
            isNewAttribute=true
    }
     
    See Also:
    Serialized Form
    • Constructor Detail

      • AttributeCreateControllerCmdImpl

        public AttributeCreateControllerCmdImpl()
    • 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.
        Throws:
        ECException
      • 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 creation fails.
      • performExecute

        public void performExecute()
                            throws ECException
        Create 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. This method checks if the hashtable representation is not null.
        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 cannot be found or 2) ProductAttributeForAllLanguagesDataBean cannot be populated or 3) the XML string is null or 4) an exception was thrown when creating the attributes.