com.ibm.commerce.requisitionlist.commands

Class RequisitionListCopyCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, RequisitionListCopyCmd, 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


    public class RequisitionListCopyCmdImpl
    extends RequisitionListBaseCmdImpl
    implements RequisitionListCopyCmd
    This is the default implementation of the RequisitionListCopyCmd controller command.

    Input parameters:

    NameTypeRequirementDescription
    orderIdLongmandatoryThe id of the source order or requisition list to be copied.
    nameStringoptionalThe name of the created requisition list
    status/type(CO)CharoptionalThe status/type(CO) of the created requisition list. The valid values are 'Y' and 'Z'(status)/"PRL" and "SRL"(type). The default value is 'Y'/"PRL"

    Output parameters:

    NameTypeDescription
    requisitionListIdLongthe newly created requisition list id

    Behavior:

    • It creates a new requisition list based on an existing order (or requisition list).

    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
    • Constructor Detail

      • RequisitionListCopyCmdImpl

        public RequisitionListCopyCmdImpl()
        This is the default constructor of this class.
    • Method Detail

      • getRequisitionListId

        public java.lang.Long getRequisitionListId()
        This method returns the newly created requisition list id.
        Specified by:
        getRequisitionListId in interface RequisitionListCopyCmd
        Returns:
        requisition list id.
      • performExecute

        public void performExecute()
                            throws ECException
        This method is the main execution of the command. It calls the following methods:
        • setDefaultRequisitionListStatus()
        • action()
        • updateResponseView()
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
      • setName

        public void setName(java.lang.String name)
        This method specifies the name of the created requisition list.
        Specified by:
        setName in interface RequisitionListCopyCmd
        Parameters:
        name - the requisition list name.
      • setOrderId

        public void setOrderId(java.lang.Long id)
        This method specifies the source order or requisition list id.
        Specified by:
        setOrderId in interface RequisitionListCopyCmd
        Parameters:
        id - order id.
      • setStatus

        public void setStatus(java.lang.String status)
        This method sets the status of the created requisition list.
        Specified by:
        setStatus in interface RequisitionListCopyCmd
        Parameters:
        status - the status of the created requisition list.
      • validateParameters

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

        It checks the following mandatory parameters:

        • storeId
        • orderId
        It also checks the validation of the following parameter values:
        • status
        • type
        • orderId

        Exception:

        • It throws an ECApplicationException with the message key _ERR_BAD_MISSING_CMD_PARAMETER, if the input parameter storeId or orderId are not found.
        • 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 throws an ECApplicationException with the message key _ERR_INVALID_ORDER_REFNUM, if the input parameter orderId is not a valid order id.
        Specified by:
        validateParameters in interface ECCommand
        Overrides:
        validateParameters in class AbstractECTargetableCommand
        Throws:
        ECException
      • setType

        public void setType(java.lang.String type)
        This method sets the type of the created requisition list.
        Specified by:
        setType in interface RequisitionListCopyCmd
        Parameters:
        type - the type of the created requisition list.