atg.projects.store.droplet
Class WoodFinishDroplet

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.WoodFinishDroplet
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

public class WoodFinishDroplet
extends atg.servlet.DynamoServlet


Nested Class Summary
 class WoodFinishDroplet.WoodFinish
          Class that represents a wood finish state.
 
Field Summary
static java.lang.String CLASS_VERSION
          Class version string.
static java.lang.String OPARAM_OUTPUT
          The oparam name rendered once during processing.
static java.lang.String OUTPUT_SELECTED_SKU
          The output parameter that contains the current selected sku (based on the wood finish selection).
static java.lang.String OUTPUT_WOODFINISHES
          The output parameter that contains the list of wood finish objects.
static atg.nucleus.naming.ParameterName PRODUCT
          The input parameter name for the product item.
static atg.nucleus.naming.ParameterName SELECTEDWOODFINISH
          The input parameter name for the currently selected wood finish.
static atg.nucleus.naming.ParameterName SKUS
          The input parameter name for the skus.
static java.lang.String STATE_AVAILABLE
          The state value that means the item is currently available.
static java.lang.String STATE_BACKORDERABLE
          The state value that means the item is currently out of stock, but can be backordered.
static java.lang.String STATE_NOTOFFERED
          The state value that means the item is currently not offered.
static java.lang.String STATE_OUTOFSTOCK
          The state value that means the item is currently out of stock.
static java.lang.String STATE_PREORDERABLE
          The state value that means the item is currently not offered, but can be preordered.
static java.lang.String STATE_SELECTED
          The state value that means the item is currently selected.
 
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
WoodFinishDroplet()
           
 
Method Summary
 StoreCatalogTools getCatalogTools()
           
 atg.commerce.inventory.InventoryManager getInventoryManager()
           
protected  java.lang.String getStateBasedOnInventory(java.lang.String pSkuId, atg.repository.RepositoryItem pProduct)
          Return the availabilty state based on the inventory state of the sku.
protected  java.lang.String getStateForWoodFinish(java.util.Collection pChildSkus, atg.repository.RepositoryItem pProduct, java.lang.String pWoodFinish, java.lang.String pCurrentSelectedWoodFinish)
          Returns the display state for wood finish.
 void service(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Generates WoodFinish objects for a collection of product skus.
 void setCatalogTools(StoreCatalogTools pCatalogTools)
           
 void setInventoryManager(atg.commerce.inventory.InventoryManager pInventoryManager)
          Sets the InventoryManager.
 
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, reResolveThis, 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 final java.lang.String CLASS_VERSION
Class version string.

See Also:
Constant Field Values

SELECTEDWOODFINISH

public static final atg.nucleus.naming.ParameterName SELECTEDWOODFINISH
The input parameter name for the currently selected wood finish.


SKUS

public static final atg.nucleus.naming.ParameterName SKUS
The input parameter name for the skus.


PRODUCT

public static final atg.nucleus.naming.ParameterName PRODUCT
The input parameter name for the product item.


OPARAM_OUTPUT

public static final java.lang.String OPARAM_OUTPUT
The oparam name rendered once during processing.

See Also:
Constant Field Values

OUTPUT_SELECTED_SKU

public static final java.lang.String OUTPUT_SELECTED_SKU
The output parameter that contains the current selected sku (based on the wood finish selection).

See Also:
Constant Field Values

OUTPUT_WOODFINISHES

public static final java.lang.String OUTPUT_WOODFINISHES
The output parameter that contains the list of wood finish objects.

See Also:
Constant Field Values

STATE_SELECTED

public static final java.lang.String STATE_SELECTED
The state value that means the item is currently selected.

See Also:
Constant Field Values

STATE_AVAILABLE

public static final java.lang.String STATE_AVAILABLE
The state value that means the item is currently available.

See Also:
Constant Field Values

STATE_OUTOFSTOCK

public static final java.lang.String STATE_OUTOFSTOCK
The state value that means the item is currently out of stock.

See Also:
Constant Field Values

STATE_BACKORDERABLE

public static final java.lang.String STATE_BACKORDERABLE
The state value that means the item is currently out of stock, but can be backordered.

See Also:
Constant Field Values

STATE_NOTOFFERED

public static final java.lang.String STATE_NOTOFFERED
The state value that means the item is currently not offered.

See Also:
Constant Field Values

STATE_PREORDERABLE

public static final java.lang.String STATE_PREORDERABLE
The state value that means the item is currently not offered, but can be preordered.

See Also:
Constant Field Values
Constructor Detail

WoodFinishDroplet

public WoodFinishDroplet()
Method Detail

getInventoryManager

public atg.commerce.inventory.InventoryManager getInventoryManager()
Returns:
the InventoryManager.

setInventoryManager

public void setInventoryManager(atg.commerce.inventory.InventoryManager pInventoryManager)
Sets the InventoryManager.

Parameters:
pInventoryManager - - inventory manager

getCatalogTools

public StoreCatalogTools getCatalogTools()
Returns:
the catalog tools.

setCatalogTools

public void setCatalogTools(StoreCatalogTools pCatalogTools)
Parameters:
pCatalogTools - - The catalogTools to set.

service

public void service(atg.servlet.DynamoHttpServletRequest pRequest,
                    atg.servlet.DynamoHttpServletResponse pResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
Generates WoodFinish objects for a collection of product skus.

Overrides:
service in class atg.servlet.DynamoServlet
Parameters:
pRequest - - http request
pResponse - - http response
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

getStateForWoodFinish

protected java.lang.String getStateForWoodFinish(java.util.Collection pChildSkus,
                                                 atg.repository.RepositoryItem pProduct,
                                                 java.lang.String pWoodFinish,
                                                 java.lang.String pCurrentSelectedWoodFinish)
Returns the display state for wood finish.

Parameters:
pChildSkus - the product's child skus
pWoodFinish - the size
pCurrentSelectedWoodFinish - the size that is current selected
pProduct - - product
Returns:
a display state
See Also:
STATE_AVAILABLE, STATE_NOTOFFERED, STATE_PREORDERABLE, STATE_OUTOFSTOCK, STATE_BACKORDERABLE, STATE_SELECTED

getStateBasedOnInventory

protected java.lang.String getStateBasedOnInventory(java.lang.String pSkuId,
                                                    atg.repository.RepositoryItem pProduct)
Return the availabilty state based on the inventory state of the sku.

Parameters:
pSkuId - - sku id
pProduct - - product
Returns:
STATE_AVAILABLE is item is in stock. Otherwise, STATE_OUTOFSTOCK, STATE_PREORDERABLE or STATE_BACKORDERABLE.