public class SQLDocumentVersion extends SQLDocumentLive
Modifier and Type | Class and Description |
---|---|
static class |
SQLDocumentVersion.VersionNotModifiableException |
BaseDocument.BlobWriteContext<T extends StateAccessor>, BaseDocument.StateBlobAccessor, BaseDocument.Visit
Document.BlobAccessor, Document.WriteContext
node, proxySchemas, readonly, session, systemPropNameMap, type
BLOB_DATA, BLOB_DIGEST, BLOB_ENCODING, BLOB_LENGTH, BLOB_MIME_TYPE, BLOB_NAME, DC_ISSUED, DC_PREFIX, EMPTY_STRING_ARRAY, FULLTEXT_BINARYTEXT_PROP, FULLTEXT_JOBID_PROP, FULLTEXT_SIMPLETEXT_PROP, LOCK_CREATED_PROP, LOCK_OWNER_PROP, MISC_LIFECYCLE_STATE_PROP, NO_DIRTY, NON_CANONICAL_INDEX, RELATED_TEXT, RELATED_TEXT_ID, RELATED_TEXT_RESOURCES, VERSION_WRITABLE_PROPS
BINARY_TEXT_SYS_PROP, FULLTEXT_JOBID_SYS_PROP, SIMPLE_TEXT_SYS_PROP
Modifier | Constructor and Description |
---|---|
protected |
SQLDocumentVersion(Node node,
ComplexType type,
SQLSession session,
boolean readonly) |
Modifier and Type | Method and Description |
---|---|
Document |
addChild(String name,
String typeName)
Creates a new child document of the given type.
|
Document |
checkIn(String label,
String description)
Creates a new version.
|
void |
checkOut() |
boolean |
equals(Object other) |
Document |
getBaseVersion()
Gets the version to which a checked in document is linked.
|
Document |
getChild(String name)
Gets a child document given its name.
|
List<Document> |
getChildren()
Gets the children of the document.
|
List<String> |
getChildrenIds()
Gets a list of the children ids.
|
Document |
getParent()
Gets the parent document, or
null if this is the root document. |
String |
getPath()
Gets the path of this document.
|
Document |
getSourceDocument()
Gets the source for this document.
|
Document |
getVersion(String label)
Gets a version of this document, given its label.
|
String |
getVersionSeriesId()
Gets the version series id.
|
Document |
getWorkingCopy()
Gets the working copy for this document.
|
boolean |
hasChild(String name)
Checks whether this document has a child of the given name.
|
boolean |
hasChildren()
Tests if the document has any children.
|
int |
hashCode() |
boolean |
isCheckedOut()
Checks whether this document is checked out.
|
boolean |
isFolder()
Checks whether this document is a folder.
|
boolean |
isLatestMajorVersion()
Checks whether this document is the latest major version.
|
boolean |
isLatestVersion()
Checks whether this document is the latest version.
|
boolean |
isMajorVersion()
Checks whether this document is a major version.
|
protected boolean |
isReadOnlyProperty(String name) |
boolean |
isVersion()
Checks whether this document is a version document.
|
boolean |
isVersionSeriesCheckedOut()
Checks if there is a checked out working copy for the version series of this document.
|
void |
orderBefore(String src,
String dest)
Orders the given source child before the destination child.
|
void |
restore(Document version)
Replaces this document's content with the version specified.
|
void |
setPropertyValue(String name,
Serializable value)
Sets a simple property value.
|
addFacet, followTransition, getAllFacets, getAllowedStateTransitions, getCheckinComment, getChild, getChildAsList, getChildForWrite, getDocumentLock, getFacets, getLastVersion, getLifeCyclePolicy, getLifeCycleState, getName, getNode, getPos, getPropertyValue, getProxySchemas, getRepositoryName, getSession, getSystemProp, getTargetDocument, getType, getUUID, getValue, getVersionCreationDate, getVersionLabel, getVersions, getVersionsIds, hasFacet, internalName, isProxy, isReadOnly, readDocumentPart, readPrefetch, remove, removeDocumentLock, removeFacet, setCurrentLifeCycleState, setDocumentLock, setLifeCyclePolicy, setReadOnly, setSystemProp, setTargetDocument, setValue, toString, updateList, updateList, visitBlobs, writeDocumentPart
canonicalXPath, checkReadOnlyIgnoredWrite, clearDirtyFlags, getBlobInfo, getLock, getValueBlob, getValueComplex, getValueField, getValueObject, getWriteContext, isVersionWritableProperty, readComplexProperty, readPrefetch, readPrefetch, readPrefetchField, removeLock, setBlobInfo, setLock, setValueBlob, setValueComplex, setValueField, setValueObject, typedArray, visitBlobs, writeComplexProperty, writeComplexProperty
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getLock, getWriteContext, removeLock, setLock
protected SQLDocumentVersion(Node node, ComplexType type, SQLSession session, boolean readonly)
public boolean isVersion()
Document
isVersion
in interface Document
isVersion
in class SQLDocumentLive
true
if it's a version, false
otherwisepublic boolean isCheckedOut()
Document
isCheckedOut
in interface Document
isCheckedOut
in class SQLDocumentLive
true
if the document is checked out, or false
otherwisepublic boolean isVersionSeriesCheckedOut()
Document
isVersionSeriesCheckedOut
in interface Document
isVersionSeriesCheckedOut
in class SQLDocumentLive
true
if there is a checked out working copypublic boolean isMajorVersion()
Document
isMajorVersion
in interface Document
isMajorVersion
in class SQLDocumentLive
true
if this is a major version, or false
otherwisepublic boolean isLatestVersion()
Document
isLatestVersion
in interface Document
isLatestVersion
in class SQLDocumentLive
true
if this is the latest version, or false
otherwisepublic boolean isLatestMajorVersion()
Document
isLatestMajorVersion
in interface Document
isLatestMajorVersion
in class SQLDocumentLive
true
if this is the latest major version, or false
otherwisepublic Document getWorkingCopy()
Document
getWorkingCopy
in interface Document
getWorkingCopy
in class SQLDocumentLive
public Document getBaseVersion()
Document
Returns null
for a checked out document or a version or a proxy.
getBaseVersion
in interface Document
getBaseVersion
in class SQLDocumentLive
null
public String getVersionSeriesId()
Document
getVersionSeriesId
in interface Document
getVersionSeriesId
in class SQLDocumentLive
public Document getSourceDocument()
Document
For a version, it's the working copy.
For a proxy, it's the version the proxy points to.
getSourceDocument
in interface Document
getSourceDocument
in class SQLDocumentLive
public String getPath()
Document
getPath
in interface Document
getPath
in class SQLDocumentLive
public Document getParent()
Document
null
if this is the root document.getParent
in interface Document
getParent
in class SQLDocumentLive
null
public boolean isFolder()
Document
isFolder
in interface Document
isFolder
in class SQLDocumentLive
true
if the document is a folder, false
otherwisepublic void orderBefore(String src, String dest)
Document
Both source and destination must be names that point to child documents of this document. The source document
will be placed before the destination one. If destination is null
, the source document will be appended
at the end of the children list.
orderBefore
in interface Document
orderBefore
in class SQLDocumentLive
src
- the document to movedest
- the document before which to place the source documentpublic Document addChild(String name, String typeName)
Document
Throws an error if this document is not a folder.
addChild
in interface Document
addChild
in class SQLDocumentLive
name
- the name of the new child to createtypeName
- the type of the child to createpublic Document getChild(String name)
Document
Throws DocumentNotFoundException
if the document could not be found.
getChild
in interface Document
getChild
in class SQLDocumentLive
name
- the name of the child to retrievepublic List<Document> getChildren()
Document
Returns an empty list for non-folder documents.
getChildren
in interface Document
getChildren
in class SQLDocumentLive
public List<String> getChildrenIds()
Document
Returns an empty list for non-folder documents.
getChildrenIds
in interface Document
getChildrenIds
in class SQLDocumentLive
public boolean hasChild(String name)
Document
Returns false
for non-folder documents.
hasChild
in interface Document
hasChild
in class SQLDocumentLive
name
- the name of the child to checktrue
if the child exists, false
otherwisepublic boolean hasChildren()
Document
Returns false
for non-folder documents.
hasChildren
in interface Document
hasChildren
in class SQLDocumentLive
true
if the document has children, false
otherwisepublic Document checkIn(String label, String description)
Document
checkIn
in interface Document
checkIn
in class SQLDocumentLive
label
- the version labeldescription
- the checkin commentpublic void checkOut()
checkOut
in interface Document
checkOut
in class SQLDocumentLive
public void restore(Document version)
Document
restore
in interface Document
restore
in class SQLDocumentLive
version
- the version to replace withpublic Document getVersion(String label)
Document
getVersion
in interface Document
getVersion
in class SQLDocumentLive
label
- the version labelpublic void setPropertyValue(String name, Serializable value)
Document
For more generic properties described by an xpath, use Document.setValue(java.lang.String, java.lang.Object)
instead.
setPropertyValue
in interface Document
setPropertyValue
in class SQLDocumentLive
name
- the name of the property to setvalue
- the value to setDocument.setValue(java.lang.String, java.lang.Object)
protected boolean isReadOnlyProperty(String name)
public boolean equals(Object other)
equals
in class SQLDocumentLive
public int hashCode()
hashCode
in class SQLDocumentLive
Copyright © 2015 Nuxeo SA. All rights reserved.