public interface FileImporter extends Serializable, Comparable<FileImporter>
Responsible for converting given sources to a given type of Document using default.
Modifier and Type | Method and Description |
---|---|
DocumentModel |
create(CoreSession documentManager,
Blob content,
String path,
boolean overwrite,
String filename,
TypeManager typeService)
Deprecated.
since 10.10. Use
createOrUpdate(FileImporterContext) instead. |
DocumentModel |
createOrUpdate(FileImporterContext fileImporterContext)
Returns a created or updated document based on the given
context . |
String |
getDocType()
Returns the document type configured for this
FileImporter , null if no document type is
configured. |
List<String> |
getFilters()
Gets filters.
|
String |
getName()
Gets the plugin name.
|
Integer |
getOrder()
Returns the plugin order for sorting.
|
boolean |
isEnabled() |
boolean |
isOneToMany()
Returns
true if createOrUpdate(FileImporterContext) creates more than one document for the given
blob, false otherwise. |
boolean |
matches(String mimeType)
Tests whether plugin is suitable for the given mimetype.
|
void |
setDocType(String docType)
Sets the document type configured for this importer.
|
void |
setEnabled(boolean enabled) |
void |
setFileManagerService(FileManagerService fileManagerService)
Deprecated.
since 10.3, use
Framework.getService(Class) instead if needed |
void |
setFilters(List<String> filters)
Sets filters.
|
void |
setName(String name)
Sets plugin name.
|
void |
setOrder(Integer order)
Sets the plugin order for sorting.
|
compareTo
String getDocType()
FileImporter
, null
if no document type is
configured.void setDocType(String docType)
List<String> getFilters()
The filters are all the mime/type this plugin can deal with.
void setFilters(List<String> filters)
The filters are all the mime/types this plugin can deal with.
filters
- a list of strings representing each filter@Deprecated void setFileManagerService(FileManagerService fileManagerService)
Framework.getService(Class)
instead if neededfileManagerService
- instance where the Plugin is registered as a contributionboolean matches(String mimeType)
mimeType
- the mimetype to test@Deprecated DocumentModel create(CoreSession documentManager, Blob content, String path, boolean overwrite, String filename, TypeManager typeService) throws IOException
createOrUpdate(FileImporterContext)
instead.documentManager
- the manager used to create the Documentcontent
- the content of the Filepath
- the path of current documentoverwrite
- a boolean deciding whether to create or update if we find a document with the same fileNamefilename
- the filename of the FileIOException
DocumentModel createOrUpdate(FileImporterContext fileImporterContext) throws IOException
context
.IOException
FileImporterContext
boolean isEnabled()
void setEnabled(boolean enabled)
boolean isOneToMany()
true
if createOrUpdate(FileImporterContext)
creates more than one document for the given
blob, false
otherwise.Copyright © 2019 Nuxeo. All rights reserved.