Thank you very much Mathias.  This url worked just fine.
Perhpas you can help me with two other questions:
1) Is there a class or service that would directly support loading and saving a document into a database? I work with a database that supports fileds of BLOB type and I can probably manage to create XInputStreams and XOuputStreams to load and save a document to and fro the database. 2) Once a document is loaded from the database (XInputStream or whatever) into a "local" desktop, can I "reprogram" the Save button of the local version of the writer so that it saves the document back into the database (by launching the creation of a XStorable that sends the data to an OutputStream for example).
Thanks again for your help
----- Original Message ----- From: "Mathias Bauer" <[EMAIL PROTECTED]>
Newsgroups: gmane.comp.openoffice.devel.general
Sent: Tuesday, September 05, 2006 2:54 AM
Subject: Re: Inserting remote document into local desktop


Carlos wrote:

Could you give me some pointers to load a document from an InputStream? In
a Linux server, running OpenOffice in listening mode, I created an OO
document (*.odt) and saved in the file-system of the server. Afterwards, I try to load the document into the desktop of OpenOffice that runs locally in
my PC.  The local desktop shows but it never loads the document via an
InputStream.  The code to load the document into the local desktop is as
follows:

(snip)

            // load new local writer file

            XComponent xLocalWordComponent =
xComponentLoader.loadComponentFromURL("private:factory/swriter", "_blank",
0, loadProps);

The URL you provide will always create a new, empty document, ignoring
any input stream in loadProps. Usually one would expect that the URL
should be empty in this case, but for several reasons this never worked
in OOo and you have to use the "private:stream" URL instead.

            // Display the local desktop


xLocalXDesktop.getCurrentFrame().getContainerWindow().setVisible(true);

This is a superfluous call as you didn't load the file in "hidden" mode.
Beware: making hidden frames visible didn't work in OOo versions prior
to 2.0.3.

BTW: You could also use an http or WebDAV server and load the file
directly with an http URL.

Best regards,
Mathias

--
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to