public class CouponAddRemoveControllerCmdImpl extends ControllerCommandImpl implements CouponAddRemoveControllerCmd
This Controller Command adds or removes a Coupon from an Order or deletes a Coupon. It implements CouponAddRemoveControllerCmd interface. This command is mapped to CouponsAddRemove URL.
If the command is executed as a url Command the following URL parameters must be set
Optionally the following url parameters can be set
Note: If both URL & VIEW parameters are specified, the request will be redirected to URL. If both are not specified the request will be forwarded to CouponsDisplayView.
If executing this Command as a task Command, the methods listed below must be invoked before calling the command
setCouponIds setURL or setViewName setTaskType setOrderId
Optionally the following methods can be invoked
setUserIdentifier (If for guest shopper we need to set a token which uniquely identifies her/him)
Constructor and Description |
---|
CouponAddRemoveControllerCmdImpl()
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected void | addCouponToCurrentOrder(java.lang.String couponId)
Adds a coupon to the current order.
|
protected void | changeStatusToMarkedForDelete(java.lang.String couponId)
Change Coupon status to mark for delete.
|
java.util.Vector | getCouponIds()
This method gets the list of CouponId.
|
java.lang.Long | getOrderId()
This method gets the order ID for which the Coupon should be added or removed.
|
AccessVector | getResources()
Gets the resources associated with the command.
|
java.lang.String | getTaskType()
This method gets the task type.
|
java.lang.String | getURL()
This method gets the redirect URL
|
java.lang.String | getUserIdentifier()
This method gets the userIdentifier.
|
java.lang.String | getViewName()
This methods returns the View Name.
|
void | performExecute()
Command execution body for performing different tasks depending upon the task type.
|
protected void | redirect()
redirects the response
|
protected void | removeCouponFromCurrentOrder(java.lang.String couponId)
Removes a coupon from the current order.
|
void | setCouponIds(java.util.Vector couponIds)
This method sets the list of CouponId that should be added or removed.
|
void | setOrderId(java.lang.Long orderId)
This method sets the orderId for which the Coupon should be added or removed.
|
void | setRequestProperties(TypedProperty reqProperties)
This method sets the request properties.
|
void | setTaskType(java.lang.String taskType)
This method sets the taskType.
|
void | setURL(java.lang.String url)
This method sets the redirect URL
|
void | setUserIdentifier(java.lang.String userIdentifier)
This method sets the userIdentifier.
|
void | setViewName(java.lang.String viewName)
This method sets the view name.
|
void | validateParameters()
Validates the parameters to make sure they are set.
|
public CouponAddRemoveControllerCmdImpl()
public void setRequestProperties(TypedProperty reqProperties) throws ECException
public void setUserIdentifier(java.lang.String userIdentifier)
public void setURL(java.lang.String url)
public void setTaskType(java.lang.String taskType)
public void setOrderId(java.lang.Long orderId)
public void setCouponIds(java.util.Vector couponIds)
public void setViewName(java.lang.String viewName)
public java.lang.String getViewName()
public java.lang.String getUserIdentifier()
public java.lang.String getURL()
public java.lang.String getTaskType()
public java.lang.Long getOrderId()
public java.util.Vector getCouponIds()
protected void changeStatusToMarkedForDelete(java.lang.String couponId) throws ECException
protected void addCouponToCurrentOrder(java.lang.String couponId) throws ECException
protected void removeCouponFromCurrentOrder(java.lang.String couponId) throws ECException
public void validateParameters() throws ECException
public void performExecute() throws ECSystemException, ECException
protected void redirect()
public AccessVector getResources()