You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by CQ5 Developer <cq...@googlemail.com> on 2010/02/09 16:30:48 UTC

Create a Tree in the CRX Repository via a single Sling request

Hi,

I am new to sling so forgive me if this is a basic question.

I want to create a tree of nodes from an  XML file  using Sling.
How can I achieve this easily without having to do package imports etc.

I can see how to create a single node using the info on the sling cheat
sheet.

But how do I create a node/child node/grandchild etc etc
without having to make multiple calls.

thanks
Dev

Re: Create a Tree in the CRX Repository via a single Sling request

Posted by Vidar Ramdal <vi...@idium.no>.
On Tue, Feb 9, 2010 at 4:30 PM, CQ5 Developer <cq...@googlemail.com> wrote:

> I am new to sling so forgive me if this is a basic question.
>
> I want to create a tree of nodes from an  XML file  using Sling.
> How can I achieve this easily without having to do package imports etc.
>
> I can see how to create a single node using the info on the sling cheat
> sheet.
>
> But how do I create a node/child node/grandchild etc etc
> without having to make multiple calls.

Hi,

Take a look at the Content Loader:
http://sling.apache.org/site/content-loading-jcrcontentloader.html
Basically it lets you specify JCR content in (an) XML file(s), which
you provide in a bundle that you upload to the Sling server.

If you want to do multiple node creation from a client application,
you could write your own servlet to support that.

Also, take a look at the following issue, which is for posting content
as JSON (which is not yet implemented):
https://issues.apache.org/jira/browse/SLING-1172

-- 
Vidar S. Ramdal <vi...@idium.no> - http://www.idium.no
Sommerrogata 13-15, N-0255 Oslo, Norway
+ 47 22 00 84 00 / +47 21 531941, ext 2070