OK

I've just read more or less 23 times Chapter 29. Nuxeo Restlet API,
and I've only got some ideas.

1.- This is how my restlet registration should look like, I think

<extension 
target="org.nuxeo.ecm.platform.ui.web.restAPI.service.PluggableRestletService"
      point="restlets">
   <restletPlugin
           name="updateContent"
           class="org.nuxeo.ecm.platform.ui.web.restAPI.UpdateContentRestlet"
           enabled="true"
           useSeam="true"
           useConversation="false">
           <urlPatterns>
               <urlPattern>/{repo}/{docid}/{file}/updateContent</urlPattern>
           </urlPatterns>
   </restletPlugin>

-->... "you need to contribute to the restlets extension point exposed by
org.nuxeo.ecm.platform.ui.web.restAPI.service.PluggableRestletService." HOW?

2.- My UpdateContentRestlet class.

In handle():

-- I have to get the document I want to update its content by means of the
docid.
            ......................................
            DocumentModel dm = documentManager.getDocument(new
IdRef(docid));

-- get the update file
            ...........................................
            repr = req.getEntity();
            InputStream content = repr.getStream();
            Blob newContent = new FileBlob(content)

-- set property?? (not sure)
            dm.setProperty("file","content",newContent)
            ................................................................
            Element updateContent = result.addElement("updateContent");

.................................................................
-- And finally I seat to have a cup of coffee because I do not know how to
set the element updateContent

Any tips, please?
Thanks


2007/10/29, Laurent Godard <[EMAIL PROTECTED]>:
>
> Hi Juan
>
> > Thanks for your answer, saveDocument() in OfficeMergerImpl gave me the
> > clue as how to get the place the temp odt file is. I already can create,
> > add info and upload a odt docu to the nuxeo repo.
> >
>
> ok :)
>
> > Now i have to develope a restlet that put the merged file as content of
> > a document already is in the repo.
> > I understand more or less how Nuxeo default restlets work.
> >
>
> did you have a look at
>
> http://doc.nuxeo.org/current/reference/html-single/nuxeo-book.html#nuxeo-restlet-api
>
> Laurent
>
> --
> Laurent Godard <[EMAIL PROTECTED]> - Ingénierie OpenOffice.org -
> http://www.indesko.com
> Nuxeo Enterprise Content Management >> http://www.nuxeo.com -
> http://www.nuxeo.org
> Livre "Programmation OpenOffice.org", Eyrolles 2004-2006
>
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to