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.CSROrderRollBackCmdImpl
This is the default implementation of the CSROrderProcessCmd
command.
Behavior
OrderItemDeleteCmd
to delete
this order item from the first order.OrderItemAddCmd
to add the
order item to the first order.OrderItemUpdateCmd
to update the order item of the first
order.OrderPrepareCmd
to prepare the first order.OrderProcessCmd
to process the first order.This command calls the following Commands:
AdminOrderCancelCmd
DoCancelCmd
GetOrderLevelParameterCmd
OrderItemAddCmd
OrderItemDeleteCmd
OrderItemUpdateCmd
OrderPrepareCmd
OrderProcessCmd
SetOrderLevelParameterCmd
UseCouponIdTaskCmd
This command uses the following AccessBeans:
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT IBM copyright notice field. |
static java.lang.String |
ERRTASK_NAME Error handling viewname for this command. |
static java.lang.String |
NOTEBOOK_URL The return url for a notebook 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. CSROrderRollBackCmd |
defaultCommandClassName,
NAME |
Constructor Summary | |
---|---|
CSROrderRollBackCmdImpl() |
Method Summary | |
---|---|
protected
java.util.Vector |
copyArrayToVector(
OrderItemDataBean[] orderItemsArray) Creates a vector from a array. |
protected
TypedProperty |
exceptionUtil(
TypedProperty prop, java.lang.Exception ex, java.lang.String methodName,
java.lang.String cmdName) This method sets up the response property when an exception occurs. |
protected
void |
executeOrderCancelCmd(java.lang.String orderId) Calls the AdminOrderCancelCmd to cancel an
order. |
protected
void |
executeOrderDelete(java.lang.String orderId) Delete an order in database. |
protected
void |
executeOrderItemAdd(
OrderItemDataBean theOrderItem) Call OrderItemAddCmd to add an order item. |
protected
void |
executeOrderItemDelete(
OrderItemDataBean theOrderItem) Call OrderItemDeleteCmd to delete an order
item. |
protected
void |
executeOrderItemUpdate(
OrderItemDataBean changedOrderItem,
OrderItemDataBean originalOrderItem) Call OrderItemUpdateCmd to update an order item by using
the values (cat entry ID, quantity, shipping mode ID, shipping address ID,
contract ID) from the original order items. |
protected
void |
executeOrderPrepare(java.lang.String orderId) Call OrderPrepareCmd to prepare an order. |
protected
void |
executeOrderProcess(java.lang.String orderId,
java.lang.String payInfoOrderId) This method calls OrderProcessCmd to complete an order
by using the payment info from the backup order. |
protected
void |
executeSetOrderLevelAdjustmentCmd(java.math.BigDecimal orderLevelMenuAdjustment,
java.math.BigDecimal shippingCharge) This method call SetOrderLevelParameterCmd to set the
shipping charge and menu adjustments. |
protected
OrderDataBean |
getBackupOrder() Returns the backup order. |
java.lang.String |
getBackupOrderId() Returns backup order ID. |
protected
java.util.Vector |
getBackupOrderItems() Returns the order items of the backup order. |
java.lang.String |
getCustomerId() Returns customer ID. |
protected
OrderDataBean |
getFirstOrder() Returns the first order. |
java.lang.String |
getFirstOrderId() Returns first order ID. |
protected
java.util.Vector |
getFirstOrderItems() Returns the order items of the first order. |
java.util.Hashtable |
getNLS() Returns NLS properties. |
CommandContext |
getOrgCmdContext() Returns original 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 |
getOrigOrderCouponIds() Returns the string of coupons IDs used in the original order. |
java.math.BigDecimal |
getOrigOrderGrandTotal() Returns original order grand total. |
java.lang.String |
getOrigOrderLastUpdate() Returns the origOrderLastUpdate. |
java.math.BigDecimal |
getOrigOrderLevelMenuAdjustment() Returns original order level menu adjustment. |
java.lang.String |
getOrigOrderStatus() Returns the origOrderStatus. |
java.math.BigDecimal |
getOrigShippingCharge() Returns the original shipping charge. |
java.lang.String |
getRedirectURL() Returns redirect URL. |
AccessVector |
getResources() Gets the access vector accessed by this command. |
java.lang.String |
getSecondOrderId() Returns the ID of the second order. |
java.lang.String |
getXMLFile() Returns XML file. |
protected
boolean |
ifAttributeChanged(java.math.BigDecimal changedAttr,
java.math.BigDecimal origAttr) Compares the values of two attributes with type BigDeciaml. |
protected
boolean |
ifAttributeChanged(java.lang.String changedAttr,
java.lang.String origAttr) Compares the values of two attributes with type String. |
protected
boolean |
ifOrderItemChanged(
OrderItemDataBean changedOrderItem,
OrderItemDataBean originalOrderItem) Compares order items. |
protected
OrderDataBean |
initOrderBean(java.lang.String orderId) Initializes an OrderDataBean. |
void |
performExecute() This method performs rollback changes done to the first order from the data in the backup order. |
protected
void |
removeOrderItems(java.util.Vector orderItems) Deletes all the order items in the order item list. |
protected
void |
removePrevPayment(java.lang.String orderId) Removes original payment from the order. |
protected
void |
rollbackDeletedOrUpdatedOrderItems(
OrderDataBean changedOrder, java.util.Vector changedOrderItems,
OrderDataBean originalOrder,
java.util.Vector originalOrderItems) Add or update the order items in the changedOrder so that it will have the same order items as the originalOrder. |
protected
void |
rollbackOrderAdjustment(
OrderDataBean changedOrder) Sets the shipping charge and the order level menu adjustments of the changed order to the original values. |
protected
void |
setBackupOrder(
OrderDataBean newOrder) Sets backup order. |
protected
void |
setBackupOrderId(java.lang.String newBackupOrderId) Sets backup order ID. |
protected
void |
setBackupOrderItems(java.util.Vector newOrderItems) Sets order items of the backup order. |
protected
void |
setCustomerId(java.lang.String newCustomerId) Sets customer ID. |
protected
void |
setFirstOrder(
OrderDataBean newOrder) Sets first order. |
protected
void |
setFirstOrderId(java.lang.String newFirstOrderId) Sets first order ID. |
protected
void |
setFirstOrderItems(java.util.Vector newOrderItems) Sets order items of the first order. |
protected
void |
setNLS(java.util.Hashtable newNLS) Sets NLS properties. |
protected
void |
setOrgCmdContext(
CommandContext newOrgCmdContext) Sets original command context. |
protected
void |
setOrgLangId(java.lang.Integer newOrgLangId) Sets original language ID. |
protected
void |
setOrgLocale(java.util.Locale newOrgLocale) Sets original Locale. |
protected
void |
setOrgReqProperties(
TypedProperty newOrgReqProperties) Sets original request properties. |
void |
setOrigOrderCouponIds(java.lang.String newOrigOrderCouponIds) Sets the list of coupons used in the original order |
void |
setOrigOrderLastUpdate(java.lang.String inOrigOrderLastUpdate) Sets the origOrderLastUpdate. |
void |
setOrigOrderLevelMenuAdjustment(java.lang.String tmpValue) Sets original order level menu adjustment. |
void |
setOrigOrderStatus(java.lang.String inOrigOrderStatus) Sets the origOrderStatus. |
void |
setOrigShippingCharge(java.lang.String tmpValue) Sets original order shipping charge. |
protected
void |
setRedirectURL(java.lang.String newRedirectURL) Sets redirect URL. |
protected
void |
setSecondOrderId(java.lang.String newSecondOrderId) Sets second order ID. |
protected
void |
setXMLFile(java.lang.String newXMLFile) Sets XML file. |
void |
validateParameters() Sets the NLS properties, the redirect URL 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 |
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 java.lang.String ERRTASK_NAME
Constructor Detail |
---|
public CSROrderRollBackCmdImpl()
Method Detail |
---|
protected java.util.Vector copyArrayToVector(OrderItemDataBean[] orderItemsArray)
orderItemsArray
- The arrayprotected TypedProperty exceptionUtil(TypedProperty prop, java.lang.Exception ex, java.lang.String methodName, java.lang.String cmdName)
prop
- The response typed property.ex
- The catched exception.methodName
- The name of the method with exception.cmdName
- The name of the command.protected void executeOrderCancelCmd(java.lang.String orderId) throws ECApplicationException, ECException
AdminOrderCancelCmd
to cancel an order.
orderId
- The order ID.
ECApplicationException
- If the order can not be canceled.
ECException
- If the order can not be canceled.protected void executeOrderDelete(java.lang.String orderId) throws java.lang.Exception
orderId
- The order ID.java.lang.Exception
- If order can not be
deleted.protected void executeOrderItemAdd(OrderItemDataBean theOrderItem) throws java.lang.Exception
OrderItemAddCmd
to add an order item.
theOrderItem
- The order item need to be added.java.lang.Exception
protected void executeOrderItemDelete(OrderItemDataBean theOrderItem) throws java.lang.Exception
OrderItemDeleteCmd
to delete an order item.
theOrderItem
- The order item need to be deleted.java.lang.Exception
- If order item can not be
deleted.protected void executeOrderItemUpdate(OrderItemDataBean changedOrderItem, OrderItemDataBean originalOrderItem) throws java.lang.Exception
OrderItemUpdateCmd
to update an order item by using the
values (cat entry ID, quantity, shipping mode ID, shipping address ID, contract
ID) from the original order items.
changedOrderItem
- The order item needs to be updated.originalOrderItem
- The order item contain the saved attribute
values which will be used for update.java.lang.Exception
- If order item can not be
updated.protected void executeOrderPrepare(java.lang.String orderId) throws ECException
OrderPrepareCmd
to prepare an order.
orderId
- The order ID.
ECException
- If order can not be prepared.protected void executeOrderProcess(java.lang.String orderId, java.lang.String payInfoOrderId) throws java.lang.Exception
OrderProcessCmd
to complete an order by
using the payment info from the backup order.
orderId
- The order ID.payInfoOrderId
- The ID of the order which the payment
information stored.
ECException
- If order can not be processed.java.lang.Exception
protected void executeSetOrderLevelAdjustmentCmd(java.math.BigDecimal orderLevelMenuAdjustment, java.math.BigDecimal shippingCharge) throws ECException, java.lang.Exception
SetOrderLevelParameterCmd
to set the shipping
charge and menu adjustments.
orderLevelMenuAdjustment
- The order level menu
adjustment.shippingCharge
- The shipping charge.
ECException
- If fails to set order adjustment.java.lang.Exception
- If fails to set order
adjustment.protected OrderDataBean getBackupOrder()
public java.lang.String getBackupOrderId()
protected java.util.Vector getBackupOrderItems()
public java.lang.String getCustomerId()
protected OrderDataBean getFirstOrder()
public java.lang.String getFirstOrderId()
protected java.util.Vector getFirstOrderItems()
public java.util.Hashtable getNLS()
public CommandContext getOrgCmdContext()
public java.lang.Integer getOrgLangId()
public java.lang.String getOrigOrderLastUpdate()
public java.util.Locale getOrgLocale()
public TypedProperty getOrgReqProperties()
public java.lang.String getOrigOrderCouponIds()
public java.math.BigDecimal getOrigOrderGrandTotal()
public java.math.BigDecimal getOrigOrderLevelMenuAdjustment()
public java.lang.String getOrigOrderStatus()
public java.math.BigDecimal getOrigShippingCharge()
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 getSecondOrderId()
public java.lang.String getXMLFile()
protected boolean ifAttributeChanged(java.lang.String changedAttr, java.lang.String origAttr)
changedAttr
- The changed attributeorigAttr
- The original attributeprotected boolean ifAttributeChanged(java.math.BigDecimal changedAttr, java.math.BigDecimal origAttr)
changedAttr
- The changed attributeorigAttr
- The original attributeprotected boolean ifOrderItemChanged(OrderItemDataBean changedOrderItem, OrderItemDataBean originalOrderItem) throws java.lang.Exception
changedOrderItem
- The changed order itemoriginalOrderItem
- The original order itemjava.lang.Exception
protected OrderDataBean initOrderBean(java.lang.String orderId) throws java.lang.Exception
orderId
- The order ID.java.lang.Exception
- If fails to initialize the order
databean.public void performExecute() throws ECException
performExecute
in interface
ECCommand
performExecute
in class
AbstractECTargetableCommand
ECException
- If fails to roolback order.protected void removeOrderItems(java.util.Vector orderItems) throws java.lang.Exception
orderItems
- The order items need to be deleted.java.lang.Exception
protected void removePrevPayment(java.lang.String orderId) throws ECApplicationException
orderId
- The order Id.
ECApplicationException
protected void rollbackDeletedOrUpdatedOrderItems(OrderDataBean changedOrder, java.util.Vector changedOrderItems, OrderDataBean originalOrder, java.util.Vector originalOrderItems) throws java.lang.Exception
changedOrder
- The order which has been changed.changedOrderItems
- The order items of the changedOrder.originalOrder
- The original order which contains the saved
value.originalOrderItems
- The order items of the original
order.java.lang.Exception
protected void rollbackOrderAdjustment(OrderDataBean changedOrder) throws java.lang.Exception
changedOrder
- The order which has been changed.java.lang.Exception
protected void setBackupOrder(OrderDataBean newOrder)
newOrder
- The backup order.protected void setBackupOrderId(java.lang.String newBackupOrderId)
newBackupOrderId
- The backup order ID.protected void setBackupOrderItems(java.util.Vector newOrderItems)
newOrderItems
- The order items of the backup
order.protected void setCustomerId(java.lang.String newCustomerId)
newCustomerId
- The customer ID.protected void setFirstOrder(OrderDataBean newOrder)
newOrder
- The first order.protected void setFirstOrderId(java.lang.String newFirstOrderId)
newFirstOrderId
- The ID of the first
order.protected void setFirstOrderItems(java.util.Vector newOrderItems)
protected void setNLS(java.util.Hashtable newNLS)
newNLS
- The NLS properties.protected void setOrgCmdContext(CommandContext newOrgCmdContext)
newOrgCmdContext
- The original command
context.protected void setOrgLangId(java.lang.Integer newOrgLangId)
newOrgLangId
- The original language ID.public void setOrigOrderLastUpdate(java.lang.String inOrigOrderLastUpdate)
protected void setOrgLocale(java.util.Locale newOrgLocale)
newOrgLocale
- The original Locale.protected void setOrgReqProperties(TypedProperty newOrgReqProperties)
newOrgReqProperties
- The original request
properties.public void setOrigOrderCouponIds(java.lang.String newOrigOrderCouponIds)
newOrigOrderCouponIds
- IDs of coupons used in the original
orderpublic void setOrigOrderLevelMenuAdjustment(java.lang.String tmpValue)
public void setOrigShippingCharge(java.lang.String tmpValue)
public void setOrigOrderStatus(java.lang.String inOrigOrderStatus)
protected void setRedirectURL(java.lang.String newRedirectURL)
newRedirectURL
- The redirect URL.protected void setSecondOrderId(java.lang.String newSecondOrderId)
newSecondOrderId
- The second order ID.protected void setXMLFile(java.lang.String newXMLFile)
newXMLFile
- The XML file.public void validateParameters() throws ECApplicationException
validateParameters
in interface
ECCommand
validateParameters
in class
AbstractECTargetableCommand
ECApplicationException