Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.core.model
Interface Document

All Superinterfaces:
DocumentContainer, Lockable, PropertyContainer, VersionableDocument
All Known Subinterfaces:
DocumentProxy, SQLDocument
All Known Implementing Classes:
AbstractDocument, MockDocument, SQLDocumentLive, SQLDocumentProxy, SQLDocumentVersion

public interface Document
extends DocumentContainer, PropertyContainer, VersionableDocument, Lockable

A document object.

Author:
Bogdan Stefanescu, Julien Anguenot

Method Summary
 boolean followTransition(java.lang.String transition)
          Follows a given life cycle transition.
 java.util.Collection<java.lang.String> getAllowedStateTransitions()
          Returns the allowed state transitions for this document.
 java.util.Calendar getLastModified()
          Gets the last modification time on this document.
 java.lang.String getLifeCyclePolicy()
          Returns the life cycle policy of this document.
 java.lang.String getLifeCycleState()
          Returns the life cycle of the document.
 java.lang.String getName()
          Gets the name of this document.
 Document getParent()
          Gets the parent document or null if this is the root document.
 java.lang.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 java.io.Serializable>
T
getSystemProp(java.lang.String name, java.lang.Class<T> type)
          Get system property of the specified type.
 DocumentType getType()
          Gets this document's type.
 java.lang.String getUUID()
          Gets this document's UUID.
 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.
 void save()
          Saves any modification done on this document or its children.
 void setCurrentLifeCycleState(java.lang.String state)
          Sets the lifecycle state of the document.
 void setLifeCyclePolicy(java.lang.String policy)
          Sets the life cycle policy of this document.
<T extends java.io.Serializable>
void
setSystemProp(java.lang.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.
 
Methods inherited from interface org.nuxeo.ecm.core.model.DocumentContainer
addChild, getChild, getChildren, getChildren, getChildrenIds, hasChild, hasChildren, orderBefore, removeChild, resolvePath
 
Methods inherited from interface org.nuxeo.ecm.core.model.PropertyContainer
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
 
Methods inherited from interface org.nuxeo.ecm.core.versioning.VersionableDocument
checkIn, checkOut, getBaseVersion, getCheckinComment, getLastVersion, getSourceDocument, getVersion, getVersionCreationDate, getVersionLabel, getVersions, getVersionSeriesId, getVersionsIds, getWorkingCopy, hasVersions, isCheckedOut, isLatestMajorVersion, isLatestVersion, isMajorVersion, isVersion, isVersionSeriesCheckedOut, restore
 
Methods inherited from interface org.nuxeo.ecm.core.model.Lockable
getLock, isLocked, setLock, unlock
 

Method Detail

getSession

Session getSession()
Gets the session that owns this document.

Returns:
the session

getName

java.lang.String getName()
                         throws DocumentException
Gets the name of this document.

Returns:
the document name. Cannot be null
Throws:
DocumentException - if any exception occurred

getUUID

java.lang.String getUUID()
Gets this document's UUID.

Returns:
the document UUID (cannot be null)

getParent

Document getParent()
                   throws DocumentException
Gets the parent document or null if this is the root document.

Returns:
the parent document or null if this is the root document
Throws:
DocumentException

getType

DocumentType getType()
Gets this document's type.

Returns:
the document type (cannot be null)

getPath

java.lang.String getPath()
                         throws DocumentException
Gets the path of this document.

Returns:
the path
Throws:
DocumentException

getLastModified

java.util.Calendar getLastModified()
                                   throws DocumentException
Gets the last modification time on this document.

Returns:
last modification time
Throws:
DocumentException

isFolder

boolean isFolder()
Tests whether this document represent a folder or a leaf document.

Returns:
true if the document is a folder document, false otherwise

remove

void remove()
            throws DocumentException
Removes this document and all its children, if any.

Throws:
DocumentException - if an error occurs

save

void save()
          throws DocumentException
Saves any modification done on this document or its children.

For some implementations this may do nothing if they are commiting modifications as they are done by calling the corresponding method.

Throws:
DocumentException - if an error occurs

getLifeCycleState

java.lang.String getLifeCycleState()
                                   throws LifeCycleException
Returns the life cycle of the document.

Returns:
the life cycle as a string
Throws:
LifeCycleException
See Also:
org.nuxeo.ecm.core.lifecycle

setCurrentLifeCycleState

void setCurrentLifeCycleState(java.lang.String state)
                              throws LifeCycleException
Sets the lifecycle state of the document.

Parameters:
state - the state
Throws:
LifeCycleException

getLifeCyclePolicy

java.lang.String getLifeCyclePolicy()
                                    throws LifeCycleException
Returns the life cycle policy of this document.

Returns:
the life cycle policy name of this document as a string
Throws:
LifeCycleException

setLifeCyclePolicy

void setLifeCyclePolicy(java.lang.String policy)
                        throws LifeCycleException
Sets the life cycle policy of this document.

Parameters:
policy - the policy
Throws:
LifeCycleException

followTransition

boolean followTransition(java.lang.String transition)
                         throws LifeCycleException
Follows a given life cycle transition.

This will update the current life cycle of the document.

Parameters:
transition - the name of the transition to follow
Returns:
a boolean representing the status if the operation
Throws:
LifeCycleException

getAllowedStateTransitions

java.util.Collection<java.lang.String> getAllowedStateTransitions()
                                                                  throws LifeCycleException
Returns the allowed state transitions for this document.

Returns:
a collection of state transitions as string
Throws:
LifeCycleException

isProxy

boolean isProxy()
Checks whether or not this doc is a proxy document.

Returns:
true if it's a proxy false otherwise

getRepository

Repository getRepository()
Returns the repository in which the document lives.

Returns:
a Repository instance.

setSystemProp

<T extends java.io.Serializable> void setSystemProp(java.lang.String name,
                                                    T value)
                   throws DocumentException
Set a system property which is a property of by the built-in node type ECM_SYSTEM_ANY.

Type Parameters:
T -
Parameters:
name -
value -
Throws:
DocumentException

getSystemProp

<T extends java.io.Serializable> T getSystemProp(java.lang.String name,
                                                 java.lang.Class<T> type)
                                             throws DocumentException
Get system property of the specified type.

Type Parameters:
T -
Parameters:
name -
type -
Returns:
Throws:
DocumentException

readDocumentPart

void readDocumentPart(DocumentPart dp)
                      throws java.lang.Exception
Load document part properties from storage and fill them inside the given document part.

Parameters:
dp -
Throws:
java.lang.Exception

writeDocumentPart

void writeDocumentPart(DocumentPart dp)
                       throws java.lang.Exception
Read modifications in the given document part and write them on storage.

Parameters:
dp -
Throws:
java.lang.Exception

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.