public class DocumentModelImpl extends Object implements DocumentModel, Cloneable
DocumentModel.| Modifier and Type | Class and Description |
|---|---|
protected class |
DocumentModelImpl.RunWithCoreSession<T> |
DocumentModel.DocumentModelRefresh| Modifier and Type | Field and Description |
|---|---|
protected ACP |
acp |
protected ArrayMap<Class<?>,Object> |
adapters |
protected String |
checkinComment |
protected String |
currentLifeCycleState |
protected DataModelMap |
dataModels |
static long |
F_IMMUTABLE |
static long |
F_PROXY |
static long |
F_VERSION |
protected Set<String> |
facets
Facets including those on instance.
|
protected String |
id |
Set<String> |
instanceFacets
Instance facets.
|
Set<String> |
instanceFacetsOrig
Instance facets when the document was read.
|
protected boolean |
isACPLoaded |
protected boolean |
isCheckedOut |
protected boolean |
isLatestMajorVersion |
protected boolean |
isLatestVersion |
protected boolean |
isMajorVersion |
protected boolean |
isStateLoaded
state is lifecycle, version stuff.
|
protected boolean |
isVersionSeriesCheckedOut |
protected String |
lifeCyclePolicy |
protected Lock |
lock |
protected static Lock |
LOCK_UNKNOWN |
protected DocumentRef |
parentRef |
protected Path |
path |
protected Long |
pos |
Prefetch |
prefetch |
protected DocumentRef |
ref |
protected String |
repositoryName |
protected Set<String> |
schemas
Schemas including those from instance facets.
|
protected Set<String> |
schemasOrig
Schemas including those from instance facets when the doc was read
|
protected String |
sid |
protected String |
sourceId |
static String |
STRICT_LAZY_LOADING_POLICY_KEY |
protected static Boolean |
strictSessionManagement |
protected DocumentType |
type |
protected String |
typeName |
protected String |
versionSeriesId |
REFRESH_ACP, REFRESH_ACP_IF_LOADED, REFRESH_ACP_LAZY, REFRESH_ALL, REFRESH_CONTENT, REFRESH_CONTENT_IF_LOADED, REFRESH_CONTENT_LAZY, REFRESH_DEFAULT, REFRESH_IF_LOADED, REFRESH_LAZY, REFRESH_PREFETCH, REFRESH_STATE| Modifier | Constructor and Description |
|---|---|
protected |
DocumentModelImpl() |
|
DocumentModelImpl(DocumentModel parent,
String name,
String type) |
|
DocumentModelImpl(String typeName)
Constructor to use a document model client side without referencing a document.
|
|
DocumentModelImpl(String parentPath,
String name,
String type)
Constructor to be used by clients.
|
|
DocumentModelImpl(String sid,
String type,
String id,
Path path,
DocumentRef docRef,
DocumentRef parentRef,
String[] schemas,
Set<String> facets,
String sourceId,
String repositoryName,
boolean isProxy) |
|
DocumentModelImpl(String sid,
String type,
String id,
Path path,
Lock lock,
DocumentRef docRef,
DocumentRef parentRef,
String[] schemas,
Set<String> facets,
String sourceId,
String repositoryName)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(PropertyVisitor visitor,
Object arg)
Method that implement the visitor pattern.
|
void |
addDataModel(DataModel dataModel) |
boolean |
addFacet(String facet)
Adds a facet to the document instance.
|
void |
attach(String sid)
Reattaches a document impl to an existing session.
|
DocumentRef |
checkIn(VersioningOption option,
String description)
Checks in a document and returns the created version.
|
void |
checkOut()
Checks out a document.
|
protected void |
clearPrefetchXPath(String xpath) |
DocumentModel |
clone()
Clone operation.
|
DataModel |
cloneDataModel(DataModel data) |
static DataModel |
cloneDataModel(Schema schema,
DataModel data) |
static Object |
cloneField(Field field,
String key,
Object value) |
protected void |
computeFacetsAndSchemas(Set<String> instanceFacets)
Recomputes all facets and schemas from the instance facets.
|
static Set<String> |
computeSchemas(DocumentType type,
Collection<String> instanceFacets,
boolean isProxy)
Recomputes effective schemas from a type + instance facets.
|
void |
copyContent(DocumentModel sourceDoc)
Copies all the data from a source document.
|
void |
copyContextData(DocumentModel otherDocument)
Copies the context data from given document to this document.
|
void |
detach(boolean loadAll)
Detaches the documentImpl from its existing session, so that it can survive beyond the session's closing.
|
boolean |
equals(Object obj) |
boolean |
followTransition(String transition)
Follows a given life cycle transition.
|
ACP |
getACP()
Gets the access control policy (ACP) for this document.
|
<T> T |
getAdapter(Class<T> itf)
Adapts the document to the given interface.
|
<T> T |
getAdapter(Class<T> itf,
boolean refreshCache)
Adapts the document to the given interface.
|
Collection<String> |
getAllowedStateTransitions()
Gets the allowed state transitions for this document.
|
Map<String,String> |
getBinaryFulltext()
Gets the fulltext extracted from the binary fields.
|
String |
getCacheKey()
Returns a cache key.
|
String |
getChangeToken()
Opaque string that represents the last update state of the DocumentModel.
|
String |
getCheckinComment()
Returns the checkin comment if the document model is a version.
|
ScopedMap |
getContextData()
Gets the context data associated to this document.
|
Serializable |
getContextData(ScopeType scope,
String key)
Gets the context data associated to this document for given scope and given key.
|
Serializable |
getContextData(String key)
Gets the context data using the default scope.
|
CoreSession |
getCoreSession()
Gets the core session to which this document is tied.
|
String |
getCurrentLifeCycleState()
Returns the life cycle of the document.
|
DataModel |
getDataModel(String schema)
Gets the data model corresponding to the given schema.
|
DataModelMap |
getDataModels()
Gets the data models.
|
Collection<DataModel> |
getDataModelsCollection()
Gets a list with the currently fetched data models.
|
Set<String> |
getDeclaredFacets()
Deprecated.
|
String[] |
getDeclaredSchemas()
Deprecated.
|
DocumentType |
getDocumentType()
Gets the document type object.
|
Set<String> |
getFacets()
Gets the facets available on this document (from the type and the instance facets).
|
String |
getId()
Gets the document UUID.
|
String |
getLifeCyclePolicy()
Returns the life cycle policy of the document.
|
String |
getLock()
Deprecated.
|
Lock |
getLockInfo()
Gets the lock info on the document.
|
String |
getName()
Gets the document name.
|
PropertyObjectResolver |
getObjectResolver(String xpath) |
DocumentRef |
getParentRef()
Retrieves the parent reference of the current document.
|
DocumentPart |
getPart(String schema)
Get a document part given its schema name
|
DocumentPart[] |
getParts()
Gets this document's parts.
|
Path |
getPath()
Gets the document path.
|
String |
getPathAsString()
Gets the document path as a string.
|
Long |
getPos()
Gets the document's position in its containing folder (if ordered).
|
Map<String,Object> |
getProperties(String schemaName)
Gets the values from the given data model as a map.
|
Property |
getProperty(String xpath)
Gets a property given a xpath.
|
Object |
getProperty(String schemaName,
String name)
Gets a property from the given schema.
|
Serializable |
getPropertyValue(String xpath)
Gets a property value given a xpath.
|
DocumentRef |
getRef()
Gets a reference to the core document that can be used either remotely or locally (opens the core JVM).
|
String |
getRepositoryName()
Returns the name of the repository in which the document is stored.
|
String[] |
getSchemas()
Gets the schemas available on this document (from the type and the facets).
|
String |
getSessionId()
Retrieves the session id corresponding to this object.
|
String |
getSourceId()
Returns the source document identifier.
|
<T extends Serializable> |
getSystemProp(String systemProperty,
Class<T> type)
Gets system property of the specified type.
|
protected CoreSession |
getTempCoreSession() |
String |
getTitle()
Gets the title from the dublincore schema.
|
String |
getType()
Gets the document type name.
|
String |
getVersionLabel()
Returns the version label.
|
String |
getVersionSeriesId()
Gets the version series id for this document.
|
static String |
getXPathSchemaName(String xpath,
Set<String> docSchemas,
String[] returnName) |
boolean |
hasFacet(String facet)
Checks if the document has a facet, either from its type or added on the instance.
|
int |
hashCode() |
boolean |
hasSchema(String schema)
Checks if the document has the given schema, either from its type or added on the instance through a facet.
|
protected static Set<String> |
inferFacets(Set<String> facets,
DocumentType documentType) |
boolean |
isCheckedOut()
Tests if the document is checked out.
|
boolean |
isDirty()
Checks if the document has actual data to write (dirty parts).
|
boolean |
isDownloadable()
Checks if this document can be downloaded.
|
boolean |
isFolder()
Checks if this document is a folder.
|
boolean |
isImmutable()
Checks if this document is immutable.
|
boolean |
isLatestMajorVersion()
Checks if a document is the latest major version in the version series.
|
boolean |
isLatestVersion()
Checks if a document is the latest version in the version series.
|
boolean |
isLifeCycleLoaded() |
boolean |
isLocked()
Tests if the document is locked.
|
boolean |
isMajorVersion()
Checks if a document is a major version.
|
boolean |
isPrefetched(String xpath)
Checks if a property is prefetched.
|
boolean |
isPrefetched(String schemaName,
String name)
Checks if a property is prefetched.
|
boolean |
isProxy()
Checks if this document is a proxy.
|
boolean |
isSchemaLoaded(String name) |
boolean |
isVersion()
Checks if this document is a version.
|
boolean |
isVersionable()
Checks if this document can have versions.
|
boolean |
isVersionSeriesCheckedOut()
Checks if there is a checked out working copy for the version series of this document.
|
protected DataModel |
loadDataModel(String schema)
Lazily loads the given data model.
|
protected String |
oldLockKey(Lock lock) |
void |
prefetchCurrentLifecycleState(String lifecycle)
Used to set lifecycle state along with prefetching other properties.
|
void |
prefetchLifeCyclePolicy(String lifeCyclePolicy)
Used to set lifecycle policy along with prefetching other properties.
|
void |
putContextData(ScopeType scope,
String key,
Serializable value)
Adds mapping to the context data for given scope.
|
void |
putContextData(String key,
Serializable value)
Sets a context data in the default scope.
|
void |
refresh()
Same as
DocumentModel.refresh(REFRESH_DEFAULT). |
void |
refresh(int refreshFlags,
String[] schemas)
Refresh document data from server.
|
boolean |
removeFacet(String facet)
Removes a facet from the document instance.
|
Lock |
removeLock()
Removes the lock on the document.
|
void |
reset()
Clears any prefetched or cached document data.
|
void |
setACP(ACP acp,
boolean overwrite)
Sets the ACP for this document model.
|
void |
setId(String id)
Sets the document id.
|
void |
setIsImmutable(boolean isImmutable) |
void |
setIsProxy(boolean isProxy) |
void |
setIsVersion(boolean isVersion) |
Lock |
setLock()
Sets a lock on the document.
|
void |
setLock(String key)
Deprecated.
|
void |
setPathInfo(String parentPath,
String name)
Sets path info.
|
void |
setPosInternal(Long pos)
Sets the document's position in its containing folder (if ordered).
|
void |
setPrefetch(Prefetch prefetch)
Sets prefetch information.
|
void |
setProperties(String schemaName,
Map<String,Object> data)
Sets values for the given data model.
|
void |
setProperty(String schemaName,
String name,
Object value)
Sets the property value from the given schema.
|
void |
setPropertyValue(String xpath,
Serializable value)
Sets a property value given a xpath.
|
String |
toString() |
void |
unlock()
Unlocks the given document.
|
protected boolean |
useStrictSessionManagement() |
public static final String STRICT_LAZY_LOADING_POLICY_KEY
public static final long F_VERSION
public static final long F_PROXY
public static final long F_IMMUTABLE
protected DocumentRef ref
protected DocumentType type
protected Set<String> schemasOrig
public Set<String> instanceFacets
public Set<String> instanceFacetsOrig
protected DataModelMap dataModels
protected DocumentRef parentRef
protected static final Lock LOCK_UNKNOWN
protected boolean isStateLoaded
protected String currentLifeCycleState
protected String lifeCyclePolicy
protected boolean isCheckedOut
protected String versionSeriesId
protected boolean isLatestVersion
protected boolean isMajorVersion
protected boolean isLatestMajorVersion
protected boolean isVersionSeriesCheckedOut
protected String checkinComment
protected transient boolean isACPLoaded
protected String repositoryName
protected static Boolean strictSessionManagement
protected DocumentModelImpl()
public DocumentModelImpl(String typeName)
It must at least contain the type.
public DocumentModelImpl(String parentPath, String name, String type)
A client constructed data model must contain at least the path and the type.
public DocumentModelImpl(String sid, String type, String id, Path path, Lock lock, DocumentRef docRef, DocumentRef parentRef, String[] schemas, Set<String> facets, String sourceId, String repositoryName)
The lock parameter is unused since 5.4.2.
facets - the per-instance facetspublic DocumentModelImpl(String sid, String type, String id, Path path, DocumentRef docRef, DocumentRef parentRef, String[] schemas, Set<String> facets, String sourceId, String repositoryName, boolean isProxy)
public DocumentModelImpl(DocumentModel parent, String name, String type)
public static Set<String> computeSchemas(DocumentType type, Collection<String> instanceFacets, boolean isProxy)
public DocumentType getDocumentType()
DocumentModelgetDocumentType in interface DocumentModelpublic String getTitle()
getTitle in interface DocumentModelDocumentModel.getTitle()public String getSessionId()
DocumentModel
This method should rarely be used, use DocumentModel.getCoreSession() directly instead.
Using the session id you can retrieve the core session that created the object.
Document models created by the user on the client side are not bound to any session. They are simple DTO used to transport data.
getSessionId in interface DocumentModelpublic DocumentRef getRef()
DocumentModelgetRef in interface DocumentModelpublic DocumentRef getParentRef()
DocumentModelgetParentRef in interface DocumentModelpublic CoreSession getCoreSession()
DocumentModelThis may be null if the document has been detached from a session.
getCoreSession in interface DocumentModelprotected boolean useStrictSessionManagement()
protected CoreSession getTempCoreSession()
public void detach(boolean loadAll)
DocumentModeldetach in interface DocumentModelloadAll - if true, load all data and ACP from the session before detachingpublic void attach(String sid)
DocumentModelattach in interface DocumentModelsid - the session idprotected DataModel loadDataModel(String schema)
public DataModel getDataModel(String schema)
DocumentModelNull is returned if the document type has no such schema.
getDataModel in interface DocumentModelschema - the schema namepublic Collection<DataModel> getDataModelsCollection()
DocumentModelgetDataModelsCollection in interface DocumentModelpublic void addDataModel(DataModel dataModel)
public String[] getSchemas()
DocumentModelgetSchemas in interface DocumentModel@Deprecated public String[] getDeclaredSchemas()
DocumentModelgetDeclaredSchemas in interface DocumentModelpublic boolean hasSchema(String schema)
DocumentModelhasSchema in interface DocumentModelschema - the schema nametrue if the document has the schemapublic Set<String> getFacets()
DocumentModelgetFacets in interface DocumentModelpublic boolean hasFacet(String facet)
DocumentModelhasFacet in interface DocumentModelfacet - the facet nametrue if the document has the facet@Deprecated public Set<String> getDeclaredFacets()
DocumentModelgetDeclaredFacets in interface DocumentModelpublic boolean addFacet(String facet)
DocumentModelDoes nothing if the facet was already present on the document.
addFacet in interface DocumentModelfacet - the facet nametrue if the facet was added, or false if it is already presentpublic boolean removeFacet(String facet)
DocumentModelIt's not possible to remove a facet coming from the document type.
removeFacet in interface DocumentModelfacet - the facet nametrue if the facet was removed, or false if it isn't present or is present on the type or
does not exitprotected static Set<String> inferFacets(Set<String> facets, DocumentType documentType)
public String getId()
DocumentModelgetId in interface DocumentModelpublic String getName()
DocumentModelgetName in interface DocumentModelpublic Long getPos()
DocumentModelgetPos in interface DocumentModelnull if the containing folder is not orderedpublic void setPosInternal(Long pos)
pos - the positionpublic String getPathAsString()
DocumentModelgetPathAsString in interface DocumentModelpublic Map<String,Object> getProperties(String schemaName)
DocumentModelThe operation will fetch the data model from the server if not already fetched.
getProperties in interface DocumentModelschemaName - the data model schema namepublic Object getProperty(String schemaName, String name)
DocumentModelThe data model owning the property will be fetched from the server if not already fetched.
getProperty in interface DocumentModelschemaName - the schema namename - the property namepublic void setPathInfo(String parentPath, String name)
DocumentModelpath and ref attributes will be set according to info
setPathInfo in interface DocumentModelprotected String oldLockKey(Lock lock)
@Deprecated public String getLock()
DocumentModel
Lock info is cached on the document for performance. Use CoreSession.getLockInfo(org.nuxeo.ecm.core.api.DocumentRef) to get the non-cached
status.
getLock in interface DocumentModelpublic boolean isLocked()
DocumentModel
Lock info is cached on the document for performance. Use CoreSession.getLockInfo(org.nuxeo.ecm.core.api.DocumentRef) to get the non-cached
status.
isLocked in interface DocumentModel@Deprecated public void setLock(String key)
DocumentModel
This is a wrapper for CoreSession.setLock(DocumentRef, String).
setLock in interface DocumentModelkey - the key to use when lockingpublic void unlock()
DocumentModelunlock in interface DocumentModelpublic Lock setLock()
DocumentModelsetLock in interface DocumentModelpublic Lock getLockInfo()
DocumentModel
Lock info is cached on the document for performance. Use CoreSession.getLockInfo(org.nuxeo.ecm.core.api.DocumentRef) to get the non-cached
status.
getLockInfo in interface DocumentModelnull otherwisepublic Lock removeLock()
DocumentModelThe caller principal should be the same as the one who set the lock or to belongs to the administrator group, otherwise an exception will be throw.
If the document was not locked, does nothing.
Returns the previous lock info.
removeLock in interface DocumentModelnull if there was no lockpublic boolean isCheckedOut()
DocumentModelA checked out document can be modified normally. A checked in document is identical to the last version that it created, and not modifiable.
Only applicable to documents that are live (not versions and not proxies).
isCheckedOut in interface DocumentModeltrue if the document is checked out, false if it is checked inpublic void checkOut()
DocumentModelA checked out document can be modified normally.
Only applicable to documents that are live (not versions and not proxies).
checkOut in interface DocumentModelpublic DocumentRef checkIn(VersioningOption option, String description)
DocumentModelA checked in document is identical to the last version that it created, and not modifiable.
Only applicable to documents that are live (not versions and not proxies).
checkIn in interface DocumentModeloption - whether to do create a new VersioningOption.MINOR or VersioningOption.MAJOR version
during check indescription - the checkin commentpublic String getVersionLabel()
DocumentModelThe label returned is computed by the VersioningService.
getVersionLabel in interface DocumentModelnullpublic String getVersionSeriesId()
DocumentModelAll documents and versions derived by a check in or checkout from the same original document share the same version series id.
getVersionSeriesId in interface DocumentModelpublic boolean isLatestVersion()
DocumentModelisLatestVersion in interface DocumentModelpublic boolean isMajorVersion()
DocumentModelisMajorVersion in interface DocumentModelpublic boolean isLatestMajorVersion()
DocumentModelisLatestMajorVersion in interface DocumentModelpublic boolean isVersionSeriesCheckedOut()
DocumentModelisVersionSeriesCheckedOut in interface DocumentModelpublic String getCheckinComment()
DocumentModelgetCheckinComment in interface DocumentModelnullpublic ACP getACP()
DocumentModelReturns null if no security was defined on this document.
The ACP can be used to introspect or to evaluate user privileges on this document.
This is a wrapper for CoreSession.getACP(DocumentRef) but it is recommended since it caches the ACP for
later usage.
getACP in interface DocumentModelpublic void setACP(ACP acp, boolean overwrite)
DocumentModel
This is a wrapper for CoreSession.setACP(DocumentRef, ACP, boolean)
setACP in interface DocumentModelacp - the ACP to setoverwrite - whether to overwrite the old ACP or notCoreSession#setACP(DocumentRef, ACP, boolean)}public String getType()
DocumentModelgetType in interface DocumentModelpublic void setProperties(String schemaName, Map<String,Object> data)
DocumentModelThis will not fetch the data model if not already fetched.
setProperties in interface DocumentModelschemaName - the schema namedata - the values to setpublic void setProperty(String schemaName, String name, Object value)
DocumentModelThis operation will not fetch the data model if not already fetched
setProperty in interface DocumentModelschemaName - the schema namename - the property namevalue - the property valuepublic Path getPath()
DocumentModelgetPath in interface DocumentModelpublic DataModelMap getDataModels()
DocumentModelgetDataModels in interface DocumentModelpublic boolean isFolder()
DocumentModelisFolder in interface DocumentModelpublic boolean isVersionable()
DocumentModelisVersionable in interface DocumentModelpublic boolean isDownloadable()
DocumentModelisDownloadable in interface DocumentModelpublic void accept(PropertyVisitor visitor, Object arg)
DocumentModelThe visitor must return null to stop visiting children otherwise a context object that will be passed as the arg argument to children
accept in interface DocumentModelvisitor - the visitor to acceptarg - an argument passed to the visitor. This should be used by the visitor to carry on the visiting
context.public <T> T getAdapter(Class<T> itf)
DocumentModelAttention, the first computation will cache the adaptation result for later calls.
getAdapter in interface DocumentModelT - the interface type to adapt toitf - the interface classpublic <T> T getAdapter(Class<T> itf, boolean refreshCache)
DocumentModelgetAdapter in interface DocumentModelT - the interface type to adapt toitf - the interface classrefreshCache - : readapt and stores in cache if already exists.public boolean followTransition(String transition)
DocumentModelThis will update the current life cycle of the document.
followTransition in interface DocumentModeltransition - the name of the transition to followpublic Collection<String> getAllowedStateTransitions()
DocumentModelgetAllowedStateTransitions in interface DocumentModelpublic String getCurrentLifeCycleState()
DocumentModelgetCurrentLifeCycleState in interface DocumentModelorg.nuxeo.ecm.core.lifecyclepublic String getLifeCyclePolicy()
DocumentModelgetLifeCyclePolicy in interface DocumentModelorg.nuxeo.ecm.core.lifecyclepublic boolean isVersion()
DocumentModelisVersion in interface DocumentModelpublic boolean isProxy()
DocumentModelisProxy in interface DocumentModelpublic boolean isImmutable()
DocumentModelisImmutable in interface DocumentModeltrue if the document is a version or a proxy to a version, false otherwisepublic void setIsVersion(boolean isVersion)
public void setIsProxy(boolean isProxy)
public void setIsImmutable(boolean isImmutable)
public boolean isDirty()
DocumentModelisDirty in interface DocumentModelpublic ScopedMap getContextData()
DocumentModelgetContextData in interface DocumentModelpublic Serializable getContextData(ScopeType scope, String key)
DocumentModelgetContextData in interface DocumentModelpublic void putContextData(ScopeType scope, String key, Serializable value)
DocumentModelContext data is like a request map set on the document model to pass additional information to components interacting with the document model (events processing for instance).
putContextData in interface DocumentModelpublic Serializable getContextData(String key)
DocumentModelgetContextData in interface DocumentModelkey - the context data keypublic void putContextData(String key, Serializable value)
DocumentModelputContextData in interface DocumentModelkey - the context data keyvalue - the valuepublic void copyContextData(DocumentModel otherDocument)
DocumentModelcopyContextData in interface DocumentModelpublic void copyContent(DocumentModel sourceDoc)
DocumentModelcopyContent in interface DocumentModelpublic static Object cloneField(Field field, String key, Object value)
public static DataModel cloneDataModel(Schema schema, DataModel data)
public DataModel cloneDataModel(DataModel data)
public String getCacheKey()
DocumentModel
Cache key will be computed like this :
docUUID + "-" + sessionId + "-" + timestamp
We will use the last modification time if present for the timestamp.
Since 5.6, the timestamp does not hold milliseconds anymore as some databases do not store them, which could interfere with cache key comparisons.
getCacheKey in interface DocumentModelpublic String getRepositoryName()
DocumentModelgetRepositoryName in interface DocumentModelpublic String getSourceId()
DocumentModelThis is useful when not interested about the repository UUID itself. Technically, this is the current version UUID.
getSourceId in interface DocumentModelpublic boolean isSchemaLoaded(String name)
public boolean isPrefetched(String xpath)
DocumentModelisPrefetched in interface DocumentModelxpath - the property xpathtrue if it is prefetchedpublic boolean isPrefetched(String schemaName, String name)
DocumentModelisPrefetched in interface DocumentModelschemaName - the schema namename - the property nametrue if it is prefetchedpublic void setPrefetch(Prefetch prefetch)
INTERNAL: This method is not in the public interface.
public void prefetchCurrentLifecycleState(String lifecycle)
DocumentModelprefetchCurrentLifecycleState in interface DocumentModelpublic void prefetchLifeCyclePolicy(String lifeCyclePolicy)
DocumentModelprefetchLifeCyclePolicy in interface DocumentModelpublic <T extends Serializable> T getSystemProp(String systemProperty, Class<T> type)
DocumentModelgetSystemProp in interface DocumentModelpublic boolean isLifeCycleLoaded()
isLifeCycleLoaded in interface DocumentModelpublic DocumentPart getPart(String schema)
DocumentModelgetPart in interface DocumentModelschema - the schemapublic DocumentPart[] getParts()
DocumentModelgetParts in interface DocumentModelpublic Property getProperty(String xpath)
DocumentModelNote that what's called xpath in this context is not an actual XPath as specified by the w3c. Main differences are that in our xpath:
foo/bar[i]/baz as foo/i/bazgetProperty in interface DocumentModelpublic static String getXPathSchemaName(String xpath, Set<String> docSchemas, String[] returnName)
public Serializable getPropertyValue(String xpath) throws PropertyException
DocumentModelNote that what's called xpath in this context is not an actual XPath as specified by the w3c. Main differences are that in our xpath:
foo/bar[i]/baz as foo/i/bazgetPropertyValue in interface DocumentModelPropertyExceptionpublic void setPropertyValue(String xpath, Serializable value) throws PropertyException
DocumentModelsetPropertyValue in interface DocumentModelPropertyExceptionprotected void clearPrefetchXPath(String xpath)
public DocumentModel clone() throws CloneNotSupportedException
DocumentModelclone in interface DocumentModelclone in class ObjectCloneNotSupportedExceptionpublic void reset()
DocumentModelThis will force the document to lazily update its data when required.
reset in interface DocumentModelpublic void refresh()
DocumentModelDocumentModel.refresh(REFRESH_DEFAULT).refresh in interface DocumentModelpublic void refresh(int refreshFlags, String[] schemas)
DocumentModelThe data models will be removed and all prefetch and system data will be refreshed from the server
The refreshed data contains:
DocumentModel.REFRESH_STATE
DocumentModel.REFRESH_PREFETCH
DocumentModel.REFRESH_ACP_IF_LOADED
DocumentModel.REFRESH_ACP_LAZY
DocumentModel.REFRESH_ACP
DocumentModel.REFRESH_CONTENT_IF_LOADED
DocumentModel.REFRESH_CONTENT_LAZY
DocumentModel.REFRESH_CONTENT
DocumentModel.REFRESH_DEFAULT same as REFRESH_STATE | REFRESH_DEFAULT | REFRESH_ACP_IF_LOADED |
REFRESH_CONTENT_IF_LOADED
DocumentModel.REFRESH_ALL same as REFRESH_STATE | REFRESH_PREFTECH | REFRESH_ACP | REFRESH_CONTENT
refresh in interface DocumentModelrefreshFlags - the refresh flagsschemas - the document parts (schemas) that should be refreshed nowprotected void computeFacetsAndSchemas(Set<String> instanceFacets)
public String getChangeToken()
DocumentModelThis token can be used for optimistic locking and avoid dirty updates. See CMIS spec : http://docs.oasis-open.org/cmis/CMIS/v1.0/os/cmis-spec-v1.0.html#_Toc243905432
getChangeToken in interface DocumentModelpublic void setId(String id)
id - public Map<String,String> getBinaryFulltext()
DocumentModelgetBinaryFulltext in interface DocumentModelpublic PropertyObjectResolver getObjectResolver(String xpath)
getObjectResolver in interface DocumentModelxpath - the property xpathPropertyObjectResolver to manage the property reference to external entities, null if this
property's type has no resolver.Copyright © 2016 Nuxeo SA. All rights reserved.