Class NoteImporter
- java.lang.Object
-
- org.nuxeo.ecm.platform.filemanager.service.extension.AbstractFileImporter
-
- org.nuxeo.ecm.platform.filemanager.service.extension.NoteImporter
-
- All Implemented Interfaces:
Serializable
,Comparable<FileImporter>
,FileImporter
public class NoteImporter extends AbstractFileImporter
Imports the string content of a blob as text for the content of the "note" field of a new Note document.If an existing document with the same title is found the existing Note document is updated instead.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.nuxeo.ecm.platform.filemanager.service.extension.AbstractFileImporter
DISABLE_AUDIT_LOGGER, docType, enabled, fileManagerService, filters, name, order, patterns, SKIP_UPDATE_AUDIT_LOGGING
-
-
Constructor Summary
Constructors Constructor Description NoteImporter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDefaultDocType()
Default document type to use when the plugin XML configuration does not specify one.protected String
getString(Blob blob)
protected static String
guessEncoding(Blob blob)
boolean
isOverwriteByTitle()
Whether document overwrite is detected by checking title or filename.void
updateDocument(DocumentModel doc, Blob content)
Updates the document (sets its properties).boolean
updateDocumentIfPossible(DocumentModel doc, Blob content)
Tries to update the documentdoc
with the blobcontent
.-
Methods inherited from class org.nuxeo.ecm.platform.filemanager.service.extension.AbstractFileImporter
checkAllowedSubtypes, checkIn, checkInAfterAdd, checkSecurity, compareTo, create, createDocument, createOrUpdate, doSecurityCheck, doSecurityCheck, getBlob, getDocType, getDocType, getFileManagerService, getFilters, getName, getNearestContainerPath, getOrder, isEnabled, isOneToMany, matches, setDocType, setEnabled, setFileManagerService, setFilters, setName, setOrder, skipCheckInForBlob
-
-
-
-
Method Detail
-
getDefaultDocType
public String getDefaultDocType()
Description copied from class:AbstractFileImporter
Default document type to use when the plugin XML configuration does not specify one.To implement when the default
AbstractFileImporter.createOrUpdate(FileImporterContext)
method is used.- Overrides:
getDefaultDocType
in classAbstractFileImporter
-
isOverwriteByTitle
public boolean isOverwriteByTitle()
Description copied from class:AbstractFileImporter
Whether document overwrite is detected by checking title or filename.To implement when the default
AbstractFileImporter.createOrUpdate(FileImporterContext)
method is used.- Overrides:
isOverwriteByTitle
in classAbstractFileImporter
-
updateDocumentIfPossible
public boolean updateDocumentIfPossible(DocumentModel doc, Blob content)
Description copied from class:AbstractFileImporter
Tries to update the documentdoc
with the blobcontent
.Returns
true
if the document is really updated.- Overrides:
updateDocumentIfPossible
in classAbstractFileImporter
-
updateDocument
public void updateDocument(DocumentModel doc, Blob content)
Description copied from class:AbstractFileImporter
Updates the document (sets its properties).Default implementation sets the content.
- Overrides:
updateDocument
in classAbstractFileImporter
-
getString
protected String getString(Blob blob) throws IOException
- Throws:
IOException
-
guessEncoding
protected static String guessEncoding(Blob blob) throws IOException
- Throws:
IOException
-
-