sling-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bertrand Delacretaz <>
Subject Re: Content creation based on a JSON object
Date Tue, 21 Jun 2011 10:08:51 GMT

On Mon, Jun 13, 2011 at 6:53 PM, Xavi Beumala <> wrote:
> I'm creating content structures using the slingPostServlet by passing a JSON object.
In the Sling documentation it says that this is an :operation=import and it works perfectly
> Is there any major difference I should take into consideration compared to when I create
content using a simple key/value post request? Is the import process different to POST content
creation other than the JSON format of the object to be created?

It is different in that it uses Sling's ContentImporter service, which
is also used for initial content loading for example.

I don't think there are major differences but it's obviously less fine-grained.

> On the other hand, if I specify :replace to replace the entire object graph and the node
is versionable will a new version of the node be checked in? Or does the import remove the
to-be-replaced node an create a complete new one?...

I'm not familiar with the automatic versioning features of the post
servlet unfortunately - looking at the ImportOperation code I'd say
those are handled in the same way as with other POST operations, in
the AbstractCreateOperation and AbstractPostOperation classes.


View raw message