The Free and Open Productivity Suite
Apache OpenOffice 4.1.3 released

Developing Scripts in NetBeans

This document describes how to set up NetBeans for OpenOffice.org Scripting and how to write a simple script using NetBeans. You can download the NetBeans IDE from the NetBeans download page.



Now start NetBeans and mount the directory you created using the File/Mount Filesystem menu option. You also need to mount the following of the jar files in the <OpenOffice.org installation>/program/classes directory in order to access the OpenOffice.org API from your scripts:

unoil.jar, ridl.jar, sandbox.jar, jurt.jar, juh.jar


Creating a Parcel Recipe

OpenOffice.org scripts are delivered in Script Parcels. Like OpenOffice.org documents they are zip files. Script Parcels have the .sxp extension. Script Parcels are generated from Parcel Recipes where all of the files that are necessary to create the parcel are put together. To create a new Parcel Recipe: This will create a new directory with the name you chose. In this directory you will find a Contents directory where all of your files will be placed. An empty stub file will have been placed in the Contents directory and can be used as a starting point for your script.

Note: To add further empty stub scripts to your Parcel Recipe, right click on the Contents directory and use the New/Office Scripting/Empty Script menu item.


Actions available for Parcel Recipe

If the user right clicks on the parcel directory they should be able to use the following actions:


Actions available for Script Parcels

Script Parcels supports only one action:

Note: If you deploy a Script Parcel to an OpenOffice.org installation you need to use the Tools/Scripting Add-on's/Refresh All Scripts menu item for the new script to appear in the Assign Script dialog.

Note: You can also deploy to OpenOffice.org documents within NetBeans using drag and drop or cut and paste.


Actions available for OpenOffice.org Documents

OpenOffice.org Documents are also recognised by NetBeans. Any parcels contained in the document will be displayed as nodes of the OpenOffice.org document. Deleting one of these nodes will remove the Script Parcel from the document. You should ensure that the document is not open in OpenOffice.org before deleting any parcels it may contain. OpenOffice.org documents support the standard Delete, Cut and Copy actions and the following custom actions:


Debugging Java OpenOffice.org scripts in NetBeans

Note: As the BeanShell scripting language does not support debugging it is not possible to debug BeanShell OpenOffice.org scripts from NetBeans. You can however use the Interactive BeanShell scripting menu item under the Tools menu in OpenOffice.org to test BeanShell code. Just enter any BeanShell code and hit the Eval button to execute it.




Last Modified: Nov 19 2003

Apache Feather

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

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