On Tue, Feb 9, 2010 at 4:30 PM, CQ5 Developer <[email protected]> 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 <[email protected]> - http://www.idium.no
Sommerrogata 13-15, N-0255 Oslo, Norway
+ 47 22 00 84 00 / +47 21 531941, ext 2070

Reply via email to