External component events
You can configure an External page component to subscribe to various system events. Whenever one of those events occurs, related data is passed to the page component.
Entity events
The following table lists entity events.
- Event: Trigger
ENTITY_UPDATED: Theentity (id)is updated.ENTITY_CREATED: Anentityis created.ENTITY_SAVED: Theentity (id)is saved.ENTITY_REFRESHED: Theentity (id)is refreshed.ENTITY_DELETED(subscribe event): Content Hub publishes this event to notify external components when anentity (id)has been deleted.ENTITY_DELETED(publish event): External components can publish this event to notify Content Hub that anentity (id)has been deleted.DefinitionNameis required. If no entityidis provided, all components listening to any entity of that definition will be notified.Idis optional. If specified, only components listening to that particular entity will be notified.ENTITY_CHANGED: ThememberNameis changed on the entity (id).SEARCH_FINISHED: A search is completed.SELECTION_CHANGED: A selection changes.ANNOTATION_SELECTED: An annotation is selected on the Annotations sidebar.ANNOTATION_DESELECTED: An annotation is deselected on the Annotations sidebar.CLOSE_MEDIA_SELECTOR: The media selection dialog is closed.
Realtime events
The following table lists realtime events.
| Event | Trigger | Event Data |
|---|---|---|
realtime (notificationType) | A real-time notification is received. | Notification parameters |
The following data is passed to the events:
Entity saved event
To subscribe to the ENTITY_SAVED event, use the following code:
Entity changed event
The format of the data received following an ENTITY_CHANGED event depends on the type of data that was changed. For example, if a system property was changed, the data received has the following format:
If a normal property was changed, the data received has the following format:
If a relation with the allow_navigation enabled changes, the data received has the following format:
If a relation with the allow_navigation disabled changes, the data received has the following format:
Search finished event
When monitoring the SEARCH_FINISHED event, use the getEventSearchIdentifier method to compare the searchIdentifier with the one from the event.
In React, the ENTITY_LOADED and ENTITY_UNLOADED events are no longer required as the entity is already loaded when the external component renders. We recommend that the first initialization takes place in the root of the code instead of the render method; otherwise, the initialization logic repeats unnecessarily.