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