incubator-ooo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rony G. Flatscher (Apache)" <>
Subject Ad scripting languages (Re: OpenOffice in Java
Date Sun, 08 Jul 2012 15:43:50 GMT
Hi Andreas,

On 07.07.2012 17:36, Andreas S├Ąger wrote:
> Am 06.07.2012 16:26, Rony G. Flatscher (Apache) wrote:
>> In addtion, the very important AOO scripting framework is totally Java based.
> Why can I run all non-Java macros on a machine with no Java?
not sure, what you are after.

AFAIK, originally there was "StarBasic" implemented as the scripting language for OpenOffice
renamed to " Basic") and part of it.

Then, later, Python got added as a scripting language, by implementing a Python UNO binding.

That was it for quite some time as it is everything else but a trivial task to create the
infrastructure to add a new scripting language to OpenOffice from scratch for programmers
who might
have no working knowledge about the UNO framework.

Then later (2004?, 2005?), a Java scripting framework got added to OpenOffice.

This Java scripting framework allowed in the first place to finally add JavaScript (Rhino,
a very
popular Java implemenation of JavaScript) as a scripting language to OpenOffice.

In addtion BeanShell ("interpreted Java") was added as an additional scripting languages to
OpenOffice as well taking advantage of the new Java scripting framework.

Because there has been a Java scripting framework for OpenOffice it has become a feasible
job to add
any scripting language to OpenOffice for which a Java implementation existed, without the
need of an
intimate knowledge of the UNO framework. A feasible example of adding scripting languages
OpenOffice via the Java scripting framework would be all the Apache BSF scripting languages
<>). Starting with Java 1.6 the "javax.script" package
got introduced
into Java which could be used to add new scripting languages to OpenOffice as well, using
existing Java scripting framework.

The interesting thing here is, that one can use the Java scripting framework for OpenOffice
also for
scripting languages, that are implemented in C++, believe it or not!

This may sound strange, but in effect, this is simpler than starting from scratch to create
some UNO
binding for a new scripting language for programmers who have no intimate knowledge of the
framework and its implementations. An example for such a possibility is the oxt-package that
the opensource and "human centric" scripting language ooRexx (cf. <>)
OpenOffice using Java as the bridge (there is an ooRexx package, that has extensive Java support
JNI for ooRexx, camouflaging all of Java as the dynamically typed, caseless programming language
ooRexx, and does so successfully and fast, cf. <>,
oxt-package is part of the distribution and gets automatically installed with BSF4ooRexx,
OpenOffice is installed on the machine).


Two years ago, there was a presentation of an OpenOffice introspection tool implemented in
which can be used interactively or via all the OpenOffice scripting languages via the dispatch
interface, which is able to create great overviews of the UNO objects (and/or UNO classes)
you have
in hand, including links that lead to the OpenOffice API documentation on the Internet. Here
is a
link to a brief tutorial which might be interesting for OpenOffice developers, hence giving
links to
the slides, the brief tutorial on how to use it from Basic, Java, JavaScript,
and Python:

  * slides:
      o <>

  * tutorial/readme:
      o <>

  * result of introspecting an UNO writer object on-the-fly, one level only, yielding 11 pages
      o <>

  * result of introspecting an UNO writer object on-the-fly, two levels, yielding 55 (!) pages
      o <>

As you (hopefully) see, having a Java based scripting framework is a boon for OpenOffice.
allows/enables programmers to rather quickly make a scripting language available to OpenOffice
taking advantage of the Java scripting framework.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message