com.ibm.commerce.tools.optools.returns.commands
Class CSRReturnItemAddCmdImpl

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.returns.commands.CSRReturnBaseCmdImpl
                          |
                          +--com.ibm.commerce.tools.optools.returns.commands.CSRReturnItemAddCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, CSRReturnItemAddCmd, ECCommand, ECTargetableCommand, Protectable, ToolsControllerCommand

public class CSRReturnItemAddCmdImpl
extends CSRReturnBaseCmdImpl
implements CSRReturnItemAddCmd

	Adds one or more return items to a return.  A return item could be a order item or a catalog entry.
	If a return does not exist then one will be created.
	This command is a wrapper for the ReturnItemAddCmd command.  
	See the command class com.ibm.commerce.returns.commands.ReturnItemAddCmd for more detailed information
	on the behavior.


Field Summary
static java.lang.String COPYRIGHT
           
protected  java.util.Vector returnItemsToBeAdded
          Vector containing Hashtables.
 
Fields inherited from class com.ibm.commerce.tools.optools.returns.commands.CSRReturnBaseCmdImpl
customerId, ERRTASK_NAME, origCmdContext, origReqProperties, redirectURL, returnId, returnResBun, xmlRoot
 
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.returns.commands.CSRReturnItemAddCmd
defaultCommandClassName, NAME
 
Constructor Summary
CSRReturnItemAddCmdImpl()
           
 
Method Summary
protected  void executeReturnItemAdd()
          Sets up the input request property for the ReturnItemAddCmd command and calls the command.
 AccessVector getResources()
          Gets the access vector accessed by this command.
 java.util.Vector getReturnItemsToBeAdded()
          Getter method
protected  void parseInputXMLObject(java.util.Hashtable xmlRoot)
           Parses the input xml data stream, retrieves the parameters and stores them in the objects variables.
 void performExecute()
          Copies the command context and request properties in preparation of calling the ReturnItemAddCmd command.
 void setReturnItemsToBeAdded(java.util.Vector newReturnItemsToBeAdded)
          Setter method
 
Methods inherited from class com.ibm.commerce.tools.optools.returns.commands.CSRReturnBaseCmdImpl
exceptionUtil, getCustomerId, getNLS, getOrigCmdContext, getOrigReqProperties, getRedirectURL, getReturnId, setCustomerId, setNLS, setOrigCmdContext, setOrigReqProperties, setRedirectURL, setReturnId, traceFormat, validateParameters
 
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, validateParameters
 
Methods inherited from interface com.ibm.commerce.security.Protectable
fulfills, getOwner
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT

returnItemsToBeAdded

protected java.util.Vector returnItemsToBeAdded
Vector containing Hashtables. Each Hashtable represents a return item that will be added to a return.
Constructor Detail

CSRReturnItemAddCmdImpl

public CSRReturnItemAddCmdImpl()
Method Detail

executeReturnItemAdd

protected void executeReturnItemAdd()
                             throws java.lang.Exception
Sets up the input request property for the ReturnItemAddCmd command and calls the command.
Throws:
ECApplicationException - If a return reason is not found. If the command factory class does not return a instance of the ReturnItemAddCmd command.

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 CSRReturnBaseCmdImpl
Returns:
AccessVector of resource action pairs

getReturnItemsToBeAdded

public java.util.Vector getReturnItemsToBeAdded()
Getter method
Returns:
Vector of hashtables where each hashtable represents data for a return item that will be passed to the ReturnItemAddCmd.

parseInputXMLObject

protected void parseInputXMLObject(java.util.Hashtable xmlRoot)
                            throws ECApplicationException
 Parses the input xml data stream,  retrieves the parameters and stores them in the objects variables.
 The following setter methods are called:  
   - setReturnId
   - setCustomerId
   - setReturnItemsToBeAdded
Overrides:
parseInputXMLObject in class CSRReturnBaseCmdImpl
Parameters:
xmlRoot - Representation of the xml data stream as a java Hashtable
Throws:
ECApplicationException - If customerId is null or empty

performExecute

public void performExecute()
                    throws ECException
Copies the command context and request properties in preparation of calling the ReturnItemAddCmd command. Calls the ReturnItemAddCmd. Puts the returnId output parameter on the response property Set up the redirect url by putting the redirect url parameter into the response property
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECApplicationException - If ReturnItemAddCmd command throws an exception. If a general exception occurs while parsing and validating the input params.

setReturnItemsToBeAdded

public void setReturnItemsToBeAdded(java.util.Vector newReturnItemsToBeAdded)
Setter method
Parameters:
newReturnItemsToBeAdded - Vector of hashtables where each hashtable represents data for a return item that will be passed to the ReturnItemAddCmd.