java.lang.Object | +--CacheableCommandImpl | +--com.ibm.commerce.command.AbstractECTargetableCommand | +--com.ibm.commerce.command.ControllerCommandImpl | +--com.ibm.commerce.tools.command.ToolsControllerCommandImpl | +--com.ibm.commerce.inventory.commands.InventoryAdjustCmdImpl
Default implementation of the InventoryAdjustCmd
interface.
Makes an adjustment to existing inventory by calling the
adjustinventory
database stored procedure.
An adjustment can be made by either marking down quantities in one or more RECEIPT rows (when the adjustment is negative), or adding inventory to an existing RECEIPT row (when the adjustment is positive).
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT The internal copyright field. |
Fields inherited from class com.ibm.commerce.command. ControllerCommandImpl |
requestProperties,
responseProperties,
retriable,
viewReqProperties |
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
commandContext |
Fields inherited from interface com.ibm.commerce.inventory.commands. InventoryAdjustCmd |
defaultCommandClassName,
NAME |
Fields inherited from interface com.ibm.commerce.tools.common. ECToolsConstants |
EC_LINE_SEPARATOR,
EC_TOOLS_FULFILLMENT_CENTER_ID,
EC_TOOLS_MERCHANT_CENTER_URL,
EC_TOOLS_STORE_LANGUAGE_URL,
EC_TOOLS_STORES_ACCESS_CONTROL_REQUIRED,
EC_TOOLS_STORES_EMPTY,
EC_TOOLS_STORES_NO_ACCESS,
EC_TOOLS_STORES_NOT_ADMINISTRATOR,
EC_XML,
EC_XMLFILE,
EC_XMLFILEOBJECT,
EC_XMLOBJECT,
EC_XMLSTRING |
Constructor Summary | |
---|---|
InventoryAdjustCmdImpl() |
Method Summary | |
---|---|
protected
void |
checkNumberFormatException() Checks that the numeric fields are numeric: ffmcenterId invAdjCodeId quantity versionSpcId |
protected
void |
checkParametersException() Checks if the required fields are missing or not in the right data type. |
AccessVector |
getResources() Gets the access vector accessed by this command. |
protected
void |
handleSubmitError(
ECException e) Constructs and returns the error message. |
void |
performExecute() Makes an adjustment to existing inventory by calling the adjustinventory database stored procedure. |
void |
setAdjustmentComment(java.lang.String newAdjustmentComment) Sets the comment on the adjustment. |
void |
setFfmcenterId(java.lang.String newFfmcenterId) Sets the fulfillment center identifier. |
void |
setInvAdjCodeId(java.lang.String newInvAdjCodeId) Sets the identifier for the adjustment type being made. |
void |
setInvadjustId(java.lang.String newInvadjustId) Set the inventory adjustment identifier. |
void |
setItemspcId(java.lang.String newItemspcId) Sets the item identifier. |
void |
setMemberId(java.lang.String newMemberId) Sets the member identifier. |
void |
setPartNumber(java.lang.String newPartNumber) Sets the part number. |
void |
setQuantity(java.lang.String newQuantity) Sets the quantity to adjust. |
void |
setVersionSpcId(java.lang.String newVersionSpcId) Sets the product version identifier of the item. |
void |
validateParameters() Gets the information about the adjustment to be made and sets the information into the command local variable. |
Methods inherited from class com.ibm.commerce.tools.command. ToolsControllerCommandImpl |
getViewInputProperties,
setRequestProperties |
Methods inherited from class com.ibm.commerce.command. ControllerCommandImpl |
checkPermission,
fulfills,
getForUserId,
getGeneric,
getOwner,
getRequestProperties,
getResolvedRequestProperties,
getResourceOwners,
getResponseProperties,
getRetriable,
isGeneric,
isRetriable,
mergeProperties,
setForUserId,
setGeneric,
setOwner,
setResponseProperties,
setRetriable,
setViewInputProperties |
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
accessControlCheck,
checkIsAllowed,
checkParameters,
checkResourcePermission,
createCommandExecutionEvent,
execute,
finalize,
getAccCheck,
getCommandContext,
getCommandIfName,
getCommandName,
getCommandStoreId,
getDefaultProperties,
getStoreId,
getUser,
getUserId,
isReadyToCallExecute,
reset,
setAccCheck,
setCommandContext,
setCommandIfName,
setCommandStoreId,
setDefaultProperties |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait,
wait, wait |
Methods inherited from interface com.ibm.commerce.command. ControllerCommand |
checkPermission,
execute,
getGeneric,
getRequestProperties,
getResolvedRequestProperties,
getResponseProperties,
getRetriable,
getViewInputProperties,
isGeneric,
isRetriable,
mergeProperties,
setGeneric,
setRequestProperties,
setRetriable,
setViewInputProperties |
Methods inherited from interface com.ibm.commerce.command. AccCommand |
accessControlCheck,
getAccCheck,
getForUserId,
getResourceOwners,
setAccCheck,
setForUserId,
setOwner |
Methods inherited from interface com.ibm.commerce.command. ECCommand |
checkIsAllowed,
checkResourcePermission,
createCommandExecutionEvent,
getCommandContext,
getCommandIfName,
getCommandName,
getCommandStoreId,
getDefaultProperties,
getStoreId,
getUser,
getUserId,
setCommandContext,
setCommandIfName,
setCommandStoreId,
setDefaultProperties |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
Constructor Detail |
---|
public InventoryAdjustCmdImpl()
Method Detail |
---|
public void setAdjustmentComment(java.lang.String newAdjustmentComment)
InventoryAdjustCmd
setAdjustmentComment
in interface
InventoryAdjustCmd
newAdjustmentComment
- adjustment commentInventoryAdjustCmd.setAdjustmentComment(java.lang.String)
public void setFfmcenterId(java.lang.String newFfmcenterId)
InventoryAdjustCmd
setFfmcenterId
in interface
InventoryAdjustCmd
newFfmcenterId
- fulfillment center idInventoryAdjustCmd.setFfmcenterId(java.lang.String)
public void setInvAdjCodeId(java.lang.String newInvAdjCodeId)
InventoryAdjustCmd
setInvAdjCodeId
in interface
InventoryAdjustCmd
newInvAdjCodeId
- adjustment type idInventoryAdjustCmd.setInvAdjCodeId(java.lang.String)
public void setInvadjustId(java.lang.String newInvadjustId)
newInvadjustId
- adjustment identifierpublic void setItemspcId(java.lang.String newItemspcId)
InventoryAdjustCmd
setItemspcId
in interface
InventoryAdjustCmd
newItemspcId
- item specified idInventoryAdjustCmd.setItemspcId(java.lang.String)
public void setMemberId(java.lang.String newMemberId)
InventoryAdjustCmd
setMemberId
in interface
InventoryAdjustCmd
newMemberId
- member identifierInventoryAdjustCmd.setMemberId(java.lang.String)
public void setPartNumber(java.lang.String newPartNumber)
InventoryAdjustCmd
setPartNumber
in interface
InventoryAdjustCmd
newPartNumber
- part numberInventoryAdjustCmd.setPartNumber(java.lang.String)
public void setQuantity(java.lang.String newQuantity)
InventoryAdjustCmd
setQuantity
in interface
InventoryAdjustCmd
newQuantity
- adjustment quantityInventoryAdjustCmd.setQuantity(java.lang.String)
public void setVersionSpcId(java.lang.String newVersionSpcId)
InventoryAdjustCmd
setVersionSpcId
in interface
InventoryAdjustCmd
newVersionSpcId
- product version of the specified itemInventoryAdjustCmd.setVersionSpcId(java.lang.String)
public void validateParameters() throws ECException
StoreId must be set in the command context.
Parameters:
validateParameters
in interface
ECCommand
validateParameters
in class
AbstractECTargetableCommand
ECApplicationException
- If the * XMLObject cannot be parsed as
expected, specifies _ERR_BAD_MISSING_CMD_PARAMETER If the StoreId isn't
set, specifies _ERR_DIDNT_SET_MERCHANTECException
checkParametersException()
,
handleSubmitError(com.ibm.commerce.exception.ECException)
protected void checkParametersException() throws ECApplicationException
Looks for these parameters:
ECApplicationException
- Throw ECApplicationException to indicate
which field is missing or bad.public AccessVector getResources() throws ECException
getResources
in interface
ECCommand
getResources
in class
AbstractECTargetableCommand
ECException
handleSubmitError(com.ibm.commerce.exception.ECException)
public void performExecute() throws ECException
adjustinventory
database stored procedure. An adjustment can be
made by either marking down quantities in one or more RECEIPT rows (when the
adjustment is negative), or adding inventory to an existing RECEIPT row (when
the adjustment is positive).
If item specified id is null, uses ItemSpecificationAccessBean to get it
from the memberId and partnumber. Or uses
InventoryJDBCHelperAccessBean().findItemCurrentVersion
to get it
using the versionSpcId.
performExecute
in interface
ECCommand
performExecute
in class
AbstractECTargetableCommand
ECException
checkNumberFormatException()
protected void checkNumberFormatException() throws ECApplicationException
com.ibm.commerce.exception.ECApplicationException.
- Throw
ECApplicationException to indicate which field is bad.
ECApplicationException
protected void handleSubmitError(ECException e) throws ECApplicationException
e
- exception
ECApplicationException
- Throw ECApplicationException with the newly
constructed message.