Building Scripting Framework
JDK1.3 or greater
ANT which is available from http://ant.apache.org/bindownload.cgi
Full OO1.1beta or later solver and installation set
OO1.1beta or later OpenOffice build environment
bsh-1.2b7.jar available from http://www.beanshell.org/download.html
NetBeans IDE - this is currently needed for the build (unless you modify one of the makefiles. It is intended to develop a makefile that will detect the presence or absence of the NetBeans IDEand react accordingly)
Setting up build environment
If you have not configured your environment with Java and Ant, please re-run the configure script from the config_office project including the options --with-jdk-home=<JAVA_HOME> --with-ant-home=<ANT_HOME> and source or run the environment set-up script. See the Tools project homepage for details.
If configure can not find Ant, after you have sourced or run the environment set-up script, you may need to add all jarfiles under <ANT_HOME>/lib to your $CLASSPATH.
If you only have solvers, you will need to checkout the following modules on a tag that is appropriate to the release you are building for (eg. OO1.1beta)
The Scripting Framework is work-in-progress. For this reason it is not included in the main OpenOffice build & install set. Thus, at this moment it is necessary to make several patches to the sources & build a separate install set for the Scripting Framework. It is intended that at some point in the future the Scripting Framework will be integrated into OpenOffice. Since we will be modifying these projects, it is a good idea to backup your unoil and offapi modules and then checkout the following with the tag SF-OO644_ED02_1
unoil/drafts/com/sun/star/script/framework (drafts/com/sun/star/script/framework,needs to be in the unoil module)
offapi/drafts/com/sun/star/script/framework (drafts/com/sun/star/script/framework,needs to be in the offapi module)
You will need to modify the offapi and unoil modules so that the services and interfaces for scripting are available.
Ensure that you have the drafts/com/sun/star/script/framework directory under the offapi module, if you don't, you will need to check it out from CVS with the tag SF-OO644_ED02_1
Modify the prj/build.lst, you will need to add the following lines
oa offapi\drafts\com\sun\star\script\framework\runtime nmake - all oa_scriptfruntime_drafts NULL
oa offapi\drafts\com\sun\star\script\framework\security nmake - all oa_sfsecurity_drafts NULL
oa offapi\drafts\com\sun\star\script\framework\provider nmake - all oa_sfprovider_drafts NULL
oa offapi\drafts\com\sun\star\script\framework\storage nmake - all oa_sfstorage_drafts NULL
and add "oa_scriptfruntime_drafts oa_sfsecurity_drafts oa_sfprovider_drafts oa_sfstorage_drafts" to the last line before "NULL"
Modify the prj/d.lst, you will need to add the following line
..\%__SRC%\ucr\ScriptFramework.rdb %_DEST%\bin%_EXT%\ScriptFramework.rdb after the line:
Modify the util/makefile.mk and add the following to UNOIDLDBFILES list
- Modify the util/makefile.mk and add the following line to the target $(UCR)$/types.db
+$(REGMERGE) $(UCR)$/ScriptFramework.rdb / $(UCR)$/dcssscriptfruntime.db $(UCR)$/dcsssfprovider.db $(UCR)$/dcsssfsecurity.db $(UCR)$/dcsssfstorage.db
Add ul_scriptf_drafts to the last line before NULL
The line should now look something like this
ul unoil\drafts\com\sun\star\script\framework nmake - all ul_scriptf_drafts ul_ucb ul_frame ul_ucb NULL
Building the Scripting Framework module
Modify java/build.env to point to the point to beanshell bsh-1.2b7.jar, ( see install.dir entry in build.env )
Assuming you have NetBeans installed, modify the java/build.env to point at the NetBeans installation (see the openide.class.path entry in the build.xml for more details).
Alternatively, if you do not wish to build the add-in, delete the following entries from the depends section of the target "all" in the build.xml
No NetBeans add-in
Execute build and deliver in the offapi module
Execute build and deliver in the unoil module
Execute build in the scripting module
In scripting/workben there is an ANT build.xml file for compiling the examples installer, creating the UNO package, and creating a Jar file for an automated install. Running dmake in the scripting/workben directory should result in the creation of the SFrameworkInstall.jar in the directory under the output directory appriate for your platform (eg. wntmsci9.pro).
The use of the automated installer, written in Java, is recommended, unless you're on a platform other than Solaris/SPARC, Linux/x86, Windows! It is recommended that even on such a platform that every effort should be made to get the installer to work. If this isn't possible the following is the set of steps needed to manually install the framework. The first stage in the manual installation is to build the UNO package containing the libraries & Jar files.
Create a two directories ($pkgsf) for scripting framework and ($pkgbs) from beanshell support.
Create directories called $pkgsf/<PLATFORM>.plt and $pkgsf/skip_registration (Where <PLATFORM> is like linux_x86)
NOTE: A list of supported directories is available in the source file desktop/source/pkgchk/pkgchk_packages.cxx, you may need to modify this, if your platform is not supported
Copy in the libraries from scripting/<platform>/lib to $pkgsf/<PLATFORM>.plt
Copy in ScriptRuntimeForJava.jar from scripting/<platform>/class into the top level directory, $pkgsf
Copy in unoil.jar from $pkgsf/unoil/<platform>/class to $pkgsf/skip_registration directory
Copy ScriptRuntimeForBeanShell.jar from scripting/<platform>/class to $pkgbs
Copy bsh-1.2b7.jar, available from http://www.beanshell.org/download.html to $pkgbs/skip_registration directory.
Copy ScriptFramework.rdb from offapi/<platform>/ucr/ScriptFramework.rdb to $pkgsf
Copy ProtocolHandler.xcu from scripting/workben/installer/ to $pkgsf
Now, zip up all files in directory, $pkgsf to ooscriptf.zip
Now, zip up all file in directory, $pkgbs to bshruntime.zip
The next stage is to take the UNO packages and install them in an OpenOffice installation.
Copy the zips file into your OpenOffice installation under the user/uno_packages directory
In the program directory, run pkgchk on each of the zip files
The next stage is to install the Starbasic dialogs, configuration files and example scripts.
Create a directory ScriptBindingLibrary, from the directory scripting/workben/binding copy the following files to ScriptBindingLibrary, dialog.xlb, HelpBinding.xdl, MenuBinding.xdl, script.xlb, EventsBinding.xdl, KeyBinding.xdl, ScriptBinding.xba
Copy ScriptBindingLibrary directory and its contents to <OpenOffice path>/user/basic directory.
Insert the following lines into <OpenOffice path>/user/basic/script.xlc ( insert these lines immediately above the entry for the Standard library)
<library:library library:name="ScriptBindingLibrary" xlink:href="file:://<OpenOffice path>user/basic/ScriptBindingLibrary/script.xlb/" xlink:type="simple" library:link="false"/>
Insert this following lines into <OpenOffice path>/user/basic/dialog.xlc ( insert these lines immediately above the entry for the Standard library)
<library:library library:name="ScriptBindingLibrary" xlink:href="file://<OpenOffice path>/user/basic/ScriptBindingLibrary/dialog.xlb/" xlink:type="simple" library:link="false"/>
Create a Scripts directory, create sub-directories java and beanshell in Scripts directory. Create sub directories MemoryUsage, InteractiveBeanShell in the beanshell directory. Copy the contents of each of the scripting/examples/beanshell directories into the newly created directories. Create sub directories Highlight, MemoryUsage and ScriptFrmwrkHelper in the java directory. Using the tables below populate the java directory with the appropriate files ( make sure to rename files where necessary )
Build example and framework helper scripts. Create a classpath with the following jars <SOLVERPATH>/<platform>/bin/unoil.jar,<SOLVERPATH>/<platform>/bin/jurt.jar, <SOLVERPATH>/<platform>/bin/jut.jar, <SOLVERPATH>/<platform>/bin/java_uno.jar, <SOLVERPATH>/<platform>/bin/ridl.jar, <SOLVERPATH>/<platform>/bin/sandbox.jar. Change directory to Highlight, MemoryUsage and ScriptFrmwrkHelper in turn, building all java files in each one. Jar up the class files in each directory creating ScriptFrmwrkHelper.jar in ScriptFrmwrkHelper, Highlight.jar in Highlight and finally MemUsage.jar in MemoryUsage.
Copy the entire Scripts directory hierarchy to <OpenOffice Path>/user/
Install the configuration files. Firstly backup any config files ( *.xml ) present in the <OpenOffice Path>/user/config/soconfig directory ( including sub-directories ). Copy all files with “.xml” extention ( except manifest.xml ) from scripting/workben/bindings to <OpenOffice Path>/user/config/soconfig. If <OpenOffice Path>/user/config/soconfig/META-INF directory doesn't exist create it. Copy manifest.xml from directory scripting/workben/bindings to <OpenOffice Path>/user/config/soconfig/META-INF directory.
The script framework is now installed.
Installation, User or Developer queries on the Office Scripting Framework
Issues found in the Office Scripting Framework should be logged