REST interface for creating a lenya document

florent andrĂ© <[email protected]> Wed, 28 Sep 2011 13:00:09 +0200
Newsgroups gmane.comp.cms.lenya.devel
Message-ID <[email protected]>
It's a really first version (names will change).

The more simple usecase for creating one document with specific body

$ curl -X POST 
"http://yourhost/lenya/publication-name/modules/lenyaDocWriting/create" 
-F "[email protected]"

For Frieburg hackers :
$ curl -X POST 
"http://193.196.240.56:8080/lenya/default/modules/lenyaDocWriting/create" -F 
"[email protected]"


content of the addxhtmlfile.xml file (save on you fs do $curl in the 
same folder) :
=========
<?xml version="1.0" encoding="UTF-8"?>

<lenyadoc:lenyadoc xmlns:lenyadoc="http://4sengines/lenyadoc/0.1" 
xmlns:xhtml="http://www.w3.org/1999/xhtml">

   <lenyadoc:parameters>
     <lenyadoc:resourcetype>xhtml</lenyadoc:resourcetype>
     <lenyadoc:pubname>default</lenyadoc:pubname>
     <lenyadoc:parentpath>/tutorial</lenyadoc:parentpath>
     <lenyadoc:language>en</lenyadoc:language>
     <lenyadoc:navtitle>Title of your new document</lenyadoc:navtitle>
   </lenyadoc:parameters>
   <!-- replace the body content of the default resource created -->
   <lenyadoc:content>
     <lenyadoc:contentpath>html</lenyadoc:contentpath>
     <lenyadoc:replacepath>body</lenyadoc:replacepath>
     <lenyadoc:fragment>
       <xhtml:body>
	<xhtml:p> here you have new content !! </xhtml:p>
       </xhtml:body>
     </lenyadoc:fragment>

   </lenyadoc:content>

</lenyadoc:lenyadoc>
=========
end file content