Re: [dev] OOo BASIC Calc extension - sheet functions in library other than "Standard" - how ?

2009-03-17 Thread Ariel Constenla-Haile
Hello Jan,

On Tuesday 17 March 2009, 21:15, Jan Holst Jensen wrote:
> Well, I have compiled my first IDL now so I am more or less on my merry
> way to implementing the extension functions in Python instead.

there is an example for you to follow:

http://udk.openoffice.org/python/python-bridge.html#calc-addin
http://udk.openoffice.org/python/samples/python-tokencounter-calc-addin.oxt

can't say if/how it works, because never tried it.

Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


"Aus der Kriegsschule des Lebens
- Was mich nicht umbringt,
macht mich härter."
Nietzsche Götzendämmerung, Sprüche und Pfeile, 8.

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] OOo BASIC Calc extension - sheet functions in library other than "Standard" - how ?

2009-03-17 Thread Jan Holst Jensen

Ariel Constenla-Haile wrote:

Hello Jan,

On Tuesday 17 March 2009, 20:17, Jan Holst Jensen wrote:
  

Is the .XCU example that I used as a template incomplete or outdated or
is it not possible to add a Basic function to the list in the function
wizard ?



AFAIK the later. The configration file (xcu) is for Add-in functions implemented 
in UNO-components.


For example in

http://openoffice.org/2001/registry"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; oor:name="CalcAddIns" 
oor:package="org.openoffice.Office">


oor:op="replace">

...




"org.openoffice.sdk.spreadsheet.CalcAddIns" is the service identifier of the UNO 
component.
  

Hi Ariel.

Ah - makes sense. So supporting Basic extensions in the function wizard 
sounds like even more work that needs to be done.


Well, I have compiled my first IDL now so I am more or less on my merry 
way to implementing the extension functions in Python instead.


Cheers
-- Jan

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] OOo BASIC Calc extension - sheet functions in library other than "Standard" - how ?

2009-03-17 Thread Ariel Constenla-Haile
Hello Jan,

On Tuesday 17 March 2009, 20:17, Jan Holst Jensen wrote:
> Is the .XCU example that I used as a template incomplete or outdated or
> is it not possible to add a Basic function to the list in the function
> wizard ?

AFAIK the later. The configration file (xcu) is for Add-in functions 
implemented 
in UNO-components.

For example in

http://openoffice.org/2001/registry"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; oor:name="CalcAddIns" 
oor:package="org.openoffice.Office">


...




"org.openoffice.sdk.spreadsheet.CalcAddIns" is the service identifier of the 
UNO 
component.

Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


"Aus der Kriegsschule des Lebens
- Was mich nicht umbringt,
macht mich härter."
Nietzsche Götzendämmerung, Sprüche und Pfeile, 8.

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] OOo BASIC Calc extension - sheet functions in library other than "Standard" - how ?

2009-03-17 Thread Jan Holst Jensen




no, you cannot add functions to the Standard library using an 
extension. You'll have to develop an Add-in (in C++, Java or 
Python).
  
if issue http://qa.openoffice.org/issues/show_bug.cgi?id=53615 
(allow other libraries) is solved, things will become easier.
It is an issue from 2005, so it seems I shouldn't hold my breath 
for a solution... ?



Ask Niklas...


No quick solution in sight. We don't want to load and search all 
libraries, and we don't have any additional information available 
besides the function name.


Niklas

Basic supports the syntax: library-name-dot-function-name, like 
MyLib.MyFunc. Maybe Calc could, too? Basic Runtime isn't smart enough 
to try to load the library for you, but Calc could be made that smart.


That solution gets a vote from me - allowing library.function syntax in 
a cell would feel natural to me; at least that is what I tried as soon 
as I had put my function in my own library.


An alternative could be to allow an extension to add a module to the 
standard library, to e.g. add appropriate wrapper functions to surface 
library functions to Calc. If the reason for not allowing this is to 
avoid excessive initialization on startup, you could perhaps constrain 
extension modules so they are not allowed to have a Main sub ? That 
would be OK for a module that only consists of wrapper functions. But 
having to add special logic for special extension modules makes the 
above solution sounds far more clean and simple...  

However - a crucial feature (for me at least) that must also be 
supported is proper integration into the function wizard. If this won't 
work for Basic add-ins that will be reason enough for me to go the 
Python or Java route anyway.


I have tried defining a function called "TestFunction" in the Standard 
library that just multiplies the input number by 20. Works fine as a 
cell function. I then tried to make an .XCU file that defines that there 
is a function called "TestFunction" and that it has a single parameter 
called X (using the example from 
http://specs.openoffice.org/sdk/tools/spec_uno-skeletonmaker.odt as a 
template). The .XCU file was then installed by hitching a ride via an 
otherwise unrelated example extension. "TESTFUNCTION" is now listed in 
the function wizard but refuses to work (no parameters listed - even 
though I have listed the X parameter in the .XCU file) and I can no 
longer use "TestFunction" as a cell function (Err:504). Removing the 
extension and thereby the .XCU file removes "TESTFUNCTION" from the 
function wizard and restores "TestFunction" as a working cell function.


Is the .XCU example that I used as a template incomplete or outdated or 
is it not possible to add a Basic function to the list in the function 
wizard ?


Cheers
-- Jan

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] OOo BASIC Calc extension - sheet functions in library other than "Standard" - how ?

2009-03-17 Thread T. J. Frazier

Niklas Nebel wrote:

On 03/17/09 14:08, Peter Eberlein wrote:

Jan Holst Jensen schrieb:

Peter Eberlein wrote:


no, you cannot add functions to the Standard library using an 
extension. You'll have to develop an Add-in (in C++, Java or Python).
  
if issue http://qa.openoffice.org/issues/show_bug.cgi?id=53615 
(allow other libraries) is solved, things will become easier.
It is an issue from 2005, so it seems I shouldn't hold my breath for 
a solution... ?



Ask Niklas...


No quick solution in sight. We don't want to load and search all 
libraries, and we don't have any additional information available 
besides the function name.


Niklas

Basic supports the syntax: library-name-dot-function-name, like 
MyLib.MyFunc. Maybe Calc could, too? Basic Runtime isn't smart enough to 
try to load the library for you, but Calc could be made that smart.


--
T. J. Frazier
Melbourne, FL

(TJFrazier on OO.o)

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] amount of stopper / regressions for 3.1 release

2009-03-17 Thread Mathias Bauer
Hi,

Oliver-Rainer Wittmann - Software Engineer - Sun Microsystems wrote:

> Hi all,
> 
> Thorsten Ziehm wrote:
>> Hi Mathias,
>> 
>> Mathias Bauer schrieb:
>>> Ingrid Halama wrote:
>>>
 This is not sufficient. Heavy code restructurings and cleanups are 
 not bound to the feature freeze date, 
>>> Perhaps they should? And at least as far as it concerns me they are.
>>>
 but have a great potential to introduce regressions also. I think the 
 show-stopper phase must be extended in relation to the feature-phase 
 *and* the normal-bug-fixing-phase.

 Furthermore what does it help to simply let different people do the 
 nominations while the criteria are not clear? So I would like to 
 suggest a criterion: In the last four weeks before the feature freeze 
 only those (but all those) CWSses get nominated that have a complete 
 set of required tests run successfully. Same for the last four weeks 
 before end of normal-bug-fixing-phase. We could start with the tests 
 that are there already and develop them further.
>>>
>>> The problem is that the usual test runs obviously don't find the bugs
>>> that now bite us, most of them have been found by users or testers
>>> *working* with the program. Adding more CWS test runs and so shortening
>>> the time for real-life testing will not help us but make things worse.
>> 
>> The problem is a bit more complex. The testers and test script writers
>> do not have any time for writing new test cases for new functionality,
>> they do not have time to check fixed issues in master, they do not have
>> time to check code changes in a CWS as much as they should and at the
>> end you are right, they do not have the time for real-life testing.
>> 
>> But at the last point I want to relativize a little bit. The QA 
>> community and the L10N testers find critical problems in DEV build very
>> early. Most of the regressions which were reported in the past days on
>> the releases list, are regressions in the very past builds. Some of the
>> issues weren't identified very early by Sun employees, because they have
>> to look in a lot of issues these days to identify the show stoppers.
>> 
> 
> IMHO, we do not find critical problems (show stoppers) in DEV builds 
> very early, only half of them are found early according to my experience.
> Some data about the show stoppers, which I have fixed in the last days:
> 
> ISSUE INTRODUCED IN   FOUND IN
> i99822DEV300m2 (2008-03-12)   OOO310m3 (2009-02-26)
> 
> i99876DEV300m30 (2008-08-25)  OOO310m3
> 
> i99665DEV300m39 (2009-01-16)  OOO310m3
> 
> i100043   OOO310m1OOO310m4 (2009-03-04)
> 
> i100014   OOO310m2OOO310m4
> 
> i100132   DEV300m38 (2008-12-22)  OOO310m4
> 
> i100035   SRCm248 (2008-02-21)OOO310m4
> This issue is special, because it was a memory problem, that by accident 
> was not detected. Thus, it should not be counted in this statistic.
> 
> Looking at this concrete data, I personally can say that we find more or 
> less half of the show stoppers early.

I'm currently investigating the blocker list. Here's a rough summary:
from 77 issues 42 have been introduced before feature freeze (IIRC that
was in DEV300_m39). 9 issues are regression on the OOO310 code line, the
others still are not classified, but I'm working on it. I will follow up
with the complete results later.

Interestingly a considerable amount of showstoppers have been present
already in 3.0.1, some in 3.0 and a very few even in older versions.
Some of them even weren't regressions at all.

An interesting problem is

http://www.openoffice.org/issues/show_bug.cgi?id=100235

This issue was introduced very early (DEV300_m26 or so), but couldn't be
found before we had localized builds.

Regards,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to "nospamfor...@gmx.de".
I use it for the OOo lists and only rarely read other mails sent to it.

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] OOo BASIC Calc extension - sheet functions in library other than "Standard" - how ?

2009-03-17 Thread Niklas Nebel

On 03/17/09 14:08, Peter Eberlein wrote:

Jan Holst Jensen schrieb:

Peter Eberlein wrote:


no, you cannot add functions to the Standard library using an 
extension. You'll have to develop an Add-in (in C++, Java or Python).
  
if issue http://qa.openoffice.org/issues/show_bug.cgi?id=53615 (allow 
other libraries) is solved, things will become easier.
It is an issue from 2005, so it seems I shouldn't hold my breath for a 
solution... ?



Ask Niklas...


No quick solution in sight. We don't want to load and search all 
libraries, and we don't have any additional information available 
besides the function name.


Niklas

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



[dev] Typo in sal/osl/unx/file.cxx

2009-03-17 Thread Pavel Lastovicka

Hello,

I was looking at the source code in sal/osl/unx/file.cxx.
And there in function osl_openFile() is the following code:

  /* remove the NONBLOCK flag again */
  flags = fcntl(fd, F_GETFL, NULL);
  flags &= ~O_NONBLOCK;
  if( 0 > fcntl(fd, F_GETFL, flags) )
  return oslTranslateFileError(OSL_FET_ERROR, errno);

The second fcntl call should be fcntl(fd, F_SETFL, flags), shouldn't it?
--
Pavel Lastovicka

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] OOo BASIC Calc extension - sheet functions in library other than "Standard" - how ?

2009-03-17 Thread Peter Eberlein

Jan Holst Jensen schrieb:

Peter Eberlein wrote:


no, you cannot add functions to the Standard library using an 
extension. You'll have to develop an Add-in (in C++, Java or Python).
  
if issue http://qa.openoffice.org/issues/show_bug.cgi?id=53615 (allow 
other libraries) is solved, things will become easier.
It is an issue from 2005, so it seems I shouldn't hold my breath for a 
solution... ?



Ask Niklas...

Regards

Peter


-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] OOo BASIC Calc extension - sheet functions in library other than "Standard" - how ?

2009-03-17 Thread Jan Holst Jensen

Peter Eberlein wrote:


no, you cannot add functions to the Standard library using an 
extension. You'll have to develop an Add-in (in C++, Java or Python).
  
if issue http://qa.openoffice.org/issues/show_bug.cgi?id=53615 (allow 
other libraries) is solved, things will become easier.
It is an issue from 2005, so it seems I shouldn't hold my breath for a 
solution... ?


Cheers
-- Jan

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] OOo BASIC Calc extension - sheet functions in library other than "Standard" - how ?

2009-03-17 Thread Peter Eberlein

Hi,

Jan Holst Jensen schrieb:

Ariel Constenla-Haile wrote:

Hello Jan,

On Sunday 15 March 2009, 21:15, Jan Holst Jensen wrote:
 

I can add OOo Basic functions to the "Standard" library and use those as
sheet functions without problems. Now, when I want to deploy the
functions packaged as an extension I run into problems.

As far as I can see an extension (an .oxt package) is not able to
install functions into the "Standard" library. Is there a good 
solution to this ? Or will I have to use Python or Java

instead of OOo Basic to do this (a shame since OOo Basic does the job
really nice) ?



no, you cannot add functions to the Standard library using an 
extension. You'll have to develop an Add-in (in C++, Java or Python).
  
if issue http://qa.openoffice.org/issues/show_bug.cgi?id=53615 (allow 
other libraries) is solved, things will become easier.


Peter


-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] Java Uno Runtime.exec()

2009-03-17 Thread Stephan Bergmann

On 03/17/09 11:29, Vincent Spiewak wrote:

Dear developers,
I'm trying to execute an external application (pipeline-lite.exe)
inside a Java Uno Extension.
OpenOffice.org crash without any additionnals informations.

Do I need to make my runtime.exec() in another Thread ?


No idea why OOo crashes, but two things to note from 
: 
"Because some native platforms only provide limited buffer size for 
standard input and output streams, failure to promptly write the input 
stream or read the output stream of the subprocess may cause the 
subprocess to block, and even deadlock." and "There is no requirement 
that a process represented by a Process object execute asynchronously or 
concurrently with respect to the Java process that owns the Process object."


-Stephan

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] Sections and appending documents

2009-03-17 Thread Ariel Constenla-Haile
Hello Fhomasp,

On Tuesday 17 March 2009, 07:50, Fhomasp wrote:
> Thanks, you've been most helpful.
>
> I do still have a problem with the createInstanceWithContext part.

> factory.createInstanceWithContext("com.sun.star.text.TextSection",component
>Context));

you're mixing things: a css.text.TextSection is to be instantiated at the 
document factory, not at the global service manager.
So you're mixing the css.lang.XMultiServiceFactory (implemented by the 
css.text.[Generic]TextDocument)
http://api.openoffice.org/docs/common/ref/com/sun/star/lang/XMultiServiceFactory.html

with the css.lang.XMultiComponentFactory
http://api.openoffice.org/docs/common/ref/com/sun/star/lang/XMultiComponentFactory.html

Query css.lang.XMultiServiceFactory from your css.text.TextDocument, and then 
invoke css.lang.XMultiServiceFactory.createInstance() which only takes an 
string, no css.uno.XComponentContext

http://api.openoffice.org/docs/common/ref/com/sun/star/lang/XMultiServiceFactory.html#createInstance

> I think the problem might be related to the environment of the application.

no, the problem is that you started coding without even studying the basics 
first.
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OpenOffice.org_Developers_Guide


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


"Aus der Kriegsschule des Lebens
- Was mich nicht umbringt,
macht mich härter."
Nietzsche Götzendämmerung, Sprüche und Pfeile, 8.

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] OOo BASIC Calc extension - sheet functions in library other than "Standard" - how ?

2009-03-17 Thread Jan Holst Jensen

Ariel Constenla-Haile wrote:

Hello Jan,

On Sunday 15 March 2009, 21:15, Jan Holst Jensen wrote:
  

I can add OOo Basic functions to the "Standard" library and use those as
sheet functions without problems. Now, when I want to deploy the
functions packaged as an extension I run into problems.

As far as I can see an extension (an .oxt package) is not able to
install functions into the "Standard" library. 
Is there a good solution to this ? Or will I have to use Python or Java

instead of OOo Basic to do this (a shame since OOo Basic does the job
really nice) ?



no, you cannot add functions to the Standard library using an extension. 
You'll have to develop an Add-in (in C++, Java or Python).
  

Hi Ariel.

Thanks for the info although it confirms my fears. So I can deploy Basic 
macros as extensions and add buttons and stuff to the UI but cannot 
deploy Basic functions so they are available from Calc - feels a little 
like being cheated.


But Python is fortunately a nice language :-).

Cheers
-- Jan

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] OOo BASIC Calc extension - sheet functions in library other than "Standard" - how ?

2009-03-17 Thread Ariel Constenla-Haile
Hello Jan,

On Sunday 15 March 2009, 21:15, Jan Holst Jensen wrote:
> I can add OOo Basic functions to the "Standard" library and use those as
> sheet functions without problems. Now, when I want to deploy the
> functions packaged as an extension I run into problems.
>
> As far as I can see an extension (an .oxt package) is not able to
> install functions into the "Standard" library. 
> Is there a good solution to this ? Or will I have to use Python or Java
> instead of OOo Basic to do this (a shame since OOo Basic does the job
> really nice) ?

no, you cannot add functions to the Standard library using an extension. 
You'll have to develop an Add-in (in C++, Java or Python).

Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


"Aus der Kriegsschule des Lebens
- Was mich nicht umbringt,
macht mich härter."
Nietzsche Götzendämmerung, Sprüche und Pfeile, 8.

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] Sections and appending documents

2009-03-17 Thread Fhomasp

Thanks, you've been most helpful.

I do still have a problem with the createInstanceWithContext part.
The idea is to get an XNamed using:

xChildNamed = (XNamed) UnoRuntime.queryInterface(
 XNamed.class,

factory.createInstanceWithContext("com.sun.star.text.TextSection",componentContext));

Now there are two ways to get an XComponentContext object.  
One is to get it from the OfficeConnection object, which doesn't seem to
work for me.  The resulting XNamedObject is null.

The other is even worse.  Namely:
XComponentContext xRemoteContext =
com.sun.star.comp.helper.Bootstrap.bootstrap();

Running this static method hangs my application.

I think the problem might be related to the environment of the application. 
The OOo document runs within a Swing context.  It might, I don't know for
sure.


Grover Blue wrote:
> 
> That is my fault.  The class in the code below was a wrapper class.  The
> code should be something like:
> 
> serviceFactory.createInstance("com.sun.star.text.TextSection");
> 
> Also,
> 
> "componentExport"  is just a method to export my document (ie, save using
> XStorable) .  The saved document will then be loaded using
> "insertDocumentFromURL"
> 
> 
> 
> On Mon, Mar 16, 2009 at 11:58 AM, Fhomasp
> wrote:
> 
>>
>> Hey,
>>
>> I've been looking to merge an unknown nr. of documents in order to print
>> them using a custom method.
>> And so I came up to this code but there are a few things that are
>> bothering
>> me, which might be related to me being new to OOo Uno programming.
>> All the documents are always OpenOffice 2.4 populated Writer templates.
>>
>> The problems I have are here:
>>
>> serviceFactory.createInstance("com.sun.star.text.TextSection", document1)
>>
>> I can't seem to find a (X)ServiceFactory type that allows two arguments
>> (String, Object?).
>>
>> also the use of the method "componentExport".  I know I should find it
>> somewhere in the added links around here but with the first problem being
>> unresolved, I haven't really gotten around to this one.
>>
>> Thanks at any rate already.  This thread does already showed that there
>> is
>> a
>> possible solution to this.
>>
>>
>>
>>
>> Grover Blue wrote:
>> >
>> > I got everything to work, except for images and horizontal line
>> objects.
>> > Images are completely ignored and not imported into the document,
>> whereas
>> > horizontal line objects are flushing themselves at the top of the
>> current
>> > page.
>> >
>> > I do have a question about the section I am using.  If you look at the
>> > following code, am I properly inserting the second document (document2)
>> > into
>> > the newly created section?
>> >
>> > Here is my routine:
>> >
>> > public void appendDocument(XTextDocument document1, XTextDocument
>> > document2)
>> > throws IllegalArgumentException, java.lang.Exception {
>> >
>> > XText xDocText = document1.getText();
>> > XTextCursor xOrigDocTextCursor = xDocText.createTextCursor();
>> > XNamed xChildNamed;
>> > XTextContent xChildContent;
>> > String tempDoc = generateTempDocucmentPathName();
>> >
>> > xOrigDocTextCursor.gotoEnd(false);
>> >
>> > xDocText.insertControlCharacter(xOrigDocTextCursor,
>> > ControlCharacter.PARAGRAPH_BREAK, false);
>> >
>> > xChildNamed = (XNamed) UnoRuntime.queryInterface(
>> >  XNamed.class,
>> >
>> > serviceFactory.createInstance("com.sun.star.text.TextSection",
>> > document1));
>> >
>> > xChildNamed.setName("" + document2.hashCode());
>> >
>> > xChildContent = (XTextContent) UnoRuntime.queryInterface(
>> > XTextContent.class,
>> > xChildNamed);
>> >
>> > /*  Add document2 to the new section */
>> > xDocText.insertTextContent(xOrigDocTextCursor, xChildContent,
>> > false);
>> >
>> > PropertyValue[] storeProps = createPropertyValueArray(
>> > createPropertyValue("FilterName", new
>> > Any(Type.STRING, "writer8_template")),
>> > createPropertyValue("CompressionMode",
>> new
>> > Any(Type.STRING, "1")),
>> > createPropertyValue("Pages", new
>> > Any(Type.STRING, "All")),
>> > createPropertyValue("Overwrite", new
>> > Any(Type.BOOLEAN, Boolean.TRUE)));
>> >
>> > componentExport(document2, storeProps, tempDoc);
>> >
>> > XDocumentInsertable xDocI = (XDocumentInsertable)
>> > UnoRuntime.queryInterface(
>> > XDocumentInsertable.class,
>> > xOrigDocTextCursor);
>> >
>> > PropertyValue[] loadProps=new PropertyValue[0];
>> >
>> > xDocI.insertDocumentFromURL("file:///" + tempDoc, loadProps);
>> >
>> > deleteFile(tempDoc);
>> > }
>> >
>> >
>>
>> --
>> View this message in context:

[dev] Java Uno Runtime.exec()

2009-03-17 Thread Vincent Spiewak
Dear developers,
I'm trying to execute an external application (pipeline-lite.exe)
inside a Java Uno Extension.
OpenOffice.org crash without any additionnals informations.

Do I need to make my runtime.exec() in another Thread ?

try {

Runtime runtime = Runtime.getRuntime();
Process pipelineProcess;

String EXEC_PATH = "C:\\Documents and
Settings\\vince\\Bureau\\ftp.daisy.org\\pipeline-lite-ms-20090312\\pipeline-lite.exe";

System.out.println("pipeline path:" + EXEC_PATH);
System.out.println("Can execute pipeline ?:" + new
File(EXEC_PATH).canExecute());
pipelineProcess = runtime.exec(EXEC_PATH);

System.out.println("Wait for ...");
int code = pipelineProcess.waitFor();
System.out.println("code: " + code);
System.out.println("exit val: " + pipelineProcess.exitValue());
System.out.println("errors:" + pipelineProcess.getErrorStream());
System.out.println("outputs:" + pipelineProcess.getOutputStream());

} catch (Exception ex) {
Logger.getLogger(UnoGUI.class.getName()).log(Level.SEVERE,
null, ex);
   }


Regards,

--
- Vincent Spiewak - odt2dtbook.sourceforge.net -
--

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org