|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.droplet.EmptyFormHandler atg.droplet.GenericFormHandler atg.commerce.promotion.CouponFormHandler
public class CouponFormHandler
This FormHandler is used to "claim" a promotion and then stick this promotion into the users current list of promotions. The idea is that a coupon is just another mechanism to deliver a promotion to the user, i.e. they explicitly obtain the promotion by entering a coupon claim number and then obtaining the promotion.
The handleClaimCoupon method is responsible for actually doing the work and obtaining the promotion.
PromotionTools
,
ClaimableTools
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
Fields inherited from class atg.droplet.GenericFormHandler |
---|
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
CouponFormHandler()
Empty Constructor |
Method Summary | |
---|---|
boolean |
checkPromotionType(RepositoryItem pPromotion)
Checks to see if the type of the promotion is valid. |
protected void |
claimCoupon(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Claim the coupon. |
ClaimableManager |
getClaimableManager()
Return the ClaimableManager property. |
ClaimableTools |
getClaimableTools()
Return the ClaimableTools property. |
java.lang.String |
getClaimCouponErrorURL()
Return the claimCouponErrorURL property. |
java.lang.String |
getClaimCouponSuccessURL()
Return the claimCouponSuccessURL property. |
java.lang.String |
getCouponClaimCode()
Return the couponClaimCode property. |
Profile |
getProfile()
Return the Profile property. |
PromotionTools |
getPromotionTools()
Return the PromotionTools property. |
javax.transaction.TransactionManager |
getTransactionManager()
Return the TransactionManager property. |
java.lang.String |
getTransactionType()
Return the TransactionType property. |
protected java.util.Locale |
getUserLocale(DynamoHttpServletRequest pRequest)
Obtain the users locale by examining the request object first and then getting the default Locale object. |
java.lang.String[] |
getValidCouponItemTypes()
The list of acceptable item types for promotions when claiming a coupon. |
boolean |
handleClaimCoupon(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Method that is invoked to claim a coupon. |
protected void |
processError(java.lang.String pErrorCodeId,
java.lang.Exception e,
DynamoHttpServletRequest pRequest)
If an error occurs, this method will obtain the correct Msg resource string based upon the users locale from the getUserLocale method. |
void |
setClaimableManager(ClaimableManager pClaimableManager)
Set the ClaimableManager property. |
void |
setClaimableTools(ClaimableTools pClaimableTools)
Set the ClaimableTools property. |
void |
setClaimCouponErrorURL(java.lang.String pClaimCouponErrorURL)
Set the claimCouponErrorURL property. |
void |
setClaimCouponSuccessURL(java.lang.String pClaimCouponSuccessURL)
Set the claimCouponSuccessURL property. |
void |
setCouponClaimCode(java.lang.String pCouponClaimCode)
Set the couponClaimCode property. |
void |
setProfile(Profile pProfile)
Set the Profile property. |
void |
setPromotionTools(PromotionTools pPromotionTools)
Set the PromotionTools property. |
void |
setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
Set the TransactionManager property. |
void |
setTransactionType(java.lang.String pTransactionType)
Set the TransactionType property. |
void |
setValidCouponItemTypes(java.lang.String[] pValidCouponItemTypes)
|
Methods inherited from class atg.droplet.EmptyFormHandler |
---|
afterGet, beforeGet |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public CouponFormHandler()
Method Detail |
---|
public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
public javax.transaction.TransactionManager getTransactionManager()
public void setTransactionType(java.lang.String pTransactionType)
public java.lang.String getTransactionType()
public void setClaimableTools(ClaimableTools pClaimableTools)
public ClaimableTools getClaimableTools()
public void setClaimCouponSuccessURL(java.lang.String pClaimCouponSuccessURL)
public java.lang.String getClaimCouponSuccessURL()
public void setClaimCouponErrorURL(java.lang.String pClaimCouponErrorURL)
public java.lang.String getClaimCouponErrorURL()
public void setCouponClaimCode(java.lang.String pCouponClaimCode)
public java.lang.String getCouponClaimCode()
public void setProfile(Profile pProfile)
public Profile getProfile()
public void setPromotionTools(PromotionTools pPromotionTools)
public PromotionTools getPromotionTools()
public void setClaimableManager(ClaimableManager pClaimableManager)
public ClaimableManager getClaimableManager()
public void setValidCouponItemTypes(java.lang.String[] pValidCouponItemTypes)
public java.lang.String[] getValidCouponItemTypes()
handleClaimCoupon
protected void claimCoupon(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws ClaimableException
pRequest
- a value of type 'DynamoHttpServletRequest'pResponse
- a value of type 'DynamoHttpServletResponse'
ClaimableException
public boolean handleClaimCoupon(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- a value of type 'DynamoHttpServletRequest'pResponse
- a value of type 'DynamoHttpServletResponse'
javax.servlet.ServletException
- if an error occurs
java.io.IOException
- if an error occursprotected void processError(java.lang.String pErrorCodeId, java.lang.Exception e, DynamoHttpServletRequest pRequest) throws javax.servlet.ServletException, java.io.IOException
pErrorCodeId
- the error key that is used to obtain the error string
javax.servlet.ServletException
java.io.IOException
protected java.util.Locale getUserLocale(DynamoHttpServletRequest pRequest) throws javax.servlet.ServletException, java.io.IOException
pRequest
- a value of type 'DynamoHttpServletRequest'
javax.servlet.ServletException
- if an error occurs
java.io.IOException
- if an error occurspublic boolean checkPromotionType(RepositoryItem pPromotion)
validCouponItemTypes
pPromotion
-
validCouponItemTypes
list.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |