com.ibm.commerce.returns.commands
Class ReturnItemBaseCmdImpl

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

public abstract class ReturnItemBaseCmdImpl
extends ControllerCommandImpl
implements ReturnItemAddCmd, ReturnItemUpdateCmd

Base implementation for both ReturnItemAdd and ReturnItemUpdate.


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)
          The WebController calls this method before invoking the execute method in this command to set the request properties for this command.
 void validateParameters()
          Check mandatory parameters.
 
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl
fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
 
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from interface com.ibm.commerce.command.ControllerCommand
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, setAccCheck, setForUserId, setOwner
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from interface com.ibm.commerce.security.Protectable
fulfills, getOwner
 

Field Detail

ihshAttr_name

protected java.util.Hashtable ihshAttr_name

ihshAttr_value

protected java.util.Hashtable ihshAttr_value

ihshCatentry_id

protected java.util.Hashtable ihshCatentry_id

ihshComment

protected java.util.Hashtable ihshComment

ihshCreditAdjustment

protected java.util.Hashtable ihshCreditAdjustment

ihshKey

protected java.util.Hashtable ihshKey

ihshOrderitem_id

protected java.util.Hashtable ihshOrderitem_id

ihshQuantity

protected java.util.Hashtable ihshQuantity

ihshReason

protected java.util.Hashtable ihshReason

ihshReasonId

protected java.util.Hashtable ihshReasonId

ihshReceive

protected java.util.Hashtable ihshReceive

ihshRMAItem_id

protected java.util.Hashtable ihshRMAItem_id

ihshUom

protected java.util.Hashtable ihshUom

STR_ATTR_NAME

protected static final java.lang.String STR_ATTR_NAME

STR_ATTR_VALUE

protected static final java.lang.String STR_ATTR_VALUE

STR_CATENTRY_ID

protected static final java.lang.String STR_CATENTRY_ID
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.

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.

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:
The identifier of the catalog entry.

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:
The credit adjustment.

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:
The normalized quantity.

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.

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.

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.

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.

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.
Returns:
The RMA access bean.

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.

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.

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
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
com.ibm.commerce.command.CommandException - The superclass for all ECExceptions.

reset

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

setRequestProperties

public void setRequestProperties(TypedProperty aRequestProperties)
                          throws ECApplicationException
Description copied from interface: ControllerCommand
The WebController calls this method before invoking the execute method in this command to set the request properties for this command. It is the responsibility of the implementer of the ControllerCommand to extract the required input parameters from the request properties and perform parameter checking.
Specified by:
setRequestProperties in interface ControllerCommand
Overrides:
setRequestProperties in class ControllerCommandImpl
Following copied from interface: com.ibm.commerce.command.ControllerCommand
Parameters:
requestProperties - com.ibm.commerce.datatype.TypedProperty
Throws:
com.ibm.commerce.exception.ECException. -  

validateParameters

public void validateParameters()
                        throws ECException
Check mandatory parameters.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
ECException. -