| View previous topic :: View next topic |
| Author |
Message |
waitsun General User

Joined: 21 Jun 2004 Posts: 5
|
Posted: Thu Jun 24, 2004 5:54 pm Post subject: Can I use Java Object in OOo Macro? |
|
|
I want to write a function in OOo Macro to get results from calling a url. In Java, I can use the class HttpURLConnection to achieve this purpose.
So, can I use the Java class HttpURLConnection in Macro?
Or I need to write my own Java class that have the function to get the results and register it under OpenOffice?
Please help, thanks a lot  |
|
| Back to top |
|
 |
Cybb20 Super User


Joined: 02 Mar 2004 Posts: 1569 Location: Frankfurt, Germany
|
Posted: Thu Jun 24, 2004 9:31 pm Post subject: Re: Can I use Java Object in OOo Macro? |
|
|
| waitsun wrote: |
So, can I use the Java class HttpURLConnection in Macro?
Or I need to write my own Java class that have the function to get the results and register it under OpenOffice?
|
Yes and to question 2:
You would need to do that, at least it must be a registered component and thus known to UNO. Components are registered with the pkgchk tool from the /program folder.
You'll find examples in the SDK to that, under DevelopersGuide examples I think.
Once you have registered your own service/interface in OpenOffice, you should be able to easily make use of it with Starbasic.
I would suggest that you just inherit from HttpURLConnection class (mhh I am not positive if it works then, but just test it out!).
Feel free to share if inheritance works for registering a Java class as a UNO component.
Hope that helps.
Christian _________________ - Knowledge is Power - |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
|
| Back to top |
|
 |
|