Calc/Add-In/Project Type

From Apache OpenOffice Wiki
< Calc‎ | Add-In
Revision as of 10:33, 19 July 2006 by ErAck (Talk | contribs)

Jump to: navigation, search

Overview

The StarOffice/OpenOffice.org Calc Add-In wizard creates a new project based on a J2SE class library project and supports additional targets to create a complete office extension package and to deploy this package into the configured office installation. This new targets will be provided at the project node later, similar to the "Create NBM" in a plugin module project.
The wizard will collect all necessary information and allows the definition of new build-in Calc functions which can be used in the spreadsheet application directly after deploying the extension and restarting the office (live deployment of calc add-ins does currently not work).
After finishing the wizard you can directly build the project and can create and deploy the office extension package in your office. The created build-in functions are default implemented and do nothing. In a second step you can insert your implementation in the generated skeleton (searching for the add-in function body), rebuild the extension and deploy it again to see the effect in your office.

Project Wizard

The project wizard should be simply to use, you simply choose

  • File -> New Project -> StarOffice/OpenOffice.org -> StarOffice/OpenOffice.org Calc Add-In

and follow the wizard.

  • Step 1: Selecting the project type

Calc AddIn1.png

  • Step 2: Defining the project name and the project location

Calc AddIn2.png

  • Step 3: Defining Add-In name and an optional package


  • Step 4: Defining the new Add-In functions

Calc AddIn3.png

  • Step 5: Deploying the extenion package

Calc AddIn4.png

When you have deployed the package the usage of the Calc Add-In function(s) in your office is straight forward. Simply open a new spreadsheet document -> open the build-in function dialog -> select the “AddIn” category -> search a new Add-In function (uppercase notation) -> clicking next -> enter parameters ... -> ok


Calc AddIn5.png


Calc AddIn6.png

Generated Code

For a Calc Add-In the wizard generates more code and it would be to much to show them here. But new is that we generate a new config (.xcu) file for the Add-In describing the Add-In functions with descriptions, displaynames etc. The new configuration allows the easy support of localization of the description and displaynames. The underlying schema gets currently deployed with the extension package but with OO.org 2.0.4 the schema should be already come with the office. For the above shown example the following files are generated:

  • CalcAddIn.xcu
    the mentioned new configuration file
  • uno-extension-manifest.xml
    the package descriptor, will be packed as "META-INF/manifest.xml"
  • org/test/addin/XTestAddIn.idl
    the Add-In interface describing the new Add-In functions
  • org/test/addin/TestAddIn.idl
    the appropriate Add-In service defntion
  • org/test/addin/TestAddinImpl.java
    the generated Add-In code skeleton where only the App-In functions have to be implemented. Everything else is already implemented and even the Add-In functions are default implemented, so that the new generated project can be build and the extension can be deployed directly.
Personal tools