Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.core.versioning
Class StandardVersioningService

java.lang.Object
  extended by org.nuxeo.ecm.core.versioning.StandardVersioningService
All Implemented Interfaces:
VersioningService
Direct Known Subclasses:
CompatVersioningService

public class StandardVersioningService
extends java.lang.Object
implements VersioningService

Implementation of the versioning service that follows standard checkout / checkin semantics.


Field Summary
static java.lang.String APPROVED_STATE
           
static java.lang.String BACK_TO_PROJECT_TRANSITION
           
static java.lang.String FILE_TYPE
           
static java.lang.String NOTE_TYPE
           
static java.lang.String OBSOLETE_STATE
           
static java.lang.String PROJECT_STATE
           
 
Fields inherited from interface org.nuxeo.ecm.core.versioning.VersioningService
CHECKIN_COMMENT, MAJOR_VERSION_PROP, MINOR_VERSION_PROP, SKIP_VERSIONING, VERSIONING_OPTION
 
Constructor Summary
StandardVersioningService()
           
 
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 docModel)
          Checks what options are available on a document at save time.
 java.lang.String getVersionLabel(DocumentModel docModel)
          Gets the version label to display for a given document.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_TYPE

public static final java.lang.String FILE_TYPE
See Also:
Constant Field Values

NOTE_TYPE

public static final java.lang.String NOTE_TYPE
See Also:
Constant Field Values

PROJECT_STATE

public static final java.lang.String PROJECT_STATE
See Also:
Constant Field Values

APPROVED_STATE

public static final java.lang.String APPROVED_STATE
See Also:
Constant Field Values

OBSOLETE_STATE

public static final java.lang.String OBSOLETE_STATE
See Also:
Constant Field Values

BACK_TO_PROJECT_TRANSITION

public static final java.lang.String BACK_TO_PROJECT_TRANSITION
See Also:
Constant Field Values
Constructor Detail

StandardVersioningService

public StandardVersioningService()
Method Detail

getVersionLabel

public java.lang.String getVersionLabel(DocumentModel docModel)
Description copied from interface: VersioningService
Gets the version label to display for a given document.

Specified by:
getVersionLabel in interface VersioningService
Parameters:
docModel - the document
Returns:
the version label, like "2.1"

doPostCreate

public void doPostCreate(Document doc)
                  throws DocumentException
Description copied from interface: VersioningService
Applies versioning after document creation.

Specified by:
doPostCreate in interface VersioningService
Parameters:
doc - the document
Throws:
DocumentException

getSaveOptions

public java.util.List<VersioningOption> getSaveOptions(DocumentModel docModel)
                                                throws ClientException
Description copied from interface: VersioningService
Checks what options are available on a document at save time.

Specified by:
getSaveOptions in interface VersioningService
Parameters:
docModel - the document
Returns:
the options, the first being the default
Throws:
ClientException

doPreSave

public VersioningOption doPreSave(Document doc,
                                  boolean isDirty,
                                  VersioningOption option,
                                  java.lang.String checkinComment)
                           throws DocumentException
Description copied from interface: VersioningService
Applies versioning options before document save.

Specified by:
doPreSave in interface VersioningService
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

public void doPostSave(Document doc,
                       VersioningOption option,
                       java.lang.String checkinComment)
                throws DocumentException
Description copied from interface: VersioningService
Applies versioning options after document save.

Specified by:
doPostSave in interface VersioningService
Parameters:
doc - the document
option - an option chosen by the user or framework
checkinComment - a checkin comment
Throws:
DocumentException

doCheckIn

public Document doCheckIn(Document doc,
                          VersioningOption option,
                          java.lang.String checkinComment)
                   throws DocumentException
Description copied from interface: VersioningService
Applies version increment option and does a checkin.

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

doCheckOut

public void doCheckOut(Document doc)
                throws DocumentException
Description copied from interface: VersioningService
Apply modifications after doing a checkout.

Specified by:
doCheckOut in interface VersioningService
Parameters:
doc - the document
Throws:
DocumentException

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.