...
Anchor | ||||
---|---|---|---|---|
|
Object Type | Page | Page Version | MediaItem | MediaItemVersion | Element | Website |
---|---|---|---|---|---|---|
RETRIEVE |
| X1 | ||||
COPY | X | X | X | X | X | |
DELETE | X | X | X | X | X | X |
MOVE | X | X | X | X | X | |
CREATE | X1 | X1 | X1 | X1 | X | X |
UPDATE | X2 | X2 | X2 | X2 | X | |
CHANGED | X1 | X1 | X1 | X1 | X1 | |
PublicationStatus | X1 | X1 |
1 Only a POST event is published.
2 The Content API does not publish this event if you change a content item; this is the responsibility of the updater. In XperienCentral, this event is published by the Spring MVC and the REST API.
...
The nl.gx.webmanager.services.event
package contains the following interfaces:
Interface | Description |
---|---|
EntityEvent | Contains the events specific to CRUD operations. This class is implemented by the |
Event | Contains methods for retrieving information about the event that occurred. |
EventHandler | Contains a method for reacting to event notifications. |
EventManagerService | Contains methods for publishing, subscribing, and unsubscribing to events. |
In addition to the standard actions (create, copy, update, move, retrieve, and delete), you can also create custom actions that perform other functions. These custom actions can also be published and subscribed to. If you want to publish custom events, you will need to implement a custom event and publish this event using the Event Manager service.
...
To subscribe the event handler to particular events, the handler must be subscribed by the publisher (the Event Manager service). The EventManagerService
interface contains the following methods:
Method | Description | |||||
---|---|---|---|---|---|---|
publish | Publishes an event to the framework.
where | |||||
subscribe | Subscribes to a particular event handler.
where | |||||
unsubscribe | Unsubscribes from a particular event handler.
where |
To subscribe the event handler, the subscribe
method on the Event Manager service must be invoked. The subscribe
method takes, in addition to the event handler, an event type and a desired scope as input arguments. The event type may be PRE or POST. The scope indicates the object type on which the event applies. For the basic events the appropriate scopes are mentioned in the event overview table. It is also possible to provide a superclass or interface as scope. For example, to receive all PageVersion
events, you can subscribe to events with either scope PageEvent
.class, or any class it extends or interface it implements.
...