Class LifeCycleServiceImpl
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.ecm.core.lifecycle.impl.LifeCycleServiceImpl
- All Implemented Interfaces:
LifeCycleService
,Adaptable
,Component
,Extensible
,TimestampedService
Life cycle service implementation.
- Author:
- Julien Anguenot, Florent Guillaume
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected LifeCycleRegistry
protected LifeCycleTypeRegistry
static final ComponentName
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
followTransition
(Document doc, String transitionName) Follows a given transition.getLifeCycleByName
(String name) Returns a life cycle given its name.getLifeCycleFor
(Document doc) Returns the life cycle a given document follows.getLifeCycleNameFor
(String typeName) Returns the lifecycle name that the given type follows.Returns all the registered life cycles.getNonRecursiveTransitionForDocType
(String docTypeName) Returns a list of transition for which, when a it is followed, it should no recurse in its children.getTypesFor
(String lifeCycleName) Returns the types which follow a given life cycle.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.Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterContribution
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.runtime.model.Component
getApplicationStartedOrder
-
Field Details
-
NAME
-
lifeCycles
-
lifeCycleTypes
-
-
Constructor Details
-
LifeCycleServiceImpl
public LifeCycleServiceImpl()
-
-
Method Details
-
getLifeCycleByName
Description copied from interface:LifeCycleService
Returns a life cycle given its name.- Specified by:
getLifeCycleByName
in interfaceLifeCycleService
- Parameters:
name
- the life cycle's name- Returns:
- a life cycle descriptor instance or null if not found.
-
getLifeCycleFor
Description copied from interface:LifeCycleService
Returns the life cycle a given document follows.- Specified by:
getLifeCycleFor
in interfaceLifeCycleService
- Parameters:
doc
- the document instance- Returns:
- the life cycle instance
-
getLifeCycleNameFor
Description copied from interface:LifeCycleService
Returns the lifecycle name that the given type follows.- Specified by:
getLifeCycleNameFor
in interfaceLifeCycleService
- Parameters:
typeName
- the type's name- Returns:
- the life cycle name
-
getLifeCycles
Description copied from interface:LifeCycleService
Returns all the registered life cycles.- Specified by:
getLifeCycles
in interfaceLifeCycleService
- Returns:
- a collection of lifecycle descriptors
-
getTypesFor
Description copied from interface:LifeCycleService
Returns the types which follow a given life cycle.- Specified by:
getTypesFor
in interfaceLifeCycleService
- Parameters:
lifeCycleName
- a string holding the name of the life cycle- Returns:
- a collection of type names as strings
-
getTypesMapping
Description copied from interface:LifeCycleService
Returns the mapping from types to life cycle names.- Specified by:
getTypesMapping
in interfaceLifeCycleService
- Returns:
- a mapping from types to life cycle names
-
initialize
Description copied from interface:LifeCycleService
Initializes the life cycle for the given document.Document state will be set to the life cycle initial state.
- Specified by:
initialize
in interfaceLifeCycleService
- Parameters:
doc
- the document instance- Throws:
LifeCycleException
-
initialize
Description copied from interface:LifeCycleService
Initializes the life cycle for the given document.Tries to set given state on document, if it's a valid initial state.
- Specified by:
initialize
in interfaceLifeCycleService
- Parameters:
doc
- the document instanceinitialStateName
- the initial state name- Throws:
LifeCycleException
-
followTransition
Description copied from interface:LifeCycleService
Follows a given transition.- Specified by:
followTransition
in interfaceLifeCycleService
- Parameters:
doc
- the Document instancetransitionName
- the transition name- Throws:
LifeCycleException
-
reinitLifeCycle
Description copied from interface:LifeCycleService
Sets the current state to the initial state as defined by the associated lifecycle.- Specified by:
reinitLifeCycle
in interfaceLifeCycleService
- Throws:
LifeCycleException
-
registerExtension
Register extensions.- Specified by:
registerExtension
in interfaceExtensible
- Overrides:
registerExtension
in classDefaultComponent
- Parameters:
extension
- the extension to register
-
unregisterExtension
Unregisters an extension.- Specified by:
unregisterExtension
in interfaceExtensible
- Overrides:
unregisterExtension
in classDefaultComponent
- Parameters:
extension
- the extension to unregister
-
getNonRecursiveTransitionForDocType
Description copied from interface:LifeCycleService
Returns a list of transition for which, when a it is followed, it should no recurse in its children. TheBulkLifeCycleChangeListener
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.- Specified by:
getNonRecursiveTransitionForDocType
in interfaceLifeCycleService
- Parameters:
docTypeName
- The doc type- Returns:
- a list of transition name
- See Also:
-