You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by ms...@email.cz on 2012/02/17 18:02:34 UTC
Node naming
Hello,
I just realized following behaviour in node naming when I use the same node name for children. Say I have 2 nodes with the same name. Then Jackrabbit uses following path to distinguish them: /path/node and /path/node[1]. If I delete first node '/path/node' then node originally with absolute path '/path/node[1]' will now have absolute path '/path/node'.
It means I cannot use path '/path/node[1]' to locate second node. I must use either jcr:uuid or use unique node names for my nodes
Am I right?
Thanks
Marek
Re: Node naming
Posted by Julian Reschke <ju...@gmx.de>.
On 2012-02-17 18:02, mslama@email.cz wrote:
> Hello,
>
> I just realized following behaviour in node naming when I use the same node name for children. Say I have 2 nodes with the same name. Then Jackrabbit uses following path to distinguish them: /path/node and /path/node[1]. If I delete first node '/path/node' then node originally with absolute path '/path/node[1]' will now have absolute path '/path/node'.
>
> It means I cannot use path '/path/node[1]' to locate second node. I must use either jcr:uuid or use unique node names for my nodes
>
> Am I right?
The first one should be available as both node and node[1]; the second
one as node[2]. Until you delete the first, of course.
Best regards, Julian
Re: Node naming
Posted by Mark Herman <MH...@NBME.org>.
First of all sns are pretty tricky and usually not recommended unless really
needed [0]. As I recall the array worked like a stack, last in, first out
when referencing without the array index, so that means the entire array
shifts when you do that. See also [1] and [2].
Yes you are right, but I'd suggest avoiding them entirely if possible. If
you don't already know, you can accomplish that by using a node type that
has sns disabled (custom, or a default one like nt:folder).
[0]
http://wiki.apache.org/jackrabbit/DavidsModel#Rule_.234:_Beware_of_Same_Name_Siblings.
[1] http://www.day.com/specs/jcr/2.0/22_Same-Name_Siblings.html
[2] http://www.day.com/specs/jcr/2.0/23_Orderable_Child_Nodes.html
--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Node-naming-tp4397832p4398085.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.