Introduced in Deki 9.02
MindTouch publishes a number of events via it's own pub sub services, DekiPubSubService, which is modified version of Dream's PublishSubscribeService. This services is the authentication gatekeeper for MindTouch events.
While DekiPubSubService does the authentication, generally subscriptions to MindTouch should still go through the default pubsub service provided to every feature, which will handle the chaining subscriptions and events.
Authentication for events on DekiPubSubService is currently limited to recipient authorization via apikey for all events, or for page events, by a user's access to a particular page. It is assumed that services in the pubsub chain are trusted, as userid's are checked blindly for page access without requiring authentication information providing that the subscriber has authentication credentials for the specified user.
Every Dream Service is provided a Subscribe Uri that by default hooks them into the system PublishSubscribe bus. If the service is derived from DreamService, there also exists a Subscribe Plug property exposing this Uri. In order, for the service to receive Deki events, it needs to Post a subscription set against Subscribe. The format of subscription sets is described here. In order to qualify for Deki events, the subscriber must provide an auth token so that Deki can verify that the recipient is allowed to see the events. Currently, Deki uses the ApiKey as this token.
Sample Subscription Set:
<subscription-set>
<!-- uri of the subscribing service -->
<uri.owner>...</uri.owner>
<subscription>
<!-- if the destination feature is not public, provide a cookie doc for
publication service to be able to post the event -->
<set-cookie version="1">
<name>service-key</name>
<uri>...</uri>
<value>...</value>
</set-cookie>
<!-- one or more channel/channel wildcards -->
<channel>...</channel>
...
<!-- a feature on the service to post events to, along with the Dream ApiKey as the authtoken -->
<recipient authtoken="...">
<uri>...</uri>
</recipient>
</subscription>
</subscription-set>
The defined channels for Deki are of the following format:
event://{wikiid}/deki/{type}/{action}[/{additional info}]
Each event affects a resource, which takes the format or the normal deki api uri to that resource with the host replaced by the wikiid. For example user with id 123 on the default wiki would have a resource uri like:
http://default/@api/deki/users/123
If you look at how the PubSubService works, you will notice that it uses a special header X-Dream-Event-Channel for routing between pub/sub services. However, the Feature that eventually receives the event document should not make any assumptions about the transport, but simply rely on the document that is posted. Conversely, PubSubService is payload neutral and should not be looking for the channel in the document. It is both conceivable that the payload sent is not an XDoc, meaning PubSubService needs the channel as a header and that the recipient feature gets an event posted to it via a transport other than the pub/sub system, meaning the channel needs to exist in the document itself.
Channel: event://{wikiid}/deki/pages/{action}
Resource: http://{wikiid}/@api/deki/pages/{pageid}
Event Xml:
<deki-event wikiid="..." event-time="...">
<channel>...</channel>
<uri>...</uri>
<pageid>...</pageid>
<user id="..." anonymous="true|false">
<uri>...</uri>
</user>
<content.uri type="..">...</content.uri>
<revision.uri>...</revision.uri>
<tags.uri>...</tags.uri>
<comments.uri>...</comments.uri>
<path>...</path>
</deki-event>
Channel: event://{wikiid}/deki/pages/noop
Event Xml Addtion:
<deki-event wikiid="..." event-time="..."> ... <previous-path>...</previous-path> </deki-event>
A NoOp is used to tell listening parties to look at a page again although nothing has changed. It's current use is simply to allow the index service to re-index a page without sending a fake update event.
Channel: event://{wikiid}/deki/pages/move
A page was moved. The id remains the same, but path and previous-path in the change doc describe hierarchical change.
Channel: event://{wikiid}/deki/pages/revert
Event Xml Addition:
<deki-event wikiid="..." event-time="...">
...
<reverted-to>{revision}</reverted-to>
...
</deki-event>
The content of a page was reverted to a previous revision. Reverting a page will send both an update and a revert event.
Channel: event://{wikiid}/deki/pages/createalias
An alias to another page was created (generally this happens in tandem with a move event)
Channel: event://{wikiid}/deki/pages/view
A page was viewed.
Note: This event is disabled by default because it can be an expensive operation for busy sites. In order to enable it, you must create or set the configuration key 'events/enable-page-view-events' to true.
Channel: event://{wikiid}/deki/pages/tags/update
The tags collection for the page was updated
Channel: event://{wikiid}/deki/pages/properties/{action}
Resource: http://{wikiid}/@api/deki/pages/{pageid}/properties/{propname}
Event Xml:
<deki-event wikiid="..." event-time="..."> <channel>...</channel> <uri>...</uri> <name>...</name> <pageid>...</pageid> <content mime-type="..." href="...">...</content> </deki-event>
Pages use properties to store meta-data that don't fall under page updates, which should be reserved for content changes.
Channel: event://{wikiid}/deki/pages/properties/create
Channel: event://{wikiid}/deki/pages/properties/update
Channel: event://{wikiid}/deki/pages/properties/delete
Channel: event://{wikiid}/deki/pages/security/{action}
Resource: http://{wikiid}/@api/deki/pages/{pageid}
Event Xml:
<deki-event wikiid="..." event-time="..."> <channel>...</channel> <uri>...</uri> <pageid>...</pageid> <security cascade="..."/> </deki-event>
Security settings are properties of a page, but since they are meta data they don't fall under page updates, which should be reserved for content changes.
Channel: event://{wikiid}/deki/pages/security/create
Create in terms of security settings is unique in that it really means set, which could be overwriting existing settings
Channel: event://{wikiid}/deki/pages/security/update
Channel: event://{wikiid}/deki/pages/security/delete
Dependent change events are triggered when a resource attached to a page is modified.
Channel: event://{wikiid}/deki/pages/dependentschanged/comments/create
Channel: event://{wikiid}/deki/pages/dependentschanged/comments/update
Channel: event://{wikiid}/deki/pages/dependentschanged/comments/delete
Channel: event://{wikiid}/deki/pages/dependentschanged/files/create
Channel: event://{wikiid}/deki/pages/dependentschanged/files/update
Channel: event://{wikiid}/deki/pages/dependentschanged/files/properties/{action}
Channel: event://{wikiid}/deki/pages/dependentschanged/files/delete
Channel: event://{wikiid}/deki/pages/dependentschanged/files/restore
Channel: event://{wikiid}/deki/pages/dependentschanged/talk/{talk event path}
Talk pages trigger events like any regular page, but they will also cascade events onto the page they talk about. I.e. the event event://{wikiid}/deki/pages/update on a talk page would also trigger event://{wikiid}/deki/pages/dependentschanged/talk/update. This extends to dependents on the talk page, i.e. there could be an event such as event://{wikiid}/deki/pages/dependentschanged/talk/dependentschanged/files/create
Channel: event://{wikiid}/deki/pages/message/{custom/path}
As part of the experimental Javascript Events & Messages (JEM) feature, it is possible for javascript on a page to send custom events back into the Deki bus. Currently there is no facility in JEM to receive these injected messages, but that feature will come soon. However, in the meantime it is still possible to build a DekiScript extension that can be used to receive and expose these custom messages back to the front end.
Channel: event://{wikiid}/deki/comments/{action}
Resource: http://{wikiid}/@api/deki/pages/{pageid}/comments/{commentnumber}
Event Xml:
<deki-event wikiid="..." event-time="...">
<channel>...</channel>
<uri>...</uri>
<pageid>...</pageid>
<uri.page>...</uri.page>
<user id="..." anonymous="...">
<uri>...</uri>
</user>
<path>...</path>
<!-- content/@type and value are only included if smaller than 255 chars -->
<content uri="..." type="...">...</content>
</deki-event>
All comment events (except noop) also trigger an event://{wikiid}/deki/pages/dependentschanged/{sub-action} for the parent page.
Channel: event://{wikiid}/deki/comments/noop
A NoOp is used to tell listening parties to look at a comment again although nothing has changed. It's current use is simply to allow the index service to re-index a comment without sending a fake update event.
Channel: event://{wikiid}/deki/files/{action}
Resource: http://{wikiid}/@api/deki/files/{fileid}
Event Xml:
<deki-event wikiid="..." event-time="..."> <channel>...</channel> <fileid>...</fileid> <uri>...</uri> <content.uri type="...">...</content.uri> <revision.uri>...</revision.uri> <path>...</path> </deki-event>
All file events (except noop) also trigger an event://{wikiid}/deki/pages/dependentschanged/{sub-action} for the parent page.
Channel: event://{wikiid}/deki/files/noop
A No-Op is used to tell listening parties to look at a file again although nothing has changed. It's current use is simply to allow the index service to re-index a file without sending a fake update event.
Channel: event://{wikiid}/deki/files/properties/{action}
Resource: http://{wikiid}/@api/deki/files/{pageid}/properties/{propname}
Event Xml:
<deki-event wikiid="..." event-time="..."> <channel>...</channel> <uri>...</uri> <name>...</name> <fileid>...</fileid> <content mime-type="..." href="...">...</content> </deki-event>
Files use properties to store meta-data that don't fall under file updates, which should be reserved for content changes.
Channel: event://{wikiid}/deki/files/properties/create
Channel: event://{wikiid}/deki/files/properties/update
Channel: event://{wikiid}/deki/files/properties/delete
Channel: event://{wikiid}/deki/users/{action}
Resource: http://{wikiid}/@api/deki/users/{userid}
Event Xml:
<deki-event wikiid="..." event-time="..."> <channel>...</channel> <userid>...</userid> <uri>...</uri> </deki-event>
Channel: event://{wikiid}/deki/users/create
Channel: event://{wikiid}/deki/users/update
Channel: event://{wikiid}/deki/users/update/password
Channel: event://{wikiid}/deki/users/login
Channel: event://{wikiid}/deki/users/properties/{action}
Resource: http://{wikiid}/@api/deki/users/{pageid}/properties/{propname}
Event Xml:
<deki-event wikiid="..." event-time="..."> <channel>...</channel> <uri>...</uri> <name>...</name> <userid>...</userid> <content mime-type="..." href="...">...</content> </deki-event>
Users use properties to store meta-data that don't fall under other user updates
Channel: event://{wikiid}/deki/users/properties/create
Channel: event://{wikiid}/deki/users/properties/update
Channel: event://{wikiid}/deki/users/properties/delete
Site collects events that don't fall under a resource grouping, and therefore each may have different channel and Xml formats
The start event is triggered when an API instance starts up. At this time it is not fully ready for interaction.
Channel: event://{wikiid}/deki/site/start
Event Xml:
<deki-event wikiid="..." event-time="...">
<channel>...</channel
<uri>...</uri>
</deki-event>
The start event is triggered when an API instance has completed startup and is ready for interaction.
Channel: event://{wikiid}/deki/site/started
Event Xml:
<deki-event wikiid="..." event-time="...">
<channel>...</channel
<uri>...</uri>
</deki-event>
Channel: event://{wikiid}/deki/site/stop
Event Xml:
<deki-event wikiid="..." event-time="...">
<channel>...</channel>
<uri>...</uri>
</deki-event>
Channel: event://{wikiid}/deki/site/reindex
Event Xml:
<deki-event wikiid="..." event-time="...">
<channel>...</channel>
</deki-event>
This event is triggered when an API's instance settings have been updated.
Channel: event://{wikiid}/deki/site/settings/update
Event Xml:
<deki-event wikiid="..." event-time="...">
<channel>...</channel>
</deki-event>
Channel: event://{wikiid}/deki/users/{action}
Event Xml:
<deki-event wikiid="..." event-time="...">
<channel>...</channel>
<banid>...</banid>
<!-- userid of the user creating the ban -->
<by>...</by>
<!-- list of IPs, if the ban affected addresses -->
<addresses>
<addresss>...</address>
...
</addresses>
<!-- list of userids, if the ban affected users -->
<users>
<user id="..."/>
...
</users>
</deki-event>
Bans do not have a resource attached to them and contain all relevant data in the event doc
Channel: event://{wikiid}/deki/ban/create
Channel: event://{wikiid}/deki/ban/delete
| Images 0 | ||
|---|---|---|
| No images to display in the gallery. |
Copyright © 2011 MindTouch, Inc. Powered by