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
,
)A
for adding the Coupon to Order, R
for removing Coupon from Order, D
for
deleting the Coupon.) 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)
defaultCommandClassName, NAME
Constructor and Description |
---|
CouponAddRemoveControllerCmdImpl()
Constructor
|
Modifier and Type | Method and Description |
---|---|
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.
|
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.
|
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
fulfills, getOwner
public CouponAddRemoveControllerCmdImpl()
public void setRequestProperties(TypedProperty reqProperties) throws ECException
setRequestProperties
in interface ControllerCommand
setRequestProperties
in class ControllerCommandImpl
reqProperties
- This is an object that represents the request properties.ECException
- if an error is encountered on setting the request properties.ControllerCommand.setRequestProperties(com.ibm.commerce.datatype.TypedProperty)
public void setUserIdentifier(java.lang.String userIdentifier)
userIdentifier
- is the userIdentifier to set.public void setURL(java.lang.String url)
url
- is the redirect URLpublic void setTaskType(java.lang.String taskType)
A
for
adding Coupon to order or R
for removing Coupon from order
or D
for deleting the Coupon.taskType
- is the task type to set.public void setOrderId(java.lang.Long orderId)
orderId
- is the order id to set.public void setCouponIds(java.util.Vector couponIds)
couponIds
- is the list of couponId.public void setViewName(java.lang.String viewName)
viewName
- is the view name to set.public java.lang.String getViewName()
public java.lang.String getUserIdentifier()
public java.lang.String getURL()
public java.lang.String getTaskType()
A
for adding Coupon to order or R
for removing Coupon from
order or D
for deleting the Coupon.public java.lang.Long getOrderId()
public java.util.Vector getCouponIds()
public void validateParameters() throws ECException
validateParameters
in interface ECCommand
validateParameters
in class AbstractECTargetableCommand
ECException
- when the operation fails.public void performExecute() throws ECSystemException, ECException
A
for
adding Coupon to order or R
for removing Coupon from order
or D
for deleting the Coupon.performExecute
in interface ECCommand
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class AbstractECTargetableCommand
ECSystemException
- when a system exception is encountered.ECException
- when a general exception is encountered.public AccessVector getResources()
getResources
in interface ECCommand
getResources
in class AbstractECTargetableCommand