DataProviders provide a unified way, how import data flows into Translate5.
All DataProviders reside under the name space "editor_Models_Import_DataProvider_".
Depending on Translate5 default import or client specific interfaces, import data can be specified in the following forms:
- Single file Upload: handled by class SingleUploads (extending Directory)
- As plain import directory: handled by class Directory (extending Abstract)
- As zip container: handled by class Zip (extending Abstract)
- As URL to a zip container: handled by class ZippedUrl (extending Zip)
In general each DataProvider converts its data to a directory structure (importRootFolder) consumed finally by the Importer.
In addition the DataProviders can:
- archive the data to be imported, Method "archiveImportedData". Archiving only if configured: runtimeOptions.import.createArchivZip
- handle file clean up on import exceptions, Method "postImportHandler"
- provide a post import handler, Method "handleImportException"
This three steps are handled slightly different by the existing DataProviders.
Class | archiveImportedData | postImportHandler | handleImportException |
---|---|---|---|
Abstract | Abstract method, to be implemented. | Calls event "beforeArchiveImportedData" and then archiveImportedData. | Empty sub Method here. |
Directory | Creates a zip out of the importFolder (if enabled) | as parent (Abstract) | as parent (Abstract) |
SingleUploads | as parent (Directory) | removes the importRootFolder | removes the importRootFolder |
Zip | rename uploaded zip, or delete it, if feature disabled, throws error if exists already | call parent (Abstract) and removes importFolder | removes importFolder |
ZippedUrl | delete the uploaded zip if feature disabled | as parent (Zip) | as parent (Zip) |