Class AttachImplementationManager


  • public class AttachImplementationManager
    extends Object
    Class that centralizes the Attachment Management. Any action to manage an attachment in Openbravo should be done through this class. The class checks what is the Attachment Method to use and calls the needed handler on each case.
    • Constructor Detail

      • AttachImplementationManager

        public AttachImplementationManager()
    • Method Detail

      • upload

        public void upload​(Map<String,​String> requestParams,
                           String strTab,
                           String strKey,
                           String strDocumentOrganization,
                           File file)
                    throws OBException
        Method to upload files. This method calls needed handler class
        Parameters:
        strTab - the tab Id where the attachment is done
        strKey - the recordId where the attachment is done
        strDocumentOrganization - the organization ID of the record where the attachment is done
        file - The file to be uploaded
        Throws:
        OBException - any exception thrown during the attachment uploading
      • update

        public void update​(Map<String,​String> requestParams,
                           String attachID,
                           String tabId)
                    throws OBException
        Method to update file's metadata. This method calls needed handler class
        Parameters:
        requestParams -
        attachID - the attachmentID that will be updated
        tabId - the TabId where the attachment is being modified
        Throws:
        OBException - any exception thrown when updating the document
      • download

        public void download​(String attachmentId,
                             OutputStream os)
                      throws OBException
        Method to download a file. This method calls needed handler class
        Parameters:
        attachmentId - the attachment Id that will be downloaded
        os - The output stream to dump the file
        Throws:
        OBException - any exception thrown during the download
      • downloadAll

        public void downloadAll​(String tabId,
                                String recordIds,
                                OutputStream os)
                         throws OBException
        Method to download all the files related to the record, in a single .zip file. This method calls needed handler class
        Parameters:
        tabId - The tab Id where the download process is being executed
        recordIds - All RecordIds from where are downloading the documents
        os -
        Throws:
        OBException - any exception thrown during the download of all documents
      • delete

        public void delete​(Attachment attachment)
                    throws OBException
        Method to delete files. This method calls needed handler class
        Parameters:
        attachment - the attachment that will be removed
        Throws:
        OBException - any exception thrown when deleting an attachment