public class SQLDocumentVersion extends SQLDocumentLive
| Modifier and Type | Class and Description |
|---|---|
static class |
SQLDocumentVersion.VersionNotModifiableException |
DC_ISSUED, RELATED_TEXT_RESOURCESBINARY_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, writeDocumentPartexportFlatMap, exportMap, exportMap, getBoolean, getContent, getDate, getDirtyFields, getDouble, getLong, getName, getNode, getProperties, getPropertyIterator, getPropertyValue, getString, getValue, isPropertySet, setValuecheckWritable, isNull, isSpecialSystemProperty, setNullcheckWritable, getNodeexportFlatMap, exportMap, exportMap, getBoolean, getContent, getDate, getDirtyFields, getDouble, getLong, getProperties, getPropertyIterator, getPropertyValue, getString, isPropertySetgetName, getProperties, getPropertyIterator, getValue, isNull, isPropertySet, setNull, setValuepublic boolean isVersion()
VersionableDocumentisVersion in interface VersionableDocumentisVersion in class SQLDocumentLivepublic boolean isCheckedOut()
throws DocumentException
isCheckedOut in interface VersionableDocumentisCheckedOut in class SQLDocumentLiveDocumentExceptionpublic boolean isVersionSeriesCheckedOut()
throws DocumentException
isVersionSeriesCheckedOut in interface VersionableDocumentisVersionSeriesCheckedOut in class SQLDocumentLiveDocumentExceptionpublic boolean isMajorVersion()
throws DocumentException
isMajorVersion in interface VersionableDocumentisMajorVersion in class SQLDocumentLiveDocumentExceptionpublic boolean isLatestVersion()
throws DocumentException
isLatestVersion in interface VersionableDocumentisLatestVersion in class SQLDocumentLiveDocumentExceptionpublic boolean isLatestMajorVersion()
throws DocumentException
isLatestMajorVersion in interface VersionableDocumentisLatestMajorVersion in class SQLDocumentLiveDocumentExceptionpublic Document getWorkingCopy() throws DocumentException
getWorkingCopy in interface VersionableDocumentgetWorkingCopy in class SQLDocumentLiveDocumentExceptionpublic Document getBaseVersion() throws DocumentException
VersionableDocument
Returns null for a checked out document or a version or a proxy.
getBaseVersion in interface VersionableDocumentgetBaseVersion in class SQLDocumentLivenullDocumentExceptionpublic String getVersionSeriesId() throws DocumentException
VersionableDocumentgetVersionSeriesId in interface VersionableDocumentgetVersionSeriesId in class SQLDocumentLiveDocumentExceptionpublic Document getSourceDocument() throws DocumentException
VersionableDocumentgetSourceDocument in interface VersionableDocumentgetSourceDocument in class SQLDocumentLiveDocumentExceptionpublic String getPath() throws DocumentException
DocumentgetPath in interface DocumentgetPath in class SQLDocumentLiveDocumentExceptionpublic Document getParent() throws DocumentException
DocumentgetParent in interface DocumentgetParent in class SQLDocumentLiveDocumentExceptionpublic boolean isFolder()
DocumentisFolder in interface DocumentisFolder in class SQLDocumentLivepublic void removeChild(String name) throws DocumentException
DocumentContainerIf 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 DocumentContainerremoveChild in class SQLDocumentLivename - the child nameDocumentExceptionpublic void orderBefore(String src, String dest) throws DocumentException
DocumentContainerorderBefore in interface DocumentContainerorderBefore in class SQLDocumentLivesrc - 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
DocumentContainerThis operation throws an error if the current document is not a folder.
addChild in interface DocumentContaineraddChild in class SQLDocumentLivename - the name of the new child to createtypeName - the type of the child to createDocumentExceptionpublic Document getChild(String name) throws DocumentException
DocumentContainerThrows 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 DocumentContainergetChild in class SQLDocumentLivename - the name of the child to retrieveDocumentExceptionpublic Iterator<Document> getChildren() throws DocumentException
DocumentContainerThis operation silently ignores non-folder documents: if the document is not a folder then it returns an empty iterator.
getChildren in interface DocumentContainergetChildren in class SQLDocumentLiveDocumentExceptionpublic List<String> getChildrenIds() throws DocumentException
DocumentContainergetChildrenIds in interface DocumentContainergetChildrenIds in class SQLDocumentLiveDocumentExceptionpublic boolean hasChild(String name) throws DocumentException
DocumentContainerThis operation silently ignores non-folder documents: If the document is not a folder then return false.
hasChild in interface DocumentContainerhasChild in class SQLDocumentLivename - the name of the child to testDocumentExceptionpublic boolean hasChildren()
throws DocumentException
DocumentContainerThis operation silently ignores non-folder documents: If the document is not a folder then returns false.
hasChildren in interface DocumentContainerhasChildren in class SQLDocumentLiveDocumentExceptionpublic Document checkIn(String label, String description)
VersionableDocumentcheckIn in interface VersionableDocumentcheckIn in class SQLDocumentLivelabel - the version labeldescription - the checkin commentpublic void checkOut()
checkOut in interface VersionableDocumentcheckOut in class SQLDocumentLivepublic void restore(Document version)
VersionableDocumentrestore in interface VersionableDocumentrestore in class SQLDocumentLiveversion - the version to replace withpublic Document getVersion(String label)
VersionableDocumentgetVersion in interface VersionableDocumentgetVersion in class SQLDocumentLivelabel - the version labelpublic List<Document> getVersions()
getVersions in interface VersionableDocumentgetVersions in class SQLDocumentLivepublic boolean hasVersions()
VersionableDocumentNeeded to know if we need to use checkin/checkout methods when changing a document.
hasVersions in interface VersionableDocumenthasVersions in class SQLDocumentLivepublic Document getLastVersion()
VersionableDocumentgetLastVersion in interface VersionableDocumentgetLastVersion in class SQLDocumentLivepublic void importFlatMap(Map<String,Object> map)
PropertyContainerimportFlatMap in interface PropertyContainerimportFlatMap in class SQLComplexPropertypublic void importMap(Map<String,Map<String,Object>> map)
PropertyContainerThe property tree is recursively traversed and all property exported as entry of the Map.
importMap in interface PropertyContainerimportMap in class SQLComplexPropertypublic 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 PropertyContainersetPropertyValue in class SQLComplexPropertyname - the name of the property to setvalue - the value to setDocumentException - if any error occurspublic void setString(String name, String value) throws DocumentException
PropertyContainerIf 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 PropertyContainersetString in class SQLComplexPropertyDocumentException - if any error occursSimpleProperty#setString(String)}public void setBoolean(String name, boolean value) throws DocumentException
PropertyContainerIf 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 PropertyContainersetBoolean in class SQLComplexPropertyDocumentException - if any error occursSimpleProperty#setBoolean(boolean)}public void setLong(String name, long value)
PropertyContainerIf 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 PropertyContainersetLong in class SQLComplexPropertySimpleProperty#setLong(long)}public void setDouble(String name, double value)
PropertyContainerIf 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 PropertyContainersetDouble in class SQLComplexPropertySimpleProperty#setDouble(double)}public void setDate(String name, Calendar value)
PropertyContainerIf 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 PropertyContainersetDate in class SQLComplexPropertySimpleProperty#setDate(Calendar)}public void setContent(String name, Blob value)
PropertyContainerIf the property with that name doesn't exists, it will be created
setContent in interface PropertyContainersetContent in class SQLComplexPropertypublic void removeProperty(String name)
PropertyContainerremoveProperty in interface PropertyContainerremoveProperty in class SQLComplexPropertyname - the property to removepublic boolean equals(Object other)
equals in class SQLDocumentLivepublic int hashCode()
hashCode in class SQLDocumentLiveCopyright © 2011 Nuxeo SA. All Rights Reserved.