Package org.nuxeo.ecm.core.io.impl
Class AbstractDocumentModelWriter
- java.lang.Object
-
- org.nuxeo.ecm.core.io.impl.AbstractDocumentWriter
-
- org.nuxeo.ecm.core.io.impl.AbstractDocumentModelWriter
-
- All Implemented Interfaces:
DocumentWriter
- Direct Known Subclasses:
DocumentModelInjector,DocumentModelUpdater,DocumentModelWriter
public abstract class AbstractDocumentModelWriter extends AbstractDocumentWriter
- Author:
- Bogdan Stefanescu
-
-
Field Summary
Fields Modifier and Type Field Description protected Pathrootprotected CoreSessionsessionprotected intunsavedDocuments
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractDocumentModelWriter(CoreSession session, String parentPath)protectedAbstractDocumentModelWriter(CoreSession session, String parentPath, int saveInterval)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbeforeCreateDocument(DocumentModel doc)protected voidbeforeSaveDocument(DocumentModel doc)voidclose()Closes the writer.protected DocumentModelcreateDocument(ExportedDocument xdoc, Path toPath)Creates a new document given its path.protected static Class<?>getFieldClass(Type fieldType)intgetSaveInterval()Map<DocumentLocation,DocumentLocation>getTranslationMap()protected booleanloadFacetsInfo(DocumentModel docModel, org.dom4j.Document doc)protected static voidloadSchema(ExportedDocument xdoc, Schema schema, DocumentModel doc, org.dom4j.Element schemaElement)protected voidloadSchemas(ExportedDocument xdoc, DocumentModel docModel, org.dom4j.Document doc)protected voidloadSystemInfo(DocumentModel docModel, org.dom4j.Document doc)protected voidsaveIfNeeded()voidsetSaveInterval(int saveInterval)protected DocumentModelupdateDocument(ExportedDocument xdoc, DocumentModel doc)Updates an existing document.-
Methods inherited from class org.nuxeo.ecm.core.io.impl.AbstractDocumentWriter
createCompactFormat, createPrettyPrint, write, write, write
-
-
-
-
Field Detail
-
session
protected CoreSession session
-
root
protected Path root
-
unsavedDocuments
protected int unsavedDocuments
-
-
Constructor Detail
-
AbstractDocumentModelWriter
protected AbstractDocumentModelWriter(CoreSession session, String parentPath)
- Parameters:
session- the session to the repository where to writeparentPath- where to write the tree. this document will be used as the parent of all top level documents passed as input. Note that you may have
-
AbstractDocumentModelWriter
protected AbstractDocumentModelWriter(CoreSession session, String parentPath, int saveInterval)
-
-
Method Detail
-
getTranslationMap
public Map<DocumentLocation,DocumentLocation> getTranslationMap()
-
saveIfNeeded
protected void saveIfNeeded()
-
close
public void close()
Description copied from interface:DocumentWriterCloses the writer.
-
createDocument
protected DocumentModel createDocument(ExportedDocument xdoc, Path toPath)
Creates a new document given its path.The parent of this document is assumed to exist.
- Parameters:
xdoc- the document containingtoPath- the path of the doc to create
-
beforeCreateDocument
protected void beforeCreateDocument(DocumentModel doc)
- Since:
- 8.4
-
updateDocument
protected DocumentModel updateDocument(ExportedDocument xdoc, DocumentModel doc)
Updates an existing document.
-
beforeSaveDocument
protected void beforeSaveDocument(DocumentModel doc)
- Since:
- 8.4
-
getSaveInterval
public int getSaveInterval()
-
setSaveInterval
public void setSaveInterval(int saveInterval)
-
loadFacetsInfo
protected boolean loadFacetsInfo(DocumentModel docModel, org.dom4j.Document doc)
-
loadSystemInfo
protected void loadSystemInfo(DocumentModel docModel, org.dom4j.Document doc)
-
loadSchemas
protected void loadSchemas(ExportedDocument xdoc, DocumentModel docModel, org.dom4j.Document doc)
-
loadSchema
protected static void loadSchema(ExportedDocument xdoc, Schema schema, DocumentModel doc, org.dom4j.Element schemaElement)
-
-