public class DocumentModelFactory extends Object
DocumentModel
and a Document
for creation / update.Modifier and Type | Method and Description |
---|---|
static DataModel |
createDataModel(Document doc,
Schema schema)
Creates a data model from a document and a schema.
|
static DocumentModelImpl |
createDocumentModel(Document doc) |
static DocumentModelImpl |
createDocumentModel(Document doc,
String[] schemas)
Creates a document model for an existing document.
|
static DocumentModelImpl |
createDocumentModel(String docType)
Returns a document model computed from its type, querying the
SchemaManager service. |
static DocumentModelImpl |
createDocumentModel(String sessionId,
DocumentType docType)
Creates a document model for a new document.
|
static DocumentModel |
createDocumentModel(String type,
String id)
Create an empty documentmodel for a given type with its id already setted.
|
static DocumentModel.DocumentModelRefresh |
refreshDocumentModel(Document doc,
int flags,
String[] schemas)
Gets what's to refresh in a model (except for the ACPs, which need the session).
|
static DocumentModel |
writeDocumentModel(DocumentModel docModel,
Document doc)
Writes a document model to a document.
|
public static DocumentModelImpl createDocumentModel(Document doc) throws DocumentException
DocumentException
public static DocumentModelImpl createDocumentModel(Document doc, String[] schemas) throws DocumentException
doc
- the documentschemas
- the schemas to prefetch (deprecated), or null
DocumentException
public static DocumentModelImpl createDocumentModel(String docType)
SchemaManager
service.
The created document model is not linked to any core session.
public static DocumentModelImpl createDocumentModel(String sessionId, DocumentType docType) throws DocumentException
Initializes the proper data models according to the type info.
sessionId
- the CoreSession iddocType
- the document typeDocumentException
public static DataModel createDataModel(Document doc, Schema schema) throws DocumentException
DocumentException
public static DocumentModel writeDocumentModel(DocumentModel docModel, Document doc) throws DocumentException, ClientException
DocumentException
ClientException
public static DocumentModel.DocumentModelRefresh refreshDocumentModel(Document doc, int flags, String[] schemas) throws DocumentException, LifeCycleException
DocumentException
LifeCycleException
public static DocumentModel createDocumentModel(String type, String id) throws DocumentException
type
- id
- DocumentException
Copyright © 2015 Nuxeo SA. All rights reserved.