Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

Building the Scripting Framework for OpenOffice.org

Contents

Pre-requisites

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.

Making Scripting Framework Services and Interfaces available

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

You will need to modify the offapi and unoil modules so that the services and interfaces for scripting are available.

offapi module

  1. 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

  2. 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"

  3. 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:
    ..\%__SRC%\ucr\offapi.db %_DEST%\bin%_EXT%\offapi.rdb

  4. Modify the util/makefile.mk and add the following to UNOIDLDBFILES list

    • $(UCR)$/dcssscriptfruntime.db \

    • $(UCR)$/dcsssfprovider.db \

    • $(UCR)$/dcsssfsecurity.db \

    • $(UCR)$/dcsssfstorage.db

  5. 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

unoil module

  1. Modify prj/build.lst

    • 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

scripting module

  1. Modify java/build.env to point to the point to beanshell bsh-1.2b7.jar, ( see install.dir entry in build.env )

  2. 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).

  3. 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

      • localoffice.jar

      • netbeans.jar

Building

  1. Execute build and deliver in the offapi module

  2. Execute build and deliver in the unoil module

  3. Execute build in the scripting module

Automated Installer

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).

Manual Installation of the Scripting Framework

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.

  1. Create a two directories ($pkgsf) for scripting framework and ($pkgbs) from beanshell support.

  2. 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

  3. Copy in the libraries from scripting/<platform>/lib to $pkgsf/<PLATFORM>.plt

  4. Copy in ScriptRuntimeForJava.jar from scripting/<platform>/class into the top level directory, $pkgsf

  5. Copy in unoil.jar from $pkgsf/unoil/<platform>/class to $pkgsf/skip_registration directory

  6. Copy ScriptRuntimeForBeanShell.jar from scripting/<platform>/class to $pkgbs

  7. Copy bsh-1.2b7.jar, available from http://www.beanshell.org/download.html to $pkgbs/skip_registration directory.

  8. Copy ScriptFramework.rdb from offapi/<platform>/ucr/ScriptFramework.rdb to $pkgsf

  9. Copy ProtocolHandler.xcu from scripting/workben/installer/ to $pkgsf

  10. Now, zip up all files in directory, $pkgsf to ooscriptf.zip

  11. 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.

  1. Copy the zips file into your OpenOffice installation under the user/uno_packages directory 

  2. 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.

    1. 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

    2. Copy ScriptBindingLibrary directory and its contents to <OpenOffice path>/user/basic directory.

    3. 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"/>

    4. 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"/>

    5. 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 )

      Source (scripting/examples/java)

      Destination file

      HighlightTextParcel.xml

      <OpenOffice Path>/user/Scripts/java/Highlight/parcel-descriptor.xml

      HighlightUtil.java

      <OpenOffice Path>/user/Scripts/java/Highlight/HighlightUtil.java

      HighlightText.java

      <OpenOffice Path>/user/Scripts/java/Highlight/HighlightText.java

      MemoryUsage.java

      <OpenOffice Path>/user/Scripts/java/MemoryUsage/MemoryUsage.java

      MemoryUsageParcel.xml

      <OpenOffice Path>/user/Scripts/java/MemoryUsage/parcel-descriptor.xml

      ScriptFrmwrkHelper.java

      <OpenOffice Path>/user/Scripts/java/ScriptFrmwrkHelper/ScriptFrmwrkHelper.java

      ScriptFrameWkHelperParcel.xml

      <OpenOffice Path>/user/Scripts/java/ScriptFrmwrkHelper/parcel-descriptor.xml

    6. 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.

    7. Copy the entire Scripts directory hierarchy to <OpenOffice Path>/user/

    8. 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.

Mailing List

Installation, User or Developer queries on the Office Scripting Framework

Issues

Issues found in the Office Scripting Framework should be logged in Issuezilla
component: framework
subcomponent: scripting


Last revision: Wed Mar 19 17:39:14 GMT 2003

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.