com.ibm.commerce.requisitionlist.commands

Class RequisitionListItemUpdateCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, OrderItemAddCmd, OrderItemUpdateCmd, RequisitionListItemUpdateCmd, Protectable, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable
    Direct Known Subclasses:
    RequisitionListItemUpdateWithDynamicKitCmdImpl


    public class RequisitionListItemUpdateCmdImpl
    extends OrderItemUpdateCmdImpl
    implements RequisitionListItemUpdateCmd
    This is the default implementation of the RequisitionListItemUpdateCmd controller command.

    Input parameters:

    Name Type Requirement Description
    requisitionListId Long optional The requisition list ID
    name String optional The requisition list name
    ... The name value pairs similar to OrderItemUpdate

    Output parameters:

    Name Type Description
    ... The output similar to OrderItemUpdate

    Behavior:

    • The original parameter orderId for OrderItemUpdate command is replaced by requisitionListId.
    • The requisitionListId does not support abbreviation. It must be a number.
    • The other differences between RequisitionListItemUpdate and OrderItemUpdate:
      RequisitionListItemUpdate does not take parameter offerId and contractId because there is no price calculation for the requisition list item.
    • You can use this command to do the following things.
      Adds an item to a requisition list.
      Updates an item's information such as quantity and ship mode.
      Deletes an item from a requisition list.
    • To add an item to a requisition list, you can specify a catEntryId and quantity.
      • If the requisitionListId is specified, the item will be added to the requisition list.
      • If the requisitionListId is not specified, the item will be added to a new created private requisition list.
    • To update an item in a requisition list, you can specify an orderItemId and the other updated information.
    • To delete an item from a requisition list, you can specify an orderItemId and quantity=0.

    View:

    • RedirectView.
    This command uses the following AccessBeans:
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        The IBM copyright notice field.
        See Also:
        Constant Field Values
      • CLASSNAME

        public static final java.lang.String CLASSNAME
        The name of this class.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RequisitionListItemUpdateCmdImpl

        public RequisitionListItemUpdateCmdImpl()
    • Method Detail

      • performExecute

        public void performExecute()
                            throws ECException
        This method performs the main business logic.
        • It calls super.performExecute() to do work.
        • If the super class throws an exception with a badPartNumberErrorView error view, it changes the error view to RLBadPartNumberErrorView.
        • If the super class throws an exception with an InvalidInputErrorView error view, it changes the error view to RLInvalidInputErrorView.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class OrderItemBaseCmdImpl
        Throws:
        ECException
      • reset

        public void reset()
        This method resets all instance variables.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class OrderItemBaseCmdImpl
      • setName

        public void setName(java.lang.String name)
        This method specifies the requisition list name.
        Specified by:
        setName in interface RequisitionListItemUpdateCmd
        Parameters:
        name - The requisition list name.
      • setRequisitionListId

        public void setRequisitionListId(java.lang.Long id)
        This method specifies the requisition list ID.
        Specified by:
        setRequisitionListId in interface RequisitionListItemUpdateCmd
        Parameters:
        id - The requisition list ID.
      • setStatus

        public void setStatus(java.lang.String status)
        This method specifies the status of the requisition list.
        Specified by:
        setStatus in interface RequisitionListItemUpdateCmd
        Parameters:
        status - The status of the requisition list.
      • setType

        public void setType(java.lang.String type)
        This method specifies the type of the created requisition list. If it is not specified, the default value is 'PRL', a shareable requisition list.
        Specified by:
        setType in interface RequisitionListItemUpdateCmd
        Parameters:
        type - The type of the created requisition list.
      • validateParameters

        public void validateParameters()
                                throws ECException
        This method validates the input parameters.

        It checks whether the request can cause the size of the requisition list, as well as the requested quantity, to exceed business threshold. Then it checks the validation of the following parameter values:

        • requisitionListId
        • iRequisitionListStatus
        • iRequisitionListType

        Exception:

        • It throws an ECApplicationException with the message key _ERR_INVALID_ORDER_REFNUM, if the input parameter requisitionListId is not a valid order ID.
        • It throws an ECApplicationException with the message key _ERR_INVALID_INPUT, if the input parameter status is not 'Y' or 'Z'. Also if the input parameter status is 'Z' or type is "SRL" but the user is a B2C user.

        • It also calls super.validateParameters() to do the additional parameters validation.
        • If the super class throws exception with error view badPartNumberErrorView, it changes the error view to RLBadPartNumberErrorView.
        • If the super class throws exception with error view InvalidInputErrorView, it changes the error view to RLInvalidInputErrorView.
        Specified by:
        validateParameters in interface ECCommand
        Overrides:
        validateParameters in class OrderItemBaseCmdImpl
        Throws:
        ECException
      • getStatus

        public java.lang.String getStatus()
        This method returns the status of the requisition list.
        Returns:
        The status of the requisition list.
      • getType

        public java.lang.String getType()
        This method returns the type of the requisition list.
        Returns:
        The type of the requisition list.