From version 8.4
edited by Vincent Massol
on 2017/09/05
To version 9.1
edited by Vincent Massol
on 2019/02/08
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -137,6 +137,13 @@
137 137  ...
138 138  {{/code}}
139 139  
140 +== Activating the listener ==
141 +
142 +Contrary to the Wiki Component-based solution above, this solution requires that the page be called for the listener to be registered against the Observation Manager. There are several options:
143 +
144 +* Option 1: Write a small Wiki Component that listens to the ##ApplicationStartedEvent## (and possible ##WikiReadyEvent## for subwikis) and that calls your Groovy page. Thus whenever XWiki starts your listener will be registered.
145 +* Option 2: Instead of registering it against the Observation Manager instead register your listener as a Component. Then, use, for example, [[the Event Listeners Administration extension>>doc:extensions:Extension.Event Listeners Administration.WebHome]] to start/stop the listener.
146 +
140 140  = Send a mail whenever a comment is added =
141 141  
142 142  Let's implement this use case in Java this time!
... ... @@ -236,7 +236,7 @@
236 236  
237 237  {{info}}
238 238  If you are experiencing problems trying to build it, see:
239 -http://dev.xwiki.org/xwiki/bin/view/Community/Building
246 +[[http:~~/~~/dev.xwiki.org/xwiki/bin/view/Community/Building>>doc:dev:Community.Building]]
240 240  {{/info}}
241 241  
242 242  Before trying it, go to your wiki's administration page and make sure you've configured the Email properties. Try it by adding a new comment on a page. You should receive an email!

Get Connected