For JavaOne attendees using the lab machines provided, the steps in
Exercise 0 are done for you as part of the login process. So please proceed to
Exercise 1.
Note: you do not have to download ODFDOM. The authors of this lab have included a compiled and working version of ODFDOM in the lab: odfdom.jar
The reason for this is that the API of ODFDOM is a work in progress and may not be compatible with the code presented in the exercises.
We do encourage the download of the latest version, though, to benefit from additions and bugfixes.
Download the source code of the ODFDOM. This is available in a Mercurial repository. The following instructions
explain everything on the NetBeans side. Confer ODFDOM build environment
using NetBeans IDE
In NetBeans, open "Versioning - Mercurial - Clone Other...". Enter the following Repository URL: https://odftoolkit.org/hg/odfdom~developer.
Click "Next >"

Figure-03: Download ODFDOM 1
The following paths are already ok, so click "Next >" again.

Figure-04: Download ODFDOM 2
Enter "<lab_root>/odfdom" as Parent Directory. Note:
"/home/javaone2009" is only a placeholder. Click "Finish". You may have to wait a little bit until Mercurial finishes.

Figure-05: Download ODFDOM 3
When cloning the project has finished, you may get the message box shown in Figure-06 - depending on your system.
Click on "Yes" to ignore Mercurial's own files. If the settings here are already done on your machine,
go directly to the next point.

Figure-06: Download ODFDOM finished
Finally, the maybe irritating message shown in Figure-07 will appear. Click on "Open Project..."
This will open the project and set it as Main project.

Figure-07: Open ODFDOM project
If you run into a reference problem as displayed in Figure-08, that is a known bug in the NetBeans platform (and already fixed in NetBeans 6.7).
This problem occurs when you have Java 6 installed, because the ODFDOM has Java 5 as official baseline. Fortunately there is a workaround available.

Figure-08: Reference Problem
Open the project's properties by right clicking on the project. Click on "Properties". Note that
"Resolve Reference Problems..." is only helpful when there is also Java 5 available on your system.

Figure-09: Open Project Properties
Go to the "Libraries" category. Notice the missing Java platform.

Figure-10: Open Project Properties
Simply select one of the available Java platforms, make sure it is "JDK 1.5". Click "OK"

Figure-11: Select the correct platform
You will be asked to regenereate build-impl.xml. Click on "Regenerate"

Figure-12: Regenerate build-impl.xml
The following configuration steps are not mandatory to do the exercises, but they may help in working with ODFDOM.
The authors of the lab strongly encourage to do the following to make working with the lab easier.
Add the javadoc of ODFDOM to NetBeans.
Open "Tools - Library" Click on "New Library..."

Figure-13: Library Manager
Enter "ODFDOM" as name. Click "OK" next.

Figure-14: Create new Library
In the still open Library Manager dialog, the new library is added. Click on "Add JAR/Folder"and choose
"<lab_root>/resources/odfdom/jars/odfdom.jar"

Figure-15: Library Mabager
Back again, click on "Javadoc" and then on "Add Zip/Folder". Choose the folder "<lab_root>/resources/odfdom/javadoc"

Figure-16: Library Manager
Click "OK" now to close the dialog. When you type a "." after a variable or class name from the odfdom.jar package,
NetBeans will open the Javadoc in a popup window. Example:

Figure-17: Javadoc Example