atg.projects.store.droplet
Class SkuAvailabilityLookup

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.SkuAvailabilityLookup
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 SkuAvailabilityLookup
extends atg.servlet.DynamoServlet

This droplet looks at a single sku and the product referencing it and determines if it is available, preorderable, backorderable or unavailable.

The inventoryManager property must be configured for this droplet.

This droplet takes the following input parameters:

This droplet renders the following open parameters:

This droplet sets the following output parameters when rendering the available and backorderable open parameters.

Example:


 <dsp:droplet name="/atg/store/droplet/SkuAvailabilityLookup">
   <dsp:param name="product" param="product"/>
   <dsp:param name="skuId" param="product.childSKUs[0].repositoryId"/>
   <dsp:oparam name="available">
     Is available
   </dsp:oparam>
   <dsp:oparam name="preorderable">
     Can be preordered
     <dsp:droplet name="/atg/dynamo/droplet/IsEmpty">
       <dsp:param name="value" param="availabilityDate"/>
       <dsp:oparam name="false">
         <br>
         Will be available
         <dsp:valueof param="availabilityDate" converter="date" format="M/d/yy"/>
       </dsp:oparam>
     </dsp:droplet>
   </dsp:oparam>
   <dsp:oparam name="backorderable">
     Can be backordered
   </dsp:oparam>
   <dsp:oparam name="unavailable">
     Is unavailable
   </dsp:oparam>
 </dsp:droplet>

 


Field Summary
static java.lang.String AVAILABILITY_DATE
          The output parameter name for the availabilityDate to set.
static java.lang.String CLASS_VERSION
          Class version string.
protected  StoreInventoryManager mInventoryManager
          Inventory manager.
static java.lang.String OPARAM_OUTPUT_AVAILABLE
          The oparam name rendered once if the item is not preorderable and is in stock.
static java.lang.String OPARAM_OUTPUT_BACKORDERABLE
          The oparam name rendered once if the item is not preorderable, is not in stock and is backorderable.
static java.lang.String OPARAM_OUTPUT_DEFAULT
          The oparam name rendered once if none of the above open parameters exists.
static java.lang.String OPARAM_OUTPUT_ERROR
          The oparam name rendered once if the provided skuId can not be looked up in the inventory repository.
static java.lang.String OPARAM_OUTPUT_PREORDERABLE
          The oparam name rendered once if the item is a preorderable item.
static java.lang.String OPARAM_OUTPUT_UNAVAILABLE
          The oparam name rendered once if the item is none of the above.
static atg.nucleus.naming.ParameterName PRODUCT
          The input parameter name for the product and skuId to check.
static atg.nucleus.naming.ParameterName SKU_ID
          Sku id parameter name.
 
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
SkuAvailabilityLookup()
           
 
Method Summary
 StoreInventoryManager getInventoryManager()
           
 void service(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Determines if the item is preorderable.
 void setInventoryManager(StoreInventoryManager pInventoryManager)
           
 
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

PRODUCT

public static final atg.nucleus.naming.ParameterName PRODUCT
The input parameter name for the product and skuId to check.


SKU_ID

public static final atg.nucleus.naming.ParameterName SKU_ID
Sku id parameter name.


AVAILABILITY_DATE

public static final java.lang.String AVAILABILITY_DATE
The output parameter name for the availabilityDate to set.

See Also:
Constant Field Values

OPARAM_OUTPUT_PREORDERABLE

public static final java.lang.String OPARAM_OUTPUT_PREORDERABLE
The oparam name rendered once if the item is a preorderable item.

See Also:
Constant Field Values

OPARAM_OUTPUT_AVAILABLE

public static final java.lang.String OPARAM_OUTPUT_AVAILABLE
The oparam name rendered once if the item is not preorderable and is in stock.

See Also:
Constant Field Values

OPARAM_OUTPUT_BACKORDERABLE

public static final java.lang.String OPARAM_OUTPUT_BACKORDERABLE
The oparam name rendered once if the item is not preorderable, is not in stock and is backorderable.

See Also:
Constant Field Values

OPARAM_OUTPUT_UNAVAILABLE

public static final java.lang.String OPARAM_OUTPUT_UNAVAILABLE
The oparam name rendered once if the item is none of the above.

See Also:
Constant Field Values

OPARAM_OUTPUT_ERROR

public static final java.lang.String OPARAM_OUTPUT_ERROR
The oparam name rendered once if the provided skuId can not be looked up in the inventory repository.

See Also:
Constant Field Values

OPARAM_OUTPUT_DEFAULT

public static final java.lang.String OPARAM_OUTPUT_DEFAULT
The oparam name rendered once if none of the above open parameters exists.

See Also:
Constant Field Values

mInventoryManager

protected StoreInventoryManager mInventoryManager
Inventory manager.

Constructor Detail

SkuAvailabilityLookup

public SkuAvailabilityLookup()
Method Detail

getInventoryManager

public StoreInventoryManager getInventoryManager()
Returns:
the inventoryManager.

setInventoryManager

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

service

public void service(atg.servlet.DynamoHttpServletRequest pRequest,
                    atg.servlet.DynamoHttpServletResponse pResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
Determines if the item is preorderable.

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