atg.commerce.gifts
Class GiftlistDroplet

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.TimedOperationService
              extended by atg.nucleus.servlet.ServletService
                  extended by atg.nucleus.servlet.HttpServletService
                      extended by atg.servlet.DynamoServlet
                          extended by atg.commerce.gifts.GiftlistDroplet
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, ParameterServlet, java.util.EventListener, javax.servlet.Servlet

public class GiftlistDroplet
extends DynamoServlet

This servlet either adds or removes the specified giftlist to or from the optional param "profile". If "profile" is not supplied or is not an instance of Profile, it is resolved from Nucleus and this is the profile with which the giftlist is associated. The purpose of this servlet is to associate or disassociate other people's giftlists from a customer's profile. This servlet is configurable using the properties file. For example: GiftlistDroplet.properties

 $class=atg.commerce.gifts.GiftlistDroplet

 giftlistManager=GiftlistManager
 giftlistRepository=Giftlists
 
The invocation of the droplet can then be invoked with the following parameters:
 <DROPLET bean="/atg/commerce/gifts/GiftlistDroplet">
 <PARAM NAME="giftlistId" VALUE="param:giftlistId">
 <PARAM NAME="action" VALUE="add">
 <PARAM NAME="profile" VALUE="bean:/atg/userprofiling/Profile">
 <OPARAM NAME="output">
 Output
 </OPARAM>
 <OPARAM NAME="error">
 Error
 </OPARAM>
 </DROPLET>
 

If the profile is not passed in, it is resolved from the Nucleus. Then depending on the action passed into the servlet, it will either add or remove the giftlist from the profile.

The required input parameters for this servlet are:

giftlistId
The id of the giftlist
action
The action to perform on the giftlist
The following parameters are optional:
profile
The profile of the current customer. If not passed, it will be resolved from the Nucleus.

The output parameters for this servlet are:

output
Rendered if list added or removed successfully.
error
Any exception that may have occured while adding or removing list.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.servlet.DynamoServlet
mAllowCleanupRequest, mParameters
 
Fields inherited from class atg.nucleus.servlet.ServletService
SERVLET_INFO_KEY
 
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
GiftlistDroplet()
           
 
Method Summary
 java.lang.String getGiftlistActionAddProperty()
          Returns property giftlistActionAddProperty.
 java.lang.String getGiftlistActionRemoveProperty()
          Returns property giftlistActionRemoveProperty.
 GiftlistManager getGiftlistManager()
          Returns property giftlistManager.
 Repository getGiftlistRepository()
          Returns property giftlistRepository.
 java.lang.String getProfile()
          Returns property profile.
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Adds or removes giftlist from current profile.
 void setGiftlistActionAddProperty(java.lang.String pGiftlistActionAddProperty)
          Sets property giftlistActionAddProperty
 void setGiftlistActionRemoveProperty(java.lang.String pGiftlistActionRemoveProperty)
          Sets property giftlistActionRemoveProperty
 void setGiftlistManager(GiftlistManager pGiftlistManager)
          Sets property giftlistManager.
 void setGiftlistRepository(Repository pGiftlistRepository)
          Sets property giftlistRepository.
 void setProfile(java.lang.String pProfile)
          Sets property profile
 
Methods inherited from class atg.servlet.DynamoServlet
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, service, service, setParameter
 
Methods inherited from class atg.nucleus.servlet.ServletService
destroy, getServletConfig, getServletInfo, init, setServletInfo
 
Methods inherited from class atg.nucleus.TimedOperationService
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
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

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

GiftlistDroplet

public GiftlistDroplet()
Method Detail

setProfile

public void setProfile(java.lang.String pProfile)
Sets property profile

Parameters:
pProfile - the profile of the current customer.

getProfile

public java.lang.String getProfile()
Returns property profile.


setGiftlistManager

public void setGiftlistManager(GiftlistManager pGiftlistManager)
Sets property giftlistManager.

Parameters:
pGiftlistManager - the giftlistManager class to perform high level operations on giftlists and giftitems

getGiftlistManager

public GiftlistManager getGiftlistManager()
Returns property giftlistManager. Default GiftlistManager.


setGiftlistRepository

public void setGiftlistRepository(Repository pGiftlistRepository)
Sets property giftlistRepository.

Parameters:
pGiftlistRepository - the giftlist repository where giftlists are stored.

getGiftlistRepository

public Repository getGiftlistRepository()
Returns property giftlistRepository. Default GiftlistRepository.


setGiftlistActionRemoveProperty

public void setGiftlistActionRemoveProperty(java.lang.String pGiftlistActionRemoveProperty)
Sets property giftlistActionRemoveProperty

Parameters:
pGiftlistActionRemoveProperty - the property to store the value for the remove action.

getGiftlistActionRemoveProperty

public java.lang.String getGiftlistActionRemoveProperty()
Returns property giftlistActionRemoveProperty. Default remove.


setGiftlistActionAddProperty

public void setGiftlistActionAddProperty(java.lang.String pGiftlistActionAddProperty)
Sets property giftlistActionAddProperty

Parameters:
pGiftlistActionAddProperty - the property to store the value for the add action.

getGiftlistActionAddProperty

public java.lang.String getGiftlistActionAddProperty()
Returns property giftlistActionAddProperty. Default add.


service

public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
Adds or removes giftlist from current profile. This servlet looks for a profile passed in. If one was not passed, it resolves it from the Nucleus. It then calls the manager class to either add or remove the giftlist.

Overrides:
service in class DynamoServlet
Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong