public class StandardVersioningService extends Object implements ExtendableVersioningService
Modifier and Type | Field and Description |
---|---|
static String |
APPROVED_STATE |
static String |
BACK_TO_PROJECT_TRANSITION |
static String |
FILE_TYPE |
static String |
NOTE_TYPE |
static String |
OBSOLETE_STATE |
static String |
PROJECT_STATE |
CHECKIN_COMMENT, DISABLE_AUTO_CHECKOUT, MAJOR_VERSION_PROP, MINOR_VERSION_PROP, SKIP_VERSIONING, VERSIONING_OPTION
Constructor and Description |
---|
StandardVersioningService() |
public static final String FILE_TYPE
public static final String NOTE_TYPE
public static final String PROJECT_STATE
public static final String APPROVED_STATE
public static final String OBSOLETE_STATE
public static final String BACK_TO_PROJECT_TRANSITION
public String getVersionLabel(DocumentModel docModel)
VersioningService
getVersionLabel
in interface VersioningService
docModel
- the document"2.1"
public void doPostCreate(Document doc, Map<String,Serializable> options)
VersioningService
doPostCreate
in interface VersioningService
doc
- the documentpublic List<VersioningOption> getSaveOptions(DocumentModel docModel) throws ClientException
VersioningService
getSaveOptions
in interface VersioningService
docModel
- the documentClientException
public boolean isPreSaveDoingCheckOut(Document doc, boolean isDirty, VersioningOption option, Map<String,Serializable> options) throws DocumentException
VersioningService
VersioningService.doPreSave(org.nuxeo.ecm.core.model.Document, boolean, org.nuxeo.ecm.core.api.VersioningOption, java.lang.String, java.util.Map<java.lang.String, java.io.Serializable>)
will do a checkout when called with the same arguments.
Needed to be able to send "about to checkin" events.
isPreSaveDoingCheckOut
in interface VersioningService
doc
- the documentisDirty
- true
if there is actual data to saveoption
- an option chosen by the user or frameworkoptions
- map event info and optionstrue
if VersioningService.doPreSave(org.nuxeo.ecm.core.model.Document, boolean, org.nuxeo.ecm.core.api.VersioningOption, java.lang.String, java.util.Map<java.lang.String, java.io.Serializable>)
will do a checkoutDocumentException
public VersioningOption doPreSave(Document doc, boolean isDirty, VersioningOption option, String checkinComment, Map<String,Serializable> options) throws DocumentException
VersioningService
doPreSave
in interface VersioningService
doc
- the documentisDirty
- true
if there is actual data to saveoption
- an option chosen by the user or frameworkcheckinComment
- a checkin commentDocumentException
public boolean isPostSaveDoingCheckIn(Document doc, VersioningOption option, Map<String,Serializable> options) throws DocumentException
VersioningService
VersioningService.doPostSave(org.nuxeo.ecm.core.model.Document, org.nuxeo.ecm.core.api.VersioningOption, java.lang.String, java.util.Map<java.lang.String, java.io.Serializable>)
will do a checkin when called with the same arguments.isPostSaveDoingCheckIn
in interface VersioningService
doc
- the documentoption
- an option chosen by the user or frameworkoptions
- map event infotrue
if VersioningService.doPostSave(org.nuxeo.ecm.core.model.Document, org.nuxeo.ecm.core.api.VersioningOption, java.lang.String, java.util.Map<java.lang.String, java.io.Serializable>)
will do a checkinDocumentException
public Document doPostSave(Document doc, VersioningOption option, String checkinComment, Map<String,Serializable> options) throws DocumentException
VersioningService
doPostSave
in interface VersioningService
doc
- the documentoption
- an option chosen by the user or frameworkcheckinComment
- a checkin commentDocumentException
public Document doCheckIn(Document doc, VersioningOption option, String checkinComment) throws DocumentException
VersioningService
doCheckIn
in interface VersioningService
doc
- the documentoption
- an option chosen by the user or frameworkcheckinComment
- a checkin commentDocumentException
public void doCheckOut(Document doc) throws DocumentException
VersioningService
doCheckOut
in interface VersioningService
doc
- the documentDocumentException
public Map<String,VersioningRuleDescriptor> getVersioningRules()
getVersioningRules
in interface ExtendableVersioningService
public void setVersioningRules(Map<String,VersioningRuleDescriptor> versioningRules)
ExtendableVersioningService
setVersioningRules
in interface ExtendableVersioningService
public void setDefaultVersioningRule(DefaultVersioningRuleDescriptor defaultVersioningRule)
ExtendableVersioningService
setDefaultVersioningRule
in interface ExtendableVersioningService
Copyright © 2015 Nuxeo SA. All rights reserved.