Ask Your Question

how does this work? an official Libreoffice 4.1 sample js file imports and uses java code? [closed]

asked 2013-09-29 05:19:31 +0100

roy gravatar image

updated 2016-02-18 07:27:52 +0100

Alex Kemp gravatar image

Hi, the sample script I am referring to is in the default installation of LibreOffice:

File:"exportsheetstohtml.js" Location: "C:\Program Files\LibreOffice 4\share\Scripts\javascript\ExportSheetsToHTML\"

I was just wondering if there is a software design document explaining how several script languages are implemented.

explaining things like:

(1) how does this work? the above sample js file imports java code, and then uses the java methods throughout the js script?

(1.a) if the js code is runs as a new process, or in a new thread to affect the current document,

(1.b) what language does libreoffice use to parse and run the scripting languages? (ie does libreoffice actually use the 'official' script compiler/interpreters engines for (js, py), or does libreoffice use a language like C++ just read the script, then convert it straight to a a C++ command, then run it?

(2) if the js engine (not the js libreoffice api) was made by libreoffice, or if it uses something like the mozilla rhino js engine, or another one.

(3) I can see that there is a python libreoffice api - which could be used outside of a macro I assume. I was thinking, Is it possible to use a general IDE (external to libreoffice) to run some js code on a libreoffice document or set of documents in a folder? ( I am just thinking out loud, trying to build a mental picture, sorry if this is a silly question). if so, does anyone have some tips to set this up on an IDE like eclipse, or Code::Blocks?

Thanks to the person/s who can give me some info, so I can get a good mental picture of how the scriping engines are implemented, and work from a software developer perspective.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-11-10 16:25:45.312707

1 Answer

Sort by » oldest newest most voted

answered 2013-10-05 08:15:21 +0100

roy gravatar image

ill have a look at the code, I just thought i'd pop in a post to see if anyone would give an overview.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2013-09-29 05:19:31 +0100

Seen: 724 times

Last updated: Oct 05 '13