Hi Juan
I've got a blob as a result of merging some odt files. This blob will be
the content of a document but I need to set into it some user
information before (the repo url of the document in which the blob will
be stored).
XDocumentInfo in ooo handles loaded components so I need the component url.
Yes as discussed with Richard, this is the easiest way i think
Or maybe an ID of you document and a query when needed and let your
restlet calculate dynamically.
I think the best place to do it is in the method saveDocument in
OfficeMergeImpl, just before odt file become a blob, of course It is not
possible unless I rewrite officemerger.
Another way I can think is get a new File from the merged blob, set the
info and again get a blob, maybe complicated.
You'll need to access an OOo object. Fortunatelly, the OfficeMerger
exposes the NxOpenOfficeConnection object
You may have a look at testOpenCloseConnection() test in officeMerger
module for a use case example.
Once your OOo desktop obtained, you will have to use the
loadComponentFromURL() method for your file.
Be aware that OOo, by default needs URL.
You can also load from inputStream if you want to avoid using files
(but, may result in slower processing).
have a look at
http://api.openoffice.org/docs/DevelopersGuide/OfficeDev/OfficeDev.xhtml#1_1_5_1_Loading_Documents
and
http://api.openoffice.org/docs/common/ref/com/sun/star/document/MediaDescriptor.html#InputStream
It is the same approach than for saving in an outpuStream you have in
the NxOOoConnector
For your XDocumentInfo itself, have a look at
http://api.openoffice.org/docs/common/ref/com/sun/star/document/XDocumentInfoSupplier.html
Feel free to ask if any question
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