public class VersioningComponent extends DefaultComponent implements VersioningService
| Modifier and Type | Class and Description |
|---|---|
protected static class |
VersioningComponent.VersioningRuleRegistry |
| Modifier and Type | Field and Description |
|---|---|
protected ComponentContext |
context |
protected Deque<DefaultVersioningRuleDescriptor> |
defaultVersioningRuleList |
VersioningService |
service |
protected static StandardVersioningService |
STANDARD_VERSIONING_SERVICE |
static String |
VERSIONING_RULE_XP |
static String |
VERSIONING_SERVICE_XP |
protected VersioningComponent.VersioningRuleRegistry |
versioningRulesRegistry |
protected Map<VersioningServiceDescriptor,VersioningService> |
versioningServices |
lastModifiedCHECKIN_COMMENT, DISABLE_AUTO_CHECKOUT, MAJOR_VERSION_PROP, MINOR_VERSION_PROP, SKIP_VERSIONING, VERSIONING_OPTION| Constructor and Description |
|---|
VersioningComponent() |
applicationStarted, getAdapter, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, setModifiedNow, unregisterExtensionpublic static final String VERSIONING_SERVICE_XP
public static final String VERSIONING_RULE_XP
protected static final StandardVersioningService STANDARD_VERSIONING_SERVICE
protected Map<VersioningServiceDescriptor,VersioningService> versioningServices
protected VersioningComponent.VersioningRuleRegistry versioningRulesRegistry
protected Deque<DefaultVersioningRuleDescriptor> defaultVersioningRuleList
public VersioningService service
protected ComponentContext context
public VersioningComponent()
public void activate(ComponentContext context)
ComponentThis method is called by the runtime when a component is activated.
activate in interface Componentactivate in class DefaultComponentcontext - the runtime contextpublic void deactivate(ComponentContext context)
ComponentThis method is called by the runtime when a component is deactivated.
deactivate in interface Componentdeactivate in class DefaultComponentcontext - the runtime contextpublic void registerContribution(Object contrib, String point, ComponentInstance contributor)
registerContribution in class DefaultComponentpublic void unregisterContribution(Object contrib, String point, ComponentInstance contributor)
unregisterContribution in class DefaultComponentprotected void registerVersioningService(VersioningServiceDescriptor contrib)
protected void unregisterVersioningService(VersioningServiceDescriptor contrib)
protected void registerVersioningRule(VersioningRuleDescriptor contrib)
protected void unregisterVersioningRule(VersioningRuleDescriptor contrib)
protected void registerDefaultVersioningRule(DefaultVersioningRuleDescriptor contrib)
protected void unregisterDefaultVersioningRule(DefaultVersioningRuleDescriptor contrib)
protected void recompute()
protected Map<String,VersioningRuleDescriptor> getVersioningRules()
protected DefaultVersioningRuleDescriptor getDefaultVersioningRule()
public String getVersionLabel(DocumentModel doc)
VersioningServicegetVersionLabel in interface VersioningServicedoc - the document"2.1"public void doPostCreate(Document doc, Map<String,Serializable> options)
VersioningServicedoPostCreate in interface VersioningServicedoc - the documentpublic List<VersioningOption> getSaveOptions(DocumentModel docModel)
VersioningServicegetSaveOptions in interface VersioningServicedocModel - the documentpublic boolean isPreSaveDoingCheckOut(Document doc, boolean isDirty, VersioningOption option, Map<String,Serializable> options)
VersioningServiceVersioningService.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 VersioningServicedoc - 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 checkoutpublic VersioningOption doPreSave(Document doc, boolean isDirty, VersioningOption option, String checkinComment, Map<String,Serializable> options)
VersioningServicedoPreSave in interface VersioningServicedoc - the documentisDirty - true if there is actual data to saveoption - an option chosen by the user or frameworkcheckinComment - a checkin commentpublic boolean isPostSaveDoingCheckIn(Document doc, VersioningOption option, Map<String,Serializable> options)
VersioningServiceVersioningService.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 VersioningServicedoc - 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 checkinpublic Document doPostSave(Document doc, VersioningOption option, String checkinComment, Map<String,Serializable> options)
VersioningServicedoPostSave in interface VersioningServicedoc - the documentoption - an option chosen by the user or frameworkcheckinComment - a checkin commentpublic Document doCheckIn(Document doc, VersioningOption option, String checkinComment)
VersioningServicedoCheckIn in interface VersioningServicedoc - the documentoption - an option chosen by the user or frameworkcheckinComment - a checkin commentpublic void doCheckOut(Document doc)
VersioningServicedoCheckOut in interface VersioningServicedoc - the documentCopyright © 2015 Nuxeo SA. All rights reserved.