Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.core.versioning
Interface VersioningService

All Known Subinterfaces:
VersioningServiceLocal
All Known Implementing Classes:
CompatVersioningService, StandardVersioningService, VersioningComponent, VersioningServiceBean

public interface VersioningService

The versioning service holds the versioning policy used to define what happens to a document's version when it is created, saved, checked in, checked out or restored, and what version increment options (none, minor, major) are made available to the user.

Since:
5.4

Field Summary
static java.lang.String CHECKIN_COMMENT
          Context data to provide a checkin comment for operations that potentially check in (save, publish, checkin).
static java.lang.String MAJOR_VERSION_PROP
          Document property in which the major version is stored.
static java.lang.String MINOR_VERSION_PROP
          Document property in which the minor version is stored.
static java.lang.String SKIP_VERSIONING
          Context data that can be used to skip versioning on document creation, in case the supplied version is enough.
static java.lang.String VERSIONING_OPTION
          Context data to provide a user-level choice to the versioning policy.
 
Method Summary
 Document doCheckIn(Document doc, VersioningOption option, java.lang.String checkinComment)
          Applies version increment option and does a checkin.
 void doCheckOut(Document doc)
          Apply modifications after doing a checkout.
 void doPostCreate(Document doc)
          Applies versioning after document creation.
 void doPostSave(Document doc, VersioningOption option, java.lang.String checkinComment)
          Applies versioning options after document save.
 VersioningOption doPreSave(Document doc, boolean isDirty, VersioningOption option, java.lang.String checkinComment)
          Applies versioning options before document save.
 java.util.List<VersioningOption> getSaveOptions(DocumentModel doc)
          Checks what options are available on a document at save time.
 java.lang.String getVersionLabel(DocumentModel doc)
          Gets the version label to display for a given document.
 

Field Detail

MAJOR_VERSION_PROP

static final java.lang.String MAJOR_VERSION_PROP
Document property in which the major version is stored.

See Also:
Constant Field Values

MINOR_VERSION_PROP

static final java.lang.String MINOR_VERSION_PROP
Document property in which the minor version is stored.

See Also:
Constant Field Values

SKIP_VERSIONING

static final java.lang.String SKIP_VERSIONING
Context data that can be used to skip versioning on document creation, in case the supplied version is enough.

See Also:
Constant Field Values

VERSIONING_OPTION

static final java.lang.String VERSIONING_OPTION
Context data to provide a user-level choice to the versioning policy. Value is a VersioningOption.

See Also:
Constant Field Values

CHECKIN_COMMENT

static final java.lang.String CHECKIN_COMMENT
Context data to provide a checkin comment for operations that potentially check in (save, publish, checkin).

See Also:
Constant Field Values
Method Detail

getVersionLabel

java.lang.String getVersionLabel(DocumentModel doc)
Gets the version label to display for a given document.

Parameters:
doc - the document
Returns:
the version label, like "2.1"

getSaveOptions

java.util.List<VersioningOption> getSaveOptions(DocumentModel doc)
                                                throws ClientException
Checks what options are available on a document at save time.

Parameters:
doc - the document
Returns:
the options, the first being the default
Throws:
ClientException

doPostCreate

void doPostCreate(Document doc)
                  throws DocumentException
Applies versioning after document creation.

Parameters:
doc - the document
Throws:
DocumentException

doPreSave

VersioningOption doPreSave(Document doc,
                           boolean isDirty,
                           VersioningOption option,
                           java.lang.String checkinComment)
                           throws DocumentException
Applies versioning options before document save.

Parameters:
doc - the document
isDirty - true if there is actual data to save
option - an option chosen by the user or framework
checkinComment - a checkin comment
Returns:
the validated option (to use in doPostSave)
Throws:
DocumentException

doPostSave

void doPostSave(Document doc,
                VersioningOption option,
                java.lang.String checkinComment)
                throws DocumentException
Applies versioning options after document save.

Parameters:
doc - the document
option - an option chosen by the user or framework
checkinComment - a checkin comment
Throws:
DocumentException

doCheckIn

Document doCheckIn(Document doc,
                   VersioningOption option,
                   java.lang.String checkinComment)
                   throws DocumentException
Applies version increment option and does a checkin.

Parameters:
doc - the document
option - an option chosen by the user or framework
checkinComment - a checkin comment
Returns:
the version
Throws:
DocumentException

doCheckOut

void doCheckOut(Document doc)
                throws DocumentException
Apply modifications after doing a checkout.

Parameters:
doc - the document
Throws:
DocumentException

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.