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>
Modifier and Type | Field and Description |
---|---|
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 StoreInventoryManagerInterface |
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.
|
Constructor and Description |
---|
SkuAvailabilityLookup() |
Modifier and Type | Method and Description |
---|---|
atg.service.util.CurrentDate |
getCurrentDate()
Gets the CurrentDate component.
|
StoreInventoryManagerInterface |
getInventoryManager() |
void |
service(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
Determines if the item is preorderable.
|
void |
setCurrentDate(atg.service.util.CurrentDate pCurrentDate)
Sets the CurrentDate component.
|
void |
setInventoryManager(StoreInventoryManagerInterface pInventoryManager) |
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, init, service, service, setParameter
destroy, getServletConfig, getServletInfo, setServletInfo
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
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, toString
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static final java.lang.String CLASS_VERSION
public static final atg.nucleus.naming.ParameterName PRODUCT
public static final atg.nucleus.naming.ParameterName SKU_ID
public static final java.lang.String AVAILABILITY_DATE
public static final java.lang.String OPARAM_OUTPUT_PREORDERABLE
public static final java.lang.String OPARAM_OUTPUT_AVAILABLE
public static final java.lang.String OPARAM_OUTPUT_BACKORDERABLE
public static final java.lang.String OPARAM_OUTPUT_UNAVAILABLE
public static final java.lang.String OPARAM_OUTPUT_ERROR
public static final java.lang.String OPARAM_OUTPUT_DEFAULT
protected StoreInventoryManagerInterface mInventoryManager
public StoreInventoryManagerInterface getInventoryManager()
public void setInventoryManager(StoreInventoryManagerInterface pInventoryManager)
pInventoryManager
- - the inventoryManager to set.public void setCurrentDate(atg.service.util.CurrentDate pCurrentDate)
public atg.service.util.CurrentDate getCurrentDate()
public void service(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
service
in class atg.servlet.DynamoServlet
pRequest
- - http requestpResponse
- - http responsejavax.servlet.ServletException
- if an error occursjava.io.IOException
- if an error occurs