| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.nucleus.TimedOperationService
atg.servlet.pipeline.PipelineableServletImpl
atg.servlet.pipeline.InsertableServletImpl
atg.commerce.promotion.PromotionServlet
public class PromotionServlet
The PromotionServlet allows a promotion to be added to a users profile
 via a URL.  It must be in the servlet pipeline for this to work.  If it 
 is in the servlet pipeline and enabled is true
 then the following example demonstrates how to use PromotionServlet:
 
<a href="../../whatever.jhtml" encode="true"> <param name="PROMO" value="promo10102"> Click here to get 20% discount on shirts... </a>
 Note: 
 First, encode=true is required otherwise the parameter is added as
 a query parameter and not a url parameter and it won't work 
 Second, value for the param tag is the promotion id in the
 /atg/commerce/pricing/Promotions repository for item descriptor(s) given 
 in property promotionItemDescriptorNames.
| Field Summary | |
|---|---|
| static java.lang.String | CLASS_VERSIONClass version string | 
| protected  java.lang.String | mPromotionParameter | 
| 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 | |
|---|---|
| PromotionServlet() | |
| Method Summary | |
|---|---|
|  java.lang.String | getProfile()The profile that the promotion will be added to. | 
|  java.lang.String[] | getPromotionItemDescriptorNames()These are the names of the valid promotion item descriptors | 
|  java.lang.String | getPromotionParameter()This is the name of the request parameter than contains the promotion. | 
|  Repository | getPromotionRepository()This is the repository that contains the promotions | 
|  PromotionTools | getPromotionTools()This is a helper class for manipulating promotions | 
|  boolean | isEnabled()If enabledis true, then this servlet is "active" in that
 it will look for a PROMO parameter to add to the current profile. | 
|  void | service(DynamoHttpServletRequest pRequest,
        DynamoHttpServletResponse pResponse)The service method that looks for the PROMO parameter and adds it to the profile, before pass the request to the next servlet in the pipeline. | 
|  void | setEnabled(boolean pEnabled) | 
|  void | setProfile(java.lang.String pProfile) | 
|  void | setPromotionItemDescriptorNames(java.lang.String[] pPromotionItemDescriptorNames) | 
|  void | setPromotionParameter(java.lang.String pPromotionParameter) | 
|  void | setPromotionRepository(Repository pPromotionRepository) | 
|  void | setPromotionTools(PromotionTools pPromotionTools) | 
| Methods inherited from class atg.servlet.pipeline.InsertableServletImpl | 
|---|
| doStartService, getInsertAfterServlet, setInsertAfterServlet | 
| Methods inherited from class atg.servlet.pipeline.PipelineableServletImpl | 
|---|
| createAdminServlet, destroy, getAdminServlet, getNextServlet, getServletConfig, getServletInfo, init, isUsePathInfo, passRequest, passRequest, service, service, setNextServlet, setServletInfo, setUsePathInfo | 
| Methods inherited from class atg.nucleus.TimedOperationService | 
|---|
| getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics | 
| 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 | 
| Methods inherited from interface atg.servlet.pipeline.PipelineableServlet | 
|---|
| getNextServlet, passRequest, setNextServlet | 
| Methods inherited from interface javax.servlet.Servlet | 
|---|
| destroy, getServletConfig, getServletInfo, init, service | 
| Field Detail | 
|---|
public static java.lang.String CLASS_VERSION
protected java.lang.String mPromotionParameter
| Constructor Detail | 
|---|
public PromotionServlet()
| Method Detail | 
|---|
public void setProfile(java.lang.String pProfile)
public java.lang.String getProfile()
public void setPromotionParameter(java.lang.String pPromotionParameter)
public java.lang.String getPromotionParameter()
PROMO
public void setPromotionRepository(Repository pPromotionRepository)
public Repository getPromotionRepository()
public void setPromotionItemDescriptorNames(java.lang.String[] pPromotionItemDescriptorNames)
public java.lang.String[] getPromotionItemDescriptorNames()
public void setPromotionTools(PromotionTools pPromotionTools)
public PromotionTools getPromotionTools()
public void setEnabled(boolean pEnabled)
public boolean isEnabled()
enabled is true, then this servlet is "active" in that
 it will look for a PROMO parameter to add to the current profile.
public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws java.io.IOException,
                    javax.servlet.ServletException
service in class PipelineableServletImpljava.io.IOException - if an error occurred while reading or writing
 the servlet request
javax.servlet.ServletException - if an error occurred while processing
 the servlet request| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||