| View previous topic :: View next topic |
| Author |
Message |
sebastians Newbie

Joined: 28 Dec 2005 Posts: 1
|
Posted: Wed Dec 28, 2005 2:40 pm Post subject: insertDocumentFromURL and private:stream |
|
|
| It is posiible to use "private:stream" as url parameter for XDocumentInsertable.insertDocumentFromURL ? |
|
| Back to top |
|
 |
n0mer General User


Joined: 20 Mar 2006 Posts: 46
|
Posted: Mon Jun 26, 2006 6:58 am Post subject: Re: insertDocumentFromURL and private:stream |
|
|
| sebastians wrote: | | It is posiible to use "private:stream" as url parameter for XDocumentInsertable.insertDocumentFromURL ? |
Why not?
http://api.openoffice.org/docs/DevelopersGuide/Text/Text.xhtml#1_3_1_5_Inserting_Text_Files
| Quote: |
Inserting Text Files
The text cursor in writer supports the interface com.sun.star.document.XDocumentInsertable which has a single method to insert a file at the current cursor position:
void insertDocumentFromURL( [in] string aURL,
[in] sequence< com::sun::star::beans::PropertyValue > aOptions)
Pass a URL and an empty sequence of PropertyValue structs. However, load properties could be used as described in com.sun.star.document.MediaDescriptor.
|
MediaDescriptor supports loading document content from InputStream:
http://api.openoffice.org/docs/common/ref/com/sun/star/document/MediaDescriptor.html
| Quote: |
::com::sun::star::io::XInputStream
InputStream [ OPTIONAL ]
content of document
|
|
|
| Back to top |
|
 |
n0mer General User


Joined: 20 Mar 2006 Posts: 46
|
Posted: Mon Jun 26, 2006 9:46 am Post subject: Re: insertDocumentFromURL and private:stream |
|
|
| sebastians wrote: | | It is posiible to use "private:stream" as url parameter for XDocumentInsertable.insertDocumentFromURL ? |
But...i got IllegalArgumentException with the following code
(hidden parameter is removed as it suggested here: http://www.oooforum.org/forum/viewtopic.phtml?p=77866#77866 ) :
| Code: |
PropertyValue[] loadProps = new PropertyValue[] {
// makeProperty("Hidden", Boolean.TRUE),
makeProperty("FilterName", "HTML (StarWriter)"), //writer_web_HTML_help
makeProperty("InputStream", new OOInputStream(html.getBytes()))
};
xDocumentInsertable.insertDocumentFromURL("private:stream", loadProps);
|
No visible way to find sources for Java implementation of XDocumentInsertable class
to debug them: i downloaded OOo_2.0.2_src.tar.gz (293M), but there are no sources.
Only these files:
| Quote: |
./OOB680_m5/qadevOOo/testdocs/XDocumentInsertable.sxw
./OOB680_m5/qadevOOo/tests/basic/ifc/document/XDocumentInsertable
./OOB680_m5/qadevOOo/tests/basic/ifc/document/XDocumentInsertable/CVS
./OOB680_m5/qadevOOo/tests/basic/ifc/document/XDocumentInsertable/CVS/Template
./OOB680_m5/qadevOOo/tests/basic/ifc/document/XDocumentInsertable/CVS/Entries
./OOB680_m5/qadevOOo/tests/basic/ifc/document/XDocumentInsertable/CVS/Tag
./OOB680_m5/qadevOOo/tests/basic/ifc/document/XDocumentInsertable/CVS/Root
./OOB680_m5/qadevOOo/tests/basic/ifc/document/XDocumentInsertable/CVS/Repository
./OOB680_m5/qadevOOo/tests/basic/ifc/document/XDocumentInsertable/script.xlb
./OOB680_m5/qadevOOo/tests/basic/ifc/document/XDocumentInsertable/document_XDocumentInsertable.xba
./OOB680_m5/qadevOOo/tests/java/ifc/document/_XDocumentInsertable.java
./OOB680_m5/offapi/com/sun/star/document/XDocumentInsertable.idl
./OOB680_m5/sw/qa/unoapi/testdocuments/XDocumentInsertable.sxw
|
|
|
| Back to top |
|
 |
n0mer General User


Joined: 20 Mar 2006 Posts: 46
|
Posted: Mon Jun 26, 2006 11:57 pm Post subject: Re: insertDocumentFromURL and private:stream |
|
|
| n0mer wrote: | IllegalArgumentException with the following code
(hidden parameter is removed as it suggested here: http://www.oooforum.org/forum/viewtopic.phtml?p=77866#77866 ) :
| Code: |
PropertyValue[] loadProps = new PropertyValue[] {
// makeProperty("Hidden", Boolean.TRUE),
makeProperty("FilterName", "HTML (StarWriter)"), //writer_web_HTML_help
makeProperty("InputStream", new OOInputStream(html.getBytes()))
};
xDocumentInsertable.insertDocumentFromURL("private:stream", loadProps);
|
|
It seems possible load document from stream first,
then insert it via API.
Here ( http://www.oooforum.org/forum/viewtopic.phtml?p=15281#15281 ) is java source code for iteration over text paragraphs in Writer document, followed with well-argumented discussion.
And, still unable to find the way how to debug source code of insertDocumentFromURL() method 
Last edited by n0mer on Tue Jun 27, 2006 7:34 am; edited 2 times in total |
|
| Back to top |
|
 |
n0mer General User


Joined: 20 Mar 2006 Posts: 46
|
|
| Back to top |
|
 |
|