Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.versioning
Class CompatVersioningService

java.lang.Object
  extended by org.nuxeo.ecm.core.versioning.StandardVersioningService
      extended by org.nuxeo.ecm.core.versioning.CompatVersioningService
All Implemented Interfaces:
ExtendableVersioningService, VersioningService

public class CompatVersioningService
extends StandardVersioningService

Compatibility implementation of the versioning service in Nuxeo.


Field Summary
 
Fields inherited from class org.nuxeo.ecm.core.versioning.StandardVersioningService
APPROVED_STATE, BACK_TO_PROJECT_TRANSITION, FILE_TYPE, NOTE_TYPE, OBSOLETE_STATE, 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
CompatVersioningService()
           
 
Method Summary
 Document doCheckIn(Document doc, VersioningOption option, String checkinComment)
          Applies version increment option and does a checkin.
 void doCheckOut(Document doc)
          Apply modifications after doing a checkout.
 Document doPostSave(Document doc, VersioningOption option, String checkinComment, Map<String,Serializable> options)
          Applies versioning options after document save.
 VersioningOption doPreSave(Document doc, boolean isDirty, VersioningOption option, String checkinComment, Map<String,Serializable> options)
          Applies versioning options before document save.
 String getVersionLabel(DocumentModel doc)
          Gets the version label to display for a given document.
 
Methods inherited from class org.nuxeo.ecm.core.versioning.StandardVersioningService
doPostCreate, getSaveOptions, getVersioningRules, setDefaultVersioningRule, setVersioningRules
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompatVersioningService

public CompatVersioningService()
Method Detail

getVersionLabel

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

Specified by:
getVersionLabel in interface VersioningService
Overrides:
getVersionLabel in class StandardVersioningService
Parameters:
doc - the document
Returns:
the version label, like "2.1"

doPreSave

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

Specified by:
doPreSave in interface VersioningService
Overrides:
doPreSave in class StandardVersioningService
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 Document doPostSave(Document doc,
                           VersioningOption option,
                           String checkinComment,
                           Map<String,Serializable> options)
                    throws DocumentException
Description copied from interface: VersioningService
Applies versioning options after document save. If a new version is checked in during the operation, the document for this version is returned to the caller.

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

doCheckIn

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

Specified by:
doCheckIn in interface VersioningService
Overrides:
doCheckIn in class StandardVersioningService
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
Overrides:
doCheckOut in class StandardVersioningService
Parameters:
doc - the document
Throws:
DocumentException

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.