On 5/9/08, Paul Noden <[EMAIL PROTECTED]> wrote: > 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. my first question is: why introducing a new import/export format when JCR already defines the sysview XML for exact that purpose? furthermore, the API provides methods for exporting and importing.
> 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'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 please note, that the multi-commands will be removed shortly. see https://issues.apache.org/jira/browse/SLING-422 for details. > 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? > > The work seems most likely be contained entirely within the > SlingPostProcessor and SlingPostServlet objects, and am working on it > at the moment. i think it could be an added value to add support for importing sysview serializations via the default PostServlet. but then the default GET servlet should also be able to produce sysview exports (don't know if this is already implemented). -- regards, toby
