atg.projects.store.droplet
Class DefaultProductDetailsDroplet

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.projects.store.droplet.DefaultProductDetailsDroplet
All Implemented Interfaces:
atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, atg.servlet.ParameterServlet, java.util.EventListener, javax.servlet.Servlet
Direct Known Subclasses:
ColoredProductDetailsDroplet

public class DefaultProductDetailsDroplet
extends atg.servlet.DynamoServlet

This droplet should be used on the Single/Multiple SKU Product Details Pages.

This droplet obtains currently viewed product and SKU from the current request and saves into request all necessary data to be displayed on the PDP.

Input parameters:

product
Currently viewed product.
skus
Product's child SKUs. Will be used if selectedSku is not specified.
selectedSku
Currently viewed SKU. For a multi-SKU PDP this droplet should be called for each displayed SKU.

Output parameters:

quantity
Default quantity to be displayed on the page.
availabilityType
Specifies availability of the currently selected SKU. Can be one of the following:
  1. available
  2. preorderable
  3. backorderable
  4. unavailable
availabilityDate
If availabilityType is preorderable or backorderable, this parameter will be set. Contains date when the SKU specified will be available.
comparisonsContainsProduct
Flags, if current product is already added to the Comparisons List.
showEmailAFriend
Flags, if 'Email a Friend' button should be displayed.
showGiftlists
Flags, if 'Add to Giftlist' button should be displayed.
wishlistContainsSku
Flags, if user wishlist already contains the SKU specified.
giftlists
Collection of user's giftlists. Note that these giftlists are filtered by site already.
selectedSku
The selected SKU, will be the same as passed in. If no SKU is passed and product contains only one SKU then selectedSku parameter will be set to this SKU.

Open parameters:

output
Always rendered


Field Summary
protected static java.lang.String AVAILABILITY_STATUS_AVAILABLE
           
protected static java.lang.String AVAILABILITY_STATUS_BACKORDERABLE
           
protected static java.lang.String AVAILABILITY_STATUS_PREORDERABLE
           
protected static java.lang.String AVAILABILITY_STATUS_UNAVAILABLE
           
static java.lang.String CLASS_VERSION
          Class version string.
protected static java.lang.String OPEN_PARAMETER_OUTPUT
           
protected static java.lang.String PARAMETER_AVAILABILITY_DATE
           
protected static java.lang.String PARAMETER_AVAILABILITY_TYPE
           
protected static java.lang.String PARAMETER_COMPARISONS_CONTAINS_PRODUCT
           
protected static java.lang.String PARAMETER_GIFTLISTS
           
protected static java.lang.String PARAMETER_PRODUCT
           
protected static java.lang.String PARAMETER_QUANTITY
           
protected static java.lang.String PARAMETER_SELECTED_SKU
           
protected static java.lang.String PARAMETER_SHOW_EMAIL_A_FRIEND
           
protected static java.lang.String PARAMETER_SHOW_GIFTLISTS
           
protected static java.lang.String PARAMETER_SKUS
           
protected static java.lang.String PARAMETER_WISHLIST_CONTAINS_SKU
           
 
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
DefaultProductDetailsDroplet()
           
 
Method Summary
protected  boolean areGiftlistsAvailable(atg.servlet.DynamoHttpServletRequest pRequest)
          This method calculates boolean flag, specifying if 'Add to Giftlist' button should be displayed on the page.
protected  java.util.Collection<atg.repository.RepositoryItem> getAllSkus(atg.servlet.DynamoHttpServletRequest pRequest)
          This method obtains a Collection of all specified product SKUs.
protected  java.util.Date getAvailabilityDate(atg.repository.RepositoryItem pSku, atg.repository.RepositoryItem pProduct, java.lang.String pAvailabilityType)
          This method calculates availability date for the product and SKU specified.
protected  java.lang.String getAvailabilityType(atg.repository.RepositoryItem pSku, atg.repository.RepositoryItem pProduct)
          This method calculates availability type for the product/SKU specified.
 java.lang.String getCartFormHandlerPath()
           
 StoreCatalogTools getCatalogTools()
          Gets the mCatalogTools
 java.lang.String getComparisonsListPath()
           
protected  StoreProductComparisonList getCurrentComparisonsList(atg.servlet.DynamoHttpServletRequest pRequest)
          This method retrieves current Comparisons List from the request specified.
 atg.service.util.CurrentDate getCurrentDate()
          Gets the CurrentDate component.
protected  atg.repository.RepositoryItem getCurrentProduct(atg.servlet.DynamoHttpServletRequest pRequest)
          This method takes currently viewed product from the request specified.
protected  atg.userprofiling.Profile getCurrentProfile(atg.servlet.DynamoHttpServletRequest pRequest)
          This method retrieves current profile from the request specified.
protected  java.util.Collection<atg.repository.RepositoryItem> getCurrentProfileGiftlists(atg.servlet.DynamoHttpServletRequest pRequest)
          This method calculates all user's giftlists to be displayed on the page.
 atg.commerce.gifts.GiftlistSiteFilter getGiftListSiteFilter()
           
 atg.commerce.gifts.GiftlistTools getGiftlistTools()
           
 StoreInventoryManager getInventoryManager()
           
 java.lang.String getProfilePath()
           
 StorePropertyManager getProfilePropertyManager()
           
protected  long getQuantity(atg.servlet.DynamoHttpServletRequest pRequest)
          This method calculates default quantity to be dislpayed on the PDP.
protected  atg.repository.RepositoryItem getSelectedSku(atg.servlet.DynamoHttpServletRequest pRequest)
          This method takes currently selected SKU from the request.
 java.lang.String getSiteContextPath()
           
 atg.projects.store.multisite.StoreSitePropertiesManager getSitePropertiesManager()
           
protected  boolean isCurrentProductAddedToComparisons(atg.servlet.DynamoHttpServletRequest pRequest)
          This method calculates boolean flag, specifying if currently viewed product is already added to the Comparisons list.
protected  boolean isCurrentSkuAddedToWishlist(atg.servlet.DynamoHttpServletRequest pRequest)
          This method calculates a boolean flag, specifying if currently selected SKU is already added to the user's wishlist.
protected  boolean isEmailEnabled(atg.servlet.DynamoHttpServletRequest pRequest)
          This method calculates boolean flag, specifying if currently viewed product can be emailed to a friend.
 void service(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This method provides the default implementation of service, by dispatching to conventionally named methods which begin with "do".
protected  void serviceContents(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This method specifies, which open parameters should be serviced.
 void setCartFormHandlerPath(java.lang.String pCartFormHandlerPath)
           
 void setCatalogTools(StoreCatalogTools pCatalogTools)
          Sets the mCatalogTools
 void setComparisonsListPath(java.lang.String pComparisonsListPath)
           
 void setCurrentDate(atg.service.util.CurrentDate pCurrentDate)
          Sets the CurrentDate component.
 void setGiftListSiteFilter(atg.commerce.gifts.GiftlistSiteFilter pGiftListSiteFilter)
           
 void setGiftlistTools(atg.commerce.gifts.GiftlistTools pGiftlistTools)
           
 void setInventoryManager(StoreInventoryManager pInventoryManager)
           
 void setProfilePath(java.lang.String pProfilePath)
           
 void setProfilePropertyManager(StorePropertyManager pProfilePropertyManager)
           
 void setSiteContextPath(java.lang.String pSiteContextPath)
           
 void setSitePropertiesManager(atg.projects.store.multisite.StoreSitePropertiesManager pSitePropertiesManager)
           
 
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, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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 final java.lang.String CLASS_VERSION
Class version string.

See Also:
Constant Field Values

AVAILABILITY_STATUS_UNAVAILABLE

protected static final java.lang.String AVAILABILITY_STATUS_UNAVAILABLE
See Also:
Constant Field Values

AVAILABILITY_STATUS_AVAILABLE

protected static final java.lang.String AVAILABILITY_STATUS_AVAILABLE
See Also:
Constant Field Values

AVAILABILITY_STATUS_BACKORDERABLE

protected static final java.lang.String AVAILABILITY_STATUS_BACKORDERABLE
See Also:
Constant Field Values

AVAILABILITY_STATUS_PREORDERABLE

protected static final java.lang.String AVAILABILITY_STATUS_PREORDERABLE
See Also:
Constant Field Values

OPEN_PARAMETER_OUTPUT

protected static final java.lang.String OPEN_PARAMETER_OUTPUT
See Also:
Constant Field Values

PARAMETER_AVAILABILITY_DATE

protected static final java.lang.String PARAMETER_AVAILABILITY_DATE
See Also:
Constant Field Values

PARAMETER_AVAILABILITY_TYPE

protected static final java.lang.String PARAMETER_AVAILABILITY_TYPE
See Also:
Constant Field Values

PARAMETER_COMPARISONS_CONTAINS_PRODUCT

protected static final java.lang.String PARAMETER_COMPARISONS_CONTAINS_PRODUCT
See Also:
Constant Field Values

PARAMETER_PRODUCT

protected static final java.lang.String PARAMETER_PRODUCT
See Also:
Constant Field Values

PARAMETER_QUANTITY

protected static final java.lang.String PARAMETER_QUANTITY
See Also:
Constant Field Values

PARAMETER_SELECTED_SKU

protected static final java.lang.String PARAMETER_SELECTED_SKU
See Also:
Constant Field Values

PARAMETER_SHOW_EMAIL_A_FRIEND

protected static final java.lang.String PARAMETER_SHOW_EMAIL_A_FRIEND
See Also:
Constant Field Values

PARAMETER_SHOW_GIFTLISTS

protected static final java.lang.String PARAMETER_SHOW_GIFTLISTS
See Also:
Constant Field Values

PARAMETER_SKUS

protected static final java.lang.String PARAMETER_SKUS
See Also:
Constant Field Values

PARAMETER_WISHLIST_CONTAINS_SKU

protected static final java.lang.String PARAMETER_WISHLIST_CONTAINS_SKU
See Also:
Constant Field Values

PARAMETER_GIFTLISTS

protected static final java.lang.String PARAMETER_GIFTLISTS
See Also:
Constant Field Values
Constructor Detail

DefaultProductDetailsDroplet

public DefaultProductDetailsDroplet()
Method Detail

getComparisonsListPath

public java.lang.String getComparisonsListPath()
Returns:
the comparisonsListPath

setComparisonsListPath

public void setComparisonsListPath(java.lang.String pComparisonsListPath)
Parameters:
pComparisonsListPath - the comparisonsListPath to set

getGiftListSiteFilter

public atg.commerce.gifts.GiftlistSiteFilter getGiftListSiteFilter()
Returns:
the giftListSiteFilter

setGiftListSiteFilter

public void setGiftListSiteFilter(atg.commerce.gifts.GiftlistSiteFilter pGiftListSiteFilter)
Parameters:
pGiftListSiteFilter - the giftListSiteFilter to set

getCartFormHandlerPath

public java.lang.String getCartFormHandlerPath()
Returns:
the cartFormHandlerPath

setCartFormHandlerPath

public void setCartFormHandlerPath(java.lang.String pCartFormHandlerPath)
Parameters:
pCartFormHandlerPath - the cartFormHandlerPath to set

getInventoryManager

public StoreInventoryManager getInventoryManager()
Returns:
the inventoryManager

setInventoryManager

public void setInventoryManager(StoreInventoryManager pInventoryManager)
Parameters:
pInventoryManager - the inventoryManager to set

getProfilePropertyManager

public StorePropertyManager getProfilePropertyManager()
Returns:
the profilePropertyManager

setProfilePropertyManager

public void setProfilePropertyManager(StorePropertyManager pProfilePropertyManager)
Parameters:
pProfilePropertyManager - the profilePropertyManager to set

getProfilePath

public java.lang.String getProfilePath()
Returns:
the profilePath

setProfilePath

public void setProfilePath(java.lang.String pProfilePath)
Parameters:
pProfilePath - the profilePath to set

getGiftlistTools

public atg.commerce.gifts.GiftlistTools getGiftlistTools()
Returns:
the giftlistTools

setGiftlistTools

public void setGiftlistTools(atg.commerce.gifts.GiftlistTools pGiftlistTools)
Parameters:
pGiftlistTools - the giftlistTools to set

getSitePropertiesManager

public atg.projects.store.multisite.StoreSitePropertiesManager getSitePropertiesManager()
Returns:
the sitePropertiesManager

setSitePropertiesManager

public void setSitePropertiesManager(atg.projects.store.multisite.StoreSitePropertiesManager pSitePropertiesManager)
Parameters:
pSitePropertiesManager - the sitePropertiesManager to set

getSiteContextPath

public java.lang.String getSiteContextPath()
Returns:
the siteContextPath

setSiteContextPath

public void setSiteContextPath(java.lang.String pSiteContextPath)
Parameters:
pSiteContextPath - the siteContextPath to set

getCatalogTools

public StoreCatalogTools getCatalogTools()
Gets the mCatalogTools

Returns:
mCatalogTools

setCatalogTools

public void setCatalogTools(StoreCatalogTools pCatalogTools)
Sets the mCatalogTools

Parameters:
pCatalogTools - Value to set

setCurrentDate

public void setCurrentDate(atg.service.util.CurrentDate pCurrentDate)
Sets the CurrentDate component.


getCurrentDate

public atg.service.util.CurrentDate getCurrentDate()
Gets the CurrentDate component.


service

public void service(atg.servlet.DynamoHttpServletRequest pRequest,
                    atg.servlet.DynamoHttpServletResponse pResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
This method provides the default implementation of service, by dispatching to conventionally named methods which begin with "do".

Overrides:
service in class atg.servlet.DynamoServlet
Parameters:
pRequest - the request to be processed
pResponse - the response object for this request
Throws:
javax.servlet.ServletException - an application specific error occurred processing this request
java.io.IOException - an error occurred reading data from the request or writing data to the response.

serviceContents

protected void serviceContents(atg.servlet.DynamoHttpServletRequest pRequest,
                               atg.servlet.DynamoHttpServletResponse pResponse)
                        throws javax.servlet.ServletException,
                               java.io.IOException
This method specifies, which open parameters should be serviced. Current implementation services 'output' oparam only.

Parameters:
pRequest - current request.
pResponse - current response.
Throws:
javax.servlet.ServletException - if something goes wrong.
java.io.IOException - if something goes wrong.

getCurrentProfile

protected atg.userprofiling.Profile getCurrentProfile(atg.servlet.DynamoHttpServletRequest pRequest)
This method retrieves current profile from the request specified.

Parameters:
pRequest - current request.
Returns:
currently served profile.

getCurrentComparisonsList

protected StoreProductComparisonList getCurrentComparisonsList(atg.servlet.DynamoHttpServletRequest pRequest)
This method retrieves current Comparisons List from the request specified.

Parameters:
pRequest - current request.
Returns:
currently served comparisons list.

getQuantity

protected long getQuantity(atg.servlet.DynamoHttpServletRequest pRequest)
This method calculates default quantity to be dislpayed on the PDP. Current implementation takes quantity from the CartFormHandler's items property, i.e. last added quantity. If items are not specified, default value of 1 returned.

Parameters:
pRequest - current request.
Returns:
default quantity.

getSelectedSku

protected atg.repository.RepositoryItem getSelectedSku(atg.servlet.DynamoHttpServletRequest pRequest)
This method takes currently selected SKU from the request. If it's not passed but product contains only single SKU then this SKU is returned.

Parameters:
pRequest - current request.
Returns:
currently selected SKU.

getCurrentProduct

protected atg.repository.RepositoryItem getCurrentProduct(atg.servlet.DynamoHttpServletRequest pRequest)
This method takes currently viewed product from the request specified.

Parameters:
pRequest - current request.
Returns:
currently viewed product.

getAllSkus

protected java.util.Collection<atg.repository.RepositoryItem> getAllSkus(atg.servlet.DynamoHttpServletRequest pRequest)
This method obtains a Collection of all specified product SKUs. These SKU should be specified as skus request parameter.

Parameters:
pRequest - current request.
Returns:
product's child SKUs.

getAvailabilityDate

protected java.util.Date getAvailabilityDate(atg.repository.RepositoryItem pSku,
                                             atg.repository.RepositoryItem pProduct,
                                             java.lang.String pAvailabilityType)
This method calculates availability date for the product and SKU specified. Current implementation takes availability from the inventory manager.

Parameters:
pSku - currently selected SKU.
pProduct - currently viewed product.
pAvailabilityType - product/SKU availability (i.e. 'available', 'preorderable', etc.)
Returns:
availability date.

getAvailabilityType

protected java.lang.String getAvailabilityType(atg.repository.RepositoryItem pSku,
                                               atg.repository.RepositoryItem pProduct)
This method calculates availability type for the product/SKU specified. Current implementation takes availability from the inventory manager. Return value may be one of the following:
  1. AVAILABILITY_STATUS_AVAILABLE
  2. AVAILABILITY_STATUS_BACKORDERABLE
  3. AVAILABILITY_STATUS_PREORDERABLE
  4. AVAILABILITY_STATUS_UNAVAILABLE

Parameters:
pSku - currently selected SKU.
pProduct - currently viewed product.
Returns:
availability type in form of String

getCurrentProfileGiftlists

protected java.util.Collection<atg.repository.RepositoryItem> getCurrentProfileGiftlists(atg.servlet.DynamoHttpServletRequest pRequest)
This method calculates all user's giftlists to be displayed on the page. Current implementation filters giftlists created on the current site group only.

Parameters:
pRequest - current request.
Returns:
user's giftlists.

areGiftlistsAvailable

protected boolean areGiftlistsAvailable(atg.servlet.DynamoHttpServletRequest pRequest)
This method calculates boolean flag, specifying if 'Add to Giftlist' button should be displayed on the page. Current implementation does not show this button to transient users or users without giftlists.

Parameters:
pRequest - current request.
Returns:
boolean flag.

isCurrentSkuAddedToWishlist

protected boolean isCurrentSkuAddedToWishlist(atg.servlet.DynamoHttpServletRequest pRequest)
This method calculates a boolean flag, specifying if currently selected SKU is already added to the user's wishlist.

Parameters:
pRequest - current request.
Returns:
true if SKU already added to the wishlist, false otherwise.

isCurrentProductAddedToComparisons

protected boolean isCurrentProductAddedToComparisons(atg.servlet.DynamoHttpServletRequest pRequest)
This method calculates boolean flag, specifying if currently viewed product is already added to the Comparisons list.

Parameters:
pRequest - current request.
Returns:
true if current product is already added to the list, false otherwise.

isEmailEnabled

protected boolean isEmailEnabled(atg.servlet.DynamoHttpServletRequest pRequest)
This method calculates boolean flag, specifying if currently viewed product can be emailed to a friend.

Parameters:
pRequest - current request.
Returns:
true if 'Email a Friend' button should be displayed, false otherwise.