public class PromotionCodeAddRemoveControllerCmdImpl extends ControllerCommandImpl implements PromotionCodeAddRemoveControllerCmd
This Controller Command adds or removes a PromotionCode from an Order. It implements the PromotionCodeAddRemoveControllerCmd interface. This command is mapped to the PromotionCodeManage 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
Optionally the following methods can be invoked
Constructor and Description |
---|
PromotionCodeAddRemoveControllerCmdImpl()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void | addPromoCodeToOrder()
Adds a promotion code to the current order
|
java.lang.Long | getOrderId()
This method gets the order ID for which the promotion code should be added or removed.
|
java.util.Vector | getPromotionCodes()
This method gets the promotion codes.
|
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 user identifier.
|
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
|
void | removePromoCodeFromOrder()
Removes a promotion code from the current order.
|
void | setOrderId(java.lang.Long aOrderId)
This method sets the order ID for which the promotion code should be added or removed.
|
void | setPromotionCodes(java.util.Vector aPromotionCodes)
This method sets the promotion codes.
|
void | setRequestProperties(TypedProperty aReqProperties)
This method sets the request properties of the controller command.
|
void | setTaskType(java.lang.String aTaskType)
This method sets the task type.
|
void | setURL(java.lang.String aUrl)
This method sets the redirect URL.
|
void | setUserIdentifier(java.lang.String aUserIdentifier)
This method sets the user identifier.
|
void | setViewName(java.lang.String aViewName)
This method sets the view name.
|
void | validateParameters()
Parameters validation to make sure they are set.
|
boolean | validatePromotionCode(java.lang.String pCode)
This method checks if the Promotion Code is valid.
|
public PromotionCodeAddRemoveControllerCmdImpl()
public void setUserIdentifier(java.lang.String aUserIdentifier)
public void setURL(java.lang.String aUrl)
public void setTaskType(java.lang.String aTaskType)
public void setOrderId(java.lang.Long aOrderId)
public void setPromotionCodes(java.util.Vector aPromotionCodes)
public void setViewName(java.lang.String aViewName)
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 getPromotionCodes()
public void setRequestProperties(TypedProperty aReqProperties) throws ECException
protected void redirect()
public void validateParameters() throws ECException
public void removePromoCodeFromOrder() throws ECException
public void addPromoCodeToOrder() throws ECApplicationException
public boolean validatePromotionCode(java.lang.String pCode) throws ECApplicationException
public void performExecute() throws ECSystemException, ECException
public AccessVector getResources()