Well, didn't make it back for a post last night, sorry, but did get a chance to work with this a bit. When I decided to create this topic, during a discussion on the Base mailing list I said I'd let anyone that cared to watch me "
BUMBLE" my way along...so no holding back..maybe should have said Bumble and Stumble...
Many, many years ago in a college course an instructor made a comment that has always stuck with me - "Every decision involves a trade off of some kind!"
Well this little project has already found one of the trade offs surrounding one of the decisions.
The decision: I would work on this project only under Linux ( Ubuntu 8.04 ) and I would use only the development tools supplied in the Ubuntu repositories.
The trade off: The development tools are not the most current releases.
The effect: Not everything is going to work as the examples available say they should.
Case in point -
The latest release of NetBeans on the Sun Server is 6.1, but the lastest version in the Ubuntu repository is 6.0.1.
If I had downloaded the SUN supplied NetBeans/JDK bundle I would have the actual Java Development Kit 1.6, but using the Ubuntu build it came with OpenJDK
Finally - the OpenOffice.org Plugin for NetBeans - if I had NB 6.1 then I would have version 1.1.2 of the plugin, but with 6.0.1 I apparently can only use 1.1.1 (beta) of the plugin.
What does that mean - overall, I don't know - last night it meant that the first example would not build until I figured out the bug that was in the plugin and not my code...a fun time for someone that doesn't really know the environment yet. Then again maybe it makes for an even better learning experience.
OK - here is what I did. First I went and looked at that example on the wiki for building an UnoComponent. First comment "
WTFrack - Over!". Can do the first 2 steps and then it just leaves you hanging...fine I can imitate a deer in the head lights with the best of them when needs be...but being undaunted wen in search of a real tutorial..and I found it.
It is a hands on lab that was available at the Java-One conference this year called
OpenOffice.org Extensions with NetBeans. If you register with the Sun Developers Network , then the lab material is available for download.
So - I did and I did. My first impression from running through, some not all, of the exercises is - if you are interested in learning this stuff then this is where you want to start.
OK - back to My Decision - the Trade Off - the Consequences
The very first exercise is to create a "OpenOffice Client Application" that 'eats' ODF documents and 'spits out' PDF documents.
[ POINT of confusion here - since SUN made me register to download the lab package I am not sure if I can post parts of it here...hmmm... well doesn't really matter I can show what I did, right]
Step one - create a new project. File>New project
Excellent on the new project dialog is the OpenOffice.org entry - just point click, and a couple of simple questions, like give the project a name and Voila it builds the basic project structure...
The attachment Screenshot-New Project.png is no longer available
This project now includes one source code file, consisting of:
Code: Select all
/*
* DocumentConverter.java
*
* Created on 2008.05.02 - 23:49:50
*
*/
package com.example;
import com.sun.star.uno.XComponentContext;
import com.sun.star.comp.helper.Bootstrap;
/**
*
* @author hardydrew
*/
public class DocumentConverter {
/** Creates a new instance of DocumentConverter */
public DocumentConverter() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
try {
// get the remote office component context
XComponentContext xContext = Bootstrap.bootstrap();
}
catch (java.lang.Exception e){
e.printStackTrace();
}
finally {
System.exit( 0 );
}
}
}
Wonderful - one small thing I noticed was that the code in my editor was a little bit, just a little, different from the code that was shown n the Lab documentation...and no the difference is not in the authors name alone...but hey that won't be a problem right...
- new_dog2.gif (5 KiB) Viewed 5567 times