com.ibm.commerce.rfq.commands

Class RFQAttachmentReplaceCmdImpl

    • Constructor Detail

      • RFQAttachmentReplaceCmdImpl

        public RFQAttachmentReplaceCmdImpl()
    • Method Detail

      • reset

        public void reset()
        Reset the command
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
      • setRequestProperties

        public void setRequestProperties(TypedProperty reqParms)
                                  throws ECException
        Retrieves the identifier of the RFQ, old attachment id, and new attachment description.
        The WebController calls the setRequestProperties method before invoking the execute method in this command.
        Specified by:
        setRequestProperties in interface ControllerCommand
        Overrides:
        setRequestProperties in class AttachmentUploadCmdImpl
        Parameters:
        com.ibm.commerce.datatype.TypedProperty - request parameters
        Throws:
        ECException
        See Also:
        ControllerCmd#setRequestProperties(TypedProperty)
      • performExecute

        public void performExecute()
                            throws ECException
        Save the attachment to datastore, and associate the attachment to an RFQ. Calls DeleteRFQAttachmentCmd for removing the RFQ and old attachment relationship. Calls MarkAttachmentForDeleteCmd for mark for delete the attachment Calls super.performExecute() for saving Calls TradeAttachmentCreateCmd.execute() for creating the association

        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AttachmentUploadCmdImpl
        Throws:
        ECException
        See Also:
        ECCommand#performExecute()
      • getRfqId

        public java.lang.Long getRfqId()
        Gets the rfqId
        Returns:
        Returns a Long
      • setRfqId

        public void setRfqId(java.lang.Long rfqId)
        Sets the rfqId
        Parameters:
        rfqId - The rfqId to set
      • validateParameters

        public void validateParameters()
                                throws ECException
        Checks if the RFQ id has been set, and if specified RFQ exist. Checks if the attachment id has been set, and if specified attachment exist.

        Specified by:
        validateParameters in interface ECCommand
        Overrides:
        validateParameters in class UploadToStreamCmdImpl
        Throws:
        ECException.
        ECException - Thrown with the message ECMessage._ERR_UPLOAD_MISSING_REFCMD when refcmd is missing from the <instance_name>.xml file attachment configuration section. Thrown with the message ECMessage._ERR_UPLOAD_FILECONTENTTYPE_NOTALLOWED when the contenttype of the upload file does not match the file extension. Thrown with the message ECMessage._ERR_UPLOAD_FILETYPE_NOTALLOWED when the file type is not contained in supportedfileextension as specified in the attachment configuration. Thrown with the message ECMessage._ERR_UPLOAD_FILESIZE_TOOBIG when the filesize exceeds the maximum allowable size in the attachment configuration section of the <instance_name>.xml file.
        See Also:
        ECCommand#validateParameters()
      • getDescription

        public java.lang.String getDescription()
        Gets the description
        Returns:
        Returns a String
      • setDescription

        public void setDescription(java.lang.String description)
        Sets the description
        Parameters:
        description - The description to set
      • getOldAttachmentId

        public java.lang.Long getOldAttachmentId()
        Gets the attachment ID.
        Returns:
        Returns a Long
      • setOldAttachmentId

        public void setOldAttachmentId(java.lang.Long oldAttachmentId)
        Sets the attachment ID.
        Parameters:
        attachmentId - The attachmentId to set