Building the Scripting Framework for OpenOffice.org
Contents:
Requirements:
- 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 greater OpenOffice build environment (see: Downloading and Building the Source, currently this is for 643 not OO643C )
Projects to get from CVS
Backup your unoil and offapi modules and then checkout the following:Modules to be checkout from CVS head:
- 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)
- unoil
- offapi
Setting up build environment for Scripting
Assumption: That you have a build environment set-up to build OpenOffice.org or components for OpenOffice.org, otherwise please read the guide on Downloading and Building the SourceIf you have configured your environment with Java and Ant, please skip on to ...... , otherwise you will need to re-run the configure script from the config_office project and include the options --with-jdk-home=<PATH TO JAVA> --with-ant-home=<PATH TO ANT> and source or run the environment set-up script.
NOTE: If configure can not get Ant, after you have sourced or run the environment set-up script, you will need add all jarfiles under <PATH TO ANT>/lib to your $CLASSPATH
Modifying offapi, unoil and scripting modules for building
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
- and add "oa_sfprovider_drafts oa_sfstorage_drafts oa_scriptf_drafts" to the last line before "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_drafts to 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"/>
Building scripting
- Execute build in the offapi module
- Execute build in the unoil module
- Execute build in the scripting module
Creating the UNO Package:
Please read the Developer's Guide for more information on UNO packages- 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
Manual Installation of the Scripting Framework
- 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
If you have any problems, please post your problem to dev@framework.openoffice.org