java.lang.Object | +--CacheableCommandImpl | +--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.CSROrderProcessCmdImpl
This is the default implementation of the CSROrderProcessCmd
command.
This command calls the following Commands:
CSROrderAdjustmentUpdateCmd
CSROrderCommentsNotifyCmd
DoCancelCmd
CSROrderPrepareCmd
OrderProcessCmd
This command uses the following AccessBeans:
OrderAccessBean
OrderCommentAccessBean
OrderItemAccessBean
UserRegistryAccessBean
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT IBM copyright notice field. |
static java.lang.String |
NOTEBOOK_URL The return url for a notebook widget. |
static java.lang.String |
WIZARD_URL The return url for a wizard widget. |
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. CSROrderProcessCmd |
defaultCommandClassName,
NAME |
Constructor Summary | |
---|---|
CSROrderProcessCmdImpl() |
Method Summary | |
---|---|
protected
void |
addComments() This method generates comments for order(s) and prepares email for notification. |
protected
void |
checkOrderAdjustment() Checks if order level adjustments are positive. |
protected
void |
exceptionUtil(
TypedProperty prop, java.lang.Exception ex, java.lang.String methodName,
java.lang.String cmdName, java.lang.String errMsg) Common exception code for this command. |
protected
void |
executeBackupOrderDelete() Deletes backup order in database. |
protected
void |
executeCSROrderAdjustmentUpdate() This method calls CSROrderAdjustmentUpdateCmd to reprepare the order(s) if there are some manual adjustments. |
protected
void |
executeCSROrderPrepare() This method calls CSROrderPrepareCmd to prepare order(s). |
protected
void |
executeOrderProcess(java.lang.String orderId,
java.lang.String billingAddressId, java.util.Hashtable payment) This method calls OrderProcessCmd to complete an order. |
java.lang.String |
getAdminId() Returns the administrator's ID. |
java.lang.String |
getBackupOrderId() Returns backup order ID. |
java.util.Hashtable |
getComment() Returns comment as a Hashtable. |
java.lang.String |
getCustomerId() Returns customer ID. |
java.lang.String |
getEditOrderInfo() Returns "true" if it is called from an edit order notebook. |
java.lang.String |
getFirstBillingAddressId() Returns first billing address ID. |
java.lang.String |
getFirstDirtyBit() Returns the first order dirty status. |
java.lang.String |
getFirstOrderId() Returns first order ID. |
java.util.Hashtable |
getFirstPayment() Returns the payment information for the first order as a Hashtable. |
java.util.Hashtable |
getNLS() Returns the properties containing all translatable messages for this command. |
java.lang.String |
getNotifyMerchant() Gets notify merchant option. |
java.lang.String |
getNotifyOrderSubmitted() Gets order submitted notification option. |
java.lang.String |
getNotifyShopper() Gets notify customer option. |
CommandContext |
getOrgCmdContext() Returns the original commandContext (administrator's command context). |
java.lang.Integer |
getOrgLangId() Returns original language ID. |
java.util.Locale |
getOrgLocale() Returns original locale. |
TypedProperty |
getOrgReqProperties() Returns original request properties. |
java.lang.String |
getRedirectURL() Returns the redirect URL that is to be executed after this controller command terminates. |
AccessVector |
getResources() Gets the access vector accessed by this command. |
java.lang.String |
getSecondBillingAddressId() Returns second billing address ID. |
java.lang.String |
getSecondOrderId() Returns second order ID. |
java.util.Hashtable |
getSecondPayment() Returns the payment information for the second order as a Hashtable. |
protected
java.lang.String |
getSuccessMsg(java.util.Hashtable orderMgmtNLS) Returns final success message. |
java.lang.String |
getXMLFile() Returns XML file. |
boolean |
isBackupOrderDeleteError() Returns error flag for deleting backup order error. |
boolean |
isEmailError() Retures error flag for email comment error. |
protected
boolean |
isEmptyOrder(java.lang.String orderRefNum) Determines if an order has order items or not. |
boolean |
isFirstOrderExist() Returns true if the first order exits. |
boolean |
isSecondOrderExist() Returns true if the Second order exits. |
void |
performExecute() This method performs the execution for process the new order(s) and cancel old order if neccessary. |
protected
void |
removePrevPayment() When editing an order, remove the original payment for the first order. |
protected
void |
setAdminId(java.lang.String newAdminId) Set administrator's ID. |
protected
void |
setBackupOrderDeleteError(boolean newBackupOrderDeleteError) Set setBackupOrderDeleteError flag. |
protected
void |
setBackupOrderId(java.lang.String newBackupOrderId) Sets backup order ID. |
protected
void |
setComment(java.util.Hashtable newComment) Sets comment. |
protected
void |
setCustomerId(java.lang.String newCustomerId) Sets customer ID. |
protected
void |
setEditOrderInfo(java.lang.String newEditOrderInfo) Sets "true" if it is edit order info notebook. |
protected
void |
setEmailError(boolean newEmailError) Sets "true" if there is an email error. |
protected
void |
setFirstBillingAddressId(java.lang.String newBillingAddressId) Sets first billing address ID. |
protected
void |
setFirstDirtyBit(java.lang.String newFirstDirtyBit) Sets "true" if there are some adjustments in the first order, "false" if not. |
protected
void |
setFirstOrderExist(boolean newFirstOrderExist) Sets if there are some order items in first order. |
protected
void |
setFirstOrderId(java.lang.String newFirstOrderId) Sets first order ID. |
protected
void |
setFirstPayment(java.util.Hashtable newPayment) Sets first payment information. |
protected
void |
setIsSecondOrderExist(boolean newIsSecondOrderExist) Sets if there are some order items in second order. |
protected
void |
setNLS(java.util.Hashtable newNLS) Sets NLS properties. |
void |
setNotifyMerchant(java.lang.String notifyMerchant) Sets notify merchant option. |
void |
setNotifyOrderSubmitted(java.lang.String notifyOrderSubmitted) Sets order submitted notification option. |
void |
setNotifyShopper(java.lang.String notifyShopper) Sets notify customer option. |
protected
void |
setOrgCmdContext(
CommandContext newOrgCmdContext) Sets original commandContext. |
protected
void |
setOrgLangId(java.lang.Integer newOrgLangId) Sets the original language ID. |
protected
void |
setOrgLocale(java.util.Locale newOrgLocale) Sets original locale. |
protected
void |
setOrgReqProperties(
TypedProperty newOrgReqProperties) Sets original request properties. |
protected
void |
setRedirectURL(java.lang.String newRedirectURL) Sets redirect URL. |
protected
void |
setSecondBillingAddressId(java.lang.String newBillingAddressId) Sets second billing address ID. |
protected
void |
setSecondOrderExist(boolean newSecondOrderExist) Sets second order exist flag. |
protected
void |
setSecondOrderId(java.lang.String newSecondOrderId) Sets second order ID. |
protected
void |
setSecondPayment(java.util.Hashtable newPayment) Sets second payment information. |
protected
void |
setSuccessMsg(java.lang.String newSuccessMsg) Sets final success message. |
protected
void |
setXMLFile(java.lang.String newXMLFile) Sets XML file. |
void |
validateParameters() This method gets XMLObject from the GUI Notebook or Wizard and get ready to parse it. |
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 |
checkPermission,
fulfills,
getForUserId,
getGeneric,
getOwner,
getRequestProperties,
getResolvedRequestProperties,
getResourceOwners,
getResponseProperties,
getRetriable,
isGeneric,
isRetriable,
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,
isRetriable,
mergeProperties,
setGeneric,
setRequestProperties,
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
public static final java.lang.String NOTEBOOK_URL
public static final java.lang.String WIZARD_URL
Constructor Detail |
---|
public CSROrderProcessCmdImpl()
Method Detail |
---|
protected void addComments() throws ECException
ECApplicationException
- if fails to add comments or email
notification.
ECException
protected void checkOrderAdjustment() throws ECApplicationException
ECApplicationException
- if tax, shipping, shipping tax and grand
total of the order is less than zero.protected void exceptionUtil(TypedProperty prop, java.lang.Exception ex, java.lang.String methodName, java.lang.String cmdName, java.lang.String errMsg) throws ECApplicationException
prop
- The response typed property.ex
- The catched exception.methodName
- The name of the method with exception.cmdName
- The name of the command.errMsg
- The translated error message string.
ECApplicationException
- The exception to be sent to the error
handling view.protected void executeBackupOrderDelete() throws java.lang.Exception
java.lang.Exception
- if order can not be
deleted.protected void executeCSROrderAdjustmentUpdate() throws ECException
ECException
- if adjustment can not be applied.protected void executeCSROrderPrepare() throws ECException
ECException
- if unable to prepare order.protected void executeOrderProcess(java.lang.String orderId, java.lang.String billingAddressId, java.util.Hashtable payment) throws ECException
orderId
- The order ID to process.billingAddressId
- The address ID used for this order.payment
- The payment name-value pairs for this order.
ECException
- if unable to process order.public java.lang.String getAdminId()
public java.lang.String getBackupOrderId()
public java.util.Hashtable getComment()
public java.lang.String getCustomerId()
public java.lang.String getEditOrderInfo()
public java.lang.String getFirstBillingAddressId()
public java.lang.String getFirstDirtyBit()
public java.lang.String getFirstOrderId()
public java.util.Hashtable getFirstPayment()
public java.util.Hashtable getNLS()
public CommandContext getOrgCmdContext()
public java.lang.Integer getOrgLangId()
public java.util.Locale getOrgLocale()
public TypedProperty getOrgReqProperties()
public java.lang.String getRedirectURL()
public AccessVector getResources() throws ECException
getResources
in interface
ECCommand
getResources
in class
AbstractECTargetableCommand
ECException
- If the resource can not be
retrieved.public java.lang.String getSecondBillingAddressId()
public java.lang.String getSecondOrderId()
public java.util.Hashtable getSecondPayment()
protected java.lang.String getSuccessMsg(java.util.Hashtable orderMgmtNLS)
orderMgmtNLS
- The hashtable with the translated
messages.public java.lang.String getXMLFile()
public boolean isBackupOrderDeleteError()
public boolean isEmailError()
protected boolean isEmptyOrder(java.lang.String orderRefNum) throws java.lang.Exception
orderRefNum
- An order ID.java.lang.Exception
- if unable to instantiate order
accessbean.public boolean isFirstOrderExist()
public boolean isSecondOrderExist()
public void performExecute() throws ECException
performExecute
in interface
ECCommand
performExecute
in class
AbstractECTargetableCommand
ECException
- if unable to process the orders.protected void removePrevPayment() throws ECApplicationException
ECApplicationException
- if unable to cancel
payment.protected void setAdminId(java.lang.String newAdminId)
newAdminId
- The administrator's ID.protected void setBackupOrderDeleteError(boolean newBackupOrderDeleteError)
newBackupOrderDeleteError
- Set true if there is an error to
delete a backup order, false if no delete error.protected void setBackupOrderId(java.lang.String newBackupOrderId)
newBackupOrderId
- The backup order ID for the first
order.protected void setComment(java.util.Hashtable newComment)
newComment
- The hashtable containing the comment
details.protected void setCustomerId(java.lang.String newCustomerId)
newCustomerId
- The customer ID.protected void setEditOrderInfo(java.lang.String newEditOrderInfo)
newEditOrderInfo
-protected void setEmailError(boolean newEmailError)
newEmailError
- Set true if there is an email error, false if
no email error.protected void setFirstBillingAddressId(java.lang.String newBillingAddressId)
newBillingAddressId
- The billing address ID of the first
order.protected void setFirstDirtyBit(java.lang.String newFirstDirtyBit)
newFirstDirtyBit
-protected void setFirstOrderExist(boolean newFirstOrderExist)
newFirstOrderExist
- true if there are some order items in
first order.protected void setFirstOrderId(java.lang.String newFirstOrderId)
newFirstOrderId
- The first order ID.protected void setFirstPayment(java.util.Hashtable newPayment)
newPayment
- The name-value pairs with the first order payment
information.protected void setIsSecondOrderExist(boolean newIsSecondOrderExist)
newIsSecondOrderExist
- true if there are some order items in
second order.protected void setNLS(java.util.Hashtable newNLS)
newNLS
- The name-value pairs containing the messages to be
used by this command.protected void setOrgCmdContext(CommandContext newOrgCmdContext)
newOrgCmdContext
- The original command context (admin command
context).protected void setOrgLangId(java.lang.Integer newOrgLangId)
newOrgLangId
- The original language ID.protected void setOrgLocale(java.util.Locale newOrgLocale)
newOrgLocale
- The locale from the original command
context.protected void setOrgReqProperties(TypedProperty newOrgReqProperties)
newOrgReqProperties
- The original request
properties.protected void setRedirectURL(java.lang.String newRedirectURL)
newRedirectURL
- The name of the redirect
page.protected void setSecondBillingAddressId(java.lang.String newBillingAddressId)
newBillingAddressId
- The billing address ID of the second
order.protected void setSecondOrderExist(boolean newSecondOrderExist)
newSecondOrderExist
- Set true if there are some order items
in second order.protected void setSecondOrderId(java.lang.String newSecondOrderId)
newSecondOrderId
- The second order ID.protected void setSecondPayment(java.util.Hashtable newPayment)
newPayment
- The name-value pairs with the second order
payment information.protected void setSuccessMsg(java.lang.String newSuccessMsg)
newSuccessMsg
- The translated success message for the
order(s).protected void setXMLFile(java.lang.String newXMLFile)
newXMLFile
- The XML file used.public void validateParameters() throws ECApplicationException
validateParameters
in interface
ECCommand
validateParameters
in class
CSRBaseControllerCommandImpl
ECException
- If cannot parse the XMLObject, throw
ECApplicationException
ECApplicationException
public java.lang.String getNotifyMerchant()
public void setNotifyMerchant(java.lang.String notifyMerchant)
notifyMerchant
- "1" to notify merchant;
"0" not to notif merchant.public java.lang.String getNotifyShopper()
public void setNotifyShopper(java.lang.String notifyShopper)
notifyShopper
- "1" to notify customer;
"0" not to notif customer.public java.lang.String getNotifyOrderSubmitted()
public void setNotifyOrderSubmitted(java.lang.String notifyOrderSubmitted)
notifyOrderSubmitted
- "1" to notify order
submission; "0" not to notify order submission.