public class SQLDocumentVersion extends SQLDocumentLive
Modifier and Type | Class and Description |
---|---|
static class |
SQLDocumentVersion.VersionNotModifiableException |
DC_ISSUED, RELATED_TEXT_RESOURCES
BINARY_TEXT_SYS_PROP, FULLTEXT_JOBID_SYS_PROP
Modifier and Type | Method and Description |
---|---|
Document |
addChild(String name,
String typeName)
Creates a new child document given its typename.
|
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.
|
Iterator<Document> |
getChildren()
Gets an iterator over the children of the document.
|
List<String> |
getChildrenIds()
Gets a list of the children ids.
|
Document |
getLastVersion()
Gets the last version 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.
|
Document |
getSourceDocument()
Gets the head ("live") version of this document.
|
Document |
getVersion(String label)
Gets a version of this document, given its label.
|
List<Document> |
getVersions() |
String |
getVersionSeriesId()
Gets the version series id.
|
Document |
getWorkingCopy() |
boolean |
hasChild(String name)
Tests if the document has the named child.
|
boolean |
hasChildren()
Tests if the document has any children.
|
int |
hashCode() |
boolean |
hasVersions()
Tells the caller if this document has versions or not.
|
void |
importFlatMap(Map<String,Object> map)
Imports a flat map of properties into this document.
|
void |
importMap(Map<String,Map<String,Object>> map)
Imports the tree properties from the given Java Map.
|
boolean |
isCheckedOut() |
boolean |
isFolder()
Tests whether this document represent a folder or a leaf document.
|
boolean |
isLatestMajorVersion() |
boolean |
isLatestVersion() |
boolean |
isMajorVersion() |
boolean |
isVersion()
Checks whether or not this doc is a version document.
|
boolean |
isVersionSeriesCheckedOut() |
void |
orderBefore(String src,
String dest)
Orders the given source child before the destination child.
|
void |
removeChild(String name)
Removes the child having the given name
|
void |
removeProperty(String name)
Removes the property with the given name.
|
void |
restore(Document version)
Replaces current version with version specified.
|
void |
setBoolean(String name,
boolean value)
Sets the scalar property value to the given boolean value.
|
void |
setContent(String name,
Blob value)
Sets the content property to the given value.
|
void |
setDate(String name,
Calendar value)
Sets the scalar property value to the given date value.
|
void |
setDouble(String name,
double value)
Set the scalar property value to the given double value.
|
void |
setLong(String name,
long value)
Sets the scalar property value to the given long value.
|
void |
setPropertyValue(String name,
Object value)
Generic method to set a property value.
|
void |
setString(String name,
String value)
Sets the scalar property value to the given string value.
|
addFacet, followTransition, getACLProperty, getAllFacets, getAllowedStateTransitions, getCheckinComment, getChildren, getFacets, getLastModified, getLifeCyclePolicy, getLifeCycleState, getLock, getProperty, getRepository, getSession, getSystemProp, getType, getUUID, getVersionCreationDate, getVersionLabel, getVersionsIds, hasFacet, isProxy, readDocumentPart, remove, removeFacet, removeLock, resolvePath, save, setCurrentLifeCycleState, setLifeCyclePolicy, setLock, setSystemProp, toString, writeDocumentPart
exportFlatMap, exportMap, exportMap, getBoolean, getContent, getDate, getDirtyFields, getDouble, getLong, getName, getNode, getProperties, getPropertyIterator, getPropertyValue, getString, getValue, isPropertySet, setValue
checkWritable, isNull, isSpecialSystemProperty, setNull
checkWritable, getNode
exportFlatMap, exportMap, exportMap, getBoolean, getContent, getDate, getDirtyFields, getDouble, getLong, getProperties, getPropertyIterator, getPropertyValue, getString, isPropertySet
getName, getProperties, getPropertyIterator, getValue, isNull, isPropertySet, setNull, setValue
public boolean isVersion()
VersionableDocument
isVersion
in interface VersionableDocument
isVersion
in class SQLDocumentLive
public boolean isCheckedOut() throws DocumentException
isCheckedOut
in interface VersionableDocument
isCheckedOut
in class SQLDocumentLive
DocumentException
public boolean isVersionSeriesCheckedOut() throws DocumentException
isVersionSeriesCheckedOut
in interface VersionableDocument
isVersionSeriesCheckedOut
in class SQLDocumentLive
DocumentException
public boolean isMajorVersion() throws DocumentException
isMajorVersion
in interface VersionableDocument
isMajorVersion
in class SQLDocumentLive
DocumentException
public boolean isLatestVersion() throws DocumentException
isLatestVersion
in interface VersionableDocument
isLatestVersion
in class SQLDocumentLive
DocumentException
public boolean isLatestMajorVersion() throws DocumentException
isLatestMajorVersion
in interface VersionableDocument
isLatestMajorVersion
in class SQLDocumentLive
DocumentException
public Document getWorkingCopy() throws DocumentException
getWorkingCopy
in interface VersionableDocument
getWorkingCopy
in class SQLDocumentLive
DocumentException
public Document getBaseVersion() throws DocumentException
VersionableDocument
Returns null
for a checked out document or a version or a proxy.
getBaseVersion
in interface VersionableDocument
getBaseVersion
in class SQLDocumentLive
null
DocumentException
public String getVersionSeriesId() throws DocumentException
VersionableDocument
getVersionSeriesId
in interface VersionableDocument
getVersionSeriesId
in class SQLDocumentLive
DocumentException
public Document getSourceDocument() throws DocumentException
VersionableDocument
getSourceDocument
in interface VersionableDocument
getSourceDocument
in class SQLDocumentLive
DocumentException
public String getPath() throws DocumentException
Document
getPath
in interface Document
getPath
in class SQLDocumentLive
DocumentException
public Document getParent() throws DocumentException
Document
getParent
in interface Document
getParent
in class SQLDocumentLive
DocumentException
public boolean isFolder()
Document
isFolder
in interface Document
isFolder
in class SQLDocumentLive
public void removeChild(String name) throws DocumentException
DocumentContainer
If this is not a folder does nothing.
If this is a folder and no child exists with the given name then throws an exception
removeChild
in interface DocumentContainer
removeChild
in class SQLDocumentLive
name
- the child nameDocumentException
public void orderBefore(String src, String dest) throws DocumentException
DocumentContainer
orderBefore
in interface DocumentContainer
orderBefore
in class SQLDocumentLive
src
- the document to movedest
- the document before which to place the source documentDocumentException
- if this document is not an orderable folder or any other exception occurspublic Document addChild(String name, String typeName) throws DocumentException
DocumentContainer
This operation throws an error if the current document is not a folder.
addChild
in interface DocumentContainer
addChild
in class SQLDocumentLive
name
- the name of the new child to createtypeName
- the type of the child to createDocumentException
public Document getChild(String name) throws DocumentException
DocumentContainer
Throws an exception if the document could not be found.
If the supplied name is null, returns the default child of the document if any, otherwise raises an exception.
getChild
in interface DocumentContainer
getChild
in class SQLDocumentLive
name
- the name of the child to retrieveDocumentException
public Iterator<Document> getChildren() throws DocumentException
DocumentContainer
This operation silently ignores non-folder documents: if the document is not a folder then it returns an empty iterator.
getChildren
in interface DocumentContainer
getChildren
in class SQLDocumentLive
DocumentException
public List<String> getChildrenIds() throws DocumentException
DocumentContainer
getChildrenIds
in interface DocumentContainer
getChildrenIds
in class SQLDocumentLive
DocumentException
public boolean hasChild(String name) throws DocumentException
DocumentContainer
This operation silently ignores non-folder documents: If the document is not a folder then return false.
hasChild
in interface DocumentContainer
hasChild
in class SQLDocumentLive
name
- the name of the child to testDocumentException
public boolean hasChildren() throws DocumentException
DocumentContainer
This operation silently ignores non-folder documents: If the document is not a folder then returns false.
hasChildren
in interface DocumentContainer
hasChildren
in class SQLDocumentLive
DocumentException
public Document checkIn(String label, String description)
VersionableDocument
checkIn
in interface VersionableDocument
checkIn
in class SQLDocumentLive
label
- the version labeldescription
- the checkin commentpublic void checkOut()
checkOut
in interface VersionableDocument
checkOut
in class SQLDocumentLive
public void restore(Document version)
VersionableDocument
restore
in interface VersionableDocument
restore
in class SQLDocumentLive
version
- the version to replace withpublic Document getVersion(String label)
VersionableDocument
getVersion
in interface VersionableDocument
getVersion
in class SQLDocumentLive
label
- the version labelpublic List<Document> getVersions()
getVersions
in interface VersionableDocument
getVersions
in class SQLDocumentLive
public boolean hasVersions()
VersionableDocument
Needed to know if we need to use checkin/checkout methods when changing a document.
hasVersions
in interface VersionableDocument
hasVersions
in class SQLDocumentLive
public Document getLastVersion()
VersionableDocument
getLastVersion
in interface VersionableDocument
getLastVersion
in class SQLDocumentLive
public void importFlatMap(Map<String,Object> map)
PropertyContainer
importFlatMap
in interface PropertyContainer
importFlatMap
in class SQLComplexProperty
public void importMap(Map<String,Map<String,Object>> map)
PropertyContainer
The property tree is recursively traversed and all property exported as entry of the Map.
importMap
in interface PropertyContainer
importMap
in class SQLComplexProperty
public void setPropertyValue(String name, Object value) throws DocumentException
PropertyContainer
This is a shortcut for getProperty(String).setValue(Object)
The following type of objects can be used as values depending on the property type:
setPropertyValue
in interface PropertyContainer
setPropertyValue
in class SQLComplexProperty
name
- the name of the property to setvalue
- the value to setDocumentException
- if any error occurspublic void setString(String name, String value) throws DocumentException
PropertyContainer
If the property with that name doesn't exists, it will be created.
This is a shortcut to create or set string properties.
setString
in interface PropertyContainer
setString
in class SQLComplexProperty
DocumentException
- if any error occursSimpleProperty#setString(String)}
public void setBoolean(String name, boolean value) throws DocumentException
PropertyContainer
If the property with that name doesn't exists, it will be created.
This is a shortcut to create or set boolean properties.
setBoolean
in interface PropertyContainer
setBoolean
in class SQLComplexProperty
DocumentException
- if any error occursSimpleProperty#setBoolean(boolean)}
public void setLong(String name, long value)
PropertyContainer
If the property with that name doesn't exists, it will be created.
This is a shortcut to create or set long properties.
setLong
in interface PropertyContainer
setLong
in class SQLComplexProperty
SimpleProperty#setLong(long)}
public void setDouble(String name, double value)
PropertyContainer
If the property with that name doesn't exists, it will be created.
This is a shortcut to create or set double properties
setDouble
in interface PropertyContainer
setDouble
in class SQLComplexProperty
SimpleProperty#setDouble(double)}
public void setDate(String name, Calendar value)
PropertyContainer
If the property with that name doesn't exists, it will be created
This is a shortcut to create or set date properties.
setDate
in interface PropertyContainer
setDate
in class SQLComplexProperty
SimpleProperty#setDate(Calendar)}
public void setContent(String name, Blob value)
PropertyContainer
If the property with that name doesn't exists, it will be created
setContent
in interface PropertyContainer
setContent
in class SQLComplexProperty
public void removeProperty(String name)
PropertyContainer
removeProperty
in interface PropertyContainer
removeProperty
in class SQLComplexProperty
name
- the property to removepublic boolean equals(Object other)
equals
in class SQLDocumentLive
public int hashCode()
hashCode
in class SQLDocumentLive
Copyright © 2011 Nuxeo SA. All Rights Reserved.