public abstract class AbstractFileImporter extends Object implements FileImporter
Default file importer behavior.
FileImporter, 
Serialized Form| Modifier and Type | Field and Description | 
|---|---|
static String | 
DISABLE_AUDIT_LOGGER  | 
protected String | 
docType  | 
protected boolean | 
enabled  | 
protected FileManagerService | 
fileManagerService
Deprecated. 
 
since 10.3, use  
Framework.getService(Class) instead if needed | 
protected List<String> | 
filters  | 
protected String | 
name  | 
protected Integer | 
order  | 
protected List<Pattern> | 
patterns  | 
static String | 
SKIP_UPDATE_AUDIT_LOGGING  | 
| Constructor and Description | 
|---|
AbstractFileImporter()  | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
checkIn(DocumentModel doc)
Deprecated. 
 
since 9.1 automatic versioning is now handled at versioning service level, remove versioning
             behaviors from importers 
 | 
protected void | 
checkInAfterAdd(DocumentModel doc)
Deprecated. 
 
since 9.1 automatic versioning is now handled at versioning service level, remove versioning
             behaviors from importers 
 | 
int | 
compareTo(FileImporter other)  | 
DocumentModel | 
create(CoreSession session,
      Blob content,
      String path,
      boolean overwrite,
      String fullname,
      TypeManager typeService)
Creates the document. 
 | 
protected void | 
createDocument(DocumentModel doc,
              String title)
Creates the document (sets its properties). 
 | 
DocumentModel | 
createOrUpdate(FileImporterContext context)
Returns a created or updated document based on the given  
context. | 
protected void | 
doSecurityCheck(CoreSession documentManager,
               String path,
               String typeName)  | 
protected void | 
doSecurityCheck(CoreSession documentManager,
               String path,
               String typeName,
               TypeManager typeService)  | 
protected Blob | 
getBlob(DocumentModel doc)  | 
protected String | 
getDefaultDocType()
Default document type to use when the plugin XML configuration does not specify one. 
 | 
String | 
getDocType()
Returns the document type configured for this  
FileImporter, null if no document type is
 configured. | 
protected String | 
getDocType(DocumentModel container)
Gets the doc type to use in the given container. 
 | 
FileManagerService | 
getFileManagerService()
Deprecated. 
 
since 10.3, use  
Framework.getService(Class) instead if needed | 
List<String> | 
getFilters()
Gets filters. 
 | 
String | 
getName()
Gets the plugin name. 
 | 
protected String | 
getNearestContainerPath(CoreSession documentManager,
                       String path)
Returns nearest container path 
 | 
Integer | 
getOrder()
Returns the plugin order for sorting. 
 | 
boolean | 
isEnabled()  | 
boolean | 
isOneToMany()
Returns  
true if FileImporter.createOrUpdate(FileImporterContext) creates more than one document for the given
 blob, false otherwise. | 
protected boolean | 
isOverwriteByTitle()
Whether document overwrite is detected by checking title or filename. 
 | 
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. 
 | 
protected boolean | 
skipCheckInForBlob(Blob blob)
Deprecated. 
 
since 9.1 automatic versioning is now handled at versioning service level, remove versioning
             behaviors from importers 
 | 
protected void | 
updateDocument(DocumentModel doc,
              Blob content)
Updates the document (sets its properties). 
 | 
protected boolean | 
updateDocumentIfPossible(DocumentModel doc,
                        Blob content)
Tries to update the document  
doc with the blob content. | 
protected boolean enabled
public static final String SKIP_UPDATE_AUDIT_LOGGING
public static final String DISABLE_AUDIT_LOGGER
@Deprecated protected transient FileManagerService fileManagerService
Framework.getService(Class) instead if neededpublic AbstractFileImporter()
public List<String> getFilters()
FileImporterThe filters are all the mime/type this plugin can deal with.
getFilters in interface FileImporterpublic void setFilters(List<String> filters)
FileImporterThe filters are all the mime/types this plugin can deal with.
setFilters in interface FileImporterfilters - a list of strings representing each filterpublic boolean matches(String mimeType)
FileImportermatches in interface FileImportermimeType - the mimetype to testpublic String getName()
FileImportergetName in interface FileImporterpublic void setName(String name)
FileImportersetName in interface FileImportername - a string holding the namepublic String getDocType()
FileImporterFileImporter, null if no document type is
 configured.getDocType in interface FileImporterpublic void setDocType(String docType)
FileImportersetDocType in interface FileImporterprotected String getDocType(DocumentModel container)
protected String getDefaultDocType()
 To implement when the default createOrUpdate(FileImporterContext) method is used.
protected boolean isOverwriteByTitle()
 To implement when the default createOrUpdate(FileImporterContext) method is used.
protected void createDocument(DocumentModel doc, String title)
updateDocument(org.nuxeo.ecm.core.api.DocumentModel, org.nuxeo.ecm.core.api.Blob) will be called after this.
 Default implementation sets the title.
protected boolean updateDocumentIfPossible(DocumentModel doc, Blob content)
doc with the blob content.
 
 Returns true if the document is really updated.
protected void updateDocument(DocumentModel doc, Blob content)
Default implementation sets the content.
protected Blob getBlob(DocumentModel doc)
public boolean isOneToMany()
FileImportertrue if FileImporter.createOrUpdate(FileImporterContext) creates more than one document for the given
 blob, false otherwise.isOneToMany in interface FileImporterpublic DocumentModel create(CoreSession session, Blob content, String path, boolean overwrite, String fullname, TypeManager typeService) throws IOException
FileImportercreate in interface FileImportersession - 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 fileNamefullname - the filename of the FileIOExceptionpublic DocumentModel createOrUpdate(FileImporterContext context) throws IOException
FileImportercontext.createOrUpdate in interface FileImporterIOExceptionFileImporterContext@Deprecated protected boolean skipCheckInForBlob(Blob blob)
@Deprecated public FileManagerService getFileManagerService()
Framework.getService(Class) instead if needed@Deprecated public void setFileManagerService(FileManagerService fileManagerService)
Framework.getService(Class) instead if neededFileImportersetFileManagerService in interface FileImporterfileManagerService - instance where the Plugin is registered as a contributionpublic void setEnabled(boolean enabled)
setEnabled in interface FileImporterpublic boolean isEnabled()
isEnabled in interface FileImporterpublic Integer getOrder()
FileImportergetOrder in interface FileImporterpublic void setOrder(Integer order)
FileImportersetOrder in interface FileImporterpublic int compareTo(FileImporter other)
compareTo in interface Comparable<FileImporter>protected String getNearestContainerPath(CoreSession documentManager, String path)
If given path points to a folderish document, return it. Else, return parent path.
@Deprecated protected void checkIn(DocumentModel doc)
@Deprecated protected void checkInAfterAdd(DocumentModel doc)
protected void doSecurityCheck(CoreSession documentManager, String path, String typeName)
protected void doSecurityCheck(CoreSession documentManager, String path, String typeName, TypeManager typeService)
Copyright © 2019 Nuxeo. All rights reserved.