System Event Options

System events is a special kind of server-side events. A system event always starts with the sv namespace and they can only be emitted by SiteVision, not by RESTApps. System events has a category that groups related operations. RESTApps can act on the operation as well as the category (but never on the namespace).

sv:category:operation

sv:publishing

SiteVision emits system events in the publishing category whenever a publishing-related operation is performed (e.g. page is published or unpublished).

sv:publishing:publish

 Emitted when something (typically a page) is published.

// sv:publishing:publish options example
{
   event: 'sv:publishing:publish', // The full name of the event
   emitter: '247.12121212',        // The JCR identifier of the emitting user [@since 4.5.5]   
   timestamp: 12345678890123456,   // The timestamp when the event was emitted
   node: '4.121212121212'          // The JCR identifier of the Node that was published
}

sv:publishing:unpublish

 Emitted when something (typically a page) is unpublished.

// sv:publishing:unpublish options example
{
   event: 'sv:publishing:unpublish', // The full name of the event
   emitter: '247.12121212',          // The JCR identifier of the emitting user [@since 4.5.5]   
   timestamp: 12345678890123456,     // The timestamp when the event was emitted
   node: '4.121212121212'            // The JCR identifier of the Node that was unpublished
}

sv:simpleuser

SiteVision emits system events in the simpleuser category whenever a operation related to a simple user is performed.

sv:simpleuser:create

 Emitted when a simple user is created.

// sv:simpleuser:create options example
{
   event: 'sv:simpleuser:create', // The full name of the event
   emitter: '247.12121212',       // The JCR identifier of the emitting user [@since 4.5.5]   
   timestamp: 12345678890123456,  // The timestamp when the event was emitted
   user: '255.121212121212'       // The JCR identifier of the simple user that was created
}

sv:simpleuser:update

 Emitted when a simple user is updated.

// sv:simpleuser:update options example
{
   event: 'sv:simpleuser:update', // The full name of the event
   emitter: '247.12121212',       // The JCR identifier of the emitting user [@since 4.5.5]   
   timestamp: 12345678890123456,  // The timestamp when the event was emitted
   user: '255.121212121212'       // The JCR identifier of the simple user that was updated
}

sv:trashcan [@since SiteVision 5.1]

SiteVision emits system events in the trashcan category whenever an item is added to the trashcan or restored from the trashcan.

sv:trashcan:add

 Emitted when something (typically a page/article/file/image) is added to the trashcan.

// sv:trashcan:add options example
{
   event: 'sv:trashcan:add',     // The full name of the event
   emitter: '247.12121212',      // The JCR identifier of the emitting user
   timestamp: 12345678890123456, // The timestamp when the event was emitted
   node: '4.121212121212'        // The JCR identifier of the Node that was trashed
}

sv:trashcan:restore

 Emitted when something (typically a page/article/file/image) is restored from the trashcan.

// sv:trashcan:restore options example
{
   event: 'sv:trashcan:restore', // The full name of the event
   emitter: '247.12121212',      // The JCR identifier of the emitting user
   timestamp: 12345678890123456, // The timestamp when the event was emitted
   node: '4.121212121212'        // The JCR identifier of the Node that was restored
}

Timer events [@since SiteVision 5.2]

SiteVision periodically emits timer events in five intervals:

  • sv:every-5-minutes
  • sv:every-15-minutes
  • sv:every-30-minutes
  • sv:every-hour
  • sv:every-day

Timer events are system global, hence triggered on all websites and not emitted by a specific user. A RESTApp that acts on a timer event must finish its execution before next event interval occurs.

// sv:every-hour options example
{
   event: 'sv:every-hour',      // The full name of the event
   emitter: 'anonymous',        // No user is emitting the event
   timestamp: 12345678890123456 // The timestamp when the event was emitted
}

Execution of a timer event must be completed within the specific event interval!

A RESTApp that acts on a timer event and executes longer than the interval for that event, will
cause all RESTApps on that site to not receive any further timer events of that specific type, until its execution is completed. E.g. if execution of a 5-minutes event takes 12 minutes, all RESTApps on that site will miss two 5-minutes events.

Beware of overlap when acting on more than one timer event!

Timer events are executed periodically and intervals will overlap each other every now and then (e.g. for every third 5-minutes event, there will also be a 15-minutes event).

Timer events has no category since it has no semantic meaning!

RESTApps that are interested in "all timer events" can act on the most frequently emitted sv:every-5-minutes event and do its custom time-related logic.