public interface VersioningService
Modifier and Type | Field and Description |
---|---|
static String |
CHECKIN_COMMENT
Context data to provide a checkin comment for operations that potentially check in (save, publish, checkin).
|
static String |
DISABLE_AUTO_CHECKOUT
Context data to disable auto-checkout of checked-in documents at pre-save time.
|
static String |
MAJOR_VERSION_PROP
Document property in which the major version is stored.
|
static String |
MINOR_VERSION_PROP
Document property in which the minor version is stored.
|
static String |
SKIP_VERSIONING
Context data that can be used to skip versioning on document creation, in case the supplied version is enough.
|
static String |
VERSIONING_OPTION
Context data to provide a user-level choice to the versioning policy.
|
Modifier and Type | Method and Description |
---|---|
void |
doAutomaticVersioning(DocumentModel previousDocument,
DocumentModel currentDocument,
boolean before)
Does automatic versioning if a policy exists for the current input context.
|
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.
|
void |
doPostCreate(Document doc,
Map<String,Serializable> options)
Applies versioning after document creation.
|
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.
|
List<VersioningOption> |
getSaveOptions(DocumentModel doc)
Checks what options are available on a document at save time.
|
String |
getVersionLabel(DocumentModel doc)
Gets the version label to display for a given document.
|
boolean |
isPostSaveDoingCheckIn(Document doc,
VersioningOption option,
Map<String,Serializable> options)
Checks if
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. |
boolean |
isPreSaveDoingCheckOut(Document doc,
boolean isDirty,
VersioningOption option,
Map<String,Serializable> options)
Checks if
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. |
static final String MAJOR_VERSION_PROP
static final String MINOR_VERSION_PROP
static final String SKIP_VERSIONING
static final String VERSIONING_OPTION
VersioningOption
.static final String DISABLE_AUTO_CHECKOUT
Boolean
.static final String CHECKIN_COMMENT
String getVersionLabel(DocumentModel doc)
doc
- the document"2.1"
List<VersioningOption> getSaveOptions(DocumentModel doc)
doc
- the documentvoid doPostCreate(Document doc, Map<String,Serializable> options)
doc
- the documentoptions
- map event infoboolean isPreSaveDoingCheckOut(Document doc, boolean isDirty, VersioningOption option, Map<String,Serializable> options)
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.
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 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 checkoutVersioningOption doPreSave(Document doc, boolean isDirty, VersioningOption option, String checkinComment, Map<String,Serializable> options)
doc
- the documentisDirty
- true
if there is actual data to saveoption
- an option chosen by the user or frameworkcheckinComment
- a checkin commentoptions
- map event infoboolean isPostSaveDoingCheckIn(Document doc, VersioningOption option, Map<String,Serializable> options)
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.doc
- the documentoption
- an option chosen by the user or frameworkoptions
- map event infotrue
if 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 checkinDocument doPostSave(Document doc, VersioningOption option, String checkinComment, Map<String,Serializable> options)
doc
- the documentoption
- an option chosen by the user or frameworkcheckinComment
- a checkin commentoptions
- map event infoDocument doCheckIn(Document doc, VersioningOption option, String checkinComment)
doc
- the documentoption
- an option chosen by the user or frameworkcheckinComment
- a checkin commentvoid doCheckOut(Document doc)
doc
- the documentvoid doAutomaticVersioning(DocumentModel previousDocument, DocumentModel currentDocument, boolean before)
before
- the flag to trigger a before or after automatic versioning (used to retrieve the right policy)Copyright © 2017 Nuxeo. All rights reserved.