atg.commerce.inventory
Class InventoryFormHandler

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.droplet.EmptyFormHandler
              extended by atg.droplet.GenericFormHandler
                  extended by atg.commerce.inventory.InventoryFormHandler
All Implemented Interfaces:
DropletFormHandler, atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class InventoryFormHandler
extends GenericFormHandler

This form handler can be used for three things:

It contains properties (both arrays of strings) for items that were backordered but are now in stock, and for items that were preordered but are now in stock. The form handler, through the handleUpdateInventory method, will call the InventoryManager's inventoryWasUpdated method.

See Also:
InventoryManager.inventoryWasUpdated(java.util.List)

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String DEFAULT_PROPERTY_NAME
           
static java.lang.String SKUVIEW
           
 
Fields inherited from class atg.droplet.GenericFormHandler
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS
 
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
InventoryFormHandler()
           
 
Method Summary
 int getBatchNumber()
          The subset of ids in catalogRefIds
 int getBatchSize()
          catalogRefIds will contain this many ids.
 java.lang.String[] getCatalogRefIds()
          This is an array of catalog ref ids returned from the catalogRepository.
 Repository getCatalogRepository()
          This is the repository where product catalog items are stored.
 java.lang.String getChangedProperty()
          The name of the property that is changing for SKU.
 java.lang.String getErrorMessage()
          If there is an error, this will contain its description.
 InventoryManager getInventoryManager()
          The inventory manager that will be notified of update inventory
 java.lang.String getLocationId()
          The location of the inventory that's changing.
 java.lang.String getLowerBound()
          The smallest value for propertyName contained in catalogRefIds
 java.lang.String getNewValue()
          The value to set changedProperty for SKU to
 int getNextBatchNumber()
          One more than batchNumber
 int getPreviousBatchNumber()
          One less than batchNumber
 java.lang.String getPropertyName()
          This is the property of each catalog item in catalogRepository that is bounded by lowerBound and upperBound.
 java.lang.String getSetType()
          The kind of change to make.
 java.lang.String getSKU()
          The id of the sku whose inventory is changing
 java.util.List getUpdatedItemIdList()
          A list of preordered ids.
 java.lang.String getUpdatedItemIdString()
          A space delimited string of sku ids
 java.lang.String getUpperBound()
          The largest value for propertyName contained in catalogRefIds
 boolean handleChangeInventory(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method will update the changedProperty of the inventory item with catalogRefId of SKU by newValue.
 boolean handleUpdateInventory(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This handle method will call inventoryManager.inventoryWasUpdated with the ids contained in updatedItemIdList
 void setBatchNumber(int pBatchNumber)
           
 void setBatchSize(int pBatchSize)
           
 void setCatalogRefIds(java.lang.String[] pCatalogRefIds)
           
 void setCatalogRepository(Repository pCatalogRepository)
           
 void setChangedProperty(java.lang.String pChangedProperty)
           
 void setErrorMessage(java.lang.String pErrorMessage)
           
 void setInventoryManager(InventoryManager pInventoryManager)
           
 void setLocationId(java.lang.String pLocationId)
           
 void setLowerBound(java.lang.String pLowerBound)
           
 void setNewValue(java.lang.String pNewValue)
           
 void setPropertyName(java.lang.String pPropertyName)
           
 void setSetType(java.lang.String pSetType)
           
 void setSKU(java.lang.String pSKU)
           
 void setUpdatedItemIdList(java.util.List pUpdatedItemIdList)
           
 void setUpdatedItemIdString(java.lang.String pUpdatedItemIdString)
           
 void setUpperBound(java.lang.String pUpperBound)
           
 
Methods inherited from class atg.droplet.GenericFormHandler
addFormException, addUncheckedFormException, afterSet, beforeSet, checkFormRedirect, createFormSubmissionMessage, getCancelURL, getCheckForValidSession, getFormError, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, getUncheckedFormExceptions, handleCancel, handleFormException, handleUncheckedFormException, hasUncheckedFormExceptions, isDeferForwardsAndRedirects, isRestorableForm, isUseForwards, isValidSession, redirectOrForward, resetFormExceptions, setCancelURL, setCheckForValidSession, setDeferForwardsAndRedirects, setFormName, setMessagePort, setMessageSource, setMessageType, setRestorableForm, setSendMessages, setUseForwards
 
Methods inherited from class atg.droplet.EmptyFormHandler
afterGet, beforeGet
 
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 java.lang.String CLASS_VERSION
Class version string


SKUVIEW

public static final java.lang.String SKUVIEW
See Also:
Constant Field Values

DEFAULT_PROPERTY_NAME

public static final java.lang.String DEFAULT_PROPERTY_NAME
See Also:
Constant Field Values
Constructor Detail

InventoryFormHandler

public InventoryFormHandler()
Method Detail

setSKU

public void setSKU(java.lang.String pSKU)

getSKU

public java.lang.String getSKU()
The id of the sku whose inventory is changing


setLocationId

public void setLocationId(java.lang.String pLocationId)

getLocationId

public java.lang.String getLocationId()
The location of the inventory that's changing.

Returns:
the location id.

setChangedProperty

public void setChangedProperty(java.lang.String pChangedProperty)

getChangedProperty

public java.lang.String getChangedProperty()
The name of the property that is changing for SKU. Valid choices are: If a threshold property is chosen, only a set operation is valid. If the property is availabilityDate or availabilityStatus, only a set operation is valid.


setNewValue

public void setNewValue(java.lang.String pNewValue)

getNewValue

public java.lang.String getNewValue()
The value to set changedProperty for SKU to


setSetType

public void setSetType(java.lang.String pSetType)

getSetType

public java.lang.String getSetType()
The kind of change to make. Valid values for this parameter are "set", "increase", and "decrease". "set" sets the given level to the given value. "increase" increases the current value of the given level by the given value. "decrease" decreases the current value of the given level by the given value.


setUpdatedItemIdString

public void setUpdatedItemIdString(java.lang.String pUpdatedItemIdString)

getUpdatedItemIdString

public java.lang.String getUpdatedItemIdString()
A space delimited string of sku ids


setUpdatedItemIdList

public void setUpdatedItemIdList(java.util.List pUpdatedItemIdList)

getUpdatedItemIdList

public java.util.List getUpdatedItemIdList()
A list of preordered ids.


setLowerBound

public void setLowerBound(java.lang.String pLowerBound)

getLowerBound

public java.lang.String getLowerBound()
The smallest value for propertyName contained in catalogRefIds


setUpperBound

public void setUpperBound(java.lang.String pUpperBound)

getUpperBound

public java.lang.String getUpperBound()
The largest value for propertyName contained in catalogRefIds


setBatchNumber

public void setBatchNumber(int pBatchNumber)

getBatchNumber

public int getBatchNumber()
The subset of ids in catalogRefIds

See Also:
getCatalogRefIds()

getNextBatchNumber

public int getNextBatchNumber()
One more than batchNumber


getPreviousBatchNumber

public int getPreviousBatchNumber()
One less than batchNumber


setBatchSize

public void setBatchSize(int pBatchSize)

getBatchSize

public int getBatchSize()
catalogRefIds will contain this many ids.


setCatalogRepository

public void setCatalogRepository(Repository pCatalogRepository)

getCatalogRepository

public Repository getCatalogRepository()
This is the repository where product catalog items are stored.


setPropertyName

public void setPropertyName(java.lang.String pPropertyName)

getPropertyName

public java.lang.String getPropertyName()
This is the property of each catalog item in catalogRepository that is bounded by lowerBound and upperBound.


setCatalogRefIds

public void setCatalogRefIds(java.lang.String[] pCatalogRefIds)

getCatalogRefIds

public java.lang.String[] getCatalogRefIds()
This is an array of catalog ref ids returned from the catalogRepository. It contains all catalog ref ids that are lower than upperBound and higher than lowerBound. The array will contain batchSize elements. If batchNumber is 1, then the batchNumber + 1 through batchNumber * 2 elements will be returned, and so on.


setInventoryManager

public void setInventoryManager(InventoryManager pInventoryManager)

getInventoryManager

public InventoryManager getInventoryManager()
The inventory manager that will be notified of update inventory


setErrorMessage

public void setErrorMessage(java.lang.String pErrorMessage)

getErrorMessage

public java.lang.String getErrorMessage()
If there is an error, this will contain its description. If there is no error to report, this value is null.


handleChangeInventory

public boolean handleChangeInventory(DynamoHttpServletRequest pRequest,
                                     DynamoHttpServletResponse pResponse)
                              throws javax.servlet.ServletException,
                                     java.io.IOException
This method will update the changedProperty of the inventory item with catalogRefId of SKU by newValue. The update is according to setType as follows:

Throws:
javax.servlet.ServletException
java.io.IOException

handleUpdateInventory

public boolean handleUpdateInventory(DynamoHttpServletRequest pRequest,
                                     DynamoHttpServletResponse pResponse)
                              throws javax.servlet.ServletException,
                                     java.io.IOException
This handle method will call inventoryManager.inventoryWasUpdated with the ids contained in updatedItemIdList

Throws:
javax.servlet.ServletException
java.io.IOException
See Also:
InventoryManager.inventoryWasUpdated(java.util.List)