[xwiki-dev] [Proposal] New notification implementation

Asiri Rathnayake asiri.rathnayake at gmail.com
Sat Jul 21 05:46:39 CEST 2007


Thanks. I learnt few things about how to make a proper patch too (should
have done before), my patches are bit too crappy.

I was thinking, can we use this mechanism for purposes like notifying (send
an email or something like that) to the original author of the document when
the document is changed ? Or is some other mechanism there for this purpose
?

Best Regards,

- Asiri

On 7/21/07, Vincent Massol <vincent at massol.net> wrote:
>
> For those interested I've sent a patch for implementing a new notification
> mechanism.It's available here:
>
> http://jira.xwiki.org/jira/browse/XWIKI-1522
>
> I'd love to get feedback on this. Here's what I say in there:
>
> "
> At the place where you want to register for an event:
>
> getObservationManager().addListener(new
> DocumentSaveEvent("DocumentToWatch"), listener);
>
> At the place where you want to receive for an event:
>
> public class MyListener implements EventListener
> {
>         public void onEvent(Event event, Object source, Object data)
>         {
>             ...
>         }
>  }
>
> At the place where you want to fire notifications to event listeners:
>
> getObservationManager().notify(new DocumentSaveEvent("SomeDocument"),
> "some source", "some data");
>
> It's easily extensible and you can create all sorts of events as it's
> fully generic.
> "
>
> Have a look at the implementation. You'll see I have even introduced the
> notion of EventFilter so that we can have regex when registering interest
> for an event.
>
> Thanks
> -Vincent
>
>
>
> --
> You receive this message as a subscriber of the xwiki-dev at objectweb.orgmailing list.
> To unsubscribe: mailto:xwiki-dev-unsubscribe at objectweb.org
> For general help: mailto:sympa at objectweb.org?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xwiki.org/pipermail/devs/attachments/20070721/7c547d86/attachment.htm 


More information about the devs mailing list