public class VersioningComponent extends DefaultComponent implements VersioningService
Modifier and Type | Class and Description |
---|---|
protected static class |
VersioningComponent.VersioningFilterRegistry |
protected static class |
VersioningComponent.VersioningPolicyRegistry |
protected static class |
VersioningComponent.VersioningRestrictionRegistry |
protected static class |
VersioningComponent.VersioningRuleRegistry
Deprecated.
since 9.1 use 'policy', 'filter' and 'restriction' contributions instead
|
lastModified
CHECKIN_COMMENT, DISABLE_AUTO_CHECKOUT, MAJOR_VERSION_PROP, MINOR_VERSION_PROP, SKIP_VERSIONING, VERSIONING_OPTION
Constructor and Description |
---|
VersioningComponent() |
getAdapter, getLastModified, registerExtension, setLastModified, setModifiedNow, start, stop, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted, getApplicationStartedOrder
public static final String VERSIONING_SERVICE_XP
public static final String VERSIONING_RULE_XP
public static final String VERSIONING_POLICY_XP
public static final String VERSIONING_FILTER_XP
public static final String VERSIONING_RESTRICTION_XP
protected static final StandardVersioningService STANDARD_VERSIONING_SERVICE
protected Map<VersioningServiceDescriptor,VersioningService> versioningServices
@Deprecated protected VersioningComponent.VersioningRuleRegistry versioningRulesRegistry
protected VersioningComponent.VersioningPolicyRegistry versioningPoliciesRegistry
protected VersioningComponent.VersioningFilterRegistry versioningFiltersRegistry
protected VersioningComponent.VersioningRestrictionRegistry versioningRestrictionsRegistry
@Deprecated protected Deque<DefaultVersioningRuleDescriptor> defaultVersioningRuleList
public VersioningService service
protected ComponentContext context
public VersioningComponent()
public void activate(ComponentContext context)
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextpublic void deactivate(ComponentContext context)
Component
This method is called by the runtime when a component is deactivated.
deactivate
in interface Component
deactivate
in class DefaultComponent
context
- the runtime contextpublic void registerContribution(Object contrib, String point, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public void unregisterContribution(Object contrib, String point, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
protected void registerVersioningService(VersioningServiceDescriptor contrib)
protected void unregisterVersioningService(VersioningServiceDescriptor contrib)
@Deprecated protected void registerVersioningRule(VersioningRuleDescriptor contrib)
@Deprecated protected void unregisterVersioningRule(VersioningRuleDescriptor contrib)
@Deprecated protected void registerDefaultVersioningRule(DefaultVersioningRuleDescriptor contrib)
@Deprecated protected void unregisterDefaultVersioningRule(DefaultVersioningRuleDescriptor contrib)
protected void registerVersioningPolicy(VersioningPolicyDescriptor contrib)
protected void unregisterVersioningPolicy(VersioningPolicyDescriptor contrib)
protected void registerVersioningFilter(VersioningFilterDescriptor contrib)
protected void unregisterVersioningFilter(VersioningFilterDescriptor contrib)
protected void registerVersioningRestriction(VersioningRestrictionDescriptor contrib)
protected void unregisterVersioningRestriction(VersioningRestrictionDescriptor contrib)
protected void recompute()
@Deprecated protected Map<String,VersioningRuleDescriptor> getVersioningRules()
@Deprecated protected DefaultVersioningRuleDescriptor getDefaultVersioningRule()
protected Map<String,VersioningPolicyDescriptor> getVersioningPolicies()
protected Map<String,VersioningFilterDescriptor> getVersioningFilters()
protected Map<String,VersioningRestrictionDescriptor> getVersioningRestrictions()
public String getVersionLabel(DocumentModel doc)
VersioningService
getVersionLabel
in interface VersioningService
doc
- the document"2.1"
public void doPostCreate(Document doc, Map<String,Serializable> options)
VersioningService
doPostCreate
in interface VersioningService
doc
- the documentoptions
- map event infopublic List<VersioningOption> getSaveOptions(DocumentModel docModel)
VersioningService
getSaveOptions
in interface VersioningService
docModel
- the documentpublic boolean isPreSaveDoingCheckOut(Document doc, boolean isDirty, VersioningOption option, Map<String,Serializable> options)
VersioningService
VersioningService.doPreSave(org.nuxeo.ecm.core.api.CoreSession, 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.api.CoreSession, 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(CoreSession session, Document doc, boolean isDirty, VersioningOption option, String checkinComment, Map<String,Serializable> options)
VersioningService
doPreSave
in interface VersioningService
session
- the core sessiondoc
- the documentisDirty
- true
if there is actual data to saveoption
- an option chosen by the user or frameworkcheckinComment
- a checkin commentoptions
- map event infopublic boolean isPostSaveDoingCheckIn(Document doc, VersioningOption option, Map<String,Serializable> options)
VersioningService
VersioningService.doPostSave(org.nuxeo.ecm.core.api.CoreSession, 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.api.CoreSession, 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(CoreSession session, Document doc, VersioningOption option, String checkinComment, Map<String,Serializable> options)
VersioningService
doPostSave
in interface VersioningService
session
- the core sessiondoc
- the documentoption
- an option chosen by the user or frameworkcheckinComment
- a checkin commentoptions
- map event infopublic Document doCheckIn(Document doc, VersioningOption option, String checkinComment)
VersioningService
doCheckIn
in interface VersioningService
doc
- the documentoption
- an option chosen by the user or frameworkcheckinComment
- a checkin commentpublic void doCheckOut(Document doc)
VersioningService
doCheckOut
in interface VersioningService
doc
- the documentpublic void doAutomaticVersioning(DocumentModel previousDocument, DocumentModel currentDocument, boolean before)
VersioningService
doAutomaticVersioning
in interface VersioningService
before
- the flag to trigger a before or after automatic versioning (used to retrieve the right policy)Copyright © 2018 Nuxeo. All rights reserved.