Andrew Douglas Pitonyak wrote:
I am using OOo 2.0.3 on Linux FC4.
I store a binary file into a database - Base document if it matters.
First I tried to use a stream:
oStatement.setBinaryStream(2, oStream, oStream.getLength())
The error message said that there was an error from the ODBC driver
stating that the stream was NULL. I found that the following works:
lLen = oStream.getLength()
ReDim oData(0 To lLen-1)
oStream.readBytes(oData(), lLen)
oStatement.setBytes(2, oData(), lLen)
I can extract the data from my database to a file.
oSimpleFileAccess.writeFile(sURL, oStream)
Rather than writing the file to disk, I would prefer to load the file
directly.
Dim oProp(0) As New com.sun.star.beans.PropertyValue
oProp(0).Name = "InputStream" : oProp(0).Value = oStream
REM oProp(1).Name = "ReadOnly" : oProp(1).Value = True
REM oProp(2).Name = "FilterName" : oProp(2).Value = "writer8"
StarDesktop.LoadComponentFromUrl("private:stream", "_blank", 0, oProp())
When I try this, however, soffice locks up and I have to manually kill
soffice.
The closest that I could find to a solution is in Java, but it uses a
com.sun.star.lib.uno.adapter.ByteArrayToXInputStreamAdapter
The speculation is that the XInputStream does not support XSeekable.
http://joott.cvs.sourceforge.net/joott/jooconverter2/src/net/sf/jooreports/openoffice/converter/OpenOfficeDocumentConverter.java?view=markup
An "InputStream" property of the MediaDescriptor has to support
XSeekable also. Otherwhise OOo cant deal with it.
But normaly that shouldn't produce a "locked" office instance.
The load request should fail.
But a locked office can be produced by the content you try to load.
Might be the used filter does not match to the type of content you wish
to load. You said that you tried to load a Base document ... but you use
a writer filter ("writer8"). That can produce trouble.
Solutions:
a) Let your stream provide the interface XSeekable.
b) Use another filter or dont specify any filter so
loadComponentFromURL() can search for it's own one.
c) Try to load several other contents, to make sure that your problem is
not related to these.
Regards
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]