Working with OpenOffice.org UNO components

See Also 

Number one
Create and configure a project
  1. Make sure that you have configured a valid OpenOffice.org and OpenOffice.org SDK installation under Tools > Options > Miscellaneous > OpenOffice.org Extensions.
  2. Use the OpenOffice.org Component project template.
    Choose File > New Project > OpenOffice.org > OpenOffice.org Component.
  3. Specify the project name.
  4. Specify the Component name. The component name is used to create a class name.
  5. Select a Java package. Note: The Java package selection is optional.
  6. Select the project location. The project location is the directory where the new project should be created.
  7. Specify at least one existing service, or define a new service that your component should implement. You can specify more than one service and it is possible to define new services with new interfaces or other new types.
  8. Finish the wizard to generate all the necessary files and the intial code skeleton for the new UNO component.
  9. Configure the classpath for the project. You can add a JAR file, a library, or an IDE project to the classpath.

Number two
Build the project

  1. Choose Build > Build Main Project or right-click any project and choose Build Project.
  2. Use the context menu of the project node (projects window) to create and deploy the office extension package directly in your specified office installation.
    Right-click on the project node > Create OXT
    to create the extension package.
    Right-click on the project node > Deploy Office Extension
    to deploy the extension.
  3. Alternatively you can chose the appropriate targets from the context menu for the build.xml file.
    Choose build.xml > Run Target > uno-package
    to create the extension package.
    Choose build.xml > Run Target > uno-deploy
    to deploy the extension.

Number three
Run the project
  1. This is currently not supported. OpenOffice.org extensions are running in the office process and a suitable workflow to support this from inside the IDE is not yet implemented.

Number three
Debug the project
  1. Debugging OpenOffice.org extensions is quite simple. In the Projects window, open the context menu and select "Debug Extension in Target Office".
  2. OpenOffice.org is started with a new user installation that is created in the build/soffice_debug directory. Your extension is deployed in this new user installation and OpenOffice.org is started.
  3. Set breakpoints or watches in your code.
  4. Use your Add-In in OpenOffice.org so that your code is executed.
  5. The code execution will stop at your breakpoint.
See Also
OpenOffice.org Components
OpenOffice.org Developer's Guide - Writing UNO Components