Building the Scripting Framework for OpenOffice.org
Contents
- Building Scripting Framework
- Installation
Pre-requisites
- JDK1.3 or greater
- ANT which is available from http://jakarta.apache.org/builds/jakarta-ant/release
- Full OO643C or later solver and installation set
- OO643C or later OpenOffice build environment (see: 643C Developer Release)
- IDE - these are 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 either of the IDEs specified below are react accordingly)
- NetBeans 3.4
- jEdit 4.0.3 (plus additional modules, see the guide for developing scripts usingjEditfor details)
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)
- unoil
- offapi
- scripting
- unoil/drafts/com/sun/star/script (drafts/com/sun/star/script,needs to be in the unoil module)
- offapi/drafts/com/sun/star/script (drafts/com/sun/star/script,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.
offapi module
- 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
- Modify the prj/build.lst, you will need to add the following
lines
- oa offapi\drafts\com\sun\star\script\framework nmake - all oa_scriptf_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
- Modify the util/makefile.mk and add the following to UNOIDLDBFILES list
- $(UCR)$/dcssscriptframework.db \
- $(UCR)$/dcsssfprovider.db \
- $(UCR)$/dcsssfstorage.db
unoil module
- 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
- 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 - Modify prj/build.lst
- Add the following line
ul unoil\drafts\com\sun\star\script\framework nmake - all ul_scriptf_drafts ul_ucb ul_frame NULL - Add ul_scriptf_draftsto the last line before NULL
scripting module
- Remove the comments from the lines in source/cppumaker.mk
- UNOUCRDEP=$(PRJ)/../offapi/$(INPATH)/ucr/offapi.db $(SOLARBINDIR)$/udkapi.rdb $(SOLARBINDIR)$/offapi.rdb
- UNOUCRRDB=$(PRJ)/../offapi/$(INPATH)/ucr/offapi.db $(SOLARBINDIR)$/udkapi.rdb $(SOLARBINDIR)$/offapi.rdb
- Comment out the lines in source/cppumaker.mk
- UNOUCRDEP=$(SOLARBINDIR)$/udkapi.rdb
- UNOUCRRDB=$(SOLARBINDIR)$/udkapi.rdb
- Remove the comment from the following line in java/build.xml
- <!-- <pathelement location="${prj}/../unoil/${inpath}/class/unoil.jar"/> -->
- Comment out the line in java/build.xml
- <pathelement location="${solar.jar}/unoil.jar"/>
- 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).
- 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
- No NetBeans add-in
- localoffice.jar
- netbeans.jar
- No jEdit add-in
- localoffice.jar
- jedit.jar
- netbeans.jar
- localoffice.jar
- jedit.jar
- idesupport.jar
Building
- Execute build in the offapi module
- Execute build in the unoil module
- 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- buildunopackage
- Modify the copy of the offapi.db, replacing unxsols3 with the appropriate platform.
- Modify the copy of the unoil.jar, replacing unxsols3 with the appropriate platform.
- Remove the mkdir & copy of the .plt directories other than that on which you are working.
- packagesingletons - remove the mkdir & copy of the regsingleton tool for platforms other than that on which you are working.
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.- Create a separate directory ($pkg)
- 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 - Copy in the libraries from scripting/<platform>/lib to $pkg/<PLATFORM>.plt
- Copy in ScriptRuntimeForJava.jar from scripting/<platform>/class into the top level directory, $pkg
- Copy in unoil.jar from $pkg/unoil/<platform>/class
to skip_registration directory
- Merge the following registries from offapi/<platform>/ucr into one registry called ooscript.rdb under the top level directory, $pkg
- dcssscriptframework.db
- dcsssfprovider.db
- dcsssfstorage.db
- Now, zip up all files in this directory, $pkg
- Copy the zip file into your OpenOffice installation under the user/uno_packages directory
- In the program directory, run pkgchk on the zip file
- Copy from the solver ($SRC_ROOT)/solver/643/<platform>/bin/regsingleton
to your OpenOffice installation under the program directory
- Execute the following
- ./regsingleton <OpenOffice Path>/user/uno_packages/cache/services.rdb drafts.com.sun.star.script.framework.storage.theScriptStorageManager=drafts.com.sun.star.script.framework.storage.ScriptStorageManager
- ./regsingleton <OpenOffice Path>/user/uno_packages/cache/services.rdb drafts.com.sun.star.script.framework.theScriptRuntimeForJava=drafts.com.sun.star.script.framework.ScriptRuntimeForJava
- 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
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