Page tree

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.

ClassarchiveImportedDatapostImportHandlerhandleImportException
Abstract

Abstract method, to be implemented.

Calls event "beforeArchiveImportedData" and then archiveImportedData.

Empty sub Method here.

DirectoryCreates a zip out of the importFolder (if enabled)as parent (Abstract)

as parent (Abstract)

SingleUploadsas parent (Directory)removes the importRootFolderremoves the importRootFolder
Zip

rename uploaded zip, or delete it, if feature disabled,

throws error if exists already

call parent (Abstract) and removes importFolderremoves importFolder
ZippedUrldelete the uploaded zip if feature disabledas parent (Zip)

as parent (Zip)

    
  • No labels