jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alessandro Bologna <alessandro.bolo...@gmail.com>
Subject Re: Observation before node delete
Date Fri, 01 May 2009 12:24:20 GMT
We had a similar use case, and we decided to simply flag the node with  
a "remove" property, and let the listener remove it. In this way you  
can of course access the node...

Alessandro

On May 1, 2009, at 6:25 AM, "Alfie Kirkpatrick" <Alfie.Kirkpatrick@ioko.com 
 > wrote:

> Hi, am wondering if it's possible to hook into change events <before>
> they get persisted? In particular we want to access information  
> about a
> node before it is deleted, for example its node type or property  
> values.
> In some scenarios we may even want to prevent a delete operation if
> certain criteria about the node are met/not met, for example by  
> throwing
> an exception in the event handler.
>
>
>
> The observation API only gives a path and, in Jackrabbit's
> implementation, even using a SynchronousEventListener the node is gone
> by the time the delete event gets fired. Are there any other hooks
> available/feasible?
>
>
>
> An alternative solution might be to somehow get access to the  
> session's
> change list before calling save, and then access the deleted node in
> another session. But there is no obvious place to get this information
> outside the observation framework.
>
>
>
> Is anyone else interested in this problem?
>
>
>
> Many thanks!
>
> Alfie.
>
>
>
>
>

Mime
View raw message