Class BulkLifeCycleChangeListener
- java.lang.Object
-
- org.nuxeo.ecm.core.lifecycle.event.BulkLifeCycleChangeListener
-
- All Implemented Interfaces:
PostCommitEventListener
public class BulkLifeCycleChangeListener extends Object implements PostCommitEventListener
Listener for life cycle change events.If event occurs on a folder, it will recurse on children to perform the same transition if possible.
If the transition event is about marking documents as "deleted", and a child cannot perform the transition, it will be removed.
Undelete transitions are not processed, but this listener instead looks for a specific documentUndeleted event. This is because we want to undelete documents (parents) under which we don't want to recurse.
Reinit document copy lifeCycle (BulkLifeCycleChangeListener is bound to the event documentCreatedByCopy)
-
-
Field Summary
Fields Modifier and Type Field Description static String
GET_CHILDREN_PAGE_SIZE_PROPERTY
static String
PAGINATE_GET_CHILDREN_PROPERTY
-
Constructor Summary
Constructors Constructor Description BulkLifeCycleChangeListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
changeChildrenState(CoreSession session, String transition, String targetState, DocumentModel doc)
protected void
changeDocumentsState(CoreSession session, String transition, String targetState, DocumentModelList docs)
Change doc state.void
handleEvent(EventBundle events)
Handles the set of events that were raised during the life of an user operation.protected boolean
isNonRecursiveTransition(String transition, String type)
protected void
processTransition(Event event)
protected void
reinitDocumentsLifeCyle(CoreSession documentManager, DocumentModelList docs)
-
-
-
Field Detail
-
PAGINATE_GET_CHILDREN_PROPERTY
public static final String PAGINATE_GET_CHILDREN_PROPERTY
- Since:
- 8.10-HF05 9.2
- See Also:
- Constant Field Values
-
GET_CHILDREN_PAGE_SIZE_PROPERTY
public static final String GET_CHILDREN_PAGE_SIZE_PROPERTY
- Since:
- 8.10-HF05 9.2
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BulkLifeCycleChangeListener
public BulkLifeCycleChangeListener()
-
-
Method Detail
-
handleEvent
public void handleEvent(EventBundle events)
Description copied from interface:PostCommitEventListener
Handles the set of events that were raised during the life of an user operation.The events are fired as a
BundleEvent
after the transaction is committed.- Specified by:
handleEvent
in interfacePostCommitEventListener
- Parameters:
events
- the events to handle
-
processTransition
protected void processTransition(Event event)
-
reinitDocumentsLifeCyle
protected void reinitDocumentsLifeCyle(CoreSession documentManager, DocumentModelList docs)
-
isNonRecursiveTransition
protected boolean isNonRecursiveTransition(String transition, String type)
-
changeChildrenState
protected void changeChildrenState(CoreSession session, String transition, String targetState, DocumentModel doc)
- Since:
- 9.2
-
changeDocumentsState
protected void changeDocumentsState(CoreSession session, String transition, String targetState, DocumentModelList docs)
Change doc state. Don't recurse on children as following transition trigger an event which will be handled by this listener.- Since:
- 9.2
-
-