Class AttachImplementationManager
- java.lang.Object
-
- org.openbravo.client.application.attachment.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.
-
-
Field Summary
Fields Modifier and Type Field Description static String
REFERENCE_LIST
static String
REFERENCE_SELECTOR_REFERENCE
-
Constructor Summary
Constructors Constructor Description AttachImplementationManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete(Attachment attachment)
Method to delete files.void
download(String attachmentId, OutputStream os)
Method to download a file.void
downloadAll(String tabId, String recordIds, OutputStream os)
Method to download all the files related to the record, in a single .zip file.void
update(Map<String,String> requestParams, String attachID, String tabId)
Method to update file's metadata.void
upload(Map<String,String> requestParams, String strTab, String strKey, String strDocumentOrganization, File file)
Method to upload files.
-
-
-
Field Detail
-
REFERENCE_LIST
public static final String REFERENCE_LIST
- See Also:
- Constant Field Values
-
REFERENCE_SELECTOR_REFERENCE
public static final String REFERENCE_SELECTOR_REFERENCE
- See Also:
- Constant Field Values
-
-
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 donestrKey
- the recordId where the attachment is donestrDocumentOrganization
- the organization ID of the record where the attachment is donefile
- 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 updatedtabId
- 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 downloadedos
- 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 executedrecordIds
- All RecordIds from where are downloading the documentsos
-- 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
-
-