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

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

public class CSROrderAdjustmentUpdateCmdImpl
extends ToolsControllerCommandImpl
implements CSROrderAdjustmentUpdateCmd

Updates the order level menu adjustments, eCoupons, and overrides the shipping charges for the order(s).


Old coupons specified will be removed and replaced by the new ones.


Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String ERRTASK_NAME
           
 
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.CSROrderAdjustmentUpdateCmd
defaultCommandClassName, NAME
 
Constructor Summary
CSROrderAdjustmentUpdateCmdImpl()
           
 
Method Summary
protected  TypedProperty exceptionUtil(TypedProperty prop, java.lang.Exception ex, java.lang.String methodName, java.lang.String cmdName)
          Generates common exception code.
protected  void executeCSROrderPrepare()
          Calls CSROrderPrepareCmd to parepare order(s).
protected  void executeSetOrderLevelAdjustmentCmd(java.lang.String orderId, java.math.BigDecimal menuAdjustment, java.math.BigDecimal shippingCharge)
          Calls SetOrderLevelParameterCmd to set adjustments.
 java.math.BigDecimal getFirstManuAdjust()
          Returns manual adjustment for first order.
 java.lang.String getFirstOrderCouponIds()
          Returns the string of coupon IDs used in the first order.
 java.lang.String getFirstOrderId()
          Returns first order ID.
 java.math.BigDecimal getFirstShip()
          Returns the shipping charge for 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 getRedirectURL()
          Gets the URL to be redirected to.
 AccessVector getResources()
          Gets the access vector accessed by this command.
 java.math.BigDecimal getSecondManuAdjust()
          Returns manual adjustment for second order.
 java.lang.String getSecondOrderCouponIds()
          Returns the string of coupon IDs used in the second order.
 java.lang.String getSecondOrderId()
          Returns second order ID.
 java.math.BigDecimal getSecondShip()
          Returns the shipping charge for second order.
 java.lang.String getShopperId()
          Returns shopper ID.
 boolean isFirstDirtyBit()
          Returns true if any adjustment field in first order has been changed.
 boolean isSecondDirtyBit()
          Returns true if any adjustment field in second order has been changed.
 void performExecute()
          Performs the execution for creating a manual adjustment orderitem for order.
protected  void setFirstDirtyBit(java.lang.String newFirstDirtyBit)
          Sets true if any adjustment field in first order has been changed.
protected  void setFirstManuAdjust(java.lang.String newFirstManuAdjust)
          Sets manual adjustment for first order..
 void setFirstOrderCouponIds(java.lang.String newFirstOrderCouponIds)
          Sets the list of coupons used in the first order
protected  void setFirstOrderId(java.lang.String newFirstOrderId)
          Sets first order ID.
protected  void setFirstShip(java.lang.String newFirstShip)
          Sets the shipping charge for 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 setRedirectURL(java.lang.String newRedirectURL)
          Sets the redirect URL
protected  void setSecondDirtyBit(java.lang.String newSecondDirtyBit)
          Returns true if any adjustment field in second order has been changed.
protected  void setSecondManuAdjust(java.lang.String newSecondManuAdjust)
          Sets manual adjustment for second order.
 void setSecondOrderCouponIds(java.lang.String newSecondOrderCouponIds)
          Sets the string having the coupon IDs of the coupons used in the second order
protected  void setSecondOrderId(java.lang.String newSecondOrderId)
          Sets second order ID.
protected  void setSecondShip(java.lang.String newSecondShip)
          Sets the shipping charge for second order.
protected  void setShopperId(java.lang.String newShopperId)
          Sets shopper ID.
 void validateParameters()
          Gets XMLObject from the GUI Notebook or Wizard and get ready to parse it.
 
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

ERRTASK_NAME

public static java.lang.String ERRTASK_NAME
Constructor Detail

CSROrderAdjustmentUpdateCmdImpl

public CSROrderAdjustmentUpdateCmdImpl()
Method Detail

exceptionUtil

protected TypedProperty exceptionUtil(TypedProperty prop,
                                      java.lang.Exception ex,
                                      java.lang.String methodName,
                                      java.lang.String cmdName)
Generates common exception code.
Parameters:
prop - The response typed property.
ex - The catched exception.
methodName - The method that generates the exception
cmdName - The command that generates the exception
Returns:
The response typed property of the exception

executeCSROrderPrepare

protected void executeCSROrderPrepare()
                               throws ECException
Calls CSROrderPrepareCmd to parepare order(s).
Throws:
ECException - If the order cannot be prepared.

executeSetOrderLevelAdjustmentCmd

protected void executeSetOrderLevelAdjustmentCmd(java.lang.String orderId,
                                                 java.math.BigDecimal menuAdjustment,
                                                 java.math.BigDecimal shippingCharge)
                                          throws ECException,
                                                 java.lang.Exception
Calls SetOrderLevelParameterCmd to set adjustments.
Parameters:
orderId - The ID of the order which will be applied the adjustments
menuAdjustment - The order level menu adjustment
shippingCharge - The shipping charge needs to be overriden
Throws:
ECException - If the order level adjustments cannot be updated

getFirstManuAdjust

public java.math.BigDecimal getFirstManuAdjust()
Returns manual adjustment for first order.
Returns:
The manual adjustment for first order

getFirstOrderCouponIds

public java.lang.String getFirstOrderCouponIds()
Returns the string of coupon IDs used in the first order.

getFirstOrderId

public java.lang.String getFirstOrderId()
Returns first order ID.
Returns:
The first order ID

getFirstShip

public java.math.BigDecimal getFirstShip()
Returns the shipping charge for first order.
Returns:
The shipping charge for the first order

getNLS

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

getOrgCmdContext

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

getOrgLangId

public java.lang.Integer getOrgLangId()
Returns original language ID.
Returns:
The original language ID

getOrgLocale

public java.util.Locale getOrgLocale()
Returns original Locale.
Returns:
The original Locale

getOrgReqProperties

public TypedProperty getOrgReqProperties()
Returns original request properties.
Returns:
The original request properties

getRedirectURL

public java.lang.String getRedirectURL()
Gets the URL to be redirected to.
Returns:
The redirect URL

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:
The vector of resource action pairs
Throws:
ECException - If the order cannot be retrieved

getSecondManuAdjust

public java.math.BigDecimal getSecondManuAdjust()
Returns manual adjustment for second order.
Returns:
The manual adjustment for the second order

getSecondOrderCouponIds

public java.lang.String getSecondOrderCouponIds()
Returns the string of coupon IDs used in the second order.

getSecondOrderId

public java.lang.String getSecondOrderId()
Returns second order ID.
Returns:
The second order ID

getSecondShip

public java.math.BigDecimal getSecondShip()
Returns the shipping charge for second order.
Returns:
The shipping charge for the second order

getShopperId

public java.lang.String getShopperId()
Returns shopper ID.
Returns:
The shopper ID

isFirstDirtyBit

public boolean isFirstDirtyBit()
Returns true if any adjustment field in first order has been changed.
Returns:
The flag indicating whether the first order is changed

isSecondDirtyBit

public boolean isSecondDirtyBit()
Returns true if any adjustment field in second order has been changed.
Returns:
The flag indicating whether the second order is changed

performExecute

public void performExecute()
                    throws ECException
Performs the execution for creating a manual adjustment orderitem for order.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException - If the order adjustments cannot be updated

setFirstDirtyBit

protected void setFirstDirtyBit(java.lang.String newFirstDirtyBit)
Sets true if any adjustment field in first order has been changed.
Parameters:
newFirstDirtyBit - The flag indicating whether the first order is changed

setFirstManuAdjust

protected void setFirstManuAdjust(java.lang.String newFirstManuAdjust)
Sets manual adjustment for first order..
Parameters:
newFirstManuAdjust - The value of the manual adjustment for the first order

setFirstOrderCouponIds

public void setFirstOrderCouponIds(java.lang.String newFirstOrderCouponIds)
Sets the list of coupons used in the first order
Parameters:
newFirstOrderCouponIds - IDs of coupons used in the first order

setFirstOrderId

protected void setFirstOrderId(java.lang.String newFirstOrderId)
Sets first order ID.
Parameters:
newFirstOrderId - The first order ID

setFirstShip

protected void setFirstShip(java.lang.String newFirstShip)
Sets the shipping charge for the first order.
Parameters:
newFirstShip - The value of the shipping charge for the first order

setNLS

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

setOrgCmdContext

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

setOrgLangId

protected void setOrgLangId(java.lang.Integer newOrgLangId)
Sets original language ID.
Parameters:
newOrgLangId - The original language ID

setOrgLocale

protected void setOrgLocale(java.util.Locale newOrgLocale)
Sets original Locale.
Parameters:
newOrgLocale - The original Locale

setOrgReqProperties

protected void setOrgReqProperties(TypedProperty newOrgReqProperties)
Sets original request properties.
Parameters:
newOrgReqProperties - The original request properties

setRedirectURL

public void setRedirectURL(java.lang.String newRedirectURL)
Sets the redirect URL
Parameters:
newRedirectURL - The redirect URL

setSecondDirtyBit

protected void setSecondDirtyBit(java.lang.String newSecondDirtyBit)
Returns true if any adjustment field in second order has been changed.
Parameters:
newSecondDirtyBit - The flag indicating whether the second order is changed

setSecondManuAdjust

protected void setSecondManuAdjust(java.lang.String newSecondManuAdjust)
Sets manual adjustment for second order.
Parameters:
newSecondManuAdjust - The value of the manual adjustment for hte second order

setSecondOrderCouponIds

public void setSecondOrderCouponIds(java.lang.String newSecondOrderCouponIds)
Sets the string having the coupon IDs of the coupons used in the second order
Parameters:
newSecondOrderCouponIds - IDs of coupons used in the second order

setSecondOrderId

protected void setSecondOrderId(java.lang.String newSecondOrderId)
Sets second order ID.
Parameters:
newSecondOrderId - The second order ID

setSecondShip

protected void setSecondShip(java.lang.String newSecondShip)
Sets the shipping charge for second order.
Parameters:
newSecondShip - The shipping charge for the second order

setShopperId

protected void setShopperId(java.lang.String newShopperId)
Sets shopper ID.
Parameters:
newShopperId - The shopper ID

validateParameters

public void validateParameters()
                        throws ECApplicationException
Gets XMLObject from the GUI Notebook or Wizard and get ready to parse it.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECApplicationException - If the XML does not contain the required parameters