jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "harvey waters" <harvey.wat...@googlemail.com>
Subject Re: Finding the latest version of a node
Date Wed, 09 May 2007 14:33:39 GMT
Thanks for that, I just went back to the spec and realised I had
misunderstood the term 'base'. I got it confused with root version. I'm
still not sure why they used the term 'base' ? thanks for the help though.
:)

On 5/9/07, Christoph Kiehl <christoph@sulu3000.de> wrote:
>
> harvey waters wrote:
> > Anybody know a quick way of finding the most recent version of a node,
> > currently I iterate through all the versions in the version history and
> > look
> > for the Version node that has no successors, is this the quickest way of
> > doing it ?
>
> If you want to get the latest version of a node in your workspace you can
> use
> getBaseVersion():
>
> Node node = getSession().getNodeByUUID(uuid);
> Version version = node.getBaseVersion();
> Node versionNode = version.getNode(JcrConstants.JCR_FROZENNODE);
>
> AFAIK this base version might be different in different workspaces.
>
> Cheers,
> Christoph
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message