public class LocalizingInventoryDroplet extends InventoryDroplet
/atg/commerce/inventory/InventoryLookup
. This service is intended to
be configured with both a caching and non-caching InventoryManager. Therefore with
this one service a developer can easily show both cached and uncached inventory
information. The useCache
property defines which InventoryManager
(caching or non-caching) to use when the servlet is invoked. By default this value is true. This can be overridden
by setting the servlet param useCache to true
or false
.
This servlet requires a single parameter to be set, itemId. This should be the identifier that will be passed through to the InventoryManager services. Typically this would be a SKU id.
InventoryManagers are configured using an LocalizingInventoryManager component, where localized inventory repositories can be also be defined, along with locale maps.
An optional parameter, localeKey, specifies the locale; (if unspecifed, the default is request.RequestLocale.locale). This indicates which InventoryManager (and hence which inventory repository) to use, based on the maps specified on the LocalizingInventoryManager component.
Using this id the servlet uses an InventoryManager to set an inventory information object that includes several properties. It is inside the output oparam. The parameters are as follows:
LocalizingInventoryManager
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
mAllowCleanupRequest, mParameters
SERVLET_INFO_KEY
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
LocalizingInventoryDroplet()
Constructs an instanceof LocalizingInventoryDroplet
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDefaultLocale()
the default locale for which inventory should be retrieved
|
LocalizingInventoryManager |
getLocalizingInventoryManager()
Return the LocalizingInventoryManager property.
|
boolean |
getUseRequestLocale()
flag to determine whether to ask for inventory using the locale in the Request object before falling back on the default locale
|
boolean |
isUseRequestLocale()
Test property UseRequestLocale
|
void |
service(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Replacement service method.
|
void |
setDefaultLocale(java.lang.String pDefaultLocale)
the default locale for which inventory should be retrieved
|
void |
setLocalizingInventoryManager(LocalizingInventoryManager pLocalizingInventoryManager)
Set the LocalizingInventoryManager property.
|
void |
setUseRequestLocale(boolean pUseRequestLocale)
flag to determine whether to ask for inventory using the locale in the Request object before falling back on the default locale
|
createInventoryInfo, filterOutOfStockInventoryItems, getBatchInfo, getBatchInfo, getBatchInfo, getCachingInventoryManager, getInventoryInfo, getInventoryManager, isLogMissingInventoryExceptionsAsError, isUseCache, isUseLocalizedResourceStrings, setCachingInventoryManager, setInventoryManager, setLogMissingInventoryExceptionsAsError, setUseCache, setUseLocalizedResourceStrings
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
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public LocalizingInventoryDroplet()
public void setLocalizingInventoryManager(LocalizingInventoryManager pLocalizingInventoryManager)
public LocalizingInventoryManager getLocalizingInventoryManager()
public void setDefaultLocale(java.lang.String pDefaultLocale)
pDefaultLocale
- new value to setpublic java.lang.String getDefaultLocale()
public void setUseRequestLocale(boolean pUseRequestLocale)
pUseRequestLocale
- new value to setpublic boolean getUseRequestLocale()
public boolean isUseRequestLocale()
public void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
Looks for the RepositoryItem in the appropriate inventory repository; if found, binds the inventory info as a parameter. Renders the output oparam in either case.
service
in class InventoryDroplet
pRequest
- the request to be processedpResponse
- the response object for this requestjavax.servlet.ServletException
- an application specific error occurred
processing this requestjava.io.IOException
- an error occurred reading data from the request
or writing data to the response.