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

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.CSROrderAdjustmentUpdateCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, CSROrderAdjustmentUpdateCmd, ECCommand, ECTargetableCommand, ToolsControllerCommand

public class CSROrderAdjustmentUpdateCmdImpl
extends ToolsControllerCommandImpl
implements CSROrderAdjustmentUpdateCmd

This is the default implementation of the CSROrderAdjustmentUpdateCmd command.

This command calls the following command(s):

This command uses the following AccessBean(s):

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          IBM copyright notice field.
static java.lang.String ERRTASK_NAME
          Error handling viewname for this command.
 
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)
          This method sets up the response property when an excetion occurs.
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 isFirstShippingOverride()
          Returns true if shipping charge field in first order has been overridden.
 boolean isSecondDirtyBit()
          Returns true if any adjustment field in second order has been changed.
 boolean isSecondShippingOverride()
          Returns true if shipping charge field in second order has been overridden.
 void performExecute()
          Performs the execution for updating the order level CSR adjustments, eCoupons, and overrides the shipping charges for the order(s)
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 setFirstShippingOverride(java.lang.String newFirstShippingOverride)
          Sets true if shipping charge field in first order has been overridden.
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 setSecondShippingOverride(java.lang.String newSecondShippingOverride)
          Returns true if shipping charge field in second order has been overridden.
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
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
IBM copyright notice field.
See Also:
Constant Field Values

ERRTASK_NAME

public static java.lang.String ERRTASK_NAME
Error handling viewname for this command.
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)
This method sets up the response property when an excetion occurs.
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
java.lang.Exception - 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.
Returns:
The 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 resource can not 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.
Returns:
The 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

isFirstShippingOverride

public boolean isFirstShippingOverride()
Returns true if shipping charge field in first order has been overridden.
Returns:
The flag indicating whether the shipping charge of first order is overridden.

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

isSecondShippingOverride

public boolean isSecondShippingOverride()
Returns true if shipping charge field in second order has been overridden.
Returns:
The flag indicating whether the shipping charge of second order is overridden.

performExecute

public void performExecute()
                    throws ECException
Performs the execution for updating the order level CSR adjustments, eCoupons, and overrides the shipping charges for the order(s)
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

setFirstShippingOverride

protected void setFirstShippingOverride(java.lang.String newFirstShippingOverride)
Sets true if shipping charge field in first order has been overridden.
Parameters:
newFirstShippingOverride - The flag indicating whether the shipping charge field of first order is overridden.

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

setSecondShippingOverride

protected void setSecondShippingOverride(java.lang.String newSecondShippingOverride)
Returns true if shipping charge field in second order has been overridden.
Parameters:
newSecondShippingOverride - The flag indicating whether the shipping charge field of second order is overridden.

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