com.ibm.commerce.returns.commands
Class ReturnItemBaseCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.ControllerCommandImpl
                    |
                    +--com.ibm.commerce.returns.commands.ReturnItemBaseCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, ReturnItemAddCmd, ReturnItemUpdateCmd
Direct Known Subclasses:
ReturnItemAddCmdImpl, ReturnItemUpdateCmdImpl

public abstract class ReturnItemBaseCmdImpl
extends ControllerCommandImpl
implements ReturnItemAddCmd, ReturnItemUpdateCmd

Base implementation for both ReturnItemAdd and ReturnItemUpdate.

See Also:
Serialized Form

Field Summary
protected  java.util.Hashtable ihshAttr_name
           
protected  java.util.Hashtable ihshAttr_value
           
protected  java.util.Hashtable ihshCatentry_id
           
protected  java.util.Hashtable ihshComment
           
protected  java.util.Hashtable ihshCreditAdjustment
           
protected  java.util.Hashtable ihshKey
           
protected  java.util.Hashtable ihshOrderitem_id
           
protected  java.util.Hashtable ihshQuantity
           
protected  java.util.Hashtable ihshReason
           
protected  java.util.Hashtable ihshReasonId
           
protected  java.util.Hashtable ihshReceive
           
protected  java.util.Hashtable ihshRMAItem_id
           
protected  java.util.Hashtable ihshUom
           
protected static java.lang.String STR_ATTR_NAME
           
protected static java.lang.String STR_ATTR_VALUE
           
protected static java.lang.String STR_CATENTRY_ID
           
 
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.returns.commands. ReturnItemAddCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.returns.commands. ReturnItemUpdateCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command. ECTargetableCommand
COPYRIGHT
 
Constructor Summary
protected ReturnItemBaseCmdImpl()
          ReturnItemBaseCmdImpl constructor.
 
Method Summary
protected abstract  boolean doAdd()
          This method is reserved for IBM internal use only.
protected abstract  boolean doUpdate()
          This method is reserved for IBM internal use only.
protected abstract  void extendCommand()
          Extend the command here.
protected  java.util.Hashtable getAttributeNVP(java.lang.Integer index)
          Get attribute NVPs.
protected  java.lang.Long getCatEntryId(java.lang.Integer index)
          Get the catEntry id value for the appropriate index.
protected  java.math.BigDecimal getCreditAdjustment(java.lang.Integer index)
          Get the appropriate credit adjustment for the index.
protected abstract  int getMe()
          This method is reserved for IBM internal use only.
protected  java.lang.Double getNormalizedQuantity(java.lang.Integer index, java.lang.Long aCatEntryId)
          Get the normalized quantity.
protected   OrderItemAccessBean getOrderItemAB(java.lang.Long anOrderItemId)
          Get an orderItem access bean based on the orderItem Id.
protected  java.lang.Long getOrderItemId(java.lang.Integer index)
          Get the appropriate order item identifier for the index.
protected  java.util.List getOrderList()
          Get the list of order access beans associated with the returns order items.
protected  java.lang.Double getQuantity(java.lang.Integer index)
          Get the quantity value for the appropriate index.
protected  java.lang.String getReason(java.lang.Integer index)
          Get the reason code value for the appropriate index.
protected  java.lang.Integer getReasonId(java.lang.Integer index)
          Get the reason id value for the appropriate index.
protected  java.lang.String getReceive(java.lang.Integer index)
          Get the receive value for the specified index.
protected   RMAAccessBean getRMA()
          Get the RMA access bean.
protected  java.lang.Long getRMAItemId(java.lang.Integer index)
          Get the RMA item id value for the appropriate index.
protected  java.lang.String getUOM(java.lang.Integer index)
          Get the unit of measure (UOM) value for the appropriate index.
protected   RMAAccessBean getUpdateRMA()
          Get the RMA for Update.
protected  boolean isAdminCommand()
          Is this command being called by a CSR (using forUser/forUserId)?
protected  boolean isCatEntryWithoutOrderItemReturnAllowedForShopper()
          This method decides whether a shopper can return a catEntry without an orderItem.
protected  boolean isNewRMA()
          Are we creating a new RMA?
 void performExecute()
          Execute the command.
 void reset()
          Reset the command.
 void setRequestProperties( TypedProperty aRequestProperties)
          Sets the request properties.
 void validateParameters()
          Check mandatory parameters.
 
Methods inherited from class com.ibm.commerce.command. ControllerCommandImpl
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, getViewInputProperties, 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, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, 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, 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, getResources, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 

Field Detail

ihshCatentry_id

protected java.util.Hashtable ihshCatentry_id

ihshAttr_name

protected java.util.Hashtable ihshAttr_name

ihshAttr_value

protected java.util.Hashtable ihshAttr_value

ihshReceive

protected java.util.Hashtable ihshReceive

ihshCreditAdjustment

protected java.util.Hashtable ihshCreditAdjustment

ihshKey

protected java.util.Hashtable ihshKey

ihshQuantity

protected java.util.Hashtable ihshQuantity

ihshUom

protected java.util.Hashtable ihshUom

ihshComment

protected java.util.Hashtable ihshComment

ihshReason

protected java.util.Hashtable ihshReason

ihshReasonId

protected java.util.Hashtable ihshReasonId

ihshOrderitem_id

protected java.util.Hashtable ihshOrderitem_id

ihshRMAItem_id

protected java.util.Hashtable ihshRMAItem_id

STR_CATENTRY_ID

protected static final java.lang.String STR_CATENTRY_ID
See Also:
Constant Field Values

STR_ATTR_NAME

protected static final java.lang.String STR_ATTR_NAME
See Also:
Constant Field Values

STR_ATTR_VALUE

protected static final java.lang.String STR_ATTR_VALUE
See Also:
Constant Field Values
Constructor Detail

ReturnItemBaseCmdImpl

protected ReturnItemBaseCmdImpl()
ReturnItemBaseCmdImpl constructor.
Method Detail

doAdd

protected abstract boolean doAdd()
This method is reserved for IBM internal use only.

doUpdate

protected abstract boolean doUpdate()
This method is reserved for IBM internal use only.

extendCommand

protected abstract void extendCommand()
                               throws ECException
Extend the command here.
ECException

getAttributeNVP

protected java.util.Hashtable getAttributeNVP(java.lang.Integer index)
                                       throws InvalidParameterValueException
Get attribute NVPs.
Parameters:
index - The index for the appropriate grouping.
Returns:
The hashtable of name-value pairs.
InvalidParameterValueException

getCatEntryId

protected java.lang.Long getCatEntryId(java.lang.Integer index)
                                throws InvalidParameterValueException
Get the catEntry id value for the appropriate index.
Parameters:
index - The index for the appropriate grouping.
Returns:
catEntryId the identifier of the catalog entry.
Throws:
InvalidParameterValueException - If catalog entry not valid throws com.ibm.commerce.exception.InvalidParameterValueException

getCreditAdjustment

protected java.math.BigDecimal getCreditAdjustment(java.lang.Integer index)
                                            throws InvalidParameterValueException
Get the appropriate credit adjustment for the index.
Parameters:
index - The index for the appropriate grouping.
Returns:
adjBD the credit adjustment
InvalidParameterValueException

getMe

protected abstract int getMe()
This method is reserved for IBM internal use only.

getNormalizedQuantity

protected java.lang.Double getNormalizedQuantity(java.lang.Integer index,
                                                 java.lang.Long aCatEntryId)
                                          throws ECException
Get the normalized quantity.
Parameters:
index - the index for the appropriate grouping.
aCatEntryId - the catalog entry id.
Returns:
normalizedQuantity the normalized quantity.
ECException

getOrderItemAB

protected OrderItemAccessBean getOrderItemAB(java.lang.Long anOrderItemId)
                                      throws ECException
Get an orderItem access bean based on the orderItem Id.
Parameters:
anOrderItemId - The order item Id.
Returns:
The order item access bean.
ECException

getOrderItemId

protected java.lang.Long getOrderItemId(java.lang.Integer index)
                                 throws InvalidParameterValueException
Get the appropriate order item identifier for the index.
Parameters:
index - The index for the appropriate grouping.
Returns:
The order item identifier.
Throws:
InvalidParameterValueException - If index is an integer, throws com.ibm.commerce.exception.InvalidParameterValueException

getOrderList

protected java.util.List getOrderList()
                               throws ECException
Get the list of order access beans associated with the returns order items.
Returns:
The list of order access beans.
ECException

getQuantity

protected java.lang.Double getQuantity(java.lang.Integer index)
                                throws InvalidParameterValueException
Get the quantity value for the appropriate index.
Parameters:
index - The index for the appropriate grouping.
Returns:
The quantity value.
InvalidParameterValueException

getReason

protected java.lang.String getReason(java.lang.Integer index)
Get the reason code value for the appropriate index.
Parameters:
index - The index for the appropriate grouping.
Returns:
The reason code value.

getReasonId

protected java.lang.Integer getReasonId(java.lang.Integer index)
Get the reason id value for the appropriate index.
Parameters:
index - The index for the appropriate grouping.
Returns:
The reason id value.

getReceive

protected java.lang.String getReceive(java.lang.Integer index)
Get the receive value for the specified index. If the receive value is "" (empty string) then return null.
Parameters:
index - The index for the appropriate grouping.
Returns:
The receive value.

getRMA

protected RMAAccessBean getRMA()
                        throws ECException
Get the RMA access bean. If a new RMA is to be created then it is created. calls SetRMAOrganizationCmd
Returns:
The RMA access bean.
ECException

getRMAItemId

protected java.lang.Long getRMAItemId(java.lang.Integer index)
                               throws ECApplicationException
Get the RMA item id value for the appropriate index.
Parameters:
index - The index for the appropriate grouping.
Returns:
The RMA item id value. If RMA Item Id is invalid, throws com.ibm.commerce.exception.ECApplicationException with ECMessage._ERR_BAD_MISSING_CMD_PARAMETER
ECApplicationException

getUOM

protected java.lang.String getUOM(java.lang.Integer index)
Get the unit of measure (UOM) value for the appropriate index.
Parameters:
index - The index for the appropriate grouping.
Returns:
The unit of measure value.

getUpdateRMA

protected RMAAccessBean getUpdateRMA()
                              throws ECException
Get the RMA for Update.
Returns:
The RMA access bean.
ECException

isAdminCommand

protected boolean isAdminCommand()
Is this command being called by a CSR (using forUser/forUserId)?
Returns:
true if its a CSR; false otherwise.

isCatEntryWithoutOrderItemReturnAllowedForShopper

protected boolean isCatEntryWithoutOrderItemReturnAllowedForShopper()
This method decides whether a shopper can return a catEntry without an orderItem. The default behaviour is to return true but this method can be overidden to return false if the shopper is not allowed to return catEntries.
Returns:
true if a shopper can return catalog entries; false otherwise.

isNewRMA

protected boolean isNewRMA()
Are we creating a new RMA?
Returns:
true if a new RMA is being created; false otherwise.

performExecute

public void performExecute()
                    throws ECException
Execute the command.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
ECException

reset

public void reset()
Reset the command.
Overrides:
reset in class AbstractECTargetableCommand

setRequestProperties

public void setRequestProperties(TypedProperty aRequestProperties)
                          throws ECApplicationException
Sets the request properties.
Specified by:
setRequestProperties in interface ControllerCommand
Overrides:
setRequestProperties in class ControllerCommandImpl
Parameters:
aRequestProperties - hastable of request properties
ECApplicationException

validateParameters

public void validateParameters()
                        throws ECException
Check mandatory parameters. Checks the following parameters:

Parameters