Hi,

Am Freitag, den 09.05.2008, 18:14 +0100 schrieb Paul Noden:
> The Import/Export round-trip is something that's critical once
> projects start to migrate or backup content, so I'm working on
> introducing a mechanism for importing content on the sling level.
> Script import/export is available using the webdav interface and
> doesn't need any special support, and we already have a suitable
> content export model - JSON.  A suggestion from Felix was to introduce
> a :import post parameter which would take the JSON file as a direct
> input. The filename itself is irrelevant, and it's content should
> always be JSON.

Good. And I agree, that - initially - the format to support might be
JSON, that is ok. We can still extend this, if we find that we would
need to support more formats. What is essential to me is, that the we
support round-tripping on machine-readable formats as far as possible.

> 
> The import assumes create and overwrite but not delete so the
> following would recreate the contents of /content, leaving nodes not
> in the file untouched.
> curl -F":[EMAIL PROTECTED]" http://admin:[EMAIL PROTECTED]:8888/content

I think, we sould align the import through the POST Servlet to the
import functionality of the initial content load. That is by adding
parameters similar to the ones defined for the Sling-Initial-Content
manifest header, we can align the functionality.

> 
> I've written the import method to be performed last in the stack of
> operations - the post method allows us to send multiple operations, so
> the following would delete the existing content and then import the
> content from the file.
> curl -F":delete=/content" -F":[EMAIL PROTECTED]"
> http://admin:[EMAIL PROTECTED]:8888/content

Toby is right, that such a thing will not be possible anymore in a
single operation after SLING-422 is implemented. But this is a detail I
don't care too much right now in this context.

> 
> In addition to your thoughts on the above, I would like suggestions on
> the simplest method for only importing new/deleted nodes - does it
> really require an additional flag/operation?
> 
> WDYT on introducing the new operation to the sling client library?
> Would we want to introduce a content import form to allow a GUI
> approach to Import/Export? Probably through the creation of a simple
> admin bundle?

Yes, why not ... Seems to be worth a discussion. In fact, I planned to
start a thread on more generic import/export support and esp.
round-tripping.

> 
> The work seems most likely be contained entirely within the
> SlingPostProcessor and SlingPostServlet objects, and am working on it
> at the moment.

Regards
Felix

Reply via email to