The Vienna Version of BSF4Rexx, 2007-10-13
==========================================
BSF4Rexx, version 2.6 ("The Vienna Version of BSF4Rexx"):
Please see also the text file "changesBSF4Rexx.txt" which contains important
information about changes (especially to the ooRexx wrapper 'BSF.CLS').
This version also supports OpenOffice.org (StarOffice) such that you can script
OpenOffice.org from the commandline or from within OpenOffice.org (in lieu of
OOo Basic, if you wish). More information can be gathered from the file
"readmeOOo.txt"
Brief overview
==============
BSF4Rexx is an extension to Rexx and ooRexx, consisting of an external Rexx
function package ("BSF4Rexx.dll") and a set of Java classes stored in a Java
archive.
BSF allows Java programs to call (invoke) script programs written in languages
other than Java. Such script programs may also be able to call back into Java
and use all of Java's classes and objects. (cf.
<http://jakarta.apache.org/bsf>)
- With "BSF4RExx" any Java application can use (Object) Rexx as a scripting
language.
- Open Object Rexx (ooRexx) can use Java as a huge, operating system independent
function library. (The Object Rexx support enabled with "BSF.CLS" makes Java
look like a huge Object Rexx class library!)
Preliminary versions of "The Vienna Version of BSF4Rexx" package were partly
introduced in April 2005 and April 2006 to the Rexx world at the International
Rexx Symposium organized by the Rexx Language Association (cf.
<http://www.RexxLA.org>) where it was used for enabling ooRexx to automate
(remote control) OpenOffice.org in a platform independent manner.
An overview article (dated: 2003-06-01) with short examples can be found at:
<http://wi.wu-wien.ac.at/rgf/rexx/orx14/orx14_bsf4rexx-av.pdf>
(and for the forerunner at:
<http://wi.wu-wien.ac.at/rgf/rexx/orx12/JavaBeanScriptingWithRexx_orx12.pdf>).
Another (newer) document on BSF4Rexx can be found at:
<http://wi.wu-wien.ac.at/rgf/rexx/orx15/2004_orx15_bsf-orx-layer.pdf>
The "Vienna version of BSF4Rexx" adds additional functionality, the most notable
addition allows ooRexx programs to address Java fields as if they were Object
Rexx attributes, as well as supplying the functions box() and unbox() to wrap
and unwrap primitive datatypes into/from their corresponding Java class (e.g.
needed for setting property values in OpenOffice.org - OOo).
All Rexx programs using BSF4Rexx are per se fully portable, ie. to any system
which possesses Java and a Rexx interpreter, provided that the JNI DLL/shared
library is ported to that platform (the source file to be ported/compiled is
"BSF4Rexx.cc"). Out of the box the following operating systems are supported:
Linux (Intel) and Windows.
Files and Archives
==================
readmeBSF4Rexx.txt ... this text file, explaining BSF4Rexx and its
installation
readmeOOo.txt ... text file, explaining the OpenOffice.org/Staroffice
support and its installation
BSF4Rexx_install.zip ... Archive that contains the binary distribution of, the
sources of and the samples for BSF4Rexx (including
OpenOffice.org samples), the setup scripts for Linux
and Windows
changesBSF4Rexx.txt ... text file containing a record of the most important
changes
changesOOo.txt ... text file containing a record of the most important
changes since the 2005 International Rexx symposium
ApacheLicense2.0.txt ... Apache license 2.0 text
BSF4Rexx_sources.zip ... Archive that contains the C++ and Java sources
docs_bsf4rexx.zip ... Archive that contains the documentation of the BSF4Rexx
Java programs, including add-ons
docs_apache_bsf.zip ... Archive that contains the documentation of Apache's BSF
Installation
============
!!! IF YOU HAVE ALREADY AN OLDER VERSION OF BSF4REXX INSTALLED, PLEASE
UNINSTALL AND REMOVE IT FROM YOUR SYSTEM BEFORE INSTALLING THIS VERSION !!!!
Archive 'BSF4Rexx_install.zip'
==============================
- Unzip the archive, which will create a subdirectoy named 'bsf4rexx' in
which all BSF4Rexx supporting files and programs are stored
- Change into the 'bsf4rexx' subdirectory
- Run the setup script "rexx setupBSF.rex"
This will create the following files:
- 'rexxj.cmd' (Windows) or
'rexxj.sh' (Linux)
... this script allows you to run any BSF4Rexx program without a
need to change your environment settings; the BSF4Rexx program in
this case will get started via Java (see below).
- 'setEnvironment4BSF4Rexx.cmd' (Windows) or
'setEnvironment4BSF4Rexx.sh' (Linux)
... this script changes your session's environment such, that
a) Java and b) BSF4Rexx are accessible to Rexx programs. This will
then allow BSF4Rexx programs to demand load Java, if necessary.
Problems FAQ:
- If the script does not run, because the binary java[.exe] is not on
the path, then invoke the script and supply explicitly the path:
rexx setupBSF.rex path-to-java[.exe]
3) Testing your BSF4Rexx installation
=====================================
a) Issue one of the following commands from the command line (this will load
Rexx via Java):
rexxj infoBSF.rex
or
rexxj infoBSF-oo.rex
b) Issue one of the following commands from the command line (this will cause
Rexx to load Java, the 'setEnvironment4BSF4Rexx' settings must be in
effect for these tests to succed):
rexx infoBSF.rex
or
rexx infoBSF-oo.rex
If this does does not work, because Java cannot be found, please execute
the script "setEnvironment4BSF4Rexx.cmd" (Windows) or
". ./setEnvironment4BSF4Rexx.sh" (Linux with bash shell). Then rerun the
scripts above.
4) Next steps
=============
- Run all the sample programs in "bsf4rexx/samples/" and study them.
- If interested in scripting OpenOffice.org (the examples can be found in
"bsf4rexx/samples/OOo" and its subdirectories), then please follow the
instructions in 'readmeOOo.txt' to install the specific OpenOffice support
which makes it very easy to program/script OOo with ooRexx in an openplatform
fashion.
5) Support, questions and discussion
====================================
Please use the main Rexx newsgroup to post questions, example code etc.:
<news:comp.lang.rexx>
or Google's interface to this netnews group:
<http://groups.google.at/group/comp.lang.rexx/topics>
Alternatively, enroll as a member to the non-profit organization "Rexx Language
Asssociation" (<http://www.RexxLA.org>) and use the members only listserver list
there.
OpenOffice-only related questions (other than the Rexx support itself) should be
posted on the respective listserver lists at <http://www.OpenOffice.org> (e.g.
"dev", "udk", "framework").
Good luck and have fun!
... and please tell us what you are using it for such that others may learn of
interesting problem solving applications with this technology.
Rony G. Flatscher
University of Economics and Business Administration
(Wirtschaftsuniversitaet Wien, "WU")
Vienna, 2007-10-13
--- --- --- --- --- --- --- --- --- --- --- --- ---
Some hints ad Java:
-------------------
- In order to use Java as a huge external [oo]Rexx function library you
merely need to have the "Java runtime environment (JRE)" installed on your
machine. Probably it is installed already, due to support Java applets via
your WWW-browser. Otherwise you can download and install Java e.g. from:
<http://java.sun.com>.
- You can download the entire Java API documentation from Sun's Java site. The
documentation is merely a set of plain HTML documents that are linked with
each other. Alternatively, it is possible to point your WWW browser directly
to Sun's Java WWW pages offering the very same documentation:
<http://java.sun.com/docs/index.html>
... Overview page which allows you to choose which Java version's docs you
want to browse, e.g. as of this writing the following "J2SE API Docs" were
accessible:
<http://java.sun.com/j2se/1.4.2/docs/api/> ... Java 1.4.2
or overview: <http://java.sun.com/j2se/1.4.2/docs/>
<http://java.sun.com/j2se/1.5.0/docs/api/> ... Java 1.5 aka
or overview: <http://java.sun.com/j2se/1.5.0/docs/> Java 5.0
<http://java.sun.com/javase/6/docs/api/> ... Java 1.6 aka
or overview: <http://java.sun.com/javase/6/docs/> Java 6.0
The overview URL also contains plenty of links to tutorials and other
valuable Java info material.
a) Installing Java, if not yet installed
========================================
Open a command window and enter:
java -version
If "java" is not found or not executing Java (but a stub program as is
sometimes the case on Linux) or the Java version is smaller than 1.4, then
get a new Java from the Internet for your operating system and install it on
your machine. One free possibility is to download Java from Sun, the
"father" of Java:
http://java.sun.com
It is sufficient to download the runtime version (JRE - Java runtime
environment), but you can download the Java developer version (JDK - Java
development kit) as well.
To get free access at the full documentation of all Java classes, you may
want to point your browser to:
http://java.sun.com/docs/index.html
Remark on Linux:
----------------
On Linux, if you cannot execute "java -version" successfully, then study your
Linux installation directions to make your installed Java available via the
command line.
Alternatively, you can run the supplied script (*Linux* only, part of the
archive 'BSF4Rexx_install.zip'!):
rexx setupJava.rex
which will try to locate possible installed versions of Java and will create
symbolic links to point to your
Java installation.
As a result you can invoke Java from any process and the command line.
Installing ooRexx
=================
Go and get the opensource and free "Open Object Rexx" (ooRexx) interpreter from:
<http://www.ooRexx.org/download.html>
<http://sourceforge.net/project/showfiles.php?group_id=119701>
Install ooRexx as per the instructions.