Class SQLDocumentProxy
- java.lang.Object
-
- org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentProxy
-
- All Implemented Interfaces:
Document
,SQLDocument
public class SQLDocumentProxy extends Object implements SQLDocument
A proxy is a shortcut to a target document (a version or normal document).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.nuxeo.ecm.core.model.Document
Document.BlobAccessor, Document.WriteContext
-
-
Field Summary
Fields Modifier and Type Field Description static String
CHANGE_TOKEN_PROXY_SEP
-
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
SQLDocumentProxy(Document proxy, Document target)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Document
addChild(String name, String typeName)
Creates a new child document of the given type.boolean
addFacet(String facet)
Adds a facet to this document.Document
checkIn(String label, String checkinComment)
Creates a new version.void
checkOut()
boolean
equals(Object other)
void
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.Document
getBaseVersion()
Gets the version to which a checked in document is linked.String
getChangeToken()
Gets the current change token for this document.String
getCheckinComment()
Gets the version check in comment of this document if it's a version or a proxy.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.String[]
getFacets()
Gets the facets defined on this document instance.Document
getLastVersion()
Gets the last version of this document.String
getLifeCyclePolicy()
Gets the life cycle policy of this document.String
getLifeCycleState()
Gets the life cycle state of this document.Lock
getLock()
Gets the lock if one set on this document.String
getName()
Gets the name of this document.Node
getNode()
Returns the node with info about the hierarchy location.Document
getParent()
Gets the parent document, ornull
if this is the root document.String
getPath()
Gets the path of this document.Long
getPos()
Gets the document's position in its containing folder (if ordered).Serializable
getPropertyValue(String name)
Gets a simple property value.protected static String
getProxyChangeToken(String proxyToken, String targetToken)
String
getRepositoryName()
Gets the repository in which the document lives.String[]
getRetainedProperties()
Gets the retained property xpaths of this document instance at the time it became a record.Calendar
getRetainUntil()
Gets the retention date for the document.protected String
getSchema(String xpath)
Session
getSession()
Gets the session that owns this document.Document
getSourceDocument()
Gets the source for this document.<T extends Serializable>
TgetSystemProp(String name, Class<T> type)
Gets a system property.Document
getTargetDocument()
Gets the document (version or live document) to which this proxy points.DocumentType
getType()
Gets the type of this document.String
getUUID()
Gets this document's UUID.Object
getValue(String xpath)
Gets a property value.Document
getVersion(String label)
Gets a version of this document, given its label.Calendar
getVersionCreationDate()
Gets the version creation date of this document if it's a version or a proxy.String
getVersionLabel()
Gets the version label.List<Document>
getVersions()
Gets the versions for this document.String
getVersionSeriesId()
Gets the version series id.List<String>
getVersionsIds()
Gets the list of version ids for this document.Document
getWorkingCopy()
Gets the working copy for this document.Document.WriteContext
getWriteContext()
Gets a write context for the current 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.boolean
hasFacet(String facet)
Checks whether this document has a given facet, either from its type or added on the instance.int
hashCode()
boolean
hasLegalHold()
Checks if the document has a legal hold set.boolean
isCheckedOut()
Checks whether this document is checked out.boolean
isFlexibleRecord()
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
isPropertyForProxy(String xpath)
Checks if the given property should be resolved on the proxy or the target.boolean
isProxy()
Checks whether or not this document is a proxy.boolean
isReadOnly()
Checks whether this document is readonly or not.boolean
isRecord()
Checks if the document is a record.boolean
isRetainable(String xpath)
Can the property be put under retention or legal hold.boolean
isRetained(String xpath)
Is the property under retention or legal hold.boolean
isRetentionActive()
Checks whether this document is under active retention.protected boolean
isSchemaForProxy(String schema)
Checks if the given schema should be resolved on the proxy or the target.boolean
isUnderRetentionOrLegalHold()
Checks if the document has a retention date in the future or has a legal hold.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
makeFlexibleRecord()
Turns the document into a flexible record.void
makeRecord()
Turns the document into an enforced record.void
markUserChange()
Marks the document as being modified by a user change.void
orderBefore(String src, String dest)
Orders the given source child before the destination child.void
readDocumentPart(DocumentPart dp)
Loads aDocumentPart
from storage.void
remove()
Removes this document and all its children, if any.void
remove(NuxeoPrincipal principal)
Removes this document and all its children, if any.boolean
removeFacet(String facet)
Removes a facet from this document.Lock
removeLock(String owner)
Removes a lock from this document.void
removeSingleton()
Removes this document only, without its children.String
replaceBlobDigest(String key, String newKey, String newDigest)
Visits the blobs of this document and, for those with a matching key, replace their key and digest with new ones.void
restore(Document version)
Replaces this document's content with the version specified.void
setCurrentLifeCycleState(String state)
Sets the life cycle state of this document.void
setLegalHold(boolean hold)
Sets or removes a legal hold on the document (a record).void
setLifeCyclePolicy(String policy)
Sets the life cycle policy of this document.Lock
setLock(Lock lock)
Sets a lock on this document.void
setPropertyValue(String name, Serializable value)
Sets a simple property value.void
setReadOnly(boolean readonly)
Sets this document as readonly or not.void
setRetainUntil(Calendar retainUntil)
Sets a retention date for the document (a record).void
setRetentionActive(boolean retentionActive)
Sets or unsets this document as under active retention.void
setSystemProp(String name, Serializable value)
Sets a system property.void
setTargetDocument(Document target)
Sets the document (version or live document) to which this proxy points.void
setValue(String xpath, Object value)
Sets a property value.String
toString()
boolean
validateUserVisibleChangeToken(String userVisibleChangeToken)
Validates that the passed user-visible change token is compatible with the one for this document.void
visitBlobs(Consumer<Document.BlobAccessor> blobVisitor)
Visits all the blobs of this document and calls the passed blob visitor on each one.boolean
writeDocumentPart(DocumentPart dp, Document.WriteContext writeContext, boolean create)
Writes aDocumentPart
to storage.-
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, isEnforcedRecord, writeDocumentPart
-
-
-
-
Field Detail
-
CHANGE_TOKEN_PROXY_SEP
public static final String CHANGE_TOKEN_PROXY_SEP
- See Also:
- Constant Field Values
-
-
Method Detail
-
isSchemaForProxy
protected boolean isSchemaForProxy(String schema)
Checks if the given schema should be resolved on the proxy or the target.
-
isPropertyForProxy
protected boolean isPropertyForProxy(String xpath)
Checks if the given property should be resolved on the proxy or the target.
-
getNode
public Node getNode()
Description copied from interface:SQLDocument
Returns the node with info about the hierarchy location.- Specified by:
getNode
in interfaceSQLDocument
-
isProxy
public boolean isProxy()
Description copied from interface:Document
Checks whether or not this document is a proxy.
-
getUUID
public String getUUID()
Description copied from interface:Document
Gets this document's UUID.
-
getName
public String getName()
Description copied from interface:Document
Gets the name of this document.
-
getPos
public Long getPos()
Description copied from interface:Document
Gets the document's position in its containing folder (if ordered).
-
getParent
public Document getParent()
Description copied from interface:Document
Gets the parent document, ornull
if this is the root document.
-
getPath
public String getPath()
Description copied from interface:Document
Gets the path of this document.
-
remove
public void remove()
Description copied from interface:Document
Removes this document and all its children, if any.
-
remove
public void remove(NuxeoPrincipal principal)
Description copied from interface:Document
Removes this document and all its children, if any.
-
removeSingleton
public void removeSingleton()
Description copied from interface:Document
Removes this document only, without its children.- Specified by:
removeSingleton
in interfaceDocument
-
getType
public DocumentType getType()
Description copied from interface:Document
Gets the type of this document.
-
getRepositoryName
public String getRepositoryName()
Description copied from interface:Document
Gets the repository in which the document lives.- Specified by:
getRepositoryName
in interfaceDocument
- Returns:
- the repository name.
-
getSession
public Session getSession()
Description copied from interface:Document
Gets the session that owns this document.- Specified by:
getSession
in interfaceDocument
- Returns:
- the session
-
isFolder
public boolean isFolder()
Description copied from interface:Document
Checks whether this document is a folder.
-
setReadOnly
public void setReadOnly(boolean readonly)
Description copied from interface:Document
Sets this document as readonly or not.- Specified by:
setReadOnly
in interfaceDocument
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:Document
Checks whether this document is readonly or not.- Specified by:
isReadOnly
in interfaceDocument
-
readDocumentPart
public void readDocumentPart(DocumentPart dp) throws PropertyException
Description copied from interface:Document
Loads aDocumentPart
from storage.Reading data is done by
DocumentPart
because of per-proxy schemas.- Specified by:
readDocumentPart
in interfaceDocument
- Throws:
PropertyException
-
getWriteContext
public Document.WriteContext getWriteContext()
Description copied from interface:Document
Gets a write context for the current document.- Specified by:
getWriteContext
in interfaceDocument
-
writeDocumentPart
public boolean writeDocumentPart(DocumentPart dp, Document.WriteContext writeContext, boolean create) throws PropertyException
Description copied from interface:Document
Writes aDocumentPart
to storage.Writing data is done by
DocumentPart
because of per-proxy schemas.- Specified by:
writeDocumentPart
in interfaceDocument
- Parameters:
dp
- the document partwriteContext
- the write contextcreate
- whether this is for a document creation- Returns:
true
if something changed- Throws:
PropertyException
-
setSystemProp
public void setSystemProp(String name, Serializable value)
Description copied from interface:Document
Sets a system property.- Specified by:
setSystemProp
in interfaceDocument
-
getSystemProp
public <T extends Serializable> T getSystemProp(String name, Class<T> type)
Description copied from interface:Document
Gets a system property.- Specified by:
getSystemProp
in interfaceDocument
-
getChangeToken
public String getChangeToken()
Description copied from interface:Document
Gets the current change token for this document.- Specified by:
getChangeToken
in interfaceDocument
- Returns:
- the change token
-
getProxyChangeToken
protected static String getProxyChangeToken(String proxyToken, String targetToken)
-
validateUserVisibleChangeToken
public boolean validateUserVisibleChangeToken(String userVisibleChangeToken)
Description copied from interface:Document
Validates that the passed user-visible change token is compatible with the one for this document.- Specified by:
validateUserVisibleChangeToken
in interfaceDocument
- Returns:
false
if the change token is not valid
-
markUserChange
public void markUserChange()
Description copied from interface:Document
Marks the document as being modified by a user change.This causes an additional change token increment and check during save.
- Specified by:
markUserChange
in interfaceDocument
-
getAllFacets
public Set<String> getAllFacets()
Description copied from interface:Document
Gets the facets available on this document (from the type and the instance facets).- Specified by:
getAllFacets
in interfaceDocument
- Returns:
- the facets
-
getFacets
public String[] getFacets()
Description copied from interface:Document
Gets the facets defined on this document instance. The type facets are not returned.
-
hasFacet
public boolean hasFacet(String facet)
Description copied from interface:Document
Checks whether this document has a given facet, either from its type or added on the instance.
-
addFacet
public boolean addFacet(String facet)
Description copied from interface:Document
Adds a facet to this document.Does nothing if the facet was already present on the document.
-
removeFacet
public boolean removeFacet(String facet)
Description copied from interface:Document
Removes a facet from this document.It's not possible to remove a facet coming from the document type.
- Specified by:
removeFacet
in interfaceDocument
- Parameters:
facet
- the facet name- Returns:
true
if the facet was removed, orfalse
if it isn't present or is present on the type or does not exit
-
makeRecord
public void makeRecord()
Description copied from interface:Document
Turns the document into an enforced record.A record is a document with specific capabilities related to mandatory retention until a given date, and legal holds. In addition, its main blob receives special treatment from the document blob manager to make sure it's never shared with another blob at the storage level, and is deleted as soon as the record is deleted.
If the document is already a record, this method has no effect.
The permission "MakeRecord" is required.
- Specified by:
makeRecord
in interfaceDocument
- See Also:
Document.isRecord()
-
makeFlexibleRecord
public void makeFlexibleRecord()
Description copied from interface:Document
Turns the document into a flexible record.A record is a document with specific capabilities related to mandatory retention until a given date, and legal holds.
If the document is already a flexible record, this method has no effect. An enforced record cannot be turned into a flexible record.
The permission "MakeRecord" is required.
- Specified by:
makeFlexibleRecord
in interfaceDocument
- See Also:
Document.isFlexibleRecord()
-
isRecord
public boolean isRecord()
Description copied from interface:Document
Checks if the document is a record.- Specified by:
isRecord
in interfaceDocument
- Returns:
true
if the document is a record,false
otherwise- See Also:
Document.makeRecord()
-
isFlexibleRecord
public boolean isFlexibleRecord()
- Specified by:
isFlexibleRecord
in interfaceDocument
- Returns:
true
if the document is a flexible record,false
otherwise
-
setRetainUntil
public void setRetainUntil(Calendar retainUntil)
Description copied from interface:Document
Sets a retention date for the document (a record).If no previous retention date was set, or if the previous retention date was indeterminate, or if the previous retention date was before the given value, then the retention date is set to the given value.
If the previous retention date was after the given value (that is, if trying to reduce the retention time), an exception is thrown.
If the given value is
null
and the previous retention date is in the past (it has already expired), then the retention date is set tonull
.The permission "SetRetention" is required.
- Specified by:
setRetainUntil
in interfaceDocument
- Parameters:
retainUntil
- the new retention date- See Also:
Document.getRetainUntil()
,CoreSession.RETAIN_UNTIL_INDETERMINATE
-
getRetainUntil
public Calendar getRetainUntil()
Description copied from interface:Document
Gets the retention date for the document.- Specified by:
getRetainUntil
in interfaceDocument
- Returns:
- the retention date, or "SetRetention" for a
retention in the indeterminate future, or
null
if there is no retention date - See Also:
Document.setRetainUntil(java.util.Calendar)
,CoreSession.RETAIN_UNTIL_INDETERMINATE
-
setLegalHold
public void setLegalHold(boolean hold)
Description copied from interface:Document
Sets or removes a legal hold on the document (a record).The permission "ManageLegalHold" is required.
- Specified by:
setLegalHold
in interfaceDocument
- Parameters:
hold
-true
to set a legal hold,false
to remove it- See Also:
Document.hasLegalHold()
-
hasLegalHold
public boolean hasLegalHold()
Description copied from interface:Document
Checks if the document has a legal hold set.- Specified by:
hasLegalHold
in interfaceDocument
- Returns:
true
if a legal hold has been set on the document,false
otherwise- See Also:
Document.setLegalHold(boolean)
-
isUnderRetentionOrLegalHold
public boolean isUnderRetentionOrLegalHold()
Description copied from interface:Document
Checks if the document has a retention date in the future or has a legal hold.- Specified by:
isUnderRetentionOrLegalHold
in interfaceDocument
- Returns:
true
if the document has a retention date in the future or if it has a legal hold,false
otherwise- See Also:
Document.getRetainUntil()
,Document.hasLegalHold()
-
setRetentionActive
public void setRetentionActive(boolean retentionActive)
Description copied from interface:Document
Sets or unsets this document as under active retention.- Specified by:
setRetentionActive
in interfaceDocument
-
isRetentionActive
public boolean isRetentionActive()
Description copied from interface:Document
Checks whether this document is under active retention.- Specified by:
isRetentionActive
in interfaceDocument
-
getLifeCyclePolicy
public String getLifeCyclePolicy()
Description copied from interface:Document
Gets the life cycle policy of this document.- Specified by:
getLifeCyclePolicy
in interfaceDocument
- Returns:
- the life cycle policy
-
setLifeCyclePolicy
public void setLifeCyclePolicy(String policy)
Description copied from interface:Document
Sets the life cycle policy of this document.- Specified by:
setLifeCyclePolicy
in interfaceDocument
- Parameters:
policy
- the life cycle policy
-
getLifeCycleState
public String getLifeCycleState()
Description copied from interface:Document
Gets the life cycle state of this document.- Specified by:
getLifeCycleState
in interfaceDocument
- Returns:
- the life cycle state
-
setCurrentLifeCycleState
public void setCurrentLifeCycleState(String state)
Description copied from interface:Document
Sets the life cycle state of this document.- Specified by:
setCurrentLifeCycleState
in interfaceDocument
- Parameters:
state
- the life cycle state
-
followTransition
public void followTransition(String transition) throws LifeCycleException
Description copied from interface:Document
Follows a given life cycle transition.This will update the life cycle state of the document.
- Specified by:
followTransition
in interfaceDocument
- Parameters:
transition
- the name of the transition to follow- Throws:
LifeCycleException
-
getAllowedStateTransitions
public Collection<String> getAllowedStateTransitions()
Description copied from interface:Document
Returns the allowed state transitions for this document.- Specified by:
getAllowedStateTransitions
in interfaceDocument
- Returns:
- a collection of state transitions
-
getLock
public Lock getLock()
Description copied from interface:Document
Gets the lock if one set on this document.
-
setLock
public Lock setLock(Lock lock)
Description copied from interface:Document
Sets a lock on this document.
-
removeLock
public Lock removeLock(String owner)
Description copied from interface:Document
Removes a lock from this document.- Specified by:
removeLock
in interfaceDocument
- Parameters:
owner
- the owner to check, ornull
for no check- Returns:
null
if there was no lock or if removal succeeded, or a lock if it blocks removal due to owner mismatch
-
isVersion
public boolean isVersion()
Description copied from interface:Document
Checks whether this document is a version document.
-
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
- Returns:
- the version, or
null
-
getVersionSeriesId
public String getVersionSeriesId()
Description copied from interface:Document
Gets the version series id.- Specified by:
getVersionSeriesId
in interfaceDocument
- 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
- Returns:
- the source document
-
checkIn
public Document checkIn(String label, String checkinComment)
Description copied from interface:Document
Creates a new version.
-
isCheckedOut
public boolean isCheckedOut()
Description copied from interface:Document
Checks whether this document is checked out.- Specified by:
isCheckedOut
in interfaceDocument
- Returns:
true
if the document is checked out, orfalse
otherwise
-
isLatestVersion
public boolean isLatestVersion()
Description copied from interface:Document
Checks whether this document is the latest version.- Specified by:
isLatestVersion
in interfaceDocument
- Returns:
true
if this is the latest version, orfalse
otherwise
-
isMajorVersion
public boolean isMajorVersion()
Description copied from interface:Document
Checks whether this document is a major version.- Specified by:
isMajorVersion
in interfaceDocument
- Returns:
true
if this is a major 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
- Returns:
true
if this is the latest major version, 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
- Returns:
true
if there is a checked out working copy
-
getVersionLabel
public String getVersionLabel()
Description copied from interface:Document
Gets the version label.- Specified by:
getVersionLabel
in interfaceDocument
- Returns:
- the version label
-
getCheckinComment
public String getCheckinComment()
Description copied from interface:Document
Gets the version check in comment of this document if it's a version or a proxy.- Specified by:
getCheckinComment
in interfaceDocument
- Returns:
- the check in comment, or
null
if it's not a version or a proxy
-
getWorkingCopy
public Document getWorkingCopy()
Description copied from interface:Document
Gets the working copy for this document.- Specified by:
getWorkingCopy
in interfaceDocument
- Returns:
- the working copy
-
getVersionCreationDate
public Calendar getVersionCreationDate()
Description copied from interface:Document
Gets the version creation date of this document if it's a version or a proxy.- Specified by:
getVersionCreationDate
in interfaceDocument
- Returns:
- the version creation date, or
null
if it's not a version or a proxy
-
restore
public void restore(Document version)
Description copied from interface:Document
Replaces this document's content with the version specified.
-
getVersionsIds
public List<String> getVersionsIds()
Description copied from interface:Document
Gets the list of version ids for this document.- Specified by:
getVersionsIds
in interfaceDocument
- Returns:
- the list of version ids
-
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
- Parameters:
label
- the version label- Returns:
- the version
-
getVersions
public List<Document> getVersions()
Description copied from interface:Document
Gets the versions for this document.- Specified by:
getVersions
in interfaceDocument
- Returns:
- the versions of the document, or an empty list if there are no versions
-
getLastVersion
public Document getLastVersion()
Description copied from interface:Document
Gets the last version of this document.Returns
null
if there is no version at all.- Specified by:
getLastVersion
in interfaceDocument
- Returns:
- the last version, or
null
if there is no version
-
getChild
public Document getChild(String name)
Description copied from interface:Document
Gets a child document given its name.Throws
DocumentNotFoundException
if the document could not be found.
-
getChildren
public List<Document> getChildren()
Description copied from interface:Document
Gets the children of the document.- Specified by:
getChildren
in interfaceDocument
- Returns:
- the children
-
getChildrenIds
public List<String> getChildrenIds()
Description copied from interface:Document
Gets a list of the children ids.- Specified by:
getChildrenIds
in interfaceDocument
- Returns:
- a list of children ids.
-
hasChild
public boolean hasChild(String name)
Description copied from interface:Document
Checks whether this document has a child of the given name.
-
hasChildren
public boolean hasChildren()
Description copied from interface:Document
Tests if the document has any children.- Specified by:
hasChildren
in interfaceDocument
- Returns:
true
if the document has children,false
otherwise
-
addChild
public Document addChild(String name, String typeName)
Description copied from interface:Document
Creates a new child document of the given type.
-
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
- Parameters:
src
- the document to movedest
- the document before which to place the source document
-
getTargetDocument
public Document getTargetDocument()
Description copied from interface:Document
Gets the document (version or live document) to which this proxy points.- Specified by:
getTargetDocument
in interfaceDocument
-
setTargetDocument
public void setTargetDocument(Document target)
Description copied from interface:Document
Sets the document (version or live document) to which this proxy points.- Specified by:
setTargetDocument
in interfaceDocument
-
getPropertyValue
public Serializable getPropertyValue(String name)
Description copied from interface:Document
Gets a simple property value.For more generic properties described by an xpath, use
Document.getValue(java.lang.String)
instead.- Specified by:
getPropertyValue
in interfaceDocument
- Parameters:
name
- the name of the property to get- Returns:
- the property value or
null
if the property is not set - See Also:
Document.getValue(java.lang.String)
-
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
- Parameters:
name
- the name of the property to setvalue
- the value to set- See Also:
Document.setValue(java.lang.String, java.lang.Object)
-
getValue
public Object getValue(String xpath) throws PropertyException
Description copied from interface:Document
Gets a property value.The xpath may point to a partial path, in which case the value may be a complex
List
orMap
.- Specified by:
getValue
in interfaceDocument
- Parameters:
xpath
- the xpath of the property to set- Returns:
- the property value or
null
if the property is not set - Throws:
PropertyException
- if the property does not exist
-
setValue
public void setValue(String xpath, Object value) throws PropertyException
Description copied from interface:Document
Sets a property value.The xpath may point to a partial path, in which case the value may be a complex
List
orMap
.- Specified by:
setValue
in interfaceDocument
- Parameters:
xpath
- the xpath of the property to setvalue
- the value to set- Throws:
PropertyException
- if the property does not exist or the value is of the wrong type
-
visitBlobs
public void visitBlobs(Consumer<Document.BlobAccessor> blobVisitor) throws PropertyException
Description copied from interface:Document
Visits all the blobs of this document and calls the passed blob visitor on each one.- Specified by:
visitBlobs
in interfaceDocument
- Throws:
PropertyException
-
replaceBlobDigest
public String replaceBlobDigest(String key, String newKey, String newDigest)
Description copied from interface:Document
Visits the blobs of this document and, for those with a matching key, replace their key and digest with new ones.- Specified by:
replaceBlobDigest
in interfaceDocument
- Parameters:
key
- the bob key to look fornewKey
- the new keynewDigest
- the new digest- Returns:
- the old digest if at least one replacement was done,
null
otherwise
-
getRetainedProperties
public String[] getRetainedProperties()
Description copied from interface:Document
Gets the retained property xpaths of this document instance at the time it became a record.- Specified by:
getRetainedProperties
in interfaceDocument
- Returns:
- the retained properties
-
isRetainable
public boolean isRetainable(String xpath)
Description copied from interface:Document
Can the property be put under retention or legal hold.- Specified by:
isRetainable
in interfaceDocument
- Parameters:
xpath
- the xpath- Returns:
- true if the property is retainable
-
isRetained
public boolean isRetained(String xpath)
Description copied from interface:Document
Is the property under retention or legal hold.- Specified by:
isRetained
in interfaceDocument
- Parameters:
xpath
- the xpath- Returns:
- true if the property is retained and cannot be deleted/edited
-
-