com.ibm.commerce.me.commands
Class SubmitShoppingCartCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.ControllerCommandImpl
                    |
                    +--com.ibm.commerce.me.commands.SubmitShoppingCartCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, SubmitShoppingCartCmd

public class SubmitShoppingCartCmdImpl
extends ControllerCommandImpl
implements SubmitShoppingCartCmd

This is the implementation of SubmitShoppingCard command. The SubmitShopingCart command is invoked when the procurement buyer submits or checks out their order during catalog browsing. This command changes the status of the order and order items to W (awaiting approval) from P (pending). Together with the SendShoppingCart command, the SubmitShoppingCart command can be used to alter the shopping flow to send the order of the procurement buyer to the procurement system.

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          Copyright statement.
 
Fields inherited from class com.ibm.commerce.command. ControllerCommandImpl
requestProperties, responseProperties, retriable, viewReqProperties
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.me.commands. SubmitShoppingCartCmd
defaultCommandClassName, NAME
 
Constructor Summary
SubmitShoppingCartCmdImpl()
           
 
Method Summary
 java.lang.String getErrorTask()
          Gets error task name
 java.lang.Long getOrderId()
          Gets order id.
  AccessVector getResources()
          Gets AccessVector which contains OrderAccessBeans.
 java.lang.String getViewTask()
          Gets view task name
 boolean isRetriable()
          Check to see if this command is retriable on transaction rollback exception.
 void performExecute()
          Change the status order in the orders and orderitems table from status pending(P) to waiting approval (W) when submitting the shopping cart or order to Procurement System for approval.
 void setOrderId(java.lang.Long orderId)
          Sets orderId
 void setRequestProperties( TypedProperty p)
          The WebController calls the setRequestProperties method before invoking the execute method in this command.
 void validateParameters()
          In this method, only basic parameter checking is done whether the parameters has got some values or not.
 
Methods inherited from class com.ibm.commerce.command. ControllerCommandImpl
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.command. ControllerCommand
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, mergeProperties, setGeneric, setRetriable, setViewInputProperties
 
Methods inherited from interface com.ibm.commerce.command. AccCommand
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
 
Methods inherited from interface com.ibm.commerce.command. ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 

Field Detail
public static final java.lang.String COPYRIGHT
Copyright statement.
See Also:
Constant Field Values
Constructor Detail

SubmitShoppingCartCmdImpl

public SubmitShoppingCartCmdImpl()
Method Detail

getErrorTask

public java.lang.String getErrorTask()
Gets error task name
Returns:
errorTask The error task name

getOrderId

public java.lang.Long getOrderId()
Gets order id.
Returns:
orders_Id The order id.

getResources

public AccessVector getResources()
                          throws ECException
Gets AccessVector which contains OrderAccessBeans.
Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
com.ibm.commerce.accesscontrol.AccessVector
Throws:
ECException

getViewTask

public java.lang.String getViewTask()
Gets view task name
Returns:
viewTask The view task name

isRetriable

public boolean isRetriable()
Check to see if this command is retriable on transaction rollback exception. A retriable command will be retried once on transaction rollback exception.
Specified by:
isRetriable in interface ControllerCommand
Overrides:
isRetriable in class ControllerCommandImpl
Returns:
boolean - true if this command is retriable - false if this command is not retriable

performExecute

public void performExecute()
                    throws ECException
Change the status order in the orders and orderitems table from status pending(P) to waiting approval (W) when submitting the shopping cart or order to Procurement System for approval.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
CommandException.
ECException

setOrderId

public void setOrderId(java.lang.Long orderId)
Sets orderId
Specified by:
setOrderId in interface SubmitShoppingCartCmd
Parameters:
orderId - The order id

setRequestProperties

public void setRequestProperties(TypedProperty p)
                          throws ECException
The WebController calls the setRequestProperties method before invoking the execute method in this command. It is the responsibility of the implementer of the ControllerCommand to extract the required input parameters from the request properties and perform parameter checking. Three mandatory parameters should be set before calling this command:
 1. orderRefNumber
      2. userID
      3. password
Specified by:
setRequestProperties in interface ControllerCommand
Overrides:
setRequestProperties in class ControllerCommandImpl
Parameters:
p - request properties
Returns:
void
Throws:
com.ibm.commerce.exception.ECException.
ECException

validateParameters

public void validateParameters()
                        throws ECException
In this method, only basic parameter checking is done whether the parameters has got some values or not. If a request parameter has got some value, this method will not check if it is right or wrong
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException.
ECException