Interface FileImporter
-
- 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 Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description DocumentModel
create(CoreSession documentManager, Blob content, String path, boolean overwrite, String filename, TypeManager typeService)
Deprecated.since 10.10.DocumentModel
createOrUpdate(FileImporterContext fileImporterContext)
Returns a created or updated document based on the givencontext
.String
getDocType()
Returns the document type configured for thisFileImporter
,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()
Returnstrue
ifcreateOrUpdate(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, useFramework.getService(Class)
instead if neededvoid
setFilters(List<String> filters)
Sets filters.void
setName(String name)
Sets plugin name.void
setOrder(Integer order)
Sets the plugin order for sorting.-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Method Detail
-
getName
String getName()
Gets the plugin name.- Returns:
- a string holding the plugin name
-
getDocType
String getDocType()
Returns the document type configured for thisFileImporter
,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, useFramework.getService(Class)
instead if neededEmbeds 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. UsecreateOrUpdate(FileImporterContext)
instead.Creates the document.- Parameters:
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 File- Throws:
IOException
-
createOrUpdate
DocumentModel createOrUpdate(FileImporterContext fileImporterContext) throws IOException
Returns a created or updated document based on the givencontext
.- Throws:
IOException
- Since:
- 10.10
- See Also:
FileImporterContext
-
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()
Returnstrue
ifcreateOrUpdate(FileImporterContext)
creates more than one document for the given blob,false
otherwise.- Since:
- 10.3
-
-