Improvements in Attachment model in Openbravo
Change in architecture
Note that the attachments can be still be stored using the previous model by enabling the preference ‘SaveAttachmentsOldWay’ to ‘Y’. For more information on using preferences refer here.
API’s for Attachments Management:
Before these improvements, attachments were fetched using the standard folder name of tableId-recordId. Now API’s have been introduced to fetch the attachments and also to get the directory where attachment have to be stored in the improved model based on the preference ‘Save Attachments Old Way’.
API for fetching existing attachments:
- UUID of the ad_table
- UUID of the record
String attachmentDirectory = TabAttachments.getAttachmentDirectory(“259″,”0F3A10E019754BACA5844387FB37B0D5″,”test.txt”);
API to fetch directory to save new attachments
Migrating existing attachments to the improved model
Existing attachments can be migrated based on the latest model using an ant task. The task can be executed using the following command,
2. Change the extension to use new API and migrate attachments (recommended for the mid-term, long-term). Contact us through our forum or through our social network channels https://twitter.com/Openbravo, https://www.facebook.com/OpenbravoSLU for any doubts.