Class SQLDocumentVersion
- java.lang.Object
-
- org.nuxeo.ecm.core.storage.BaseDocument<Node>
-
- org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive
-
- org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentVersion
-
- All Implemented Interfaces:
Document
,SQLDocument
public class SQLDocumentVersion extends SQLDocumentLive
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.nuxeo.ecm.core.storage.BaseDocument
BaseDocument.BlobWriteContext<T extends StateAccessor>, BaseDocument.BlobWriteInfo<T extends StateAccessor>, BaseDocument.StateBlobAccessor, BaseDocument.Visit
-
Nested classes/interfaces inherited from interface org.nuxeo.ecm.core.model.Document
Document.BlobAccessor, Document.WriteContext
-
-
Field Summary
-
Fields inherited from class org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive
node, proxySchemas, readonly, session, systemPropNameMap, type
-
Fields inherited from class org.nuxeo.ecm.core.storage.BaseDocument
BLOB_DATA, BLOB_DIGEST, BLOB_ENCODING, BLOB_LENGTH, BLOB_MIME_TYPE, BLOB_NAME, DC_ISSUED, DC_MODIFIED, DC_PREFIX, EMPTY_STRING_ARRAY, FULLTEXT_BINARYTEXT_PROP, FULLTEXT_JOBID_PROP, FULLTEXT_SIMPLETEXT_PROP, HAS_LEGAL_HOLD_PROP, IS_FLEXIBLE_RECORD_PROP, IS_RECORD_PROP, IS_TRASHED_PROP, LIST_INDEX_PATTERN, LOCK_CREATED_PROP, LOCK_OWNER_PROP, MISC_LIFECYCLE_STATE_PROP, NO_DIRTY, NON_CANONICAL_INDEX, RELATED_TEXT, RELATED_TEXT_ID, RELATED_TEXT_RESOURCES, RETAIN_UNTIL_PROP, RETAINED_PROPERTIES_PROP, TOKEN_SEP, VERSION_WRITABLE_PROPS
-
Fields inherited from interface org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocument
BINARY_TEXT_SYS_PROP, FULLTEXT_JOBID_SYS_PROP, IS_TRASHED_SYS_PROP, SIMPLE_TEXT_SYS_PROP
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SQLDocumentVersion(Node node, ComplexType type, SQLSession session, boolean readonly)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
getParent()
Gets the parent document, ornull
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.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.-
Methods inherited from class org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive
addChild, addFacet, followTransition, getAllFacets, getAllowedStateTransitions, getChangeToken, getCheckinComment, getChild, getChild, getChildAsList, getChildForWrite, getChildren, getChildrenIds, getDocumentBlobManager, getDocumentLock, getFacets, getLastVersion, getLifeCyclePolicy, getLifeCycleState, getName, getNode, getPos, getPropertyValue, getProxySchemas, getRepositoryName, getRetainedProperties, getRetainUntil, getSession, getSystemProp, getTargetDocument, getType, getUUID, getValue, getVersionCreationDate, getVersionLabel, getVersions, getVersionsIds, hasChild, hasChildren, hasFacet, hasLegalHold, internalName, isFlexibleRecord, isProxy, isReadOnly, isRecord, isRetentionActive, makeFlexibleRecord, makeRecord, makeRecord, markUserChange, readDocumentPart, remove, remove, removeDocumentLock, removeFacet, removeSingleton, replaceBlobDigest, setCurrentLifeCycleState, setDocumentLock, setLegalHold, setLifeCyclePolicy, setReadOnly, setRetainUntil, setRetentionActive, setSystemProp, setTargetDocument, setValue, toString, updateList, updateList, validateUserVisibleChangeToken, visitBlobs, writeDocumentPart
-
Methods inherited from class org.nuxeo.ecm.core.storage.BaseDocument
allowNewRetention, buildUserVisibleChangeToken, canonicalXPath, checkReadOnlyIgnoredWrite, clearDirtyFlags, getBlobInfo, getLegacyChangeToken, getLock, getTopLevelSchema, getValueBlob, getValueComplex, getValueField, getValueObject, getWriteContext, isRetainable, isRetained, isUnderRetentionOrLegalHold, isVersionWritableProperty, readComplexProperty, readComplexProperty, removeLock, setBlobInfo, setLock, setPropertyBlobData, setValueBlob, setValueBlob, setValueComplex, setValueField, setValueObject, typedArray, updateChangeToken, validateLegacyChangeToken, validateUserVisibleChangeToken, visitBlobs, writeComplexProperty, writeComplexProperty, writeDocumentPart
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.nuxeo.ecm.core.model.Document
getBlobKeys, getLock, getWriteContext, isEnforcedRecord, isRetainable, isRetained, isUnderRetentionOrLegalHold, removeLock, setLock, writeDocumentPart
-
-
-
-
Constructor Detail
-
SQLDocumentVersion
protected SQLDocumentVersion(Node node, ComplexType type, SQLSession session, boolean readonly)
-
-
Method Detail
-
isVersion
public boolean isVersion()
Description copied from interface:Document
Checks whether this document is a version document.- Specified by:
isVersion
in interfaceDocument
- Overrides:
isVersion
in classSQLDocumentLive
- Returns:
true
if it's a version,false
otherwise
-
isCheckedOut
public boolean isCheckedOut()
Description copied from interface:Document
Checks whether this document is checked out.- Specified by:
isCheckedOut
in interfaceDocument
- Overrides:
isCheckedOut
in classSQLDocumentLive
- Returns:
true
if the document is checked out, orfalse
otherwise
-
isVersionSeriesCheckedOut
public boolean isVersionSeriesCheckedOut()
Description copied from interface:Document
Checks if there is a checked out working copy for the version series of this document.- Specified by:
isVersionSeriesCheckedOut
in interfaceDocument
- Overrides:
isVersionSeriesCheckedOut
in classSQLDocumentLive
- Returns:
true
if there is a checked out working copy
-
isMajorVersion
public boolean isMajorVersion()
Description copied from interface:Document
Checks whether this document is a major version.- Specified by:
isMajorVersion
in interfaceDocument
- Overrides:
isMajorVersion
in classSQLDocumentLive
- Returns:
true
if this is a major version, orfalse
otherwise
-
isLatestVersion
public boolean isLatestVersion()
Description copied from interface:Document
Checks whether this document is the latest version.- Specified by:
isLatestVersion
in interfaceDocument
- Overrides:
isLatestVersion
in classSQLDocumentLive
- Returns:
true
if this is the latest version, orfalse
otherwise
-
isLatestMajorVersion
public boolean isLatestMajorVersion()
Description copied from interface:Document
Checks whether this document is the latest major version.- Specified by:
isLatestMajorVersion
in interfaceDocument
- Overrides:
isLatestMajorVersion
in classSQLDocumentLive
- Returns:
true
if this is the latest major version, orfalse
otherwise
-
getWorkingCopy
public Document getWorkingCopy()
Description copied from interface:Document
Gets the working copy for this document.- Specified by:
getWorkingCopy
in interfaceDocument
- Overrides:
getWorkingCopy
in classSQLDocumentLive
- Returns:
- the working copy
-
getBaseVersion
public Document getBaseVersion()
Description copied from interface:Document
Gets the version to which a checked in document is linked.Returns
null
for a checked out document or a version or a proxy.- Specified by:
getBaseVersion
in interfaceDocument
- Overrides:
getBaseVersion
in classSQLDocumentLive
- Returns:
- the version, or
null
-
getVersionSeriesId
public String getVersionSeriesId()
Description copied from interface:Document
Gets the version series id.- Specified by:
getVersionSeriesId
in interfaceDocument
- Overrides:
getVersionSeriesId
in classSQLDocumentLive
- Returns:
- the version series id
-
getSourceDocument
public Document getSourceDocument()
Description copied from interface:Document
Gets the source for this document.For a version, it's the working copy.
For a proxy, it's the version the proxy points to.
- Specified by:
getSourceDocument
in interfaceDocument
- Overrides:
getSourceDocument
in classSQLDocumentLive
- Returns:
- the source document
-
getPath
public String getPath()
Description copied from interface:Document
Gets the path of this document.- Specified by:
getPath
in interfaceDocument
- Overrides:
getPath
in classSQLDocumentLive
- Returns:
- the path
-
getParent
public Document getParent()
Description copied from interface:Document
Gets the parent document, ornull
if this is the root document.- Specified by:
getParent
in interfaceDocument
- Overrides:
getParent
in classSQLDocumentLive
- Returns:
- the parent document, or
null
-
isFolder
public boolean isFolder()
Description copied from interface:Document
Checks whether this document is a folder.- Specified by:
isFolder
in interfaceDocument
- Overrides:
isFolder
in classSQLDocumentLive
- Returns:
true
if the document is a folder,false
otherwise
-
orderBefore
public void orderBefore(String src, String dest)
Description copied from interface:Document
Orders the given source child before the destination child.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.- Specified by:
orderBefore
in interfaceDocument
- Overrides:
orderBefore
in classSQLDocumentLive
- Parameters:
src
- the document to movedest
- the document before which to place the source document
-
checkIn
public Document checkIn(String label, String description)
Description copied from interface:Document
Creates a new version.- Specified by:
checkIn
in interfaceDocument
- Overrides:
checkIn
in classSQLDocumentLive
- Parameters:
label
- the version labeldescription
- the checkin comment- Returns:
- the created version
-
checkOut
public void checkOut()
- Specified by:
checkOut
in interfaceDocument
- Overrides:
checkOut
in classSQLDocumentLive
-
restore
public void restore(Document version)
Description copied from interface:Document
Replaces this document's content with the version specified.- Specified by:
restore
in interfaceDocument
- Overrides:
restore
in classSQLDocumentLive
- Parameters:
version
- the version to replace with
-
getVersion
public Document getVersion(String label)
Description copied from interface:Document
Gets a version of this document, given its label.- Specified by:
getVersion
in interfaceDocument
- Overrides:
getVersion
in classSQLDocumentLive
- Parameters:
label
- the version label- Returns:
- the version
-
setPropertyValue
public void setPropertyValue(String name, Serializable value)
Description copied from interface:Document
Sets a simple property value.For more generic properties described by an xpath, use
Document.setValue(java.lang.String, java.lang.Object)
instead.- Specified by:
setPropertyValue
in interfaceDocument
- Overrides:
setPropertyValue
in classSQLDocumentLive
- Parameters:
name
- the name of the property to setvalue
- the value to set- See Also:
Document.setValue(java.lang.String, java.lang.Object)
-
isReadOnlyProperty
protected boolean isReadOnlyProperty(String name)
-
equals
public boolean equals(Object other)
- Overrides:
equals
in classSQLDocumentLive
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classSQLDocumentLive
-
-