jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sudhan <s.kan...@gmail.com>
Subject Re: Getting Version History after the node is deleted
Date Tue, 10 Apr 2007 18:52:22 GMT

Hi Toby,

Thanks for your suggestion.

When i tried this, i am getting :

Error :  java.lang.ClassCastException:
org.apache.jackrabbit.rmi.observation.ClientEventPoll$JCREvent

when performing casting operation as
(org.apache.jackrabbit.core.observation.EventImpl)event

is there any thing i am doing wrong here. let me know.

thanks,

Sudhan



Tobias Bocanegra wrote:
> 
> hi,
> unfortunately, the event for the node_removed does not contain any
> suitable information by the path anymore. what you need is the uuid of
> the node, in order to get the version history.
> 
> if you run inside jackrabbit, you can cast the Event to EventImpl, and
> then fetch the "NodeId getParentId();" or "NodeId getChildId()".
> 
> Example: String uuid = ((EventImpl)
> evt).getChildId().getUUID().toString();
> 
> after that you can query for the 'jcr:versionableUuid' of the
> appropriate version history.
> 
> please note, that the NodeId and EventImpl are jackrabbit internals
> and could change in later releases.
> 
> regards, toby
> 
> On 4/10/07, Sudhan <s.kanade@gmail.com> wrote:
>>
>> I am having trouble in getting the version history once I delete the node
>> through DavExplorer.
>>
>> I have listeners like this :
>>
>> 1) This is used for listening to any nodes created or updated on version
>> storage
>>
>> session.getWorkspace().getObservationManager().addEventListener(
>>                                         this,
>>                                         Event.NODE_ADDED,
>>                                         "/jcr:system/jcr:versionStorage",
>>                                         true,
>>                                         null,
>>                                         new String[] { "nt:base" },
>>                                         false);
>>
>> 2) This is used for listening to any nodes deleted from repository
>>
>> session.getWorkspace().getObservationManager().addEventListener(
>>                                         this,
>>                                         Event.NODE_REMOVED,
>>                                         "/",
>>                                         true,
>>                                         null,
>>                                         new String[] {"nt:file"},
>>                                         false);
>>
>> Now my problem is that, I am able to get the event for deleted node
>> (2)but
>> when i try to access version history for that node it throws
>> PathNotFoundException.
>>
>> Is there any way to get hold of version history once the node is deleted.
>> --
>> View this message in context:
>> http://www.nabble.com/Getting-Version-History-after-the-node-is-deleted-tf3549983.html#a9910693
>> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> -----------------------------------------< tobias.bocanegra@day.com >---
> Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
> T +41 61 226 98 98, F +41 61 226 98 97
> -----------------------------------------------< http://www.day.com >---
> 
> 

-- 
View this message in context: http://www.nabble.com/Getting-Version-History-after-the-node-is-deleted-tf3549983.html#a9926053
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message