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

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

public class CSROrderItemSplitCmdImpl
extends ToolsControllerCommandImpl
implements CSROrderItemSplitCmd

	Group a set of order items into one order by calling OrderItemMove command.
   
	This command will move the order item from one order to another order.
	If the value of the parameter toOrderId is not specified, this command will create a new order and move the order items to the new order.
	If a new order is created, this command will change the status of the new order and its order items to 'E' state.
   
	This command will also compare the order ID of the order items.  If the order ID of the order item is the same as the order
	ID which the user want to move the order item to, the command will not call the OrderItemMove to move the order item.
  
  


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.CSROrderItemSplitCmd
defaultCommandClassName, NAME
 
Constructor Summary
CSROrderItemSplitCmdImpl()
           
 
Method Summary
protected  TypedProperty exceptionUtil(TypedProperty prop, java.lang.Exception ex, java.lang.String methodName, java.lang.String cmdName)
          Common exception code.
 void executeCSROrderStatusChange(java.lang.String theOrderId, java.lang.String newStatus)
          Call CSROrderStatusChange command to change the status of the order and its order items.
protected  void executeOrderItemSplit()
          This method call OrderItemMove command to move the order items from one order to another order.
 java.lang.String getCustomerId()
          Return customer ID.
 java.lang.String getFromOrderId()
          Return the ID of the order which the order items are moved from.
 java.lang.String getNewOrderId()
          Return the ID of the newly created order.
 java.util.Hashtable getNLS()
          Return NLS properties.
 java.util.Vector getOrderItems()
          Return a vector of order items to be moved.
 CommandContext getOrgCmdContext()
          Return original command context.
 java.lang.Integer getOrgLangId()
          Return original langauge 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 getToOrderId()
          Return ID of the order which the order items will be moved to.
 void performExecute()
          This method perform the execution of moving the order items from one order to another order.
protected  void setCustomerId(java.lang.String newCustomerId)
          Set customer Id.
protected  void setFromOrderId(java.lang.String newFromOrderId)
          Set the order ID of the order items which will be moved from.
protected  void setNewOrderId(java.lang.String newNewOrderId)
          Set the order ID of the newly created order.
protected  void setNLS(java.util.Hashtable newNLS)
          Set NLS properties.
protected  void setOrderItems(java.util.Vector newOrderItems)
          Set order items which needs to be moved.
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 setToOrderId(java.lang.String newToOrderId)
          Set order ID of the order items which will be moved to.
 void validateParameters()
          Set the NLS properties and parse the input XML parameters.
 
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

CSROrderItemSplitCmdImpl

public CSROrderItemSplitCmdImpl()
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

executeCSROrderStatusChange

public void executeCSROrderStatusChange(java.lang.String theOrderId,
                                        java.lang.String newStatus)
                                 throws ECException
Call CSROrderStatusChange command to change the status of the order and its order items.
Parameters:
newStatus - The status of the order and its order items.
theOrderId - The ID of the order.
Throws:
ECException -  

executeOrderItemSplit

protected void executeOrderItemSplit()
                              throws java.lang.Exception
This method call OrderItemMove command to move the order items from one order to another order. If a new order is created, this command will change the status of the new order and its order items to 'E' state.
Throws:
java.lang.Exception -  

getCustomerId

public java.lang.String getCustomerId()
Return customer ID.
Returns:
The customer ID.

getFromOrderId

public java.lang.String getFromOrderId()
Return the ID of the order which the order items are moved from.
Returns:
The ID of the order which the order items are moved from.

getNewOrderId

public java.lang.String getNewOrderId()
Return the ID of the newly created order.
Returns:
The ID of the newly created order.

getNLS

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

getOrderItems

public java.util.Vector getOrderItems()
Return a vector of order items to be moved.
Returns:
The order items to be moved.

getOrgCmdContext

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

getOrgLangId

public java.lang.Integer getOrgLangId()
Return original langauge 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 propeties.

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

getToOrderId

public java.lang.String getToOrderId()
Return ID of the order which the order items will be moved to.
Returns:
The ID of the order which the order items will be moved to.

performExecute

public void performExecute()
                    throws ECException
This method perform the execution of moving the order items from one order to another order.
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.

setFromOrderId

protected void setFromOrderId(java.lang.String newFromOrderId)
Set the order ID of the order items which will be moved from.
Parameters:
newFromOrderId - The order ID.

setNewOrderId

protected void setNewOrderId(java.lang.String newNewOrderId)
Set the order ID of the newly created order.
Parameters:
newNewOrderId - The ID of the newly created order.

setNLS

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

setOrderItems

protected void setOrderItems(java.util.Vector newOrderItems)
Set order items which needs to be moved.
Parameters:
newOrderItems - The order items which needs to be moved.

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.

setToOrderId

protected void setToOrderId(java.lang.String newToOrderId)
Set order ID of the order items which will be moved to.
Parameters:
newToOrderId - The order ID of the order items which will be moved to.

validateParameters

public void validateParameters()
                        throws ECApplicationException
Set the NLS properties and parse the input XML parameters. This method also initializes following parameters: