com.ibm.commerce.tools.optools.order.commands
Class CSROrderPrepareCmdImpl

com.ibm.commerce.command.AbstractECTargetableCommand
  |
  +--com.ibm.commerce.command.ControllerCommandImpl
        |
        +--com.ibm.commerce.tools.command.ToolsControllerCommandImpl
              |
              +--com.ibm.commerce.tools.optools.order.commands.CSRBaseControllerCommandImpl
                    |
                    +--com.ibm.commerce.tools.optools.order.commands.CSROrderPrepareCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, CSROrderPrepareCmd, ECCommand, ECTargetableCommand, Protectable, ToolsControllerCommand

public class CSROrderPrepareCmdImpl
extends CSRBaseControllerCommandImpl
implements CSROrderPrepareCmd

Prepare pending order(s) by calling OrderPrepare command. This command will prepare at most two orders. It will only prepare the order if the order has order items.


Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String ERRTASK_NAME
           
 
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.tools.optools.order.commands.CSROrderPrepareCmd
defaultCommandClassName, NAME
 
Constructor Summary
CSROrderPrepareCmdImpl()
           
 
Method Summary
protected  TypedProperty exceptionUtil(TypedProperty prop, java.lang.Exception ex, java.lang.String methodName, java.lang.String cmdName)
          Common exception code.
protected  void executeOrderPrepare(java.lang.String orderId)
          This method call OrderPrepare command to prepare the order.
 java.lang.String getCustomerId()
          Return customer ID.
 java.lang.String getFirstOrderId()
          Return first order ID.
 java.util.Hashtable getNLS()
          Return NLS properties.
 CommandContext getOrgCmdContext()
          Return original command context.
 java.lang.Integer getOrgLangId()
          Return original language ID.
 java.util.Locale getOrgLocale()
          Return original Locale.
 TypedProperty getOrgReqProperties()
          Return original request properties.
 java.lang.String getRedirectURL()
          Return redirect URL.
 AccessVector getResources()
          Gets the access vector accessed by this command.
 java.lang.String getSecondOrderId()
          Return the ID of the second order.
protected  boolean isEmptyOrder(java.lang.String orderRefNum)
          Return true if there is no order item in the order.
 void performExecute()
          This method perform the execution for prepare the order(s).
protected  void setCustomerId(java.lang.String newCustomerId)
          Set customer ID.
protected  void setFirstOrderId(java.lang.String newFirstOrderId)
          Set first order ID.
protected  void setNLS(java.util.Hashtable newNLS)
          Set NLS properties.
protected  void setOrgCmdContext(CommandContext newOrgCmdContext)
          Set original command context.
protected  void setOrgLangId(java.lang.Integer newOrgLangId)
          Set original language ID.
protected  void setOrgLocale(java.util.Locale newOrgLocale)
          Set original Locale.
protected  void setOrgReqProperties(TypedProperty newOrgReqProperties)
          Set original request properties.
protected  void setRedirectURL(java.lang.String newRedirectURL)
          Set redirect URL.
protected  void setSecondOrderId(java.lang.String newSecondOrderId)
          Set second order ID.
 void validateParameters()
          Set the NLS properties, the redirect URL and parse the input XML parameters.
 
Methods inherited from class com.ibm.commerce.tools.optools.order.commands.CSRBaseControllerCommandImpl
callPreCommands, findCmdInterfaceName, getIfExePreCmdChains, getPreCmdChain, setIfExePreCmdChains, setPreCmdChain
 
Methods inherited from class com.ibm.commerce.tools.command.ToolsControllerCommandImpl
getViewInputProperties, setRequestProperties
 
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl
fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
 
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from interface com.ibm.commerce.command.ControllerCommand
execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRequestProperties, setRetriable, setViewInputProperties
 
Methods inherited from interface com.ibm.commerce.command.AccCommand
accessControlCheck, getAccCheck, getForUserId, setAccCheck, setForUserId, setOwner
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from interface com.ibm.commerce.security.Protectable
fulfills, getOwner
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT

ERRTASK_NAME

public static java.lang.String ERRTASK_NAME
Constructor Detail

CSROrderPrepareCmdImpl

public CSROrderPrepareCmdImpl()
Method Detail

exceptionUtil

protected TypedProperty exceptionUtil(TypedProperty prop,
                                      java.lang.Exception ex,
                                      java.lang.String methodName,
                                      java.lang.String cmdName)
Common exception code.
Parameters:
prop - com.ibm.commerce.datatype.TypedProperty
ex - java.lang.Exception
methodName - java.lang.String
cmdName - java.lang.String
Returns:
com.ibm.commerce.datatype.TypedProperty

executeOrderPrepare

protected void executeOrderPrepare(java.lang.String orderId)
                            throws ECException
This method call OrderPrepare command to prepare the order.
Parameters:
orderId - The order ID.
Throws:
ECException -  

getCustomerId

public java.lang.String getCustomerId()
Return customer ID.
Specified by:
getCustomerId in interface CSROrderPrepareCmd
Returns:
The customer ID.

getFirstOrderId

public java.lang.String getFirstOrderId()
Return first order ID.
Specified by:
getFirstOrderId in interface CSROrderPrepareCmd
Returns:
The ID of the first order.

getNLS

public java.util.Hashtable getNLS()
Return NLS properties.
Returns:
The NLS properties.

getOrgCmdContext

public CommandContext getOrgCmdContext()
Return original command context.
Returns:
The original command context.

getOrgLangId

public java.lang.Integer getOrgLangId()
Return original language ID.
Returns:
The original language ID.

getOrgLocale

public java.util.Locale getOrgLocale()
Return original Locale.
Returns:
The original Locale.

getOrgReqProperties

public TypedProperty getOrgReqProperties()
Return original request properties.
Returns:
The original request properties.

getRedirectURL

public java.lang.String getRedirectURL()
Return redirect URL.
Returns:
The redirect URL.

getResources

public AccessVector getResources()
                          throws ECException
Gets the access vector accessed by this command. The default implementation returns null indicating that no protectable resource is accessed by this command.

Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
A vector of resource action pairs

getSecondOrderId

public java.lang.String getSecondOrderId()
Return the ID of the second order.
Specified by:
getSecondOrderId in interface CSROrderPrepareCmd
Returns:
The ID of the second order.

isEmptyOrder

protected boolean isEmptyOrder(java.lang.String orderRefNum)
                        throws java.lang.Exception
Return true if there is no order item in the order.
Parameters:
orderRefNum - The order ID
Returns:
True if there is no order item in the order.
Throws:
java.lang.Exception -  

performExecute

public void performExecute()
                    throws ECException
This method perform the execution for prepare the order(s).
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException -  

setCustomerId

protected void setCustomerId(java.lang.String newCustomerId)
Set customer ID.
Parameters:
newCustomerId - The customer ID.

setFirstOrderId

protected void setFirstOrderId(java.lang.String newFirstOrderId)
Set first order ID.
Parameters:
newFirstOrderId - The ID of the first order.

setNLS

protected void setNLS(java.util.Hashtable newNLS)
Set NLS properties.
Parameters:
newNLS - The NLS properties.

setOrgCmdContext

protected void setOrgCmdContext(CommandContext newOrgCmdContext)
Set original command context.
Parameters:
newOrgCmdContext - The original command context.

setOrgLangId

protected void setOrgLangId(java.lang.Integer newOrgLangId)
Set original language ID.
Parameters:
newOrgLangId - The original language ID.

setOrgLocale

protected void setOrgLocale(java.util.Locale newOrgLocale)
Set original Locale.
Parameters:
newOrgLocale - The original Locale.

setOrgReqProperties

protected void setOrgReqProperties(TypedProperty newOrgReqProperties)
Set original request properties.
Parameters:
newOrgReqProperties - The original request properties.

setRedirectURL

protected void setRedirectURL(java.lang.String newRedirectURL)
Set redirect URL.
Parameters:
newRedirectURL - The redirect URL.

setSecondOrderId

protected void setSecondOrderId(java.lang.String newSecondOrderId)
Set second order ID.
Parameters:
newSecondOrderId - The second order ID.

validateParameters

public void validateParameters()
                        throws ECApplicationException
Set the NLS properties, the redirect URL and parse the input XML parameters.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class CSRBaseControllerCommandImpl
Throws:
ECApplicationException -