Building the Scripting Framework  for  OpenOffice.org

Contents

Pre-requisites

Projects & Modifications

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.

If configure can not find Ant, after you have sourced or run the environment set-up script,  you may need 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. OO643C)

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 is 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-OO643C

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 directory under the offapi module, if you don't, you will need to check it out from CVS head
  2. Modify the prj/build.lst, you will need to add the following lines and add "oa_sfprovider_drafts oa_sfstorage_drafts oa_scriptf_drafts" to the last line before "NULL"
  3. Modify the util/makefile.mk and add the following to UNOIDLDBFILES list

unoil module

  1. Ensure that you have the drafts/com/sun/star/script directory under the unoil module, if you don't, you will need to check it out from CVS head
  2. Modify the makefile.mk in the top level directory of the module
    Change the line RDB  =  $(SOLARBINDIR)/offapi.rdb to RDB = $(PRJ)$/..$/offapi$/$(INPATH)$/ucr$/offapi.db
  3. Modify prj/build.lst

scripting module

  1. Remove the comments from the lines in source/cppumaker.mk
  2. Comment out the lines in source/cppumaker.mk
  3. Remove the comment from the following line in java/build.xml
  4. Comment out the line in java/build.xml
  5. Assuming you have both NetBeans & jEdit installed, modify the java/build.env to point at the NetBeans & jEdit installations (see the openide.class.path & jedit.class.path entries in the build.xml for more details). 
  6. Alternatively, if you do not wish to build the add-ins, delete the following entries from the depends section of the target "all" in the build.xml

Building

  1. Execute build in the offapi module
  2. Execute build 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. However, this expects that there exist output directories in the three projects mentioned previously for each of the three main platforms (Solaris/SPARC. Linux/x86, Windows). For a build on a single platform, modifications to the following targets will need to be made Once these changes have been made, running dmake in the scripting/workben directory should result in the creation of the SFrameworkInstall.jar.

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! The first stage in the manual installation is to build the UNO package containing the libraries & Jar files.
  1. Create a separate directory ($pkg)
  2. In this directory, create directories called $pkg/<PLATFORM>.plt and $pkg/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 $pkg/<PLATFORM>.plt
  4. Copy in ScriptRuntimeForJava.jar from scripting/<platform>/class into the top level directory, $pkg
  5. Copy in unoil.jar from $pkg/unoil/<platform>/class  to skip_registration directory
  6. Merge the following registries from offapi/<platform>/ucr into one registry called ooscript.rdb under the top level directory, $pkg
  7. Now, zip up all files in this directory, $pkg
The next stage is to take the UNO package and install it in an OpenOffice installation.
  1. Copy the zip file into your OpenOffice installation under the user/uno_packages directory 
  2. In the program directory, run pkgchk on the zip file
  3. Copy from the solver ($SRC_ROOT)/solver/643/<platform>/bin/regsingleton to your OpenOffice installation under the program directory
  4. Execute the following
  5. Modify the the ProtocolHandler.xcu file under <OpenOffice Path>/share/registry/data/org/openoffice/Office/, add the following lines:
    <node oor:name="com.sun.star.comp.ScriptProtocolHandler" oor:op="replace">
        <prop oor:name="Protocols">
            <value>script:*</value>
        </prop>
    </node>
    Under the HandlerSet Tag
Unzip HighlightTextParcel.sxp from scripting/examples/java into <OpenOffice Path>/user, this should create a directory under user  called Scripts/java/HighlightText

Now, run OpenOffice and under the Tools->Configure menu add a new menu which is bound to the macro Standard.Main, then shut down OpenOffice and modify the file <OpenOffice>/user/config/soffice.cfg/writermenubar.cfg and change macro://Standard.main() to script://HighlightText.showForm. Start OpenOffice again and select the menu item you have added, this should bring up a Java dialog box call HighlightText

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: Fri Nov 29 11:40:28 GMT 2002