com.ibm.commerce.orderitems.commands
Class OrderItemDeleteCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.ControllerCommandImpl
                    |
                    +--com.ibm.commerce.orderitems.commands.OrderItemDeleteCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, OrderItemDeleteCmd

public class OrderItemDeleteCmdImpl
extends ControllerCommandImpl
implements OrderItemDeleteCmd

Deletes a product from one or more pending orders.

Behavior

View Task: RedirectView

This command uses the following AccessBeans:
See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          IBM copyright notice 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.orderitems.commands. OrderItemDeleteCmd
defaultCommandClassName, NAME
 
Constructor Summary
OrderItemDeleteCmdImpl()
           
 
Method Summary
protected  java.lang.String[] getOrderIds()
          Return a list of ids of the orders in which at lease one order item has been delete.
  AccessVector getResources()
          Gets the resources.
protected  boolean isValidStatus( OrderAccessBean orderAB)
          Checks whether the status of the order is valid when you tries to delete order items from the order.
 void performExecute()
          The main entry point of the command.
 void reset()
          Reset all instance variables.
 void setCatEntryId(java.lang.String[] ids)
          set a list of catalog entry ids to be deleted from the pending orders specified by orderId.
 void setOrderId(java.lang.String[] numbers)
          Specifies zero or more orders, using order ids or one of the special abbreviations ".", "*", ".t", "*t".
 void setOrderItemId(java.lang.String[] numbers)
          Set an array of id of order items to be deleted.
 void setOutOrderName(java.lang.String[] names)
          Specifies the names of name-value pairs to add to the redirection URL.
 void setRequestProperties( TypedProperty aRequestProperties)
          Sets the request properties.
protected  void unLockOrder(java.lang.String orderId)
          Unlocks the order.
 void validateParameters()
          Verify the input 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, 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, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 

Field Detail
public static final java.lang.String COPYRIGHT
IBM copyright notice field.
See Also:
Constant Field Values
Constructor Detail

OrderItemDeleteCmdImpl

public OrderItemDeleteCmdImpl()
Method Detail

getOrderIds

protected java.lang.String[] getOrderIds()
Return a list of ids of the orders in which at lease one order item has been delete. These order ids are also appended to redirection url.
Returns:
an array of order ids

getResources

public AccessVector getResources()
                          throws ECException
Gets the resources.
Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
resource access vector
Throws:
ECException

isValidStatus

protected boolean isValidStatus(OrderAccessBean orderAB)
                         throws ECException,
                                FinderException,
                                CreateException,
                                javax.naming.NamingException,
                                java.rmi.RemoteException,
                                java.sql.SQLException
Checks whether the status of the order is valid when you tries to delete order items from the order. It returns true if the status is 'P' or 'E'. Otherwise it returns false.
Parameters:
orderAB - OrderAccessBean
Returns:
boolean
Throws:
ECException
FinderException
CreateException
javax.naming.NamingException
java.rmi.RemoteException
java.sql.SQLException

performExecute

public void performExecute()
                    throws ECException
The main entry point of the command.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException

reset

public void reset()
Reset all instance variables.
Overrides:
reset in class AbstractECTargetableCommand

setCatEntryId

public void setCatEntryId(java.lang.String[] ids)
set a list of catalog entry ids to be deleted from the pending orders specified by orderId. This parameter is mandatory if orderItemId is not set. This parameter is ignored if orderItemId is set.
Specified by:
setCatEntryId in interface OrderItemDeleteCmd
Parameters:
ids - an array of catalog entry ids.

setOrderId

public void setOrderId(java.lang.String[] numbers)
Specifies zero or more orders, using order ids or one of the special abbreviations ".", "*", ".t", "*t". See OrderItem Commands for a description of these abbreviations. If this parameter is omitted, it defaults to "."
Specified by:
setOrderId in interface OrderItemDeleteCmd
Parameters:
numbers - an array of order ids.

setOrderItemId

public void setOrderItemId(java.lang.String[] numbers)
Set an array of id of order items to be deleted.
Specified by:
setOrderItemId in interface OrderItemDeleteCmd
Parameters:
numbers - an array of order item ids.

setOutOrderName

public void setOutOrderName(java.lang.String[] names)
Specifies the names of name-value pairs to add to the redirection URL. The values of the added name-value pairs are the reference numbers of the input orders.
Specified by:
setOutOrderName in interface OrderItemDeleteCmd

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 - request properties.
Throws:
ECApplicationException

unLockOrder

protected void unLockOrder(java.lang.String orderId)
                    throws ECException,
                           FinderException,
                           CreateException,
                           javax.naming.NamingException,
                           java.rmi.RemoteException,
                           java.sql.SQLException
Unlocks the order.
Parameters:
orderId - order id.
Throws:
ECException
FinderException
CreateException
javax.naming.NamingException
java.rmi.RemoteException
java.sql.SQLException

validateParameters

public void validateParameters()
                        throws ECException
Verify the input parameters.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException