You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Andreas Schaefer <sc...@me.com> on 2010/02/13 23:59:44 UTC

Adding Multiple Nodes with the Same Name to the Same Parent

Hi

It might just me being stupid but I cannot figure out how someone would create nodes with the same name for the same parent using POST (curl -F ...).

Curl does not accept [] and using the same name means updating the same node.

Thanks - Andy

Re: Adding Multiple Nodes with the Same Name to the Same Parent

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi Andreas,

On Sat, Feb 13, 2010 at 11:59 PM, Andreas Schaefer <sc...@me.com> wrote:
> ...It might just me being stupid but I cannot figure out how someone would create nodes with
> the same name for the same parent using POST (curl -F ...).
> Curl does not accept [] and using the same name means updating the same node....

Even if you cannot create same-name siblings via curl (didn't check if
that's true), they can be created via other means, in code or scripts.

Aynway, using SNS is usually not a good idea, see
http://wiki.apache.org/jackrabbit/DavidsModel#Rule_.234:_Beware_of_Same_Name_Siblings.

-Bertrand

Re: Adding Multiple Nodes with the Same Name to the Same Parent

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

On 13.02.2010 23:59, Andreas Schaefer wrote:
> Hi
> 
> It might just me being stupid but I cannot figure out how someone would create nodes with the same name for the same parent using POST (curl -F ...).
> 
> Curl does not accept [] and using the same name means updating the same node.
> 
> Thanks - Andy
> 

The SlingPostServlet does not support SNS (same name sibblings) at the
moment. While you might request an explicit name using something like

   curl -F:name=thename http://localhost:8888/the/parent/

to create nodes named /the/parent/thename, internally the collision will
be detected and for further calls indices will be generated, so using
the above command 5 times in a row will generate these nodes:

   /the/parent/thename
   /the/parent/thename_0
   /the/parent/thename_1
   /the/parent/thename_2
   /the/parent/thename_3

This is much like SNS with the "enhancement" that index numbers do not
change when a node is removed (like it is the case for SNS).

Regards
Felix