From dev-return-6575-apmail-jackrabbit-dev-archive=jackrabbit.apache.org@jackrabbit.apache.org Tue Apr 04 12:49:33 2006 Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 832 invoked from network); 4 Apr 2006 12:49:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Apr 2006 12:49:33 -0000 Received: (qmail 16326 invoked by uid 500); 4 Apr 2006 12:49:31 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 16289 invoked by uid 500); 4 Apr 2006 12:49:31 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 16274 invoked by uid 99); 4 Apr 2006 12:49:30 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Apr 2006 05:49:30 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [194.94.224.6] (HELO mailserv.aei.mpg.de) (194.94.224.6) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Apr 2006 05:49:29 -0700 Received: by mailserv.aei.mpg.de (Postfix, from userid 65534) id C74896C11B1; Tue, 4 Apr 2006 14:49:05 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mailserv.aei.mpg.de (Postfix) with ESMTP id 8BB346C44CD for ; Tue, 4 Apr 2006 14:49:05 +0200 (CEST) Received: from [172.16.26.123] (dhcp-123.aei.mpg.de [172.16.26.123]) (using TLSv1 with cipher DES-CBC3-SHA (168/168 bits)) (Client did not present a certificate) by mailserv.aei.mpg.de (Postfix) with ESMTP id AF4CC6BCA6F for ; Tue, 4 Apr 2006 14:49:03 +0200 (CEST) User-Agent: Microsoft-Entourage/11.2.3.060209 Date: Tue, 04 Apr 2006 14:49:02 +0200 Subject: Re: Restore a version of a node property From: Oliver Wehrens To: Message-ID: Thread-Topic: Restore a version of a node property Thread-Index: AcZX5iYaZLKNycPZEdqdEgARJOSRDA== In-Reply-To: <8be731880604040357t32202a00t7895b2e715ddd74@mail.gmail.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Virus-Scanned: by AMaViS snapshot-20020531 X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on mailserv.aei.mpg.de X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, hits=0.0 required=5.0 tests=AWL autolearn=no version=2.64 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, I did read it (but obviously not careful enough) ;-). If I create a node with a property like: node = session.getRootNode().addNode("entry"); node.addMixin("mix:versionable"); node.setProperty("content", "1"); node.getSession.save(); node.checkout(); node.setProperty("content", "2"); node.save(); node.checkin(); Now Version 1.0 of this node contains the property content with the value "2". How do I get to "1" ? What I did as workaround, I created an empty node and check it out and change the property and check in it again. Now I can access the very first version. Oliver On 04.04.2006 12:57 Uhr, "Tobias Bocanegra" wrote: >> This described method works fine for me, however how do I get a property of >> the rootNode of the history? As far as I can see it starts with the first >> revision but not with the original node I saved in the very beginning... > when a new versionable node is created, it also creates the respective > version-history node in the version storage. i also creates a > root-version, which is empty. the root-version simply acts as > 'sentinel' for the 'jcr:predecessors' and 'jcr:baseVersion' > references. when you > checkin the node, it's content get copied into the 1.0 version in the > version storage (according to the OnParentVersion) properties. > > read the versioning chapter of jsr170 for a more detailed explanation. > regards, toby > > >> >> Anybody got an idea? >> >> Thanks, Oliver >> >> >> >> On 03.04.2006 21:33 Uhr, "David Gillen" wrote: >> >>> Tobias Bocanegra day.com> writes: >>>> >>>> hi oliver, >>>> you can access the content of the version directly in the >>>> jcr:versionStorage. >>>> either by searching for your version, or by using the version history: >>>> >>>> node.getVersionHistory().getVersion(xyz).getNode >>> ("jcr:frozenNode").getProperty("yourprop"); >>>> >>> >>> >>> Hello, >>> >>> I have the same issue as the original poster, and I'm having trouble making >>> the suggestion above work >>> for me. I keep getting: >>> >>> javax.jcr.PathNotFoundException: myprop >>> at org.apache.jackrabbit.core.NodeImpl.getProperty(NodeImpl.java:2423) >>> >>> where myprop is the name of the property I'm trying to retrieve. When I run >>> through a debugger, and look at the propertyNames HashMap within the >>> NodeState >>> belonging to the node of the older version, I don't see any property names >>> listed that I created, only property names that look internal to Jackrabbit. >>> >>> I can provide source code that demonstrates this problem. Any ideas? >>> >>>> regards, toby >>> >>> -Dave >>> >>> >> >> -- >> Oliver Wehrens >> +49 170 785 1323 >> http://wehrens.net/oliver >> >> >> >> >> >> >> > > > -- > -----------------------------------------< 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 >--- > -- Oliver Wehrens +49 170 785 1323 http://wehrens.net/oliver