Difference between revisions of "OpenOffice NetBeans Integration"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Preview)
m (Overview)
 
(137 intermediate revisions by 18 users not shown)
Line 1: Line 1:
 +
[[image:OOo-Netbeans-Plugin.png|right]]
 
= Overview =
 
= Overview =
The intention of the StarOffice/OpenOffice.org NetBeans Integration is to simplify the development of office extensions. StarOffice/OpenOffice.org offers an API to program with or for the office and allows to automate tasks even remote or in process and allows to extend the office with completely new functionality. The NetBeans integration should simplify the access and usage of the API in new projects and should simplify the task of creating complete office extension packages (comparable to NetBeans plugin modules).<br>
+
The OpenOffice.org API plugin for NetBeans simplifies the development of {{AOo}} extensions. You can use the OpenOffice.org API to program {{AOo}}, and automate remote or in process tasks extend {{AOo}} with completely new functionality. The OpenOffice.org API plugin for NetBeans simplifies accessing and using of the API in new projects and simplifies the task of creating complete {{AOo}} extension packages (comparable to the NetBeans plugin modules).
  
= Planned Features =
+
= Download and Installation =
The focus is on creating new wizards for various tasks plus common basic functionality. We focus primary on Java but the support of C++ is also planned and depends on the C++ support in NetBeans which is planned at least for NetBeans 6.0. The planned feature list is not final and probably more specialized wizards for other service provider interfaces (SPI) are comming in the future.
+
  
== New Project Types ==
+
== NetBeans 6.x and OpenOffice 3.x (Obsolete) ==
 +
The plugin appears automatically in Netbeans 6.5.x, 6.7.x, 6.8 (version 2.0.6) but is not listed for later versions.
  
*'''[[OpenOffice_Simple_UNO_Client_Application_Project_Type|OpenOffice.org Client Application Project Type]]'''<br>This project type will create an adapted J2SE client application project with additional support of the simple UNO bootstrap feature. Means an adapted manifest file to support the bootstrap feature and bundling of some precompiled bootstrap glue code with the client application jar.  
+
== NetBeans 7.x and Apache OpenOffice 4.0.x ==
*'''[[OpenOffice_Calc_Add-In_Project_Type|OpenOffice.org Calc Add-In Project Type]]'''<br>This new project type will create an adapted J2SE class library project with special support for an UNO component library and an office extension package. The wizard will collect necessary information for new Calc built-in functions and abstracts from the underlying UNO technology.
+
The plugin for versions of NetBeans through 7.x is available for download from [https://people.apache.org/~cmarcum/devtools/ https://people.apache.org/~cmarcum/devtools/] provided by Carl Marcum. Use 3.x versions for extension development for OpenOffice.org versions 3.0 thru 3.4. Use the latest 4.0.5 alpha version for extension development for Apache OpenOffice 4.x. This version is under active development and will be made available in the NetBeans plugin manager list when finished. Until then, remember that it is an '''Beta''' version.
*'''[[General_UNO_Component_Project_Type|General UNO Component Project Type]]'''<br>This new project type will create an adapted J2SE class library project with special support for an UNO component library and an office extension package. The wizard will collect information about services and additional optional interfaces which should be implemented and will generate a complete code skeleton with already implemented component helper functions and default implemented interface methods.
+
*'''[[OpenOffice_Add-On_Project_Type|OpenOffice.org Add-On Project Type]]'''<br>This new project type will create an adapted J2SE class library project with special support for an UNO component library and an office extension package. The wizard will collect necessary information for an office Add-On component and will generate a Add-On specific code skeleton.
+
*'''[[OpenOffice_Scripting_Project_Type|OpenOffice.org Scripting Project Type]]'''<br>This new project type will create an adapted J2SE class library project with special support for office scripting. It should provide the possibility to import scripts from the office and open documents, edit, change and build these scripts, debug them and export them back (currently the support is planned for Java scripts only).
+
*'''[[OpenOffice_API_Library_Wrapper_Project_Type|OpenOffice.org API Library API Wrapper Project Type]]'''<br>This new project type should create a ''Library Wrapper Module'' to support simply usage of the office API in own projects. It bundles the necessary API jar files from the office in the library and in client applications. This of course is necessary to make use of the office API in clients running on machines where no office is installed and where the communication with the office is made over a remote socket connection.
+
  
== Common Features ==
+
The configuration is self-explanatory, for detailed information see [[OpenOffice_NetBeans_Integration#Configuration|Configuration]].
*'''UNOIDL Support'''<br>Means support of a new file type for UNOIDL files, including compiling, UNOIDL editor with syntax highlighting. A wizard for defining new UNOIDL types should be supported as well.
+
*'''Debug Support'''<br>Means debug support directly from NetBeans for new built and deployed extensions in the office process as well as the debugging of scripts in the office.
+
*'''Support of office extension package'''<br>This have to be defined in detail but it should at least support the browsing of a '' '''.oxt''' '' file in the NetBeans file system similar to jar|zip files.
+
*'''File type for xcu files'''<br>This have to be defined in detail but we can think of a special editor for office configuration files.
+
  
= Preview =
+
== NetBeans 8.x and Apache OpenOffice 4.1.x ==
The current preview supports three new project types, one client application wizard,a Calc Add-In wizard and a wizard for general UNO components. The Clac Add-In allows the definition of new Calc build-in functions for the spreadsheet application which can be directly used from the build-in functions wizard. The user don't need any knowledge of the underlying UNO technology and can define new functions on a higher level. The general UNO component wizard requires some more UNO base knowledge but simplify the intial creation of a new component enormously.<br>
+
The NetBeans plugin is now available for download from [http://plugins.netbeans.org/plugin/57917/apache-openoffice-api-plugin NetBeans.org AOO Plugin Page].
Once you have installed the plugin manually you will be able to easy update to future releases by using the integrated '' '''Update Center''' '' in NetBeans. The plugin comes with it's own '' '''OpenOffice.org Preview Updated Center''' '' where we will provide future previews.
+
 
 +
This plugin is also available on the NetBeans Plugin Portal Update Center. Use 'Tools > Plugins' action from the NetBeans IDE main menu for convenient installation of this plugin.
 +
 
 +
The previous version of the plugin for NetBeans 8.x and AOO 4.1.x is available for download from [http://people.apache.org/~jsc/aoo_plugin/org-openoffice-extensions-4.0.6.nbm http://people.apache.org/~jsc/aoo_plugin/org-openoffice-extensions-4.0.6.nbm] provided by Jürgen Schmidt.
 +
 
 +
Also see the mail message concerning this version: [https://markmail.org/message/7kr7b3gs2baqxdsw https://markmail.org/message/7kr7b3gs2baqxdsw]
 +
 
 +
== More recent versions of Netbeans ==
 +
Though the Netbeans plugin is not available in the Netbeans Plugin Portal Update Center (through 'Tools -> Plugins' in the IDE main menu) for versions of Netbeans > 8.x, the plugin will however still function correctly if installed manually on some of the more recent versions of Netbeans, as long as you're using a compatible JDK with Netbeans (Apache NetBeans 12.1 runs on JDK LTS releases 8 and 11, as well as on JDK 14; Netbeans 11.3 runs on JDK LTS releases 8 and 11 but not 14. Trying to use JDK 15 with Netbeans 12.1 or JDK 14 with Netbeans 11 may cause some errors both for Netbeans and the OpenOffice plugin for Netbeans). Confirmed to be working on:
 +
 
 +
* Netbeans 10 on Ubuntu 20.04 and on Windows 10 with JDK 8 or JDK 11
 +
* Netbeans 11 on Ubuntu 20.04 and on Windows 10 with JDK 8 or JDK 11
 +
* Netbeans 12.1 on Ubuntu 20.04 and on Windows 10 with JDK 8 or JDK 11 or JDK 14
 +
 
 +
After downloading the plugin from the [http://plugins.netbeans.org/plugin/57917/apache-openoffice-api-plugin NetBeans.org AOO Plugin Page], in order to install you can:
 +
 
 +
* Linux: go to 'Tools -> Plugins -> Downloaded -> Add plugin' and browse to the location of the downloaded NBM file, then once selected click on 'Install plugin'
 +
* Windows 10: either as above or '''''drag and drop''''' the NBM file on to the running instance of Netbeans
 +
 
 +
== From source ==
 +
The source is available in the Apache OpenOffice source SVN repository in the '''devtools''' tree.
 +
 
 +
The 3.0 source is available from:
 +
<blockquote>[https://svn.apache.org/repos/asf/openoffice/devtools/netbeansintegration/branches/3.0 https://svn.apache.org/repos/asf/openoffice/devtools/netbeansintegration/branches/3.0]</blockquote>
 +
 
 +
The recent source to use for 4.1 is available from:
 +
<blockquote>[https://svn.apache.org/repos/asf/openoffice/devtools/netbeansintegration/trunk https://svn.apache.org/repos/asf/openoffice/devtools/netbeansintegration/trunk]</blockquote>
 +
 
 +
= Features =
 +
Overview of the features included in the current plugin.
 +
== Project Types ==
 +
Click on &quot;File&quot; - &quot;New Project...&quot; and choose category &quot;OpenOffice.org&quot; to open a new project. All project types create working code. Once the project wizard is finished, a working
 +
compilable project is created. It may not do anything, but it can be used
 +
in {{AOo}} from the beginning.
 +
 
 +
*'''[[OpenOffice_Simple_UNO_Client_Application_Project_Type|{{AOo}} Client Application Project Type]]'''
 +
This project type creates an adapted J2SE client application project with additional support of the
 +
simple UNO bootstrap feature. To enable this, some precompiled glue code is bundled with the client
 +
application. The result is a portable jar file that bootstraps OpenOffice.org on any supported OS.
 +
 
 +
*'''[[OpenOffice_Calc_Add-In_Project_Type|OpenOffice.org Calc Add-In Project Type]]'''
 +
This project type creates an adapted J2SE class library project with special support for a UNO  
 +
component library and an office extension package. The wizard collects the necessary information for new  
 +
Calc built-in functions and abstracts from the underlying UNO technology.
 +
 
 +
*'''[[General_UNO_Component_Project_Type|General UNO Component Project Type]]'''
 +
This project type creates an adapted J2SE class library project with special support for a
 +
UNO component library and an {{AOo}} extension package. The wizard collects information about services
 +
and additional optional interfaces which should be implemented. Additional IDL types can also be
 +
defined. A complete code skeleton is generated, with the component helper functions and the default interface methods already implemented.
 +
 
 +
*'''[[OpenOffice_Add-On_Project_Type|OpenOffice.org Add-On Project Type]]'''
 +
This project type creates an adapted J2SE class library project with special support for a UNO  
 +
component library and an {{AOo}} extension package. The wizard collects the necessary information for an
 +
OpenOffice.org Add-On component and generates an Add-On specific code skeleton.
 +
 
 +
== File Types ==
 +
Click on &quot;File&quot; - &quot;New File...&quot; and select &quot;OpenOffice.org&quot; as category to create a new file for an {{AOo}} project. Note, that the OpenOffice.org category is available in all projects, although it only makes sense to use it in one of the projects stated above.
 +
*'''xcu file type'''
 +
Create an empty xcu file type. The files are recognized in NetBeans and
 +
syntax highlighting is supported.
 +
 
 +
*'''xcs file type'''
 +
Create an empty xcs file type. The files are recognized in NetBeans and
 +
syntax highlighting is supported.
 +
 
 +
*'''UNO idl file type'''
 +
You can use a file type wizard to create idl files. In the first step, you must select the name location
 +
and UNO type (e.g. Service or Interface). You can add additional
 +
information in the second step. When an interface is created, the second step asks about
 +
the functions that the interface should contain. A complete working idl file is created, and NetBeans provides syntax highlighting. When you choose
 +
to also create an implementation object (only available for service or interface), a Java skeleton file implementing
 +
your new idl file will also be created.
 +
 
 +
*'''Java UNO Object file type'''
 +
This file wizard creates a Java skeleton file that implements all functions defined in an interface or service idl file. If you choose a service, the Java implementation file will also be  
 +
registered in {{AOo}} when your extension is deployed.
 +
 
 +
== Create, deploy and debug ==
 +
These are actions that are available in the context menu of an extension project in the &quot;Project&quot;
 +
view.
 +
 
 +
*'''Debug Extension in Target {{AOo}}'''
 +
If necessary, &quot;Create OXT&quot; is executed. The resulting OXT file is registered in a temporary user installation of OpenOffice.org, which is located in the build directory of the project. (Cleaning of the project removes the user installation again.) Then {{AOo}} is started with this user installation. To trigger the registered extension, an appropriate action must be done in {{AOo}}.
 +
Execution stops at any breakpoints added to the code of the extension and debugging can start from there.
 +
 
 +
*'''Deploy and Run {{AOo}} Extension'''
 +
If necessary, &quot;Create OXT&quot; is executed. The resulting OXT file is registered inside the user installation of {{AOo}}. Then {{AOo}} is started.
 +
 
 +
*'''Create OXT'''
 +
If necessary, your code is compiled. The resulting jar file is packed into an OXT file, together with other necessary files such as configuration files, a manifest file, and images. The OXT file is located in the &quot;dist&quot; directory of the project.
 +
 
 +
*'''Publish Extension on {{AOo}} Website'''
 +
The starting page for uploading and publishing your extension on api.services.openoffice.org is loaded in your default web browser.
 +
 
 +
== Miscellaneous ==
 +
*'''External Jars'''
 +
Additional external jars that are used in an extension are automatically copied into the OXT file and added to the extension's classpath. A registered extension in {{AOo}} can still use the functionality provided there.
 +
The jars can be added to the project as a single jar or as part of a NetBeans library.
 +
 
 +
{{Note|All the jars from a library will be added to the OXT file, independent of their usage in the extension.}}
 +
 
 +
== Specifications ==
 +
 
 +
Find here links to the specifications of the plugin on the api.openoffice.org page.
 +
 
 +
[http://specs.openoffice.org/sdk/tools/spec_openoffice-netbeans-integration.odt OpenOffice.org Plugin for NetBeans]
 +
 
 +
[http://specs.openoffice.org/sdk/tools/spec_openoffice-netbeans-integration-addon-wizard.odt OpenOffice.org Plugin for NetBeans: Add-On Wizard]
 +
 
 +
[http://specs.openoffice.org/sdk/tools/spec_openoffice-netbeans-integration-calc-addin-wizard.odt OpenOffice.org Plugin for NetBeans: Add-In Wizard]
 +
 
 +
[http://specs.openoffice.org/sdk/tools/spec_openoffice-netbeans-integration-component-wizard.odt OpenOffice.org Plugin for NetBeans: Component Wizard]
 +
 
 +
[http://specs.openoffice.org/sdk/tools/spec_openoffice-netbeans-integration-debug-component.odt OpenOffice.org Plugin for NetBeans: Debug Feature]
 +
 
 +
[http://specs.openoffice.org/sdk/tools/spec_openoffice-netbeans-integration-new-idl-type.odt OpenOffice.org Plugin for NetBeans: IDL type support]
 +
 
 +
[http://specs.openoffice.org/sdk/tools/spec_openoffice-netbeans-integration-description-xml.odt OpenOffice.org Plugin for NetBeans: Support description.xml]
 +
 
 +
= Working with the plugin =
 +
The following section describes how you can work with the plugin and describes the requirements because the plugin  make use of some external stuff provided by an office and the {{AOo}} SDK.
  
 
== Requirements ==
 
== Requirements ==
The plugin ''[http://api.openoffice.org/Projects/NetBeansIntegration/org-openoffice-extensions.nbm org-openoffice-extensions.nbm]'' works only in combination with an installed StarOffice/OpenOffice.org installation and an appropriate StarOffice/OpenOffice.org Software Development Kit (SDK).  
+
The plugin works only in combination with {{AOo}} and an appropriate {{AOo}} Software Development Kit (SDK). The minimal suggested version is OpenOffice.org 2.0.4. With earlier versions, some features of the plugin will not work.
  
*'''[http://api.openoffice.org/Projects/NetBeansIntegration/org-openoffice-extensions.nbm org-openoffice-extensions.nbm]''' - the plugin module
+
*'''[https://download.openoffice.org Apache OpenOffice]''' or '''[http://www.sun.com/staroffice StarOffice 8]''' or higher versions of both programs
*'''[http://download.openoffice.org/2.0.4/index.html#download OpenOffice.org 2.0.4]''' or '''[http://www.sun.com/staroffice StarOffice 8 Product Update 4]'''  
+
*'''[https://download.openoffice.org/sdk.html OpenOffice.org Software Development Kit (SDK)]'''
*'''[http://download.openoffice.org/2.0.4/sdk.html OpenOffice.org Software Development Kit (SDK) 2.0.4]'''
+
  
== Installation ==
+
Note that the versions of {{AOo}} and the {{AOo}} SDK must match for everything to work.
The current version of the NetBeas plugin is a first preview and has to be installed manually as a normal NetBeans plugin over the “Update Center” in NetBeans. The manual installation is only necessary the first time and then you can use the integrated ''OpenOffice.org Preview Update Center''. Simply choose
+
*'' '''NetBeans -> Tools -> Update Center -> Install Manually Downloaded Modules (.nbm Files)''' ''
+
select the downloaded module and follow the wizard to install it.
+
  
=== Configuration ===
+
== Configuration ==
Before you can use the new project types you have to configure the plugin because it needs an installed office and SDK installation. Please choose
+
Before you can use the new project types you must configure the plugin because it needs an installed {{AOo}} and {{AOo}} SDK.
*'' '''Tools -> Options -> Miscellaneous -> StarOffice/OpenOffice.org Extensions''' ''
+
 
and select a valid office and SDK installation.  
+
Note:
 +
* As default settings, a standard installation will be found by the plugin - but only if {{AOo}} together with the SDK are present.
 +
* When you choose the {{AOo}} installation and an appropriate SDK is found, that SDK is chosen, the &quot;{{AOo}} SDK Installation&quot; field is then disabled.
 +
* If you change the {{AOo}} or {{AOo}} SDK installation, these changes are effective for projects created from now on only.
 +
 
 +
 
 +
For changing the office and SDK installation please choose
 +
*'' '''Tools -> Options -> Miscellaneous -> OOo API plugin''' ''
 +
and select a valid {{AOo}} and {{AOo}} SDK installation.  
 
<br>[[Image:OpenOffice_Extensions_Plugin_Options.png|center]]<br>
 
<br>[[Image:OpenOffice_Extensions_Plugin_Options.png|center]]<br>
The configuration step installs automatically a new office library which can be used in other projects diectly to support the office API. Including this library in own projects enables context sensitive help and code completion automatically.
+
The configuration step automatically installs a new OpenOffice.org library which can be used in other projects to support the OpenOffice.org API. Including this library in your own projects enables context-sensitive help and code completion.
 +
 
 +
Note: on Debian/Ubuntu, the {{AOo}} installation directory is <code>/usr/lib/openoffice/</code>. For other *nix platforms the location may vary, but you can find the location by inspecting the shell script <code>/usr/bin/ooffice</code> to see where the <code>ooqstart</code> executable is in your installation.
  
 
== Working with new Project Types ==
 
== Working with new Project Types ==
The plugin integrates two new project types under the category '''StarOffice/OpenOffice.org''':
+
The plugin integrates four new project types under the category '''StarOffice/OpenOffice.org''':
 +
*'''StarOffice/OpenOffice.org Add-On'''
 
*'''StarOffice/OpenOffice.org Calc Add-Ins'''
 
*'''StarOffice/OpenOffice.org Calc Add-Ins'''
 
*'''StarOffice/OpenOffice.org Client Application'''
 
*'''StarOffice/OpenOffice.org Client Application'''
 
*'''StarOffice/OpenOffice.org Component'''
 
*'''StarOffice/OpenOffice.org Component'''
 +
 
The wizards will collect the necessary information to create the new projects and should follow the NetBeans philosophy. You can simply choose
 
The wizards will collect the necessary information to create the new projects and should follow the NetBeans philosophy. You can simply choose
*'' '''File -> New Project -> StarOffice/OpenOffice.org -> <project_type>''' ''
+
*'' '''File -> New Project -> OpenOffice.org -> <project_type>''' ''
For more details about the project types please take a look to [[OpenOffice_Simple_UNO_Client_Application_Project_Type|OpenOffice.org UNO Client Application Project Type]], [[OpenOffice_Calc_Add-In_Project_Type|OpenOffice.org Calc Add-In Project Type]] or [[OpenOffice_Component_Project_Type|OpenOffice.org Component Project Type]]
+
For more details about the project types please take a look at
 +
*[[OpenOffice_Simple_UNO_Client_Application_Project_Type|OpenOffice.org UNO Client Application Project Type]]
 +
*[[OpenOffice_Calc_Add-In_Project_Type|OpenOffice.org Calc Add-In Project Type]]
 +
*[[General_UNO_Component_Project_Type|OpenOffice.org Component Project Type]]
 +
*[[OpenOffice_Add-On_Project_Type|OpenOffice.org Add-On Project Type]]
 +
 
 +
== Migrate Projects ==
 +
To migrate projects from an older version of the plugin to a new one is not necessary - the plugin itself will take care of that: build-uno-impl.xml and the project-uno.properties are updated, when updated versions of these files are needed for new features of the updated plugin. Note that build-uno-impl.xml will be overwritten, but project-uno.properties not. In the properties file, only new entries are added, existing ones are kept as they are. The update of the files happens when an old project is opened with a new version of the plugin and for all opened projects when the new plugin is downloaded and installed.
 +
 
 +
When migrating from one Office version to another (or porting a project across platforms), only a library has to be changed, called &quot;OpenOffice.org <version_number>&quot; (or &quot;StarOffice <version_number>&quot;). Choose '''Tools -> Libraries''' to get an overview of the existing libraries. A library is created when a valid OpenOffice.org and OpenOffice.org SDK is selected in '''Tools -> Options -> Miscellaneous -> OOo API Plugin''' (See [[OpenOffice_NetBeans_Integration#Configuration|Configuration]] for more details).
 +
* To change the library, click right on the project in the '''Project''' window and open the properties. Select '''Libraries''' as category and remove the one that points to the old installation and add the new one.
 +
* When porting the project across platforms, NetBeans notifies that a reference problem exists. The steps for changing the libraries also help in this case.
  
 
== Known Problems and Missing Features ==
 
== Known Problems and Missing Features ==
  
* context sensitive help doesn't work on Linux (Solaris not yet tested), even the javadoc generated Java UNO runtime reference documentation doesn't work on Linux. Under Windows both work as expected.
+
* Context sensitive help does not work on Linux (Solaris not yet tested), even the javadoc generated Java UNO runtime reference documentation does not work on Linux. Under Windows both work as expected.
* the integrated update center module doesn't work on Linux (known bug [http://www.netbeans.org/issues/show_bug.cgi?id=72960&x=23&y=7 72960] in NetBeans which is fixed in NetBeasn 6.0). Workaround is to install NetBeans locally where you have write access.
+
* &quot;Red Dot Problem&quot;: When you have created a project that supports own idl files (e.g. a Clac AddIn), a &quot;clean&quot; on the project will produce &quot;red dots&quot; that show that imported functionality is missing. The cause for this is the deleted jar file with the idl types that are used in your project. Although this does not seem to be the case, a compile will work and solve the problem. Sometimes the signs appear when &quot;clean and build&quot; is chosen - here the compiled idl files exist, but NetBeans does not recognize that. Open the offending Java file to solve that. Solution: compile idl files in the background and produce a &quot;shadow&quot; jar file in a temp directory that can be used even if the &quot;official&quot; file in the <project_name>/dist folder is deleted.
* syntax highlighting of UNOIDL files does work proper and needs to be improved
+
* With NetBeans versions at least 6.1 there is an update problem regarding NetBeans property sheets and node views: property sheet changes are not reflected in the node view. Seems like the notify mechanism for these updates has changed.
 +
 
 +
= Releases =
 +
 
 +
{|cellpadding=5 cellspacing=0 border=1 style="border-collapse:collapse; margin-left: 3em; border-color: #333;"
 +
|- style="background-color: #DEDEDE;"
 +
| Release Version || Planned Release Date || Release Date || Planned Features
 +
|- align=center
 +
| 1.0 || 05/08/07 || 05/08/07 || -
 +
|- align=center
 +
| 1.1 || 09/01/07 || 09/18/07 || [[OpenOffice_NetBeans_Integration/Releases/Release_1.1| see 1.1]]
 +
|- align=center
 +
| 1.1.1 || 03/08 || 03/20/08 || [[OpenOffice_NetBeans_Integration/Releases/Release_1.1.x| see 1.1.1]]
 +
|- align=center
 +
| 1.1.2 || 04/08 || 04/30/08 || [[OpenOffice_NetBeans_Integration/Releases/Release_1.1.x| see 1.1.2]]
 +
|- align=center
 +
| 1.1.3 || 06/30/08 || - || [[OpenOffice_NetBeans_Integration/Releases/Release_1.1.x| see 1.1.3]]
 +
|- align=center
 +
| 2.0 || 09/08 || - || [[OpenOffice_NetBeans_Integration/Releases/Release_2.0| see 2.0]]
 +
|- align=center
 +
| 2.0.3 || - || - || bugfixes only
 +
|- align=center
 +
| 2.0.4 || - || - || bugfixes only
 +
|- align=center
 +
| 2.0.5 || - || - || bugfixes only
 +
|- align=center
 +
| 2.0.6 || - || - || bugfixes only
 +
|- align=center
 +
| 2.0.7.alpha || - || - || changes to support NetBeans 6.9, opnly available in the file section of the API project, [http://api.openoffice.org/files/documents/22/4772/org-openoffice-extensions-2.0.7.alpha.nbm org-openoffice-extensions-2.0.7.alpha.nbm]
 +
|}
 +
 
 +
: &nbsp;&nbsp;Detailed download statistics can be found [[OpenOffice_NetBeans_Integration/Releases/Download_Statistic| here]] (not up-to-date)
 +
 
 +
* [[OpenOffice_NetBeans_Integration/Releases/Release_1.2#Current_issues_concerning_NetBeans_6|Issues]] for using the plugin with NetBeans 6.
 +
 
 +
= Planned Features =
 +
The focus is on creating new wizards for various tasks plus common basic functionality. The main programming language is Java. Support for C++ is also planned and depends on the C++ support in NetBeans which will be available at least for NetBeans 6.0. The planned feature list is not final and more specialized wizards for other service provider interfaces (SPI) are coming in the future.
 +
 
 +
== New Project Types ==
 +
*'''[[OpenOffice_Scripting_Project_Type|OpenOffice.org Scripting Project Type]]'''<br>This new project type will create an adapted J2SE class library project with special support for OpenOffice.org scripting. It should provide you the possibility to import scripts from OpenOffice.org and open documents, edit, change and build these scripts, debug them and export them back (currently the support is planned for Java scripts only).
 +
*'''[[OpenOffice_SmartTag_Project_Type|OpenOffice.org SmartTag Project Type]]'''<br>This new project type will simplify the development of SmartTags for the OpenOffice.org Writer application.
 +
*'''[[OpenOffice_API_Library_Wrapper_Project_Type|OpenOffice.org API Library API Wrapper Project Type]]'''<br>This new project type should create a ''Library Wrapper Module'' to support simple usage of the OpenOffice.org API in your own projects. It bundles the necessary API jar files from OpenOffice.org in the library and in client applications. This of course is necessary to make use of the OpenOffice.org API in clients running on machines where no OpenOffice.org is installed and where the communication with OpenOffice.org is made over a remote socket connection.
 +
 
 +
== Common Features ==
 +
*'''Editor for xcu files'''<br>This must be defined in detail but we can think of a special editor for OpenOffice .org configuration files.
 +
 
 +
= Quality Assurance =
 +
 
 +
If you find bugs please submit a new [http://api.openoffice.org/issues/enter_bug.cgi?component=sdk&issue_type=DEFECT issue] in the category '''sdk''' and the subcomponent '''netbeans-integration'''
 +
 
 +
* [[OpenOffice_NetBeans_Integration_QA|Schedule for OpenOffice.org NetBeans Integration QA ]]
 +
 
 +
= Localization =
 +
* [[OpenOffice_NetBeans_Integration/Localization|Localization Tutorial]]
 +
 
 +
 
 +
= Things to be done =
 +
* [[OpenOffice_NetBeans_Integration/To-Dos|ToDo list]]
  
 
= Feedback =
 
= Feedback =
This is a preview only and the whole stuff is under development and needs to be improved. Feedback is welcome and highly appreciated and we would like to invite you to discuss it on [mailto:dev@api.openoffice.org dev@api.openoffice.org] (Note: you have to be subscribed on the mailing list).
+
We will continuously extend and improve the plugin in the future and your feedback is welcome and highly appreciated. We would like to invite you to discuss it on [mailto:dev@api.openoffice.org dev@api.openoffice.org] (Note: you have to be subscribed on the mailing list).
 +
 
 +
You can also submit new [http://api.openoffice.org/issues/enter_bug.cgi?component=sdk&issue_type=FEATURE feature] or [http://api.openoffice.org/issues/enter_bug.cgi?component=sdk&issue_type=ENHANCEMENT enhancement] requests in the issue tracker in the category '''sdk''' and the subcomponent '''netbeans-integration'''
 +
 
 +
 
 +
[[Category:NetBeans]]
 +
[[Category:API]]
 +
[[Category:Effort]]

Latest revision as of 13:52, 31 January 2021

OOo-Netbeans-Plugin.png

Overview

The OpenOffice.org API plugin for NetBeans simplifies the development of Apache OpenOffice extensions. You can use the OpenOffice.org API to program Apache OpenOffice, and automate remote or in process tasks extend Apache OpenOffice with completely new functionality. The OpenOffice.org API plugin for NetBeans simplifies accessing and using of the API in new projects and simplifies the task of creating complete Apache OpenOffice extension packages (comparable to the NetBeans plugin modules).

Download and Installation

NetBeans 6.x and OpenOffice 3.x (Obsolete)

The plugin appears automatically in Netbeans 6.5.x, 6.7.x, 6.8 (version 2.0.6) but is not listed for later versions.

NetBeans 7.x and Apache OpenOffice 4.0.x

The plugin for versions of NetBeans through 7.x is available for download from https://people.apache.org/~cmarcum/devtools/ provided by Carl Marcum. Use 3.x versions for extension development for OpenOffice.org versions 3.0 thru 3.4. Use the latest 4.0.5 alpha version for extension development for Apache OpenOffice 4.x. This version is under active development and will be made available in the NetBeans plugin manager list when finished. Until then, remember that it is an Beta version.

The configuration is self-explanatory, for detailed information see Configuration.

NetBeans 8.x and Apache OpenOffice 4.1.x

The NetBeans plugin is now available for download from NetBeans.org AOO Plugin Page.

This plugin is also available on the NetBeans Plugin Portal Update Center. Use 'Tools > Plugins' action from the NetBeans IDE main menu for convenient installation of this plugin.

The previous version of the plugin for NetBeans 8.x and AOO 4.1.x is available for download from http://people.apache.org/~jsc/aoo_plugin/org-openoffice-extensions-4.0.6.nbm provided by Jürgen Schmidt.

Also see the mail message concerning this version: https://markmail.org/message/7kr7b3gs2baqxdsw

More recent versions of Netbeans

Though the Netbeans plugin is not available in the Netbeans Plugin Portal Update Center (through 'Tools -> Plugins' in the IDE main menu) for versions of Netbeans > 8.x, the plugin will however still function correctly if installed manually on some of the more recent versions of Netbeans, as long as you're using a compatible JDK with Netbeans (Apache NetBeans 12.1 runs on JDK LTS releases 8 and 11, as well as on JDK 14; Netbeans 11.3 runs on JDK LTS releases 8 and 11 but not 14. Trying to use JDK 15 with Netbeans 12.1 or JDK 14 with Netbeans 11 may cause some errors both for Netbeans and the OpenOffice plugin for Netbeans). Confirmed to be working on:

  • Netbeans 10 on Ubuntu 20.04 and on Windows 10 with JDK 8 or JDK 11
  • Netbeans 11 on Ubuntu 20.04 and on Windows 10 with JDK 8 or JDK 11
  • Netbeans 12.1 on Ubuntu 20.04 and on Windows 10 with JDK 8 or JDK 11 or JDK 14

After downloading the plugin from the NetBeans.org AOO Plugin Page, in order to install you can:

  • Linux: go to 'Tools -> Plugins -> Downloaded -> Add plugin' and browse to the location of the downloaded NBM file, then once selected click on 'Install plugin'
  • Windows 10: either as above or drag and drop the NBM file on to the running instance of Netbeans

From source

The source is available in the Apache OpenOffice source SVN repository in the devtools tree.

The 3.0 source is available from:

https://svn.apache.org/repos/asf/openoffice/devtools/netbeansintegration/branches/3.0

The recent source to use for 4.1 is available from:

https://svn.apache.org/repos/asf/openoffice/devtools/netbeansintegration/trunk

Features

Overview of the features included in the current plugin.

Project Types

Click on "File" - "New Project..." and choose category "OpenOffice.org" to open a new project. All project types create working code. Once the project wizard is finished, a working compilable project is created. It may not do anything, but it can be used in Apache OpenOffice from the beginning.

This project type creates an adapted J2SE client application project with additional support of the simple UNO bootstrap feature. To enable this, some precompiled glue code is bundled with the client application. The result is a portable jar file that bootstraps OpenOffice.org on any supported OS.

This project type creates an adapted J2SE class library project with special support for a UNO component library and an office extension package. The wizard collects the necessary information for new Calc built-in functions and abstracts from the underlying UNO technology.

This project type creates an adapted J2SE class library project with special support for a UNO component library and an Apache OpenOffice extension package. The wizard collects information about services and additional optional interfaces which should be implemented. Additional IDL types can also be defined. A complete code skeleton is generated, with the component helper functions and the default interface methods already implemented.

This project type creates an adapted J2SE class library project with special support for a UNO component library and an Apache OpenOffice extension package. The wizard collects the necessary information for an OpenOffice.org Add-On component and generates an Add-On specific code skeleton.

File Types

Click on "File" - "New File..." and select "OpenOffice.org" as category to create a new file for an Apache OpenOffice project. Note, that the OpenOffice.org category is available in all projects, although it only makes sense to use it in one of the projects stated above.

  • xcu file type

Create an empty xcu file type. The files are recognized in NetBeans and syntax highlighting is supported.

  • xcs file type

Create an empty xcs file type. The files are recognized in NetBeans and syntax highlighting is supported.

  • UNO idl file type

You can use a file type wizard to create idl files. In the first step, you must select the name location and UNO type (e.g. Service or Interface). You can add additional information in the second step. When an interface is created, the second step asks about the functions that the interface should contain. A complete working idl file is created, and NetBeans provides syntax highlighting. When you choose to also create an implementation object (only available for service or interface), a Java skeleton file implementing your new idl file will also be created.

  • Java UNO Object file type

This file wizard creates a Java skeleton file that implements all functions defined in an interface or service idl file. If you choose a service, the Java implementation file will also be registered in Apache OpenOffice when your extension is deployed.

Create, deploy and debug

These are actions that are available in the context menu of an extension project in the "Project" view.

  • Debug Extension in Target Apache OpenOffice

If necessary, "Create OXT" is executed. The resulting OXT file is registered in a temporary user installation of OpenOffice.org, which is located in the build directory of the project. (Cleaning of the project removes the user installation again.) Then Apache OpenOffice is started with this user installation. To trigger the registered extension, an appropriate action must be done in Apache OpenOffice. Execution stops at any breakpoints added to the code of the extension and debugging can start from there.

  • Deploy and Run Apache OpenOffice Extension

If necessary, "Create OXT" is executed. The resulting OXT file is registered inside the user installation of Apache OpenOffice. Then Apache OpenOffice is started.

  • Create OXT

If necessary, your code is compiled. The resulting jar file is packed into an OXT file, together with other necessary files such as configuration files, a manifest file, and images. The OXT file is located in the "dist" directory of the project.

  • Publish Extension on Apache OpenOffice Website

The starting page for uploading and publishing your extension on api.services.openoffice.org is loaded in your default web browser.

Miscellaneous

  • External Jars

Additional external jars that are used in an extension are automatically copied into the OXT file and added to the extension's classpath. A registered extension in Apache OpenOffice can still use the functionality provided there. The jars can be added to the project as a single jar or as part of a NetBeans library.

Documentation note.png All the jars from a library will be added to the OXT file, independent of their usage in the extension.

Specifications

Find here links to the specifications of the plugin on the api.openoffice.org page.

OpenOffice.org Plugin for NetBeans

OpenOffice.org Plugin for NetBeans: Add-On Wizard

OpenOffice.org Plugin for NetBeans: Add-In Wizard

OpenOffice.org Plugin for NetBeans: Component Wizard

OpenOffice.org Plugin for NetBeans: Debug Feature

OpenOffice.org Plugin for NetBeans: IDL type support

OpenOffice.org Plugin for NetBeans: Support description.xml

Working with the plugin

The following section describes how you can work with the plugin and describes the requirements because the plugin make use of some external stuff provided by an office and the Apache OpenOffice SDK.

Requirements

The plugin works only in combination with Apache OpenOffice and an appropriate Apache OpenOffice Software Development Kit (SDK). The minimal suggested version is OpenOffice.org 2.0.4. With earlier versions, some features of the plugin will not work.

Note that the versions of Apache OpenOffice and the Apache OpenOffice SDK must match for everything to work.

Configuration

Before you can use the new project types you must configure the plugin because it needs an installed Apache OpenOffice and Apache OpenOffice SDK.

Note:

  • As default settings, a standard installation will be found by the plugin - but only if Apache OpenOffice together with the SDK are present.
  • When you choose the Apache OpenOffice installation and an appropriate SDK is found, that SDK is chosen, the "Apache OpenOffice SDK Installation" field is then disabled.
  • If you change the Apache OpenOffice or Apache OpenOffice SDK installation, these changes are effective for projects created from now on only.


For changing the office and SDK installation please choose

  • Tools -> Options -> Miscellaneous -> OOo API plugin

and select a valid Apache OpenOffice and Apache OpenOffice SDK installation.


OpenOffice Extensions Plugin Options.png

The configuration step automatically installs a new OpenOffice.org library which can be used in other projects to support the OpenOffice.org API. Including this library in your own projects enables context-sensitive help and code completion.

Note: on Debian/Ubuntu, the Apache OpenOffice installation directory is /usr/lib/openoffice/. For other *nix platforms the location may vary, but you can find the location by inspecting the shell script /usr/bin/ooffice to see where the ooqstart executable is in your installation.

Working with new Project Types

The plugin integrates four new project types under the category StarOffice/OpenOffice.org:

  • StarOffice/OpenOffice.org Add-On
  • StarOffice/OpenOffice.org Calc Add-Ins
  • StarOffice/OpenOffice.org Client Application
  • StarOffice/OpenOffice.org Component

The wizards will collect the necessary information to create the new projects and should follow the NetBeans philosophy. You can simply choose

  • File -> New Project -> OpenOffice.org -> <project_type>

For more details about the project types please take a look at

Migrate Projects

To migrate projects from an older version of the plugin to a new one is not necessary - the plugin itself will take care of that: build-uno-impl.xml and the project-uno.properties are updated, when updated versions of these files are needed for new features of the updated plugin. Note that build-uno-impl.xml will be overwritten, but project-uno.properties not. In the properties file, only new entries are added, existing ones are kept as they are. The update of the files happens when an old project is opened with a new version of the plugin and for all opened projects when the new plugin is downloaded and installed.

When migrating from one Office version to another (or porting a project across platforms), only a library has to be changed, called "OpenOffice.org <version_number>" (or "StarOffice <version_number>"). Choose Tools -> Libraries to get an overview of the existing libraries. A library is created when a valid OpenOffice.org and OpenOffice.org SDK is selected in Tools -> Options -> Miscellaneous -> OOo API Plugin (See Configuration for more details).

  • To change the library, click right on the project in the Project window and open the properties. Select Libraries as category and remove the one that points to the old installation and add the new one.
  • When porting the project across platforms, NetBeans notifies that a reference problem exists. The steps for changing the libraries also help in this case.

Known Problems and Missing Features

  • Context sensitive help does not work on Linux (Solaris not yet tested), even the javadoc generated Java UNO runtime reference documentation does not work on Linux. Under Windows both work as expected.
  • "Red Dot Problem": When you have created a project that supports own idl files (e.g. a Clac AddIn), a "clean" on the project will produce "red dots" that show that imported functionality is missing. The cause for this is the deleted jar file with the idl types that are used in your project. Although this does not seem to be the case, a compile will work and solve the problem. Sometimes the signs appear when "clean and build" is chosen - here the compiled idl files exist, but NetBeans does not recognize that. Open the offending Java file to solve that. Solution: compile idl files in the background and produce a "shadow" jar file in a temp directory that can be used even if the "official" file in the <project_name>/dist folder is deleted.
  • With NetBeans versions at least 6.1 there is an update problem regarding NetBeans property sheets and node views: property sheet changes are not reflected in the node view. Seems like the notify mechanism for these updates has changed.

Releases

Release Version Planned Release Date Release Date Planned Features
1.0 05/08/07 05/08/07 -
1.1 09/01/07 09/18/07 see 1.1
1.1.1 03/08 03/20/08 see 1.1.1
1.1.2 04/08 04/30/08 see 1.1.2
1.1.3 06/30/08 - see 1.1.3
2.0 09/08 - see 2.0
2.0.3 - - bugfixes only
2.0.4 - - bugfixes only
2.0.5 - - bugfixes only
2.0.6 - - bugfixes only
2.0.7.alpha - - changes to support NetBeans 6.9, opnly available in the file section of the API project, org-openoffice-extensions-2.0.7.alpha.nbm
  Detailed download statistics can be found here (not up-to-date)
  • Issues for using the plugin with NetBeans 6.

Planned Features

The focus is on creating new wizards for various tasks plus common basic functionality. The main programming language is Java. Support for C++ is also planned and depends on the C++ support in NetBeans which will be available at least for NetBeans 6.0. The planned feature list is not final and more specialized wizards for other service provider interfaces (SPI) are coming in the future.

New Project Types

  • OpenOffice.org Scripting Project Type
    This new project type will create an adapted J2SE class library project with special support for OpenOffice.org scripting. It should provide you the possibility to import scripts from OpenOffice.org and open documents, edit, change and build these scripts, debug them and export them back (currently the support is planned for Java scripts only).
  • OpenOffice.org SmartTag Project Type
    This new project type will simplify the development of SmartTags for the OpenOffice.org Writer application.
  • OpenOffice.org API Library API Wrapper Project Type
    This new project type should create a Library Wrapper Module to support simple usage of the OpenOffice.org API in your own projects. It bundles the necessary API jar files from OpenOffice.org in the library and in client applications. This of course is necessary to make use of the OpenOffice.org API in clients running on machines where no OpenOffice.org is installed and where the communication with OpenOffice.org is made over a remote socket connection.

Common Features

  • Editor for xcu files
    This must be defined in detail but we can think of a special editor for OpenOffice .org configuration files.

Quality Assurance

If you find bugs please submit a new issue in the category sdk and the subcomponent netbeans-integration

Localization


Things to be done

Feedback

We will continuously extend and improve the plugin in the future and your feedback is welcome and highly appreciated. We would like to invite you to discuss it on dev@api.openoffice.org (Note: you have to be subscribed on the mailing list).

You can also submit new feature or enhancement requests in the issue tracker in the category sdk and the subcomponent netbeans-integration

Personal tools