com.ibm.commerce.tools.catalog.commands

Class ProductPricingControllerCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, ECConstants, ProductPricingControllerCmd, ToolsControllerCommand, ECToolsConstants, 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 ProductPricingControllerCmdImpl
    extends ToolsControllerCommandImpl
    implements ProductPricingControllerCmd, ECToolsConstants, ECConstants
    Controller command implementation used to persist a product pricing as offers in the database offer and offer price tables.

    Behavior

    A PricingDataBean object is used to extract the XML data passed from the client. Once the data is extracted, the data bean is transferred to a ProductPricingCmd command for persistence to the database.
    This command is used by the set prices user interface in the tooling.
    A sample of the hashtable (string representation) used by this command is as follows:

    
    
    {
            XML=
            {
                    refNum=14751,
                    ranges=[1, 50, AndUp],
                    XMLFile=catalog.pricingDialog,
                    prices=
                    [
                            {
                                    TWD=,
                                    CAD=,
                                    JPY=,
                                    CNY=,
                                    KRW=,
                                    EUR=38,
                                    BRL=,
                                    USD=43.78
                            },
                    
                            {
                                    TWD=,
                                    CAD=,
                                    JPY=,
                                    CNY=,
                                    KRW=,
                                    EUR=36,
                                    BRL=,
                                    USD=41.5
                            }
                    ],
                    isSummary=false,
                    listprices=
                    {
                            TWD=,
                            CAD=,
                            JPY=,
                            CNY=,
                            KRW=,
                            EUR=40,
                            BRL=,
                            USD=45.99
                    }
            }
    }
    
    
    See Also:
    Serialized Form
    • Constructor Detail

      • ProductPricingControllerCmdImpl

        public ProductPricingControllerCmdImpl()
    • Method Detail

      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        This method is used in place of validateParameters for this command. It always returns true as there are no parameters to validate.
        Specified by:
        isReadyToCallExecute in interface com.ibm.websphere.command.Command
        Overrides:
        isReadyToCallExecute in class AbstractECTargetableCommand
        Returns:
        This method returns a boolean value; true if we can execute the command and false otherwise. This default implementation will return true.
      • performExecute

        public void performExecute()
                            throws ECException
        The method used to perform the controller command's function (persisting pricing information). This command retrieves the vector corresponding to the parameter ECToolsConstants.EC_XMLOBJECT from the request properties. The first element of the vector is a hashtable, which contains the hashtable corresponding to the key XML. That hashtable is a representation of the XML object constructed by the offer price UI. That hashtable will be used to populate the PricingDataBean. That PricingDataBean and the command context are passed into the ProductrPricingCmd command.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException - Thrown if there is a problem with gathering and persisting data.