Event Dispatcher

No UI

This plugin informs external systems about changes in CELUM. Various filters allow you to restrict the scope of the events, so that only relevant events are dispatched. Both the filters and the dispatcher allow for custom implementations through the use of beans. By default we ship simple GET and POST implementations for use in Webhooks.

General properties

eventDispatcher.license

type: String, required: yes, default: -

The license key for the plugin (product: eventDispatcher), provided by brix.

eventDispatcher.filters

type: bean names (comma separated), required: no, default: -

Event filters to apply - needs to pass all of them in order to be dispatched. Providing no filters will dispatch all events. Known implementations:

  • eventFilterByName
  • eventFilterByUser
  • eventFilterByNode
  • eventFilterByNodeType (since 1.7.1)
  • eventFilterByMetadataUpdated (since 1.9.1)
  • eventFilterBySearchExpression (since 1.12.0)
eventDispatcher.dispatchers

type: bean names (comma separated), required: yes, default: eventDispatcherSimpleGet

Event dispatchers to inform about the event, all will be called in order. Known implementations:

  • eventDispatcherSimpleGet
  • eventDispatcherSimplePost
  • eventDispatcherJsonPost (since 1.9, configure eventDispatcher.jsonTemplate, e.g. {"channel": "Plugins", "username": "EventBot", "text": "$eventType: [$name](https://mediahub.brix.ch/main/opennodeview.do?assetId=$id)"})
  • eventDispatcherJsonPostInfofields (since 1.9, configure eventDispatcher.infofields as a list of infofield-id:name, e.g. 123:brand,456:sku , eventDispatcher.nodeRefsAsArray as boolean if you want to get NodeRef-Fields as an array, and eventDispatcher.basicAuthentication=username:password for Basic Authentication)
eventDispatcher.threads

type: int, required: yes, default: 4

Size of the thread pool that dispatches the events

Dispatcher properties

eventDispatcher.baseUrl

type: string, required: yes, default: http://localhost

Endpoint to be informed about the event. Also supports multiple URLs (comma-separated).

Adds additional parameters when available:

  • eventType: Name of the event (always; since 1.0)
  • id: ID of the affected object, unique per object type (on assets, nodes, users and usergroups; since 1.0)
  • name: Name of the affected object, non-unique (on assets, nodes, users and usergroups; since 1.3)
  • fileName: Original file name of the asset (on assets; since 1.3)
  • node: The node an asset was added to or removed from (only AssetAddedEvent and AssetRemovedEvent, since 1.8)

Example: http://pim.brix.ch/event-handler/celum.do?eventType=AssetAddedEvent&id=1337&name=Ponies&fileName=Ponies.jpg

eventDispatcher.header.*

type: string, required: no, default: -, since: 1.10

Allows you to include arbitrary headers, e.g. eventDispatcher.header.Authorization=My$ecretTok3n

Filter properties

eventDispatcher.eventWhitelist

type: string (comma separated), required: no, default: -, applies to: eventFilterByName

Only pass on events with the following names, list of:

AssetEvents

  • AssetAddedEvent (added to a node)
  • AssetCreatedEvent
  • AssetDeletedEvent
  • AssetMetadataUpdatedEvent
  • AssetReleasedEvent
  • AssetRemovedEvent (removed from a node)
  • AssetsDownloadStartedEvent
  • AssetStatusAvailable
  • AssetStatusUnavailable
  • AssetSyncedEvent (through backstage)
  • AssetTypeSetEvent
  • (AssetTrashedEvent)
  • AssetVersionActivatedEvent
  • AssetVersionAddedEvent
  • AssetVersionDeletedEvent

NodeEvents

  • NodeCreatedEvent
  • NodeDeletedEvent
  • NodeMetadataUpdatedEvent
  • NodeMovedEvent

UserEvents

  • UserCreatedEvent
  • UserDeletedEvent
  • UserLoggedInEvent
  • UserLoginFailedEvent

UserGroupEvents

  • UserGroupAddedToUserGroupEvent
  • UserGroupCreatedEvent
  • UserGroupDeletedEvent
  • UserGroupRemovedFromUserGroupEvent
  • UserAddedToUserGroupEvent
  • UserRemovedFromUserGroupEvent

PublicUrlEvents

  • PublicUrlAddedEvent
  • PublicUrlDeletedEvent

RelationEvents

  • RelationCreatedEvent
  • RelationDeletedEvent

Other

  • PreviewConversionEvent
  • PropertyChangedEvent

You can check which events are available by setting the logger of ch.brix.eventDispatcher.EventDispatcherListener to INFO, it will print a list of known events at startup.

eventDispatcher.scopeUserId

type: (list of) long, required: no, default: -, applies to: eventFilterByUser

Only pass on events that originate from an asset/node that this user can see

eventDispatcher.scopeNodeId

type: (list of) long, required: no, default: -, applies to: eventFilterByNode

Only pass on events that originate in a certain node (recursively)

eventDispatcher.scopeNodeTypeId

type: (list of) long, required: no, default: -, applies to: eventFilterByNodeType, since: 1.7.1

Only pass on events that originate in a certain node type

eventDispatcher.relevantUpdatedInfofieldIds

type: (list of) long, required: no, default: -, applies to: eventFilterByMetadataUpdated, since: 1.9.1

Only pass MetadataUpdatedEvents when one of the specified infofields have changed. Does not affect other event types.

eventDispatcher.scopeExpression

type: string, required: no, default: -, applies to: eventFilterBySearchExpression, since: 1.12.0

Only pass AssetEvents whose asset satisfies the configured SearchUtil2 expression. Does not affect other event types.

trashbin.nodeType

type: long, required: no, default: -, since 1.8

When you have the trashbin enabled (CELUM feature), an AssetAddedEvent to said trashbin will be renamed to AssetTrashedEvent in the eventType parameter

Compatibility Matrix

eventDispatcher CELUM (min. version)
1.0 - 1.5 5.12.4
1.6 - 1.10 5.13.4 (tested up to 6.10)
1.12+ 6.4.0

Release Notes

1.0

Released 2017-05-19

Initial version with support for eventFilterByName, eventFilterByUser, eventFilterByNode as well as eventDispatcherSimpleGet and eventDispatcherSimplePost.

1.1

Released 2017-05-23

Added synthesized events AssetStatusAvailable and AssetStatusUnavailable through a nightly task (in order to detect assets at the egde of their validity period).

1.2

Released 2017-08-16

Switched synthesized event source to SolrQueries (way faster)

1.3

Released 2018-03-19

Added additional parameters to the GET- and POST-Dispatchers (name and fileName when applicable)

1.4

Released 2018-07-07

Refactored default dispatchers to facilitate writing custom dispatchers

1.5

Released 2019-01-25

Added license.

1.6

Released 2019-03-07

Established compatibility with the new SOLR server (breaking, needs CELUM 5.13.4 or above)

1.7

Released 2020-04-20

Stop using CELUM's home-brew reflection utility

1.8

Released 2021-09-27

  • Introduced synthetic AssetTrashedEvent
  • Added node parameter to AssetAddedEvent/AssetRemovedEvent

1.9

Released 2021-11-30

1.10

Released 2022-01-17

  • added support for including arbitrary headers (e.g. for Authorization)
  • improved GetDispatcher that assumed there are no pre-existing parameters in the baseUrl

1.12

Released 2022-10-26

Added new eventFilterBySearchExpression which allows to filter AssetEvents by an SearchUtil2 expression.