jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: non versioned attributes on versioned nodes?
Date Sat, 16 Feb 2008 14:03:54 GMT
Hi,

On Feb 16, 2008 3:33 PM, Dave Brosius <dbrosius@mebigfatguy.com> wrote:
> I have achieved partial success storing audit info in a child node's stream
> property. As this stream is a serialized object, it is easy to append audit
> information to it.

Ah, OK. A binary property is a good place for a serialized object.

> One associated problem, is that sometimes i receive a UUID of the parent
> document object to perform operations on, and sometimes i receive a UUID of
> a version of that parent document (by design). In either case, i want to add
> audit information regarding this operation. The problem is the audit object
> is hanging off the parent document, not the version, and so if passed a UUID
> of a version, i need to find the owning document and then navigate to the
> child audit object.
> [...]
> how to I go from the Version to the Node?

You could do something like this:

    Node node = session.getNodeByUUID(...);
    if (node.isNodeType("nt:version")) {
        node = session.getNodeByUUID(
            node.getProperty("jcr:frozenNode/jcr:frozenUuid").getString());
    }

Note that the version storage can contain version histories of nodes
that do not exist in the workspace you are accessing.

BR,

Jukka Zitting

Mime
View raw message