All Superinterfaces:
Comparable<FileImporter>, Serializable
All Known Implementing Classes:
AbstractFileImporter, AudioImporter, CSVZipImporter, DefaultFileImporter, ExportedZipImporter, ImagePlugin, NoteImporter, RouteModelsZipImporter, ThreeDImporter, VideoImporter

public interface FileImporter extends Serializable, Comparable<FileImporter>
FileManagerServiceCommon plugin default interface.

Responsible for converting given sources to a given type of Document using default.

Author:
Andreas Kalogeropoulos, Anahide Tchertchian
  • Method Details

    • getName

      String getName()
      Gets the plugin name.
      Returns:
      a string holding the plugin name
    • getDocType

      String getDocType()
      Returns the document type configured for this FileImporter, null if no document type is configured.
      Since:
      5.5
    • setDocType

      void setDocType(String docType)
      Sets the document type configured for this importer.

      Since:
      5.5
    • getFilters

      List<String> getFilters()
      Gets filters.

      The filters are all the mime/type this plugin can deal with.

      Returns:
      list of string holding each filters.
    • setName

      void setName(String name)
      Sets plugin name.
      Parameters:
      name - a string holding the name
    • setFilters

      void setFilters(List<String> filters)
      Sets filters.

      The filters are all the mime/types this plugin can deal with.

      Parameters:
      filters - a list of strings representing each filter
    • setFileManagerService

      @Deprecated void setFileManagerService(FileManagerService fileManagerService)
      Deprecated.
      since 10.3, use Framework.getService(Class) instead if needed
      Embeds a reference to the holding FileManagerService instance to be able to reuse generic file creation utility methods in specific plugin implementations.
      Parameters:
      fileManagerService - instance where the Plugin is registered as a contribution
    • matches

      boolean matches(String mimeType)
      Tests whether plugin is suitable for the given mimetype.
      Parameters:
      mimeType - the mimetype to test
    • create

      @Deprecated DocumentModel create(CoreSession documentManager, Blob content, String path, boolean overwrite, String filename, TypeManager typeService) throws IOException
      Deprecated.
      since 10.10. Use createOrUpdate(FileImporterContext) instead.
      Creates the document.
      Parameters:
      documentManager - the manager used to create the Document
      content - the content of the File
      path - the path of current document
      overwrite - a boolean deciding whether to create or update if we find a document with the same fileName
      filename - the filename of the File
      Throws:
      IOException
    • createOrUpdate

      DocumentModel createOrUpdate(FileImporterContext fileImporterContext) throws IOException
      Returns a created or updated document based on the given context.
      Throws:
      IOException
      Since:
      10.10
      See Also:
    • isEnabled

      boolean isEnabled()
    • setEnabled

      void setEnabled(boolean enabled)
    • getOrder

      Integer getOrder()
      Returns the plugin order for sorting.
    • setOrder

      void setOrder(Integer order)
      Sets the plugin order for sorting.
    • isOneToMany

      boolean isOneToMany()
      Returns true if createOrUpdate(FileImporterContext) creates more than one document for the given blob, false otherwise.
      Since:
      10.3