[Solved] Running a User Defined JAVA macro from BASIC macro

Java, C++, C#, Delphi, ??? - Using the UNO bridges

[Solved] Running a User Defined JAVA macro from BASIC macro

Postby ganesh17 » Sun Sep 29, 2013 2:03 pm

I am new to writing macro for openoffice.

I had written a java macro. I have tested it seperately and it works correctly.
The JAVA macro is placed in C:\Program Files (x86)\OpenOffice 4\share\Scripts\java\CalledFromBasic folder and with the jar as CalledFromBasic.jar.

I am trying to call this from openoffice BASIC macro, for which the code is as follows.

Code: Select all   Expand viewCollapse view
Sub Main

   MSPF = createUnoService("com.sun.star.script.provider.MasterScriptProviderFactory")
   scriptPro = MSPF.createScriptProvider("")
   xScript = scriptPro.getScript("vnd.sun.star.script:TestCallFromBasic.test?language=java&location=share\Scripts\java\CalledFromBasic")
   Thing = xScript.Invoke()

End Sub


I am getting unsatisfied query for interface of type com.sun.star.provider.XScriptProvider.
From http://www.openoffice.org/api/docs/common/ref/com/sun/star/script/provider/XScriptProvider.html#getScript I know that I need to give 2 parameters.
I'm not able to figure out how to call using getScript.
Can anyone help ?
Last edited by Hagar Delest on Wed Oct 09, 2013 11:14 pm, edited 1 time in total.
Reason: tagged [Solved].
OpenOffice Ver 4.0, Windows 7
ganesh17
 
Posts: 2
Joined: Sat Sep 28, 2013 5:17 am

Re: Running a User Defined JAVA macro from a BASIC macro

Postby hanya » Thu Oct 03, 2013 11:54 am

Hi, welcome to the forum.

You are using wrong URI to your Java macro. It should be something like:
Code: Select all   Expand viewCollapse view
vnd.sun.star.script:CalledFromBasic.TestCallFromBasic.test?language=Java&location=share
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
hanya
Volunteer
 
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: Running a User Defined JAVA macro from a BASIC macro

Postby ganesh17 » Wed Oct 09, 2013 4:08 pm

I am testing that .
Thank you
OpenOffice Ver 4.0, Windows 7
ganesh17
 
Posts: 2
Joined: Sat Sep 28, 2013 5:17 am


Return to External Programs

Who is online

Users browsing this forum: No registered users and 1 guest