openoffice-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shukla, Mangesh" <mangesh.shu...@siemens.com>
Subject RE: Registering EventListeners on Add-on Menu item
Date Wed, 09 Jan 2013 08:00:11 GMT
Hi Ariel,
     Could you please give me more details on what exactly should be done to establish communication
between OpenOffice.org and external application. 

Thanks,
Mangesh

-----Original Message-----
From: Shukla, Mangesh 
Sent: Tuesday, January 08, 2013 5:50 PM
To: api@openoffice.apache.org
Subject: RE: Registering EventListeners on Add-on Menu item

Hi Ariel,
    The way I intend to use OpenOffice  Calc, is as follows:
1] OpenOffice.org Calc is started/launched from the external application. i.e external application
exists along with OpenOffice on the same machine and is always available.
2] The external application connects on a socket type of connection, on a port to OpenOffice.org
Calc.
3] An extension is implemented and deployed which adds the menu items to Calc. (it also adds
macros to the extension). Ideally I would like to enable the extension only when Calc is started
by the external application. And I am looking for ways to do this. But that is for later.
4] When the user invokes the menu on the extension, my extension communicates to the external
 application an retrieves the information to populate the spreadsheet.

>From your comments, I gather that you are advising me to  implement an extension that
"talks to" this external application, and I thank you for your suggestions. It would be very
helpful if you could give me more details on this or point me to some sample application.
I have searched the web and have found very little information on this. 

Thanks,
Mangesh.
 



-----Original Message-----
From: Ariel Constenla-Haile [mailto:arielch@apache.org]
Sent: Tuesday, January 08, 2013 5:15 PM
To: api@openoffice.apache.org
Subject: Re: Registering EventListeners on Add-on Menu item

Hi Mangesh,

On Tue, Jan 08, 2013 at 11:18:17AM +0000, Shukla, Mangesh wrote:
> Hi Ariel, Thanks for the quick reply.  Actually I intend to implement 
> this just as you describe. I intend to create an Extension to add my 
> own Menu and toolbar items. Also I will be adding some Macros 
> (functions which appear in the functions wizard), to the extension.
> The intention to add these UI items, is to transfer the call to the 
> external application, so that the data from the external application 
> can be populated in the spreadsheet. The actual functionality lies in 
> the external application, and I need to get the calls redirected to 
> the external application as and when the user invokes the menu 
> items/toolbar items/macros in the extension.

Then the proper way to do this seems not to intercept the dispatch framework; simply implement
an extension that communicates to the external application when it is asked to dispatch; the
steps would be:

- the dispatch framework asks your extension to dispatch a certain URL
  when the user executes a menu/toolbar item

- when dispatching, your extension communicates to the external
  application an retrieves the information to populate the spreadsheet

The key point here is the communication between the extension and the external application.
The Zotero extension talks to Zotero, a bibliographic program for Firexfox (or standalone),
does this via a socket (AFAIK).

Another thing to consider: is this external application already running on the target system,
or are you planning to install the application together with the extension?


> I have checked the link about the dispatch framework. However it is 
> not clear to me, how it could be made to work with a C++ client. Could 
> you direct me to some samples to illustrate the behavior.

IIRC there is an example in the SDK, but it's written in Java, and is rather complicated/obscure.
Anyway, I wouldn't suggest to follow this path of intercepting dispatches in the external
application; better implement an extension that "talks to" this external application.

There are several drawbacks for the other approach:

- the external application will have to be linked to the URE
- the external application will have to bootstrap OpenOffice, or connect
  to a running instance
- etc


Regards
--
Ariel Constenla-Haile
La Plata, Argentina

Mime
View raw message