public class LifeCycleServiceImpl extends DefaultComponent implements LifeCycleService
LifeCycleService| Modifier and Type | Field and Description |
|---|---|
protected LifeCycleRegistry |
lifeCycles |
protected LifeCycleTypeRegistry |
lifeCycleTypes |
static ComponentName |
NAME |
lastModified, name| Constructor and Description |
|---|
LifeCycleServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
followTransition(Document doc,
String transitionName)
Follows a given transition.
|
LifeCycle |
getLifeCycleByName(String name)
Returns a life cycle given its name.
|
LifeCycle |
getLifeCycleFor(Document doc)
Returns the life cycle a given document follows.
|
String |
getLifeCycleNameFor(String typeName)
Returns the lifecycle name that the given type follows.
|
Collection<LifeCycle> |
getLifeCycles()
Returns all the registered life cycles.
|
List<String> |
getNonRecursiveTransitionForDocType(String docTypeName)
Returns a list of transition for which, when a it is followed, it should no recurse in its children.
|
Collection<String> |
getTypesFor(String lifeCycleName)
Returns the types which follow a given life cycle.
|
Map<String,String> |
getTypesMapping()
Returns the mapping from types to life cycle names.
|
void |
initialize(Document doc)
Initializes the life cycle for the given document.
|
void |
initialize(Document doc,
String initialStateName)
Initializes the life cycle for the given document.
|
void |
registerExtension(Extension extension)
Register extensions.
|
void |
reinitLifeCycle(Document doc)
Sets the current state to the initial state as defined by the associated lifecycle.
|
void |
unregisterExtension(Extension extension)
Unregisters an extension.
|
activate, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterContributionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplicationStarted, getApplicationStartedOrderpublic static final ComponentName NAME
protected LifeCycleRegistry lifeCycles
protected LifeCycleTypeRegistry lifeCycleTypes
public LifeCycleServiceImpl()
public LifeCycle getLifeCycleByName(String name)
LifeCycleServicegetLifeCycleByName in interface LifeCycleServicename - the life cycle's namepublic LifeCycle getLifeCycleFor(Document doc)
LifeCycleServicegetLifeCycleFor in interface LifeCycleServicedoc - the document instancepublic String getLifeCycleNameFor(String typeName)
LifeCycleServicegetLifeCycleNameFor in interface LifeCycleServicetypeName - the type's namepublic Collection<LifeCycle> getLifeCycles()
LifeCycleServicegetLifeCycles in interface LifeCycleServicepublic Collection<String> getTypesFor(String lifeCycleName)
LifeCycleServicegetTypesFor in interface LifeCycleServicelifeCycleName - a string holding the name of the life cyclepublic Map<String,String> getTypesMapping()
LifeCycleServicegetTypesMapping in interface LifeCycleServicepublic void initialize(Document doc) throws LifeCycleException
LifeCycleServiceDocument state will be set to the life cycle initial state.
initialize in interface LifeCycleServicedoc - the document instanceLifeCycleExceptionpublic void initialize(Document doc, String initialStateName) throws LifeCycleException
LifeCycleServiceTries to set given state on document, if it's a valid initial state.
initialize in interface LifeCycleServicedoc - the document instanceinitialStateName - the initial state nameLifeCycleExceptionpublic void followTransition(Document doc, String transitionName) throws LifeCycleException
LifeCycleServicefollowTransition in interface LifeCycleServicedoc - the Document instancetransitionName - the transition nameLifeCycleExceptionpublic void reinitLifeCycle(Document doc) throws LifeCycleException
LifeCycleServicereinitLifeCycle in interface LifeCycleServiceLifeCycleExceptionpublic void registerExtension(Extension extension)
registerExtension in interface ExtensibleregisterExtension in class DefaultComponentextension - the extension to registerpublic void unregisterExtension(Extension extension)
unregisterExtension in interface ExtensibleunregisterExtension in class DefaultComponentextension - the extension to unregisterpublic List<String> getNonRecursiveTransitionForDocType(String docTypeName)
LifeCycleServiceBulkLifeCycleChangeListener will listen to the transition taken event and call a follow transition on the
children of the document if the document is folderish. It check this list of transition to find out if it should
recurse.getNonRecursiveTransitionForDocType in interface LifeCycleServicedocTypeName - The doc typeBulkLifeCycleChangeListenerCopyright © 2019 Nuxeo. All rights reserved.