Interface LifeCycleService

All Known Implementing Classes:
LifeCycleServiceImpl

public interface LifeCycleService
Life cycle service.
Author:
Julien Anguenot, Florent Guillaume
See Also:
  • Method Details

    • initialize

      void initialize(Document doc) throws LifeCycleException
      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

      void initialize(Document doc, String initialStateName) throws LifeCycleException
      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 instance
      initialStateName - the initial state name
      Throws:
      LifeCycleException
    • followTransition

      void followTransition(Document doc, String transitionName) throws LifeCycleException
      Follows a given transition.
      Parameters:
      doc - the Document instance
      transitionName - the transition name
      Throws:
      LifeCycleException
    • getLifeCycleByName

      LifeCycle getLifeCycleByName(String name)
      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

      Collection<String> getTypesFor(String lifeCycleName)
      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

      String getLifeCycleNameFor(String typeName)
      Returns the lifecycle name that the given type follows.
      Parameters:
      typeName - the type's name
      Returns:
      the life cycle name
    • getNonRecursiveTransitionForDocType

      List<String> getNonRecursiveTransitionForDocType(String docTypeName)
      Returns a list of transition for which, when a it is followed, it should no recurse in its children. The BulkLifeCycleChangeListener 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

      Map<String,String> getTypesMapping()
      Returns the mapping from types to life cycle names.
      Returns:
      a mapping from types to life cycle names
    • getLifeCycleFor

      LifeCycle getLifeCycleFor(Document doc)
      Returns the life cycle a given document follows.
      Parameters:
      doc - the document instance
      Returns:
      the life cycle instance
    • reinitLifeCycle

      void reinitLifeCycle(Document doc) throws LifeCycleException
      Sets the current state to the initial state as defined by the associated lifecycle.
      Throws:
      LifeCycleException