Download NetBeans!

20070214 Wednesday February 14, 2007

Hello OpenOffice.org API

Many many moons ago (which turns out to be June 16, 2006), Wouter van Reeven (from Amis in Holland) and I started writing a tutorial for OpenOffice.org API on the NetBeans Platform. Wouter provided the OpenOffice.org API side of the story and I provided the NetBeans Platform side. That was a pretty cool document we worked on and we intended to try to publish it somewhere externally. However, the story kind of dwindled at some stage, because it became quite difficult to provide a solid bootstrapping story. There were problems with classloading, there were problems with native libraries, and there were problems even understanding what exactly the problems were. So, even though the story was complete and the tutorial written, it never got publicized on netbeans.org or anywhere else.

However, in the meantime we have OpenOffice NetBeans Integration. One of the project templates that this integration provides (i.e., installed via an NBM file in NetBeans IDE) is called "Open Office Client Application Project Type". I used that and, without much problem, worked the original code of Wouter and my tutorial into this Java application project (i.e., not a NetBeans module suite, or rich-client application, or module, but just a plain old Java application). The downside is that you need to specify the OpenOffice SDK and local installation before you even begin working with these project types, and these are registered in a project-level file called project-uno.properties. I wonder what this means for distribution? Does this mean that the end user has to have the SDK installed locally? That's part of the bootstrapping issue we had when working with NetBeans modules and OpenOffice.org API. Anyway, the long and short of it is that the tutorial, slightly reworked for the Java application context (i.e., now I'm using a JFrame instead of a TopComponent and the bootstrapping is slightly different), is that you can produce reports like this one:

When you click the Generate Report button, you get a spreadsheet that has a number of cool features, such as rows that have alternating colors (white/orange), a special color (green) for the row with the highest number of replies, another special color (red) for the row with the lowest number of replies, and additional cells specifying the authors of the highest/lowest replied-to article. Full code for this scenario is in the tutorial worked on by Wouter and myself, which is An Introduction to the OpenOffice.org API.

Feb 14 2007, 01:02:25 AM PST Permalink