com.ibm.commerce.requisitionlist.commands
Class RequisitionListBaseCmdImpl

com.ibm.commerce.command.AbstractECTargetableCommand
  |
  +--com.ibm.commerce.command.ControllerCommandImpl
        |
        +--com.ibm.commerce.requisitionlist.commands.RequisitionListBaseCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable
Direct Known Subclasses:
RequisitionListCopyCmdImpl, RequisitionListCreateCmdImpl, RequisitionListDeleteCmdImpl, RequisitionListDisplayCmdImpl, RequisitionListSubmitCmdImpl, RequisitionListUpdateCmdImpl

public class RequisitionListBaseCmdImpl
extends ControllerCommandImpl

This is the base command implementation for the subclass requisition list commands. It has some common used instance variables and methods for the subclass requisition list commands. It defines the common ways for the execution of the subclass requisition list commands.

When the command is called from the URL, the web controller will call the following methods in sequence:

  1. setRequestProperties(TypedProperty)
  2. validateParameters()
  3. getResources()
  4. performExecute()


Field Summary
protected  java.lang.Long iOrderId
          The id of the order.
protected  java.lang.Long iRequisitionListId
          The id of the requisition list.
protected  java.lang.String iRequisitionListName
          The name of the requisition list.
protected  java.lang.String iRequisitionListStatus
          The status of the requisition list.
 
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.command.ControllerCommand
COPYRIGHT
 
Fields inherited from interface com.ibm.commerce.command.ECCommand
defaultCommandClassName
 
Fields inherited from interface com.ibm.commerce.command.ECTargetableCommand
COPYRIGHT
 
Constructor Summary
RequisitionListBaseCmdImpl()
           
 
Method Summary
protected  java.lang.Long copyOrder(java.lang.Long fromOrderId)
          Copy an order (id = fromOrderId) and return the order id of the new created order.
protected  OrderAccessBean copyOrder(OrderAccessBean fromOrderAB)
          Copy the OrderAccessBean fromOrderAB and return a new created OrderAccessBean which is a clone of fromOrderAB.
protected  OrderAccessBean copyOrderAccessBean(OrderAccessBean fromOrderAB)
          Copy the OrderAccessBean fromOrderAB and return a new created OrderAccessBean which is a clone of fromOrderAB.
protected  OrderItemAccessBean copyOrderItemAccessBean(OrderItemAccessBean fromOrderItemAB, java.lang.Long toOrderId)
          Copy the OrderItemAccessBean fromOrderItemAB and return a new created OrderItemAccessBean which is a clone of fromOrderItemAB and with order id = toOrderId.
protected  void copyOrderPayInfo(java.lang.Long fromOrderId, java.lang.Long toOrderId)
          Copy the order pay info from the order (id = fromOrderId) to the order (id = toOrderId).
protected  java.lang.String getName()
          Returns the name of the requisition list.
protected  java.lang.Long getOrderId()
          Returns the id of the order.
protected  java.lang.Long getRequisitionListId()
          Returns the id of the requisition list.
protected  java.lang.String getStatus()
          Returns the status of the requisition list.
 void reset()
          This method should be called after a command has been executed to reset its states variables.
protected  void setDefaultRequisitionListStatus()
          Sets the default requisition list status - 'Y'.
protected  void setName(java.lang.String name)
          Sets the name of the requisition list.
protected  void setOrderId(java.lang.Long id)
          Sets the id of the order.
 void setRequestProperties(TypedProperty reqProperties)
          Sets the requestProperties for the command.
protected  void setRequisitionListId(java.lang.Long id)
          Sets the id of the requisition list.
protected  void setStatus(java.lang.String status)
          Sets the status of the requisition list.
protected  void updateResponseView()
          Sets the default response view - Redirect View.
 
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, performExecute, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties, validateParameters
 
Methods inherited from interface com.ibm.commerce.command.ControllerCommand
execute
 
Methods inherited from interface com.ibm.commerce.command.AccCommand
accessControlCheck, getAccCheck, setAccCheck
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, performExecute, setCommandContext, setCommandIfName, setDefaultProperties, validateParameters
 

Field Detail

iOrderId

protected java.lang.Long iOrderId
The id of the order.

iRequisitionListId

protected java.lang.Long iRequisitionListId
The id of the requisition list.

iRequisitionListName

protected java.lang.String iRequisitionListName
The name of the requisition list.

iRequisitionListStatus

protected java.lang.String iRequisitionListStatus
The status of the requisition list.
Constructor Detail

RequisitionListBaseCmdImpl

public RequisitionListBaseCmdImpl()
Method Detail

copyOrder

protected java.lang.Long copyOrder(java.lang.Long fromOrderId)
                            throws java.sql.SQLException,
                                   javax.ejb.CreateException,
                                   javax.ejb.FinderException,
                                   javax.naming.NamingException,
                                   java.rmi.RemoteException,
                                   ECException
Copy an order (id = fromOrderId) and return the order id of the new created order. It calls copyOrder(OrderAccessBean) to do the actual work.

copyOrder

protected OrderAccessBean copyOrder(OrderAccessBean fromOrderAB)
                             throws java.sql.SQLException,
                                    javax.ejb.CreateException,
                                    javax.ejb.FinderException,
                                    javax.naming.NamingException,
                                    java.rmi.RemoteException,
                                    ECException
Copy the OrderAccessBean fromOrderAB and return a new created OrderAccessBean which is a clone of fromOrderAB. It calls copyOrderAccessBean(OrderAccessBean) to create a new OrderAccessBean and calls copyOrderItemAccessBean() to copy each order item. It also calls copyOrderPayInfo() to copy the order pay info.

copyOrderAccessBean

protected OrderAccessBean copyOrderAccessBean(OrderAccessBean fromOrderAB)
                                       throws java.sql.SQLException,
                                              javax.ejb.CreateException,
                                              javax.ejb.FinderException,
                                              javax.naming.NamingException,
                                              java.rmi.RemoteException,
                                              ECException
Copy the OrderAccessBean fromOrderAB and return a new created OrderAccessBean which is a clone of fromOrderAB. It only copies the order level information. Order item level and order pay info are not copied.

copyOrderItemAccessBean

protected OrderItemAccessBean copyOrderItemAccessBean(OrderItemAccessBean fromOrderItemAB,
                                                      java.lang.Long toOrderId)
                                               throws java.sql.SQLException,
                                                      javax.ejb.CreateException,
                                                      javax.ejb.FinderException,
                                                      javax.naming.NamingException,
                                                      java.rmi.RemoteException,
                                                      ECException
Copy the OrderItemAccessBean fromOrderItemAB and return a new created OrderItemAccessBean which is a clone of fromOrderItemAB and with order id = toOrderId.

copyOrderPayInfo

protected void copyOrderPayInfo(java.lang.Long fromOrderId,
                                java.lang.Long toOrderId)
                         throws java.sql.SQLException,
                                javax.ejb.CreateException,
                                javax.ejb.FinderException,
                                javax.naming.NamingException,
                                java.rmi.RemoteException,
                                ECException
Copy the order pay info from the order (id = fromOrderId) to the order (id = toOrderId). It first calls getOrderPaymentInfoCmd to get the order pay info from the order (id = fromOrderId) and then calls setOrderPaymentInfoCmd to set the order pay info to the order (id = toOrderId).

getName

protected java.lang.String getName()
Returns the name of the requisition list.

getOrderId

protected java.lang.Long getOrderId()
Returns the id of the order.

getRequisitionListId

protected java.lang.Long getRequisitionListId()
Returns the id of the requisition list.

getStatus

protected java.lang.String getStatus()
Returns the status of the requisition list.

reset

public void reset()
Description copied from class: AbstractECTargetableCommand
This method should be called after a command has been executed to reset its states variables. After the call to reset, we should be able to execute the command again.
Overrides:
reset in class AbstractECTargetableCommand

setDefaultRequisitionListStatus

protected void setDefaultRequisitionListStatus()
Sets the default requisition list status - 'Y'.

setName

protected void setName(java.lang.String name)
Sets the name of the requisition list.

setOrderId

protected void setOrderId(java.lang.Long id)
Sets the id of the order.

setRequestProperties

public void setRequestProperties(TypedProperty reqProperties)
                          throws ECException
Description copied from class: ControllerCommandImpl
Sets the requestProperties for the command. The WebController calls the setRequestProperties method before invoking the execute method for this command. It is the responsibility of the implementer of the ControllerCommand to extract the required input parameters from the requestProperties object.
Overrides:
setRequestProperties in class ControllerCommandImpl
Following copied from class: com.ibm.commerce.command.ControllerCommandImpl
Parameters:
requestProperties - com.ibm.commerce.datatype.TypedProperty
Throws:
com.ibm.commerce.exception.ECException. -  

setRequisitionListId

protected void setRequisitionListId(java.lang.Long id)
Sets the id of the requisition list.

setStatus

protected void setStatus(java.lang.String status)
Sets the status of the requisition list.

updateResponseView

protected void updateResponseView()
Sets the default response view - Redirect View.