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

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

public class CSROrderCommentsAddCmdImpl
extends ToolsControllerCommandImpl
implements CSROrderCommentsAddCmd

 This class will add a comment to orders.  
 If the sendEmail flag is set to true in the XML, this command will call command CSROrderCommentsNotify to send emails to the email address specified. 
 


Field Summary
static java.lang.String COPYRIGHT
           
 
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.CSROrderCommentsAddCmd
defaultCommandClassName, NAME
 
Constructor Summary
CSROrderCommentsAddCmdImpl()
          CSROrderCommentsAddCmdImpl constructor.
 
Method Summary
 void callCSROrderCommentsNotifyCmd(java.lang.Long orderId)
          Call CSROrderCommentsNotify to add comment to the order.
protected  void exceptionUtil(TypedProperty prop, java.lang.Exception ex, java.lang.String methodName, java.lang.String cmdName, java.lang.String errMsg)
          Common exception code.
 java.lang.String getInComment()
          Return the order comment.
 java.lang.String getIsNotifyShopper()
          Return the flag to indicate if there is an need to send the comment to the email address.
 java.util.Hashtable getNLS()
          Return NLS properties.
 java.lang.Long[] getOrderIds()
          Return the list of orders IDs which need to be added the order comments.
 CommandContext getOrgCmdContext()
          Return original command context.
 AccessVector getResources()
          Gets the access vector accessed by this command.
 java.lang.String getXmlfile()
          Return the XML file.
 void performExecute()
          This method performs the execution to add comment to orders.
 void setInComment(java.lang.String newInComment)
          Set order comment.
 void setIsNotifyShopper(java.lang.String notifyShopper)
          Set the flag to indicate if the order comment needs to be emailed.
protected  void setNLS(java.util.Hashtable newNLS)
          Set NLS properties.
 void setOrderIds(java.lang.Long[] newOrderIds)
          Set Order IDs which needs to be canceled.
protected  void setOrgCmdContext(CommandContext newOrgCmdContext)
          Set original command context.
 void setReceiverEmailAddress(java.lang.String newReceiverEmailAddr)
          Set the email address.
protected  void setXMLFile(java.lang.String newXMLFile)
          Set XML file.
 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
Constructor Detail

CSROrderCommentsAddCmdImpl

public CSROrderCommentsAddCmdImpl()
CSROrderCommentsAddCmdImpl constructor.
Method Detail

callCSROrderCommentsNotifyCmd

public void callCSROrderCommentsNotifyCmd(java.lang.Long orderId)
                                   throws ECException
Call CSROrderCommentsNotify to add comment to the order.
Parameters:
orderId - The order ID.
Throws:
ECException -  

exceptionUtil

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

getInComment

public java.lang.String getInComment()
Return the order comment.
Returns:
The order comment.

getIsNotifyShopper

public java.lang.String getIsNotifyShopper()
Return the flag to indicate if there is an need to send the comment to the email address.
Returns:
True if there is a need to send the comment.

getNLS

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

getOrderIds

public java.lang.Long[] getOrderIds()
Return the list of orders IDs which need to be added the order comments.
Returns:
The order IDs.

getOrgCmdContext

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

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

getXmlfile

public java.lang.String getXmlfile()
Return the XML file.
Returns:
The entire XML file.

performExecute

public void performExecute()
                    throws ECException
This method performs the execution to add comment to orders. If the flag to indicate sending email is set, it will also send the order comment to the email address specified.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException -  

setInComment

public void setInComment(java.lang.String newInComment)
Set order comment.
Parameters:
newInComment - The order comment.

setIsNotifyShopper

public void setIsNotifyShopper(java.lang.String notifyShopper)
Set the flag to indicate if the order comment needs to be emailed.
Parameters:
notifyShopper - The flag to indicate if the order comment needs to be emailed.

setNLS

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

setOrderIds

public void setOrderIds(java.lang.Long[] newOrderIds)
Set Order IDs which needs to be canceled.
Parameters:
newOrderIds - The order IDs.

setOrgCmdContext

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

setReceiverEmailAddress

public void setReceiverEmailAddress(java.lang.String newReceiverEmailAddr)
Set the email address.
Parameters:
newReceiverEmailAddr - The email address.

setXMLFile

protected void setXMLFile(java.lang.String newXMLFile)
Set XML file.
Parameters:
newXMLFile - The XML file.

validateParameters

public void validateParameters()
                        throws ECException
Set the NLS properties and parse the input XML parameters.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException -