Class EventHandler

java.lang.Object
org.nuxeo.ecm.automation.core.events.EventHandler
All Implemented Interfaces:
Descriptor

public class EventHandler extends Object implements Descriptor
Author:
Bogdan Stefanescu
  • Field Details

    • id

      protected String id
      Since:
      2021.16
    • chainId

      protected String chainId
    • isPostCommit

      protected boolean isPostCommit
    • events

      protected Set<String> events
    • doctypes

      protected Set<String> doctypes
    • facet

      protected String facet
    • lifeCycle

      protected String[] lifeCycle
    • pathStartsWith

      protected String pathStartsWith
    • attribute

      protected Filter attribute
    • memberOf

      protected List<String> memberOf
      the principal should be member of at least one of the groups. OR is used
    • isAdministrator

      protected Boolean isAdministrator
    • condition

      protected String condition
      Since:
      5.7: added to replace the 'expression' element as its evaluation is inverted
    • enabled

      protected boolean enabled
      Since:
      2021.16
  • Constructor Details

    • EventHandler

      public EventHandler()
  • Method Details

    • setLifeCycleExpr

      protected void setLifeCycleExpr(String lifeCycles)
    • setAttribute

      public void setAttribute(String attribute)
    • _setCondition

      protected void _setCondition(String condition)
    • getId

      public String getId()
      Description copied from interface: Descriptor
      The descriptor id, descriptors with same id are merged.

      To forbid multiple descriptors use UNIQUE_DESCRIPTOR_ID.

      To forbid merge use a unique value, non-overriden toString() for exemple.

      Specified by:
      getId in interface Descriptor
    • getEvents

      public Set<String> getEvents()
    • getChainId

      public String getChainId()
    • isPostCommit

      public boolean isPostCommit()
    • getCondition

      public String getCondition()
      Condition to define on event handler
      Since:
      5.7
    • getFacet

      public String getFacet()
    • getAttribute

      public Filter getAttribute()
    • getLifeCycle

      public String[] getLifeCycle()
    • getMemberOf

      public List<String> getMemberOf()
    • getIsAdministrator

      public Boolean getIsAdministrator()
    • getPathStartsWith

      public String getPathStartsWith()
    • getDoctypes

      public Set<String> getDoctypes()
    • isEnabled

      public boolean isEnabled()
    • isEnabled

      public boolean isEnabled(OperationContext ctx, EventContext eventCtx, boolean quick)
      Checks if this handler should run for the event and operation context.
      Parameters:
      quick - If true, then this method may not check all filter parameters like filter/expression and just return true to avoid costly evaluations on ShallowDocumentModel instances
    • merge

      public Descriptor merge(Descriptor o)
      Description copied from interface: Descriptor
      Returns a descriptor representing other merged into this

      Default implementation returns other.

      Specified by:
      merge in interface Descriptor
      Returns:
      the merged descriptor
      Since:
      2025.0