public abstract class AbstractDocumentModelWriter extends AbstractDocumentWriter
Modifier and Type | Field and Description |
---|---|
protected Path |
root |
protected CoreSession |
session |
protected int |
unsavedDocuments |
Modifier | Constructor and Description |
---|---|
protected |
AbstractDocumentModelWriter(CoreSession session,
String parentPath) |
protected |
AbstractDocumentModelWriter(CoreSession session,
String parentPath,
int saveInterval) |
Modifier and Type | Method and 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.
|
createCompactFormat, createPrettyPrint, write, write, write
protected CoreSession session
protected int unsavedDocuments
protected AbstractDocumentModelWriter(CoreSession session, String parentPath)
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 haveprotected AbstractDocumentModelWriter(CoreSession session, String parentPath, int saveInterval)
public Map<DocumentLocation,DocumentLocation> getTranslationMap()
protected void saveIfNeeded()
public void close()
DocumentWriter
protected DocumentModel createDocument(ExportedDocument xdoc, Path toPath)
The parent of this document is assumed to exist.
xdoc
- the document containingtoPath
- the path of the doc to createprotected void beforeCreateDocument(DocumentModel doc)
protected DocumentModel updateDocument(ExportedDocument xdoc, DocumentModel doc)
protected void beforeSaveDocument(DocumentModel doc)
public int getSaveInterval()
public void setSaveInterval(int saveInterval)
protected boolean loadFacetsInfo(DocumentModel docModel, org.dom4j.Document doc)
protected void loadSystemInfo(DocumentModel docModel, org.dom4j.Document doc)
protected void loadSchemas(ExportedDocument xdoc, DocumentModel docModel, org.dom4j.Document doc)
protected static void loadSchema(ExportedDocument xdoc, Schema schema, DocumentModel doc, org.dom4j.Element schemaElement)
protected static Class getFieldClass(Type fieldType)
Copyright © 2018 Nuxeo. All rights reserved.