[Hippo-cms7-user] Identifying same-name child-nodes of a document

Wouter Danes Wouter.Danes at hinttech.com
Wed Dec 5 11:03:01 CET 2012


Every node in Hippo has its own unique path. If I have the following structure:
A
\--AA
\--AA
\--AA

Then the paths to the different nodes are:
A/AA
A/AA[2]
A/AA[3]

So you can always uniquely identify a node.
Does that help?

From: hippo-cms7-user-bounces at lists.onehippo.org [mailto:hippo-cms7-user-bounces at lists.onehippo.org] On Behalf Of Tobias Jeger
Sent: woensdag 5 december 2012 10:49
To: Hippo CMS 7 implementation list
Subject: [Hippo-cms7-user] Identifying same-name child-nodes of a document

Hi,

I am working on a project which defines a document type with a resource (e.g. hippo:resource) which can be "multiple".
If I create multiple resources, their respective child nodes in the repository will all have the same name (but different content).

In my project's site, a resource container has been setup which, during the rendering of a link to download a certain resource,
creates a URL that uniquely identifies the resource by stripping the node name off the node's path, and replacing it with a
unique attribute of the resource, such as its filename. When the resource is requested (downloaded), that URL needs to be
translated back to the correct instance (node) in order to retrieve the content. This is currently supported by the resource
container looking for the resource with the matching filename.

Now, I also have to support the situation where my document has a "multiple" compound, which in turn contains a resource
(or even a "multiple" resource). This means that homonymous (same name) child nodes exist at arbitrary locations in the URL,
and there may be even multiple homonymous parts. The way to map a node to a URL and back described above fails for this
situation.

I expect that this problem has been tackled before. Is there a best practice? Do I have to start using the resource's UUID as part
of the URL in order to avoid the path jeopardy? Should I be indexing the homonymous nodes, like ".../mydoc/resource-3/filename.ext"?

thanks

Tobi


--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com<http://www.onehippo.com/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onehippo.org/pipermail/hippo-cms7-user/attachments/20121205/395436f9/attachment.htm>


More information about the Hippo-cms7-user mailing list