public interface Document extends DocumentContainer, PropertyContainer, VersionableDocument, Lockable
Modifier and Type | Method and Description |
---|---|
boolean |
addFacet(String facet)
Adds a facet to the document instance.
|
boolean |
followTransition(String transition)
Follows a given life cycle transition.
|
Set<String> |
getAllFacets()
Gets the facets available on this document (from the type and the
instance facets).
|
Collection<String> |
getAllowedStateTransitions()
Returns the allowed state transitions for this document.
|
String[] |
getFacets()
Gets the facets defined on this document instance.
|
Calendar |
getLastModified()
Gets the last modification time on this document.
|
String |
getLifeCyclePolicy()
Returns the life cycle policy of this document.
|
String |
getLifeCycleState()
Returns the life cycle of the document.
|
String |
getName()
Gets the name of this document.
|
Document |
getParent()
Gets the parent document or null if this is the root document.
|
String |
getPath()
Gets the path of this document.
|
Repository |
getRepository()
Returns the repository in which the document lives.
|
Session |
getSession()
Gets the session that owns this document.
|
<T extends Serializable> |
getSystemProp(String name,
Class<T> type)
Get system property of the specified type.
|
DocumentType |
getType()
Gets this document's type.
|
String |
getUUID()
Gets this document's UUID.
|
boolean |
hasFacet(String facet)
Checks if the document has a facet, either from its type or added on the
instance.
|
boolean |
isFolder()
Tests whether this document represent a folder or a leaf document.
|
boolean |
isProxy()
Checks whether or not this doc is a proxy document.
|
void |
readDocumentPart(DocumentPart dp)
Load document part properties from storage and fill them inside the given document part.
|
void |
remove()
Removes this document and all its children, if any.
|
boolean |
removeFacet(String facet)
Removes a facet from the document instance.
|
void |
save()
Saves any modification done on this document or its children.
|
void |
setCurrentLifeCycleState(String state)
Sets the lifecycle state of the document.
|
void |
setLifeCyclePolicy(String policy)
Sets the life cycle policy of this document.
|
<T extends Serializable> |
setSystemProp(String name,
T value)
Set a system property which is a property of by the built-in node type
ECM_SYSTEM_ANY.
|
void |
writeDocumentPart(DocumentPart dp)
Read modifications in the given document part and write them on storage.
|
addChild, getChild, getChildren, getChildren, getChildrenIds, hasChild, hasChildren, orderBefore, removeChild, resolvePath
exportFlatMap, exportMap, exportMap, getBoolean, getContent, getDate, getDirtyFields, getDouble, getLong, getProperties, getProperty, getPropertyIterator, getPropertyValue, getString, importFlatMap, importMap, isPropertySet, removeProperty, setBoolean, setContent, setDate, setDouble, setLong, setPropertyValue, setString
checkIn, checkOut, getBaseVersion, getCheckinComment, getLastVersion, getSourceDocument, getVersion, getVersionCreationDate, getVersionLabel, getVersions, getVersionSeriesId, getVersionsIds, getWorkingCopy, hasVersions, isCheckedOut, isLatestMajorVersion, isLatestVersion, isMajorVersion, isVersion, isVersionSeriesCheckedOut, restore
getLock, removeLock, setLock
Session getSession()
String getName() throws DocumentException
DocumentException
- if any exception occurredString getUUID()
Document getParent() throws DocumentException
DocumentException
DocumentType getType()
String getPath() throws DocumentException
DocumentException
Calendar getLastModified() throws DocumentException
DocumentException
boolean isFolder()
void remove() throws DocumentException
DocumentException
- if an error occursvoid save() throws DocumentException
For some implementations this may do nothing if they are commiting modifications as they are done by calling the corresponding method.
DocumentException
- if an error occursString getLifeCycleState() throws LifeCycleException
LifeCycleException
org.nuxeo.ecm.core.lifecycle
void setCurrentLifeCycleState(String state) throws LifeCycleException
state
- the stateLifeCycleException
String getLifeCyclePolicy() throws LifeCycleException
LifeCycleException
void setLifeCyclePolicy(String policy) throws LifeCycleException
policy
- the policyLifeCycleException
boolean followTransition(String transition) throws LifeCycleException
This will update the current life cycle of the document.
transition
- the name of the transition to followLifeCycleException
Collection<String> getAllowedStateTransitions() throws LifeCycleException
LifeCycleException
boolean isProxy()
Repository getRepository()
<T extends Serializable> void setSystemProp(String name, T value) throws DocumentException
T
- name
- value
- DocumentException
<T extends Serializable> T getSystemProp(String name, Class<T> type) throws DocumentException
T
- name
- type
- DocumentException
void readDocumentPart(DocumentPart dp) throws Exception
dp
- Exception
void writeDocumentPart(DocumentPart dp) throws Exception
dp
- Exception
Set<String> getAllFacets()
String[] getFacets()
boolean hasFacet(String facet)
facet
- the facet nametrue
if the document has the facetboolean addFacet(String facet) throws DocumentException
Does nothing if the facet was already present on the document.
facet
- the facet nametrue
if the facet was added, or false
if it is
already presentDocumentException
- if the facet does not existboolean removeFacet(String facet) throws DocumentException
It's not possible to remove a facet coming from the document type.
facet
- the facet nametrue
if the facet was removed, or false
if it
isn't present or is present on the type or does not exitDocumentException
Copyright © 2013 Nuxeo SA. All Rights Reserved.