Interface LifeCycleService

    • Method Detail

      • 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
      • 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:
        BulkLifeCycleChangeListener
      • 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