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 Path
root
protected CoreSession
session
protected int
unsavedDocuments
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractDocumentModelWriter(CoreSession session, String parentPath)
protected
AbstractDocumentModelWriter(CoreSession session, String parentPath, int saveInterval)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
beforeCreateDocument(DocumentModel doc)
protected void
beforeSaveDocument(DocumentModel doc)
void
close()
Closes the writer.protected DocumentModel
createDocument(ExportedDocument xdoc, Path toPath)
Creates a new document given its path.protected static Class<?>
getFieldClass(Type fieldType)
int
getSaveInterval()
Map<DocumentLocation,DocumentLocation>
getTranslationMap()
protected boolean
loadFacetsInfo(DocumentModel docModel, org.dom4j.Document doc)
protected static void
loadSchema(ExportedDocument xdoc, Schema schema, DocumentModel doc, org.dom4j.Element schemaElement)
protected void
loadSchemas(ExportedDocument xdoc, DocumentModel docModel, org.dom4j.Document doc)
protected void
loadSystemInfo(DocumentModel docModel, org.dom4j.Document doc)
protected void
saveIfNeeded()
void
setSaveInterval(int saveInterval)
protected DocumentModel
updateDocument(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:DocumentWriter
Closes 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)
-
-