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: Interlinking content items
Date Mon, 04 Dec 2006 11:36:16 GMT
Hi,

On 12/4/06, Marcel Dullaart <marcel.dullaart@gmail.com> wrote:
> So that means that my custom rendering engine, in my case a portlet, is
> repsonsible for handling the references, using the uuid in the anchor tag of
> the action URL for instance?

Yes. In any case your application needs to be aware of and handle the
reference. The exact mechanism of doing so is up to you.

If your portlet uses JCR paths for navigation, then you can simply
link to the path of the target node instead of exposing the UUID if
you like:

    String path = source.getProperty("my:reference").getNode().getPath();
    // separate request
    Node target = (Node) session.getItem(path);

However, if the portlet uses UUIDs for identifying nodes, then you can
simply expose that:

    String uuid = source.getProperty("my:reference").getString()
    // separate request
    Node target = session.getNodeByUUID(uuid);

Or if the reference property is known, then you can also use the
source node to identify the target:

    String path = source.getPath();
    // separate request
    Node target = ((Node)
session.getItem(path)).getProperty("my:reference").getNode();

These all assume that the target node is rendered in a separate
portlet or request.

BR,

Jukka Zitting

Mime
View raw message