com.ibm.commerce.orderquotation.commands
Class OrderItemSelectCmdImpl

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

public class OrderItemSelectCmdImpl
extends ControllerCommandImpl
implements OrderItemSelectCmd

This is the default implementation of the OrderItemSelect command.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.ibm.commerce.orderquotation.commands. OrderItemSelectCmd
OrderItemSelectCmd.EnumerationGroup
 
Field Summary
static java.lang.String COPYRIGHT
          The IBM copyright string.
 
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.orderquotation.commands. OrderItemSelectCmd
defaultCommandClassName, NAME
 
Constructor Summary
OrderItemSelectCmdImpl()
          Constructor for OrderItemSelectCmdImpl.
 
Method Summary
protected  void copyOrderPaymentInfos(java.lang.Long anParentId, java.lang.Long anSelectionOrderId)
          Copies OrderPaymentInfos from the specified parent Order to the specified selection Order.
protected  OrderAccessBean createSelectionOrder( OrderAccessBean aabParentOrder, java.lang.Integer anStoreId)
          Creates a selection Order based on the specified parent Order.
protected  OrderQuotationRelAccessBean createSelectionRel(java.lang.Long anParentId, java.lang.Integer anStoreId, java.lang.Long anContractId, java.lang.Long anSelectionOrderId)
          Creates a selection OrderQuotationRel.
protected  void deleteSelectionItems( OrderAccessBean aabSelectionOrder, OrderItemAccessBean aabSourceItem)
          Deletes the OrderItems in the specified selection Order that match the specified source OrderItem.
protected   CatalogEntryAccessBean getCatalogEntry(java.lang.Long anCatalogEntryId)
          Returns the CatalogEntry with the specified CatalogEntry ID.
protected  java.lang.Long getDefaultContractId(java.lang.Integer anStoreId)
          Returns the default Contract ID of the specified Store ID.
protected   OrderItemSelectCmd.EnumerationGroup[] getEnumerationGroups()
          Returns the enumeration groups.
protected  OrderAccessBean getOrder(java.lang.Long anOrderId)
          Returns the Order with the specified Order ID.
protected  java.lang.String[] getOutSelectionOrderQuotationRelIdNames()
          Returns the names of the output selectionOrderQuotationRelId name-value pairs.
protected  OrderQuotationRelAccessBean getRelByChildId(java.lang.Long anChildId)
          Returns the OrderQuotationRel with the specified child Order ID.
  AccessVector getResources()
          Gets the access vector accessed by this command.
protected  java.util.List getSelectionItems(java.lang.Long anSelectionOrderId, java.lang.Long anCatalogEntryId, java.lang.Long anItemSpecId, java.lang.Long anCorrelationGroup, java.lang.String astrSupplierPartNumber)
          Returns the selection OrderItems with the specified Order ID, CatalogEntry ID, ItemSpec ID and correlation group, status 'P', 'I', 'E', 'W' or 'N', and fulfillmentStatus 'INT'.
protected  OrderQuotationRelAccessBean getSelectionRel(java.lang.Long anParentId, java.lang.Integer anStoreId, java.lang.Long anContractId)
          Returns the selection OrderQuotationRel with the specified parent Order ID, Store ID and Contract ID.
protected  java.lang.Object getSelectionRelKey(java.lang.Long anParentId, java.lang.Integer anStoreId, java.lang.Long anContractId)
           
protected  boolean isCatalogEntryValid(java.lang.Long anCatalogEntryId, java.lang.Integer anStoreId, java.lang.Long anContractId)
          Returns whether the specified CatalogEntry is valid under the specified Store and Contract.
 void performExecute()
          Contains the actual business logic of the command It should be implemented by all the command writer.
 void reset()
          This method should be called after a command has been executed to reset its states variables.
protected  void resolveNumericAbbreviations()
          Resolves the numeric Order/OrderItem abbreviations without resorting to the ResolveOrderItems command.
protected  void resolveOrderItemAbbreviations()
          Resolves the Order/OrderItem abbreviations using the ResolveOrderItems command.
 void setEnumerationGroups( OrderItemSelectCmd.EnumerationGroup[] aEnumerationGroups)
          Sets the enumeration groups.
 void setOutSelectionOrderQuotationRelIdNames(java.lang.String[] astrOutSelectionOrderQuotationRelIdNames)
          Sets the names of name value pairs that should be added to the redirection URL.
 void setRequestProperties( TypedProperty aRequestProperties)
          Sets the request properties.
protected  void setResponseProperties()
          Sets the response properties.
protected  void updateSelectionItem( OrderAccessBean aabSelectionOrder, OrderItemAccessBean aabSourceItem, java.lang.Long anContractId, java.lang.Double adNormalizedQuantity)
          Creates or updates the appropiate OrderItem in the specified selection Order based on the specified source OrderItem, Contract ID and normalized quantity.
 void validateParameters()
          Performs server side parameter checking.
 
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
The IBM copyright string.
See Also:
Constant Field Values
Constructor Detail

OrderItemSelectCmdImpl

public OrderItemSelectCmdImpl()
Constructor for OrderItemSelectCmdImpl.
Method Detail

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
See Also:
com.ibm.sfc.cmd.Command#reset()

getEnumerationGroups

protected OrderItemSelectCmd.EnumerationGroup[] getEnumerationGroups()
Returns the enumeration groups.
Returns:
the enumeration groups.

getOutSelectionOrderQuotationRelIdNames

protected java.lang.String[] getOutSelectionOrderQuotationRelIdNames()
Returns the names of the output selectionOrderQuotationRelId name-value pairs.
Returns:
the names of the output selectionOrderQuotationRelId name-value pairs.

setEnumerationGroups

public void setEnumerationGroups(OrderItemSelectCmd.EnumerationGroup[] aEnumerationGroups)
Description copied from interface: OrderItemSelectCmd
Sets the enumeration groups.
Specified by:
setEnumerationGroups in interface OrderItemSelectCmd
Parameters:
aEnumerationGroups - the enumeration groups.
See Also:
OrderItemSelectCmd#setEnumerationGroups(EnumerationGroup[])

setOutSelectionOrderQuotationRelIdNames

public void setOutSelectionOrderQuotationRelIdNames(java.lang.String[] astrOutSelectionOrderQuotationRelIdNames)
Description copied from interface: OrderItemSelectCmd
Sets the names of name value pairs that should be added to the redirection URL. The values of the added name value pairs are the identifiers of the OrderQuotationRel objects with relType "selection" whose quotation selection Orders were created or updated.
Specified by:
setOutSelectionOrderQuotationRelIdNames in interface OrderItemSelectCmd
Parameters:
astrOutSelectionOrderQuotationRelIdNames - the names of the output selectionOrderQuotationRelId name-value pairs.
See Also:
OrderItemSelectCmd.setOutSelectionOrderQuotationRelIdNames(String[])

setRequestProperties

public void setRequestProperties(TypedProperty aRequestProperties)
                          throws ECException
Description copied from interface: ControllerCommand
Sets the request properties. 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
Parameters:
aRequestProperties - the request properties.
Throws:
ECException
See Also:
ControllerCmd#setRequestProperties(TypedProperty)

resolveNumericAbbreviations

protected void resolveNumericAbbreviations()
                                    throws ECException
Resolves the numeric Order/OrderItem abbreviations without resorting to the ResolveOrderItems command.
Throws:
ECException

resolveOrderItemAbbreviations

protected void resolveOrderItemAbbreviations()
                                      throws ECException
Resolves the Order/OrderItem abbreviations using the ResolveOrderItems command.
Throws:
ECException

getRelByChildId

protected OrderQuotationRelAccessBean getRelByChildId(java.lang.Long anChildId)
                                               throws ECException
Returns the OrderQuotationRel with the specified child Order ID.
Parameters:
anChildId - the child Order ID.
Returns:
the OrderQuotationRel.
Throws:
ECException

getSelectionRelKey

protected java.lang.Object getSelectionRelKey(java.lang.Long anParentId,
                                              java.lang.Integer anStoreId,
                                              java.lang.Long anContractId)
Parameters:
anParentId - the parent Order ID.
anStoreId - the Store ID.
anContractId - the Contract ID.
Returns:
the key to imapSelectionRels.
Throws:
ECException

getSelectionRel

protected OrderQuotationRelAccessBean getSelectionRel(java.lang.Long anParentId,
                                                      java.lang.Integer anStoreId,
                                                      java.lang.Long anContractId)
                                               throws ECException
Returns the selection OrderQuotationRel with the specified parent Order ID, Store ID and Contract ID.
Parameters:
anParentId - the parent Order ID.
anStoreId - the Store ID.
anContractId - the Contract ID.
Returns:
the selection OrderQuotationRel.
Throws:
ECException

getOrder

protected OrderAccessBean getOrder(java.lang.Long anOrderId)
                            throws ECException
Returns the Order with the specified Order ID.
Parameters:
anOrderId - the Order ID.
Returns:
the Order.
Throws:
ECException

validateParameters

public void validateParameters()
                        throws ECException
Description copied from interface: ECCommand
Performs server side parameter checking. This method replaces the checkParameters() method in a previous version of the code.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException
See Also:
ECCommand.validateParameters()

getResources

public AccessVector getResources()
                          throws ECException
Description copied from interface: ECCommand
Gets the access vector accessed by this command. The default implementation returns null indicating that no protectable resource is accessed by this command. It is the responsibilities of the command writer to return the protectable primary resource(s) and the corresponding actions accessed by this command.
Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
the AccessVector.
Throws:
ECException
See Also:
ECCommand.getResources()

getDefaultContractId

protected java.lang.Long getDefaultContractId(java.lang.Integer anStoreId)
                                       throws ECException
Returns the default Contract ID of the specified Store ID.
Parameters:
anStoreId - the Store ID.
Returns:
the Contract ID.
Throws:
ECException

copyOrderPaymentInfos

protected void copyOrderPaymentInfos(java.lang.Long anParentId,
                                     java.lang.Long anSelectionOrderId)
                              throws ECException
Copies OrderPaymentInfos from the specified parent Order to the specified selection Order.
Parameters:
anParentId - the parent Order ID.
anSelectionOrderId - the selection Order ID.
Throws:
ECException

createSelectionOrder

protected OrderAccessBean createSelectionOrder(OrderAccessBean aabParentOrder,
                                               java.lang.Integer anStoreId)
                                        throws ECException
Creates a selection Order based on the specified parent Order.
Parameters:
aabParentOrder - the parent Order.
anStoreId - the Store ID.
Returns:
the selection Order.
Throws:
ECException

createSelectionRel

protected OrderQuotationRelAccessBean createSelectionRel(java.lang.Long anParentId,
                                                         java.lang.Integer anStoreId,
                                                         java.lang.Long anContractId,
                                                         java.lang.Long anSelectionOrderId)
                                                  throws ECException
Creates a selection OrderQuotationRel.
Parameters:
anParentId - the parent Order ID.
anStoreId - the Store ID.
anContractId - the Contract ID.
anSelectionOrderId - the selection Order ID.
Returns:
the selection OrderQuotationRel.
Throws:
ECException

getSelectionItems

protected java.util.List getSelectionItems(java.lang.Long anSelectionOrderId,
                                           java.lang.Long anCatalogEntryId,
                                           java.lang.Long anItemSpecId,
                                           java.lang.Long anCorrelationGroup,
                                           java.lang.String astrSupplierPartNumber)
                                    throws ECException
Returns the selection OrderItems with the specified Order ID, CatalogEntry ID, ItemSpec ID and correlation group, status 'P', 'I', 'E', 'W' or 'N', and fulfillmentStatus 'INT'.
Parameters:
anSelectionOrderId - the selection Order ID.
anCatalogEntryId - the CatalogEntry ID.
anItemSpecId - the ItemSpec ID.
anCorrelationGroup - the correlation group.
astrSupplierPartNumber - the supplier part number.
Returns:
the selection OrderItems as a List of OrderItemAccessBeans.
Throws:
ECException

getCatalogEntry

protected CatalogEntryAccessBean getCatalogEntry(java.lang.Long anCatalogEntryId)
                                          throws ECException
Returns the CatalogEntry with the specified CatalogEntry ID.
Parameters:
anCatalogEntryId - the CatalogEntry ID.
Returns:
the CatalogEntry.
Throws:
ECException

isCatalogEntryValid

protected boolean isCatalogEntryValid(java.lang.Long anCatalogEntryId,
                                      java.lang.Integer anStoreId,
                                      java.lang.Long anContractId)
                               throws ECException
Returns whether the specified CatalogEntry is valid under the specified Store and Contract.
Parameters:
anCatalogEntryId - the CatalogEntry ID.
anStoreId - the Store ID.
anContractId - the Contract ID.
Returns:
whether the specified CatalogEntry is valid.
Throws:
ECException

updateSelectionItem

protected void updateSelectionItem(OrderAccessBean aabSelectionOrder,
OrderItemAccessBean aabSourceItem,
                                   java.lang.Long anContractId,
                                   java.lang.Double adNormalizedQuantity)
                            throws ECException
Creates or updates the appropiate OrderItem in the specified selection Order based on the specified source OrderItem, Contract ID and normalized quantity.
Parameters:
aabSelectionOrder - the selection Order.
aabSourceItem - the source OrderItem.
anContractId - the Contract ID.
adNormalizedQuantity - the normalized quantity.
Throws:
ECException

deleteSelectionItems

protected void deleteSelectionItems(OrderAccessBean aabSelectionOrder,
OrderItemAccessBean aabSourceItem)
                             throws ECException
Deletes the OrderItems in the specified selection Order that match the specified source OrderItem.
Parameters:
aabSelectionOrder - the selection Order.
aabSourceItem - the source OrderItem.
Throws:
ECException

setResponseProperties

protected void setResponseProperties()
                              throws ECException
Sets the response properties.
Throws:
ECException

performExecute

public void performExecute()
                    throws ECException
Description copied from interface: ECCommand
Contains the actual business logic of the command It should be implemented by all the command writer.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException
See Also:
ECCommand.performExecute()