Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.versioning
Interface VersionableDocument

All Known Subinterfaces:
Document, DocumentProxy, SQLDocument
All Known Implementing Classes:
AbstractDocument, MockDocument, SQLDocumentLive, SQLDocumentProxy, SQLDocumentVersion

public interface VersionableDocument

Author:
Eugen Ionica

Method Summary
 Document checkIn(String label, String checkinComment)
          Creates a new version.
 void checkOut()
           
 Document getBaseVersion()
          Gets the version to which a checked in document is linked.
 String getCheckinComment()
           
 Document getLastVersion()
          Gets the last version 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.
 Calendar getVersionCreationDate()
           
 String getVersionLabel()
           
 List<Document> getVersions()
           
 String getVersionSeriesId()
          Gets the version series id.
 List<String> getVersionsIds()
          Gets the list of version ids for this document.
 Document getWorkingCopy()
           
 boolean hasVersions()
          Tells the caller if this document has versions or not.
 boolean isCheckedOut()
           
 boolean isLatestMajorVersion()
           
 boolean isLatestVersion()
           
 boolean isMajorVersion()
           
 boolean isVersion()
          Checks whether or not this doc is a version document.
 boolean isVersionSeriesCheckedOut()
           
 void restore(Document version)
          Replaces current version with version specified.
 

Method Detail

checkIn

Document checkIn(String label,
                 String checkinComment)
                 throws DocumentException
Creates a new version.

Parameters:
label - the version label
checkinComment - the checkin comment
Returns:
the created version
Throws:
DocumentException

checkOut

void checkOut()
              throws DocumentException
Throws:
DocumentException

getVersionsIds

List<String> getVersionsIds()
                            throws DocumentException
Gets the list of version ids for this document.

Returns:
the list of version ids
Throws:
DocumentException
Since:
1.4.1

getVersions

List<Document> getVersions()
                           throws DocumentException
Returns:
all versions of the document, empty list if there's no version
Throws:
DocumentException

getLastVersion

Document getLastVersion()
                        throws DocumentException
Gets the last version of this document.

Returns:
the last version
Throws:
DocumentException

getSourceDocument

Document getSourceDocument()
                           throws DocumentException
Gets the head ("live") version of this document.

Returns:
Throws:
DocumentException

restore

void restore(Document version)
             throws DocumentException
Replaces current version with version specified.

Parameters:
version - the version to replace with
Throws:
DocumentException

getVersion

Document getVersion(String label)
                    throws DocumentException
Gets a version of this document, given its label.

Parameters:
label - the version label
Returns:
the version
Throws:
DocumentException

hasVersions

boolean hasVersions()
                    throws DocumentException
Tells the caller if this document has versions or not.

Needed to know if we need to use checkin/checkout methods when changing a document.

Returns:
true if there are versions
Throws:
DocumentException

isVersion

boolean isVersion()
Checks whether or not this doc is a version document.

Returns:
true if it's a version, false otherwise

getBaseVersion

Document getBaseVersion()
                        throws DocumentException
Gets the version to which a checked in document is linked.

Returns null for a checked out document or a version or a proxy.

Returns:
the version, or null
Throws:
DocumentException

isCheckedOut

boolean isCheckedOut()
                     throws DocumentException
Throws:
DocumentException

getVersionCreationDate

Calendar getVersionCreationDate()
                                throws DocumentException
Throws:
DocumentException

getVersionSeriesId

String getVersionSeriesId()
                          throws DocumentException
Gets the version series id.

Returns:
the version series id
Throws:
DocumentException

getVersionLabel

String getVersionLabel()
                       throws DocumentException
Throws:
DocumentException

isLatestVersion

boolean isLatestVersion()
                        throws DocumentException
Throws:
DocumentException

isMajorVersion

boolean isMajorVersion()
                       throws DocumentException
Throws:
DocumentException

isLatestMajorVersion

boolean isLatestMajorVersion()
                             throws DocumentException
Throws:
DocumentException

isVersionSeriesCheckedOut

boolean isVersionSeriesCheckedOut()
                                  throws DocumentException
Throws:
DocumentException

getWorkingCopy

Document getWorkingCopy()
                        throws DocumentException
Throws:
DocumentException

getCheckinComment

String getCheckinComment()
                         throws DocumentException
Throws:
DocumentException

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.