com.ibm.commerce.couponredemption.commands
Class CouponDSSCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.ControllerCommandImpl
                    |
                    +--com.ibm.commerce.couponredemption.commands.CouponDSSCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, CouponDSSCmd, ECCommand, ECTargetableCommand

public class CouponDSSCmdImpl
extends ControllerCommandImpl
implements CouponDSSCmd

This command is called when user selects a set of eCoupons and items for these coupons to be applied on in an order. For customizability, it simply calls a task command CouponDSSTaskCmd. If the selection was correct then if the SUCCESS_URL is specified the controller is transferred to that URL, otherwise, CouponDSSSuccessView is displayed. If the selection was incorrect then if the FAILURE_URL is specified the controller is transferred to that URL, otherwise, ApplicableCouponView is displayed.

See Also:
Serialized Form

Field Summary
protected  java.lang.Long[] couponId
          The IDs of the coupons to be applied to this order
protected  java.lang.String currency
          Currency to be used in discount amount calculation.
protected  java.util.Hashtable itemsSelected
          This hashtable stores the mapping from the couponIds to the array of orderitemIds that the coupon applies to.
protected  int numCoupons
          Number of coupons to be applied to this order, essentially length of couponId.
protected  java.lang.Long orderId
          ID of the order
protected  CommandContext processingContext
          The command context holder
protected  boolean selectionOK
          Indicates whether the parameters were properly formed.
 
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.couponredemption.commands. CouponDSSCmd
COPYRIGHT, defaultCommandClassName
 
Fields inherited from interface com.ibm.commerce.command. ECTargetableCommand
COPYRIGHT
 
Constructor Summary
CouponDSSCmdImpl()
          CouponDSSCmdImpl constructor, call super.
 
Method Summary
  AccessVector getResources()
          Gets the resources for eCoupon promotion.
 boolean isReadyToCallExecute()
          It always returns true.
 void performExecute()
          For customizability, it simply calls a task command CouponDSSTaskCmd.
 void validateParameters()
          It validates the parameters.
 
Methods inherited from class com.ibm.commerce.command. ControllerCommandImpl
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setRequestProperties, 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, 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

couponId

protected java.lang.Long[] couponId
The IDs of the coupons to be applied to this order

numCoupons

protected int numCoupons
Number of coupons to be applied to this order, essentially length of couponId.

orderId

protected java.lang.Long orderId
ID of the order

processingContext

protected CommandContext processingContext
The command context holder

currency

protected java.lang.String currency
Currency to be used in discount amount calculation.

selectionOK

protected boolean selectionOK
Indicates whether the parameters were properly formed.

itemsSelected

protected java.util.Hashtable itemsSelected
This hashtable stores the mapping from the couponIds to the array of orderitemIds that the coupon applies to.
Constructor Detail

CouponDSSCmdImpl

public CouponDSSCmdImpl()
CouponDSSCmdImpl constructor, call super.
Method Detail

getResources

public AccessVector getResources()
                          throws ECSystemException
Gets the resources for eCoupon promotion.
Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
the resources for eCoupon promotion
Throws:
ECSystemException

isReadyToCallExecute

public boolean isReadyToCallExecute()
It always returns true.
Overrides:
isReadyToCallExecute in class AbstractECTargetableCommand
Returns:
true always.

performExecute

public void performExecute()
                    throws ECException
For customizability, it simply calls a task command CouponDSSTaskCmd. If the selection was correct then if the SUCCESS_URL is specified the controller is transferred to that URL, otherwise, CouponDSSSuccessView is displayed. If the selection was incorrect then if the FAILURE_URL is specified the controller is transferred to that URL, otherwise, ApplicableCouponView is displayed.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
: - com.ibm.commerce.exception.ECException
ECException

validateParameters

public void validateParameters()
                        throws ECException
It validates the parameters.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException