|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.ibm.commerce.command.AbstractECTargetableCommand | +--com.ibm.commerce.command.ControllerCommandImpl | +--com.ibm.commerce.tools.command.ToolsControllerCommandImpl | +--com.ibm.commerce.tools.optools.order.commands.CSROrderRollBackCmdImpl
Change the first order so that it will contain the same order items as those order items in the backup order.
If the first order has a order item with a SKU which does not exist in the backup order, this command will call OrderItemDelete command to delete this order item from the first order.
If the backup order has a order item with a SKU which does not exist in the first order, this command will call OrderItemAdd command to add the order item to the first order.
If the first order has a order item with a SKU which does exist in the backup order, this command will compare the following attributes of those two order items:
If there is any difference found, the command will call the OrderItemUpdate command to update the order item of the first order.
Set the shipping charge, menu adjustment and coupons of the first order as those values provided by the XML.
After the changes made to the first order is done, the command will do the following:
If the grand totoal of the first order is different from the value in the XML, the command will return a warning message.
If the second order exists, this command will cancel the second order.
This command will remove the backup order after all the changes are made to the first order successfully. If the command fail to remove the backup order, the command will return a warning message.
Field Summary | |
static java.lang.String |
COPYRIGHT
|
static java.lang.String |
ERRTASK_NAME
|
static java.lang.String |
NOTEBOOK_URL
|
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)
Create a vector from a array. |
protected TypedProperty |
exceptionUtil(TypedProperty prop,
java.lang.Exception ex,
java.lang.String methodName,
java.lang.String cmdName)
Common exception code. |
protected void |
executeOrderCancelCmd(java.lang.String orderId)
Call the AdminOrderCancel command to cancel an order. |
protected void |
executeOrderDelete(java.lang.String orderId)
Delete an order in database. |
protected void |
executeOrderItemAdd(OrderItemDataBean theOrderItem)
Call OrderItemAdd command to add an order item. |
protected void |
executeOrderItemDelete(OrderItemDataBean theOrderItem)
Call OrderItemDelete command to delete an order item. |
protected void |
executeOrderItemUpdate(OrderItemDataBean changedOrderItem,
OrderItemDataBean originalOrderItem)
Call OrderItemUpdate command 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 OrderPrepare command to prepare an order. |
protected void |
executeOrderProcess(java.lang.String orderId,
java.lang.String payInfoOrderId)
This method calls OrderProcess command to complete an order by using the payment info from another order (order is is payInfoOrderId). |
protected void |
executeSetOrderLevelAdjustmentCmd(java.math.BigDecimal orderLevelMenuAdjustment,
java.math.BigDecimal shippingCharge)
This method call SetOrderLevelParameter command to set the shipping charge and menu adjustments. |
protected OrderDataBean |
getBackupOrder()
Return the backup order. |
java.lang.String |
getBackupOrderId()
Return backup order ID. |
protected java.util.Vector |
getBackupOrderItems()
Return the order items of the backup order. |
java.lang.String |
getCustomerId()
Return customer ID. |
protected OrderDataBean |
getFirstOrder()
Return the first order. |
java.lang.String |
getFirstOrderId()
Return first order ID. |
protected java.util.Vector |
getFirstOrderItems()
Return the order items of the first order. |
java.util.Hashtable |
getNLS()
Return NLS properties. |
CommandContext |
getOrgCmdContext()
Return original command context. |
java.lang.Integer |
getOrgLangId()
Return original language ID. |
java.util.Locale |
getOrgLocale()
Return original Locale. |
TypedProperty |
getOrgReqProperties()
Return original request properties. |
java.lang.String |
getOrigOrderCouponIds()
Returns the string of coupons IDs used in the original order. |
java.math.BigDecimal |
getOrigOrderGrandTotal()
Return original order grand total. |
java.math.BigDecimal |
getOrigOrderLevelMenuAdjustment()
Return original order level menu adjustment. |
java.math.BigDecimal |
getOrigShippingCharge()
Return the original shipping charge. |
java.lang.String |
getRedirectURL()
Return redirect URL. |
AccessVector |
getResources()
Gets the access vector accessed by this command. |
java.lang.String |
getSecondOrderId()
Return the ID of the second order. |
java.lang.String |
getXMLFile()
Return XML file. |
protected boolean |
ifAttributeChanged(java.math.BigDecimal changedAttr,
java.math.BigDecimal origAttr)
Compare the values of two attributes with type BigDeciaml. |
protected boolean |
ifAttributeChanged(java.lang.String changedAttr,
java.lang.String origAttr)
Compare the values of two attributes with type String. |
protected boolean |
ifOrderItemChanged(OrderItemDataBean changedOrderItem,
OrderItemDataBean originalOrderItem)
Compare the following attributes of the two order items: Cat entry ID Quantity Contract ID Shipping address ID Shipping mode ID |
protected OrderDataBean |
initOrderBean(java.lang.String orderId)
Initialize a 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)
Delete all the order items in the order item list. |
protected void |
removePrevPayment(java.lang.String orderId)
Remove 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)
Set the shipping charge and the order level menu adjustments of the changed order to the original values. |
protected void |
setBackupOrder(OrderDataBean newOrder)
Set backup order. |
protected void |
setBackupOrderId(java.lang.String newBackupOrderId)
Set backup order ID. |
protected void |
setBackupOrderItems(java.util.Vector newOrderItems)
Set order items of the backup order. |
protected void |
setCustomerId(java.lang.String newCustomerId)
Set customer ID. |
protected void |
setFirstOrder(OrderDataBean newOrder)
Set first order. |
protected void |
setFirstOrderId(java.lang.String newFirstOrderId)
Set first order ID. |
protected void |
setFirstOrderItems(java.util.Vector newOrderItems)
Set order items of the first order. |
protected void |
setNLS(java.util.Hashtable newNLS)
Set NLS properties. |
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. |
void |
setOrigOrderCouponIds(java.lang.String newOrigOrderCouponIds)
Sets the list of coupons used in the original order |
void |
setOrigOrderLevelMenuAdjustment(java.lang.String tmpValue)
Set original order level menu adjustment. |
void |
setOrigShippingCharge(java.lang.String tmpValue)
Set original order shipping charge. |
protected void |
setRedirectURL(java.lang.String newRedirectURL)
Set redirect URL. |
protected void |
setSecondOrderId(java.lang.String newSecondOrderId)
Set second order ID. |
protected void |
setXMLFile(java.lang.String newXMLFile)
Set XML file. |
void |
validateParameters()
Set 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 |
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 |
public static final java.lang.String COPYRIGHT
public static java.lang.String ERRTASK_NAME
public static final java.lang.String NOTEBOOK_URL
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
- com.ibm.commerce.datatype.TypedPropertyex
- java.lang.ExceptionmethodName
- java.lang.StringcmdName
- java.lang.Stringprotected void executeOrderCancelCmd(java.lang.String orderId) throws ECApplicationException, ECException
orderId
- The order ID.ECApplicationException
- The exception descriptionECException
- protected void executeOrderDelete(java.lang.String orderId) throws java.lang.Exception
java.lang.Exception
- protected void executeOrderItemAdd(OrderItemDataBean theOrderItem) throws java.lang.Exception
theOrderItem
- The order item need to be added.java.lang.Exception
- protected void executeOrderItemDelete(OrderItemDataBean theOrderItem) throws java.lang.Exception
theOrderItem
- The order item need to be deleted.java.lang.Exception
- protected void executeOrderItemUpdate(OrderItemDataBean changedOrderItem, OrderItemDataBean originalOrderItem) throws java.lang.Exception
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
- protected void executeOrderPrepare(java.lang.String orderId) throws ECException
orderId
- The order ID.ECException
- protected void executeOrderProcess(java.lang.String orderId, java.lang.String payInfoOrderId) throws java.lang.Exception
orderId
- The order ID.payInfoOrderId
- The ID of the order which the payment information stored.ECException
- protected void executeSetOrderLevelAdjustmentCmd(java.math.BigDecimal orderLevelMenuAdjustment, java.math.BigDecimal shippingCharge) throws ECException, java.lang.Exception
orderLevelMenuAdjustment
- The order level menu adjustment.shippingCharge
- The shipping charge.ECException
- The exception description.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.util.Locale getOrgLocale()
public TypedProperty getOrgReqProperties()
public java.lang.String getOrigOrderCouponIds()
public java.math.BigDecimal getOrigOrderGrandTotal()
public java.math.BigDecimal getOrigOrderLevelMenuAdjustment()
public java.math.BigDecimal getOrigShippingCharge()
public java.lang.String getRedirectURL()
public AccessVector getResources() throws ECException
getResources
in interface ECCommand
getResources
in class AbstractECTargetableCommand
public java.lang.String getSecondOrderId()
public java.lang.String getXMLFile()
protected boolean ifAttributeChanged(java.math.BigDecimal changedAttr, java.math.BigDecimal origAttr)
changedAttr
- The changed attributeorigAttr
- The original attributeprotected boolean ifAttributeChanged(java.lang.String changedAttr, java.lang.String 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 itemprotected OrderDataBean initOrderBean(java.lang.String orderId) throws java.lang.Exception
orderId
- The order ID.public void performExecute() throws ECException
performExecute
in interface ECCommand
performExecute
in class AbstractECTargetableCommand
ECException
- 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)
newFirstOrderId
- The order items of the first order.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.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)
The
- original order level menu adjustment.public void setOrigShippingCharge(java.lang.String tmpValue)
The
- original order shipping charge.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
-
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |