Hi Bertrand,

I was actually thinking about making JCR observers scriptable as well.


That would be really cool. There is also a quite compelling real-world use
case for this: in a lot of web apps emails need to be sent. Rather than
having to send the email during the request-response cycle (and thus slowing
down the response) an observer on the data could send it . This would make
for a much nicer architecture because async operations (like mail) are
really handled in an async way.


We could have a "magic" repository location for scripts that would be
> automatically bound to repository events, based on the touched node's
> resource type.
>
> For example, a script named
>
>   /sling/events/nt/file/event.js
>
> would be called for any events on nt:file nodes, or
>
>   /sling/events/myblog/comment/node_added.js
>
> would be called when a node is added with slingResourceType=myblog/comment
>
> How does that sound? I think that would be a cool way of exposing the
> rich JCR events functionality, and it is fairly easy to implement.



Sounds very good to me.

Michael

Reply via email to