[api-dev] How can I concatenate a stream word collection

2006-08-31 Thread aloizio

Hi

I need to merge some Word files that are streams. I receive it as a
InputStream collection and I must generate a OutputStream.

I am already able to load them as XInputStream into OpenOffice I but How can
I write a new word document that contains the previous merged?
-- 
View this message in context: 
http://www.nabble.com/How-can-I-concatenate-a-stream-word-collection-tf2197851.html#a6083117
Sent from the openoffice - api dev forum at Nabble.com.

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



Re: [api-dev] How can I concatenate a stream word collection

2006-09-01 Thread Stephan Wunderlich

Hi there,


I need to merge some Word files that are streams. I receive it as a
InputStream collection and I must generate a OutputStream.

I am already able to load them as XInputStream into OpenOffice I  
but How can

I write a new word document that contains the previous merged?


After merging your documents into one you should have an  
XTextDocument which supports the Interface XStorable.
So you should be able to store the Document with code like the  
following in MS Word format.


Dim args(0) as new com.sun.star.beans.PropertyValue
args(0).Name = "FilterName"
args(0).Value = "MS Word 97"
destination = "file:///myhome/documents/output.doc"
xStorable.storeAsURL(destination,args())

Hope that helps

Regards

Stephan

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



Re: [api-dev] How can I concatenate a stream word collection

2006-09-01 Thread aloizio

Hi Stephan,

I am newer in OpenOffice. Could you give me some example that use
XTextDocument?
Because I am understanding. Below theres is a pience of code that I am using
but it doesn't work.


 public OutputStream comporDocumentosDocParaDoc(List colecao) 
  throws java.io.IOException, DocumentException, IOException,
IllegalArgumentException, BootstrapException
  { 
ConversorDeDocumento conversor = new ConversorDeDocumento();
//prepare base document
//move the document to byteArray  
InputStream docBase = (InputStream)colecao.get(0);
ByteArrayOutputStream arrayByteDocBase = new ByteArrayOutputStream();
docBase.toString();
IOUtils.copy(docBase,arrayByteDocBase);
//via URL
File arqBase = new File("M:\\Aloizio_SS\\SINF2\\DOCS\\arq0.doc");
FileOutputStream fout = new FileOutputStream(arqBase,true);
fout.write(arrayByteDocBase.toByteArray());
fout.close(); 

//upload the base document into open office
XComponent docFinal = 
  carregarDocumentoOpenOffice(arqBase, "DOC");   

//iterator over document list
for(int i = 1; i < colecao.size(); i++)
{
  InputStream arqDoc = (InputStream)colecao.get(i);
  //move the document to byte array
  ByteArrayOutputStream arrayByteDoc = new ByteArrayOutputStream();
  IOUtils.copy(arqDoc,arrayByteDoc);
  
  //via URL
  File arqDocAux = new
File("M:\\Aloizio_SS\\SINF2\\DOCS\\arq"+i+".doc");
  FileOutputStream foutAux = new FileOutputStream(arqDocAux);
  foutAux.write(arrayByteDoc.toByteArray());
  foutAux.close();  
  
  
  //consulta a interface XTextDocument para obter o texto
  XTextDocument mxDoc =
(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, docFinal);
  XText mxDocText = mxDoc.getText();
  // create a cursor
  XTextCursor mxDocCursor = mxDocText.createTextCursor();
  mxDocCursor.gotoEnd(false);

  XDocumentInsertable lXDocInsertable = (XDocumentInsertable)UnoRuntime.
  queryInterface(XDocumentInsertable.class, mxDocCursor);

  PropertyValue[] loadProps = new PropertyValue[0]; 
  String url = createUNOFileURL(arqDocAux.getAbsolutePath());
  OOInputStream oois = new OOInputStream(arrayByteDoc.toByteArray()); 
  PropertyValue[] loadProps = new PropertyValue[3]; 
  loadProps[0] = new PropertyValue(); 
  loadProps[0].Name = "Hidden"; 
  loadProps[0].Value = new Boolean(true);   
  loadProps[1] = new PropertyValue(); 
  loadProps[1].Name = "FilterName"; 
  loadProps[1].Value = new Boolean(true); 
  loadProps[2] = new PropertyValue(); 
  loadProps[2].Name = "InputStream"; 
  loadProps[2].Value = oois;  
  lXDocInsertable.insertDocumentFromURL("private:stream", loadProps); 
}   

XStorable xstorable = ( XStorable ) UnoRuntime.queryInterface(
XStorable.class,
docFinal ); 

XComponent xComponent = ( XComponent ) UnoRuntime.queryInterface(
XComponent.class, xstorable );
xComponent.dispose();  
 
byte[] docFundido = obterDocumentoComposto(docFinal);
InputStream fim = new ByteArrayInputStream(docFundido);
OutputStream out = new ByteArrayOutputStream();
IOUtils.copy(fim,out);
return out;
  }  

thanks.



Stephan Wunderlich wrote:
> 
> Hi there,
> 
>> I need to merge some Word files that are streams. I receive it as a
>> InputStream collection and I must generate a OutputStream.
>>
>> I am already able to load them as XInputStream into OpenOffice I  
>> but How can
>> I write a new word document that contains the previous merged?
> 
> After merging your documents into one you should have an  
> XTextDocument which supports the Interface XStorable.
> So you should be able to store the Document with code like the  
> following in MS Word format.
> 
> Dim args(0) as new com.sun.star.beans.PropertyValue
> args(0).Name = "FilterName"
> args(0).Value = "MS Word 97"
> destination = "file:///myhome/documents/output.doc"
> xStorable.storeAsURL(destination,args())
> 
> Hope that helps
> 
> Regards
> 
> Stephan
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-can-I-concatenate-a-stream-word-collection-tf2197851.html#a6098023
Sent from the openoffice - api dev forum at Nabble.com.

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



Re: [api-dev] How can I concatenate a stream word collection

2006-09-01 Thread Stephan Wunderlich

Hi there,


I am newer in OpenOffice. Could you give me some example that use
XTextDocument?
Because I am understanding. Below theres is a pience of code that I  
am using

but it doesn't work.


 public OutputStream comporDocumentosDocParaDoc(List colecao)
  throws java.io.IOException, DocumentException, IOException,
IllegalArgumentException, BootstrapException
  {
ConversorDeDocumento conversor = new ConversorDeDocumento();
//prepare base document
//move the document to byteArray
InputStream docBase = (InputStream)colecao.get(0);
ByteArrayOutputStream arrayByteDocBase = new  
ByteArrayOutputStream();

docBase.toString();
IOUtils.copy(docBase,arrayByteDocBase);
//via URL
File arqBase = new File("M:\\Aloizio_SS\\SINF2\\DOCS\\arq0.doc");
FileOutputStream fout = new FileOutputStream(arqBase,true);
fout.write(arrayByteDocBase.toByteArray());
fout.close();

//upload the base document into open office
XComponent docFinal =
  carregarDocumentoOpenOffice(arqBase, "DOC");

//iterator over document list
for(int i = 1; i < colecao.size(); i++)
{
  InputStream arqDoc = (InputStream)colecao.get(i);
  //move the document to byte array
  ByteArrayOutputStream arrayByteDoc = new ByteArrayOutputStream 
();

  IOUtils.copy(arqDoc,arrayByteDoc);

  //via URL
  File arqDocAux = new
File("M:\\Aloizio_SS\\SINF2\\DOCS\\arq"+i+".doc");
  FileOutputStream foutAux = new FileOutputStream(arqDocAux);
  foutAux.write(arrayByteDoc.toByteArray());
  foutAux.close();


  //consulta a interface XTextDocument para obter o texto
  XTextDocument mxDoc =
(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class,  
docFinal);

  XText mxDocText = mxDoc.getText();
  // create a cursor
  XTextCursor mxDocCursor = mxDocText.createTextCursor();
  mxDocCursor.gotoEnd(false);

  XDocumentInsertable lXDocInsertable = (XDocumentInsertable) 
UnoRuntime.

  queryInterface(XDocumentInsertable.class, mxDocCursor);

  PropertyValue[] loadProps = new PropertyValue[0];
  String url = createUNOFileURL(arqDocAux.getAbsolutePath());
  OOInputStream oois = new OOInputStream 
(arrayByteDoc.toByteArray());

  PropertyValue[] loadProps = new PropertyValue[3];
  loadProps[0] = new PropertyValue();
  loadProps[0].Name = "Hidden";
  loadProps[0].Value = new Boolean(true);
  loadProps[1] = new PropertyValue();
  loadProps[1].Name = "FilterName";
  loadProps[1].Value = new Boolean(true);
  loadProps[2] = new PropertyValue();
  loadProps[2].Name = "InputStream";
  loadProps[2].Value = oois;
  lXDocInsertable.insertDocumentFromURL("private:stream",  
loadProps);

}

XStorable xstorable = ( XStorable ) UnoRuntime.queryInterface(
XStorable.class,
docFinal );



here you query XStorable, which should work properly, but you don't  
use it to actually store the document.



XComponent xComponent = ( XComponent ) UnoRuntime.queryInterface(
XComponent.class, xstorable );
xComponent.dispose();


Here you dispose the document and with that destroy it ... generally  
XCloseable.close() should work smoother :-)



byte[] docFundido = obterDocumentoComposto(docFinal);
InputStream fim = new ByteArrayInputStream(docFundido);
OutputStream out = new ByteArrayOutputStream();
IOUtils.copy(fim,out);
return out;


mmm ... some lines above you dispose docFinal and now you try to  
write something related to it to a java  output stream ?


Is the goal to have a Microsoft word document on disk after merging  
several document in one ?


I'm a bit lost here.

Regards

Stephan

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



Re: [api-dev] How can I concatenate a stream word collection

2006-09-01 Thread aloizio

Hi

My goal is to store the merged document on a database as a byteArray. I am
not being able to do this. Then I am trying to stored the merged document on
disk and after moving it to the database.

Do you know where I can find one example about this?

In my current code I want to read a lot of word document from database as an
InputStream array, but I   am not being able to merge them into another
document.

regards


Stephan Wunderlich wrote:
> 
> Hi there,
> 
>> I am newer in OpenOffice. Could you give me some example that use
>> XTextDocument?
>> Because I am understanding. Below theres is a pience of code that I  
>> am using
>> but it doesn't work.
>>
>>
>>  public OutputStream comporDocumentosDocParaDoc(List colecao)
>>   throws java.io.IOException, DocumentException, IOException,
>> IllegalArgumentException, BootstrapException
>>   {
>> ConversorDeDocumento conversor = new ConversorDeDocumento();
>> //prepare base document
>> //move the document to byteArray
>> InputStream docBase = (InputStream)colecao.get(0);
>> ByteArrayOutputStream arrayByteDocBase = new  
>> ByteArrayOutputStream();
>> docBase.toString();
>> IOUtils.copy(docBase,arrayByteDocBase);
>> //via URL
>> File arqBase = new File("M:\\Aloizio_SS\\SINF2\\DOCS\\arq0.doc");
>> FileOutputStream fout = new FileOutputStream(arqBase,true);
>> fout.write(arrayByteDocBase.toByteArray());
>> fout.close();
>>
>> //upload the base document into open office
>> XComponent docFinal =
>>   carregarDocumentoOpenOffice(arqBase, "DOC");
>>
>> //iterator over document list
>> for(int i = 1; i < colecao.size(); i++)
>> {
>>   InputStream arqDoc = (InputStream)colecao.get(i);
>>   //move the document to byte array
>>   ByteArrayOutputStream arrayByteDoc = new ByteArrayOutputStream 
>> ();
>>   IOUtils.copy(arqDoc,arrayByteDoc);
>>
>>   //via URL
>>   File arqDocAux = new
>> File("M:\\Aloizio_SS\\SINF2\\DOCS\\arq"+i+".doc");
>>   FileOutputStream foutAux = new FileOutputStream(arqDocAux);
>>   foutAux.write(arrayByteDoc.toByteArray());
>>   foutAux.close();
>>
>>
>>   //consulta a interface XTextDocument para obter o texto
>>   XTextDocument mxDoc =
>> (XTextDocument)UnoRuntime.queryInterface(XTextDocument.class,  
>> docFinal);
>>   XText mxDocText = mxDoc.getText();
>>   // create a cursor
>>   XTextCursor mxDocCursor = mxDocText.createTextCursor();
>>   mxDocCursor.gotoEnd(false);
>>
>>   XDocumentInsertable lXDocInsertable = (XDocumentInsertable) 
>> UnoRuntime.
>>   queryInterface(XDocumentInsertable.class, mxDocCursor);
>>
>>   PropertyValue[] loadProps = new PropertyValue[0];
>>   String url = createUNOFileURL(arqDocAux.getAbsolutePath());
>>   OOInputStream oois = new OOInputStream 
>> (arrayByteDoc.toByteArray());
>>   PropertyValue[] loadProps = new PropertyValue[3];
>>   loadProps[0] = new PropertyValue();
>>   loadProps[0].Name = "Hidden";
>>   loadProps[0].Value = new Boolean(true);
>>   loadProps[1] = new PropertyValue();
>>   loadProps[1].Name = "FilterName";
>>   loadProps[1].Value = new Boolean(true);
>>   loadProps[2] = new PropertyValue();
>>   loadProps[2].Name = "InputStream";
>>   loadProps[2].Value = oois;
>>   lXDocInsertable.insertDocumentFromURL("private:stream",  
>> loadProps);
>> }
>>
>> XStorable xstorable = ( XStorable ) UnoRuntime.queryInterface(
>> XStorable.class,
>> docFinal );
>>
> 
> here you query XStorable, which should work properly, but you don't  
> use it to actually store the document.
> 
>> XComponent xComponent = ( XComponent ) UnoRuntime.queryInterface(
>> XComponent.class, xstorable );
>> xComponent.dispose();
> 
> Here you dispose the document and with that destroy it ... generally  
> XCloseable.close() should work smoother :-)
> 
>> byte[] docFundido = obterDocumentoComposto(docFinal);
>> InputStream fim = new ByteArrayInputStream(docFundido);
>> OutputStream out = new ByteArrayOutputStream();
>> IOUtils.copy(fim,out);
>> return out;
> 
> mmm ... some lines above you dispose docFinal and now you try to  
> write something related to it to a java  output stream ?
> 
> Is the goal to have a Microsoft word document on disk after merging  
> several document in one ?
> 
> I'm a bit lost here.
> 
> Regards
> 
> Stephan
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-can-I-concatenate-a-stream-word-collection-tf2197851.html#a6101748
Sent from the openoffice - api dev forum at Nabble.com.

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



Re: [api-dev] How can I concatenate a stream word collection

2006-09-01 Thread aloizio


Hi Stephan 

Now I am merging the documents using URL and then store the merged document
on disk. I have some HTML files that are converted on WORD files (stream)
after they are merged on only one WORD document. You can see the result by
the attached files. The final document looses the text format and the others
documents only appear their code. Why?








Stephan Wunderlich wrote:
> 
> Hi there,
> 
>> I am newer in OpenOffice. Could you give me some example that use
>> XTextDocument?
>> Because I am understanding. Below theres is a pience of code that I  
>> am using
>> but it doesn't work.
>>
>>
>>  public OutputStream comporDocumentosDocParaDoc(List colecao)
>>   throws java.io.IOException, DocumentException, IOException,
>> IllegalArgumentException, BootstrapException
>>   {
>> ConversorDeDocumento conversor = new ConversorDeDocumento();
>> //prepare base document
>> //move the document to byteArray
>> InputStream docBase = (InputStream)colecao.get(0);
>> ByteArrayOutputStream arrayByteDocBase = new  
>> ByteArrayOutputStream();
>> docBase.toString();
>> IOUtils.copy(docBase,arrayByteDocBase);
>> //via URL
>> File arqBase = new File("M:\\Aloizio_SS\\SINF2\\DOCS\\arq0.doc");
>> FileOutputStream fout = new FileOutputStream(arqBase,true);
>> fout.write(arrayByteDocBase.toByteArray());
>> fout.close();
>>
>> //upload the base document into open office
>> XComponent docFinal =
>>   carregarDocumentoOpenOffice(arqBase, "DOC");
>>
>> //iterator over document list
>> for(int i = 1; i < colecao.size(); i++)
>> {
>>   InputStream arqDoc = (InputStream)colecao.get(i);
>>   //move the document to byte array
>>   ByteArrayOutputStream arrayByteDoc = new ByteArrayOutputStream 
>> ();
>>   IOUtils.copy(arqDoc,arrayByteDoc);
>>
>>   //via URL
>>   File arqDocAux = new
>> File("M:\\Aloizio_SS\\SINF2\\DOCS\\arq"+i+".doc");
>>   FileOutputStream foutAux = new FileOutputStream(arqDocAux);
>>   foutAux.write(arrayByteDoc.toByteArray());
>>   foutAux.close();
>>
>>
>>   //consulta a interface XTextDocument para obter o texto
>>   XTextDocument mxDoc =
>> (XTextDocument)UnoRuntime.queryInterface(XTextDocument.class,  
>> docFinal);
>>   XText mxDocText = mxDoc.getText();
>>   // create a cursor
>>   XTextCursor mxDocCursor = mxDocText.createTextCursor();
>>   mxDocCursor.gotoEnd(false);
>>
>>   XDocumentInsertable lXDocInsertable = (XDocumentInsertable) 
>> UnoRuntime.
>>   queryInterface(XDocumentInsertable.class, mxDocCursor);
>>
>>   PropertyValue[] loadProps = new PropertyValue[0];
>>   String url = createUNOFileURL(arqDocAux.getAbsolutePath());
>>   OOInputStream oois = new OOInputStream 
>> (arrayByteDoc.toByteArray());
>>   PropertyValue[] loadProps = new PropertyValue[3];
>>   loadProps[0] = new PropertyValue();
>>   loadProps[0].Name = "Hidden";
>>   loadProps[0].Value = new Boolean(true);
>>   loadProps[1] = new PropertyValue();
>>   loadProps[1].Name = "FilterName";
>>   loadProps[1].Value = new Boolean(true);
>>   loadProps[2] = new PropertyValue();
>>   loadProps[2].Name = "InputStream";
>>   loadProps[2].Value = oois;
>>   lXDocInsertable.insertDocumentFromURL("private:stream",  
>> loadProps);
>> }
>>
>> XStorable xstorable = ( XStorable ) UnoRuntime.queryInterface(
>> XStorable.class,
>> docFinal );
>>
> 
> here you query XStorable, which should work properly, but you don't  
> use it to actually store the document.
> 
>> XComponent xComponent = ( XComponent ) UnoRuntime.queryInterface(
>> XComponent.class, xstorable );
>> xComponent.dispose();
> 
> Here you dispose the document and with that destroy it ... generally  
> XCloseable.close() should work smoother :-)
> 
>> byte[] docFundido = obterDocumentoComposto(docFinal);
>> InputStream fim = new ByteArrayInputStream(docFundido);
>> OutputStream out = new ByteArrayOutputStream();
>> IOUtils.copy(fim,out);
>> return out;
> 
> mmm ... some lines above you dispose docFinal and now you try to  
> write something related to it to a java  output stream ?
> 
> Is the goal to have a Microsoft word document on disk after merging  
> several document in one ?
> 
> I'm a bit lost here.
> 
> Regards
> 
> Stephan
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
http://www.nabble.com/user-files/235838/teste1.html teste1.html 
http://www.nabble.com/user-files/235839/teste2.doc teste2.doc 
http://www.nabble.com/user-files/235840/teste3.html teste3.html 
http://www.nabble.com/user-files/235841/mergedDocument.doc
mergedDocument.doc 
-- 
View this message in context: 
http://www.nabble.com/How-can-I-concatenate-a-stream-word-collection-tf2197851.html#a6105229
Sent from the openoffice - api dev forum at 

Re: [api-dev] How can I concatenate a stream word collection

2006-09-02 Thread Stephan Wunderlich

Hi there,

Now I am merging the documents using URL and then store the merged  
document
on disk. I have some HTML files that are converted on WORD files  
(stream)
after they are merged on only one WORD document. You can see the  
result by
the attached files. The final document looses the text format and  
the others

documents only appear their code. Why?


Not sure why you use the way via HTML to merge the documents, but  
there might be some problems with formatting when using this filter.


The codesnipped ... http://codesnippets.services.openoffice.org/ 
Writer/Writer.MergeDocs.snip ... might give you an idea how to merge  
several documents into one.


http://api.openoffice.org/docs/DevelopersGuide/OfficeDev/ 
OfficeDev.xhtml#1_1_5_1_Loading_Documents ... should give you some  
general information on the ways to load documents.


Hope that helps

Regards

Stephan

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



Re: [api-dev] How can I concatenate a stream word collection

2006-09-07 Thread Andrew Douglas Pitonyak

aloizio wrote:


Hi

My goal is to store the merged document on a database as a byteArray. I am
not being able to do this. Then I am trying to stored the merged document on
disk and after moving it to the database.

Do you know where I can find one example about this?

In my current code I want to read a lot of word document from database as an
InputStream array, but I   am not being able to merge them into another
document

In AndrewBase.odt, I have an example that opens a document, creates a 
byte array, and dumps that into a database. I attempted to stream the 
data into the database, but streaming did not work. I had to obtain a 
byte array from the stream and then store that into the database.


--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html

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



Re: [api-dev] How can I concatenate a stream word collection

2006-09-08 Thread aloizio

Hi

I am able to store a document like a stream into database using BLOB, but I
am not able to merge the documents that are in stream format.



Andrew Douglas Pitonyak wrote:
> 
> aloizio wrote:
> 
>>Hi
>>
>>My goal is to store the merged document on a database as a byteArray. I am
>>not being able to do this. Then I am trying to stored the merged document
on
>>disk and after moving it to the database.
>>
>>Do you know where I can find one example about this?
>>
>>In my current code I want to read a lot of word document from database as
an
>>InputStream array, but I   am not being able to merge them into another
>>document
>>
> In AndrewBase.odt, I have an example that opens a document, creates a 
> byte array, and dumps that into a database. I attempted to stream the 
> data into the database, but streaming did not work. I had to obtain a 
> byte array from the stream and then store that into the database.
> 
> -- 
> Andrew Pitonyak
> My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
> My Book: http://www.hentzenwerke.com/catalog/oome.htm
> Info:  http://www.pitonyak.org/oo.php
> See Also: http://documentation.openoffice.org/HOW_TO/index.html
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-can-I-concatenate-a-stream-word-collection-tf2197851.html#a6208679
Sent from the openoffice - api dev forum at Nabble.com.

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



Re: [api-dev] How can I concatenate a stream word collection

2006-09-08 Thread Andrew Douglas Pitonyak
I was never able to insert one document into another using a stream... I 
can open a document using certain types of streams (Never from a stream 
obtained from a database), but not insert (note that I use Basic).


aloizio wrote:


Hi

I am able to store a document like a stream into database using BLOB, but I
am not able to merge the documents that are in stream format.

 


--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html

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



Re: [api-dev] How can I concatenate a stream word collection

2006-09-09 Thread Mathias Bauer
aloizio wrote:

> Hi
> 
> I need to merge some Word files that are streams. I receive it as a
> InputStream collection and I must generate a OutputStream.
> 
> I am already able to load them as XInputStream into OpenOffice I but How can
> I write a new word document that contains the previous merged?

Do you mean that you want to concatenate the documents, i.e. load the
first one, attach the second one etc.?

It *could* work by using the XDocumentInsertable interface but
unfortunately the implementation of this interface in Writer has a bug:
it doesn't load from a stream, only from a URL.

So you can load the first document from a stream, put all others into a
temporary file and insert them using the URL. Or you could wait until
the bug is fixed (should be next version past the upcoming 2.0.1
release). I don't remember the Issue ID but I know there is one.

Then you can save the whole file to an empty stream and push it into
your database.

Besr

-- 
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]



Re: [api-dev] How can I concatenate a stream word collection

2006-09-11 Thread aloizio

That's ok. I am using for while a temporary file.



Mathias Bauer wrote:
> 
> aloizio wrote:
> 
>> Hi
>> 
>> I need to merge some Word files that are streams. I receive it as a
>> InputStream collection and I must generate a OutputStream.
>> 
>> I am already able to load them as XInputStream into OpenOffice I but How
>> can
>> I write a new word document that contains the previous merged?
> 
> Do you mean that you want to concatenate the documents, i.e. load the
> first one, attach the second one etc.?
> 
> It *could* work by using the XDocumentInsertable interface but
> unfortunately the implementation of this interface in Writer has a bug:
> it doesn't load from a stream, only from a URL.
> 
> So you can load the first document from a stream, put all others into a
> temporary file and insert them using the URL. Or you could wait until
> the bug is fixed (should be next version past the upcoming 2.0.1
> release). I don't remember the Issue ID but I know there is one.
> 
> Then you can save the whole file to an empty stream and push it into
> your database.
> 
> Besr
> 
> -- 
> 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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-can-I-concatenate-a-stream-word-collection-tf2197851.html#a6247376
Sent from the openoffice - api dev forum at Nabble.com.

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