Changes for page Notifications API

Last modified by Admin on 2024/03/25 15:53

From version 11.5
edited by Admin
on 2017/04/26 15:13
Change comment: Imported extension [org.xwiki.platform:xwiki-platform-notifications-api] from repository [maven-xwiki:maven:http://nexus.xwiki.org/nexus/content/groups/public]
To version 12.1
edited by Guillaume Delhumeau
on 2017/05/10 10:53
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.Admin
1 +xwiki:XWiki.gdelhumeau
ExtensionCode.ExtensionClass[0]
Description
... ... @@ -109,28 +109,15 @@
109 109  ## Default renderer for any kind of notification.
110 110  ## Each application should create its own.
111 111  ## The variable "$event" contains the event to display.
112 -## See: org.xwiki.eventstream.Event
113 -#set ($app = "$event.application")
112 +## See: org.xwiki.notifications.CompositeEvent
113 +#template('notification/macros.vm')
114 +#set ($app = "$!event.events.get(0).application")
114 114  #set ($icon = 'bell')
115 115  #if ($app == 'xwiki')
116 - #set ($app = 'XWiki')
117 + #set ($app = $services.localization.render('core.events.appName'))
117 117   #set ($icon = 'file')
118 118  #end
119 -#set ($document = $xwiki.getDocument($event.document))
120 -<div class="clearfix">
121 - <div class="col-xs-2 notification-icon">
122 - $services.icon.renderHTML($icon)
123 - </div>
124 - <div class="col-xs-10">
125 - <p><strong>$app</strong></p>
126 - <p><strong>[$!escapetool.xml($event.type)]</strong> <a href="$!escapetool.xml($document.getURL())">$!escapetool.xml($document.getRenderedTitle('html/5.0'))</a></p>
127 - #if ("$!event.user" != '')
128 - #set ($userDoc = $xwiki.getDocument($event.user))
129 - <p>by <a href="$userDoc.getURL()">$userDoc.display('first_name', 'view') $userDoc.display('last_name', 'view')</a></p>
130 - #end
131 - <p><small>$escapetool.xml($xwiki.formatDate($event.date))</small></p>
132 - </div>
133 -</div>
120 +#displayNotificationEvent($icon, $app, $event)
134 134  {{/code}}
135 135  
136 136  You can override this template for your event type by creating a template called ##notification/{canonical name of your event class}.vm##.

Get Connected