Module:External Data Integration/Developers Guide/How To Implement A Storage Location
The External Data Integration module provides basic Attachment and Database storage locations. In this document is described how to implement a new Storage Location.
Storage Location definition
The definition in the Application Dictionary consists on adding a new item to the OBEDL Storage Location List Reference.
Storage Location implementation
The Custom Storage Location is developed by implementing the org.openbravo.externaldata.integration.process.CustomStorageLocation abstract class. This class has 3 methods to implement: saveRawData(), loadStoredDataCustom() and deleteTempData(). The class is identified with the corresponding Storage Location by a Qualifier where its name is the value set in the corresponding Reference List item.
The saveRawData() method implements the store operation. It receives the raw data and the request as parameters. The method should transform the rawData if required, and store it in the custom location (ftp, drive, database,...). A link with the EDL Requestmust be included so it is possible to retrieve the raw data when needed.
The loadStoredDataCustom() receives the EDL Request as parameter. It is executed when a synchronous process is reprocess. It has to download or retrieve the raw data linked to that request and return it.
The deleteTempData() is executed when the reprocess of a request is finished. It has to delete any temporary file or data created by the loadStoredDataCustom() method.