Package org.nuxeo.ecm.core.lifecycle
Interface LifeCycleService
- All Known Implementing Classes:
LifeCycleServiceImpl
public interface LifeCycleService
Life cycle service.
- Author:
- Julien Anguenot, Florent Guillaume
- See Also:
-
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
reinitLifeCycle
(Document doc) Sets the current state to the initial state as defined by the associated lifecycle.
-
Method Details
-
initialize
Initializes the life cycle for the given document.Document state will be set to the life cycle initial state.
- Parameters:
doc
- the document instance- Throws:
LifeCycleException
-
initialize
Initializes the life cycle for the given document.Tries to set given state on document, if it's a valid initial state.
- Parameters:
doc
- the document instanceinitialStateName
- the initial state name- Throws:
LifeCycleException
-
followTransition
Follows a given transition.- Parameters:
doc
- the Document instancetransitionName
- the transition name- Throws:
LifeCycleException
-
getLifeCycleByName
Returns a life cycle given its name.- Parameters:
name
- the life cycle's name- Returns:
- a life cycle descriptor instance or null if not found.
-
getLifeCycles
Collection<LifeCycle> getLifeCycles()Returns all the registered life cycles.- Returns:
- a collection of lifecycle descriptors
-
getTypesFor
Returns the types which follow a given life cycle.- Parameters:
lifeCycleName
- a string holding the name of the life cycle- Returns:
- a collection of type names as strings
-
getLifeCycleNameFor
Returns the lifecycle name that the given type follows.- Parameters:
typeName
- the type's name- Returns:
- the life cycle name
-
getNonRecursiveTransitionForDocType
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.- Parameters:
docTypeName
- The doc type- Returns:
- a list of transition name
- See Also:
-
getTypesMapping
Returns the mapping from types to life cycle names.- Returns:
- a mapping from types to life cycle names
-
getLifeCycleFor
Returns the life cycle a given document follows.- Parameters:
doc
- the document instance- Returns:
- the life cycle instance
-
reinitLifeCycle
Sets the current state to the initial state as defined by the associated lifecycle.- Throws:
LifeCycleException
-