jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yao Harrison <harrison.g...@gmail.com>
Subject Re: Can get the Node through assigned version
Date Tue, 27 Sep 2005 03:22:31 GMT
Sure! I have implemented the function what I want with the code your
suggested ! Thanks for your advices!    ^_^

Harrison.Yao


2005/9/25, Edgar Poce <edgarpoce@gmail.com>:
> Hi yao
>
>  sorry for the late reply, try the following ...
>
> Node n = testRootNode.addNode(nodeName1, testNodeType);
> n.addMixin(mixVersionable);
> n.setProperty("prop", "value");
> superuser.save();
> Node version = n.checkin() ;
> n.checkout() ;
> n.setProperty("prop", "newvalue");
>
> // the next line will access the version history
> // and will return the value of the property "prop", i.e. "value"
>
> n.getVersionHistory().getNode(version.getName()).getNode("jcr:frozenNode").getProperty("prop").getString()
>
> hope this helps,
> edgar
>
> PS: try to send your questions and comments to the list, it might help
> other users
>
> On 9/22/05, Yao Harrison <harrison.gyao@gmail.com> wrote:
> > Hi Buddy
> >
> >     Thanks for your feedback firstly, and I think there are some
> > mistakes in my question. So , I don't want to change any data on the
> > tree but get one node's property on given version only
> > For a sample
> > root
> >     |
> >     |---mynode1
> >     |---jcr:system
> >       |----jcr:version
> >          |----rootVersion
> >          |----1.0
> >          |----1.1
> >          |----1.2
> >
> > Question: How can I get the node property by ver 1.0 and not changed
> > any data on this tree?
> >
> > Thanks !
> >
> >
> >
> > 2005/9/22, Edgar Poce <edgarpoce@gmail.com>:
> > > Hi yao,
> > >
> > >  I'm not sure if this is what you are looking for, take a look to
> > > Node.restore() in the spec. you can download it from
> > > http://jcp.org/aboutJava/communityprocess/final/jsr170/index.html. See
> > > 8.2.14 Versioning API
> > >
> > > br,
> > > edgar
> > >
> > > On 9/22/05, Yao Harrison <harrison.gyao@gmail.com> wrote:
> > > > Hi all :
> > > >
> > > >   How can i get a node by assigned the node's version . Thanks !
> > > >
> > >
> >
>

Mime
View raw message