Extensions Packagers

From Apache OpenOffice Wiki
Revision as of 20:07, 26 August 2013 by Joesch (Talk | contribs)

Jump to: navigation, search


BasicAddonBuilder

BasicAddonBuilder is an OpenOffice.org extension that allow you to export a StarBasic library in the OpenOffice.org extension format, ready for deployment. BasicAddonBuilder does not require special skills or a deep knowledge of extensions specifications. A wizard-style dialog will guide you through the process, allowing you to define in a graphical way all menu and toolbars that will be added to the OpenOffice.org user interface in order to launch macros from your StarBasic library.

BasicAddonBuilder

The exported extension (AKA UNO package) will be ready to install in any PC running OpenOffice.org 2.0 or above, using the Package manager. (Menu Tools->Package manager...)

Requirements

In order to use BasicAddonBuilder, you must have OpenOffice.org 2.2 or above installed. BasicAddonBuilder will not work with OpenOffice.org 1.x

Install

BasicAddonBuilder is downloadable at this location and can be installed with the Extension manager.

  • Menu Tools->Extension manager...

Further information in the OpenOffice.org Help

Known issues

  • Missing documentation

The following features are not yet supported:

  • Dependances management of the generated extension
  • Import/export of BasicAddonBuilder projects

Homepage

Current versions of BasicAddonBuilder for OpenOffice.org are always available here:

Contacting author

Please send your suggestions and bug reports to: Paolo Mantovani Any feedback is welcome!

BasicAddonBuilder and AOO 4.x

From AOO 4.0 has the configuration file addons.xcu a modified structure for toolbars, see: http://wiki.openoffice.org/wiki/Extensions/Extensions_and_Apache_OpenOffice_4.0#addons.xcu_changes

Therefore an update for BasicAddonBuilder is necessary because:

  • own toolbar of the BasicAddonBuilder 0.5.0 (and earlier releases) is not displayed in AOO 4.0 (and later versions)
  • BasicAddonBuilder 0.5.0 (and earlier releases) can not create extensions, which include toolbars that can be displayed in AOO 4.0 (and later versions)

I wrote Paolo Mantovani, and Paolo Mantovani replied me that he currently does not have time to create a new version of BasicAddonBuilder. Therefore, I have now created a new Version (0.5.1).

joesch


BasicAddonBuilder 0.5.1 (Beta)

At the moment there are (initially for testing purposes) two different versions of BasicAddonBuilder 0.5.1

http://calc-info.de/files/BasicAddonBuilder-0.5.1.oxt (compatible with AOO 4.x)
http://calc-info.de/files/BasicAddonBuilder-oo3x-0.5.1.oxt (compatible up to AOO 3.4.1 and LibreOffice(*))

Both versions can produce compatible extensions for all versions of OOo, AOO and LO(*).

(*) not tested
The following figures show the additional functions of BasicAddonBuilder 0.5.1

  • adjustable compatibility for toolbars in the created extension
  • embed the publisher in the created extension (in the file description.xml)


General Options

Extension Compiler

There are many kinds of extensions : they may use languages other than Basic, or even set a configuration without any executable code. Usually an extension provides menus and toolbars for one or more applications (Writer, Calc...).

For a professional look you will have to add copyright statements, create your own help pages, provide automatic update. All displayable texts will probably have to be translated in several languages. This means editing lots of files, testing and editing each time you have found a bug, or added a feature, or added a new language.

The Extension Compiler can handle all kinds of extensions and reduce your work load. Its documentation guides you through most of the process. You don't need to know all the implementation details, you don't need a complex environment. You will edit a Writer document to write the tooltip text, license text, help pages for your extension.

You will then write a linear succession of simple Basic instructions to describe your extension. Run this Basic program: the Extension Compiler will create the files description.xml, addon.xml, manifest.xml, xxxWindowState.xml, and the license, tooltip, display name, help pages for different languages. All files will be encoded in UTF-8 to support national characters, stored in sub-folders. After a few seconds your oxt package is ready to be installed!

If you made an error, or if you are not satisfied with your extension, change some instructions and run again. For complex extensions, incremental design is easy: start simple, test, add a feature, test it, add another feature, etc.

The help pages for your extension may be specific to each application (Calc, Writer, Draw...). They are called by a help button in your dialogs, or by contextual help in the dialogs or menus, or from the help window. These help pages will be seamlessly integrated into OpenOffice.org help system. If you have created your help in several languages OpenOffice.org will choose the language which fits the best with the User Interface language.

Requirements

You must have OpenOffice.org 2.2 or above installed.

The menu merging and toolbar merging features require OpenOffice.org 2.3 or above.

The extensible help requires OpenOffice.org 2.4 and above.

Install

Extension Compiler is a Writer template document : opening it creates a new Writer document that you will have to personalize.

Save it under the name of your extension in a dedicated folder where macro execution is allowed. You will store in this dedicated folder all the libraries, files, images, needed for your extension. You may use sub-folders.

Write in this document the text of the tooltip, license and help pages of your extension, in as many languages as you like (or can).

Open the Basic IDE to the Standard library of this document. Open the module Module1 in this library. It contains a prepared macro : myExtension. Add your instructions where indicated. The instruction set is described in chapter 3 of the document, read it carefully. You will find typical examples in the modules named Template1 etc.

Run the macro. If you get an error message, correct your script and run again. Otherwise, your extension file is ready.

Latest changes

Version 1.5

  • At first loading, a message prompts to save the new document under the name of your extension.
  • The version number of the extension is automatically added to the oxt file name, e.g. myExtension-1.3.2. You can leave previous versions of your extension in the extension folder.
  • The Extension Compiler can create the update.xml file required for an on-line update.

Version 1.5.1

  • Issue 104513 reports a bug with Writer notes containing an hyperlink. Correction 1.5.1 adds a work-around of this bug in the treatment of hyperlinks in Help pages.

Version 1.5.2

  • This version resolves the blocking of the compilation caused by read-only files in the extension directory.

Version 1.5.3

Creation of help pages containing an hyperlink to an Apache OpenOffice help page is simplified.

Related Issues

As of OpenOffice.org version 3.1.0 there are currently some limitations or bugs in the extension mechanism itself, see these Issues.

Download

The latest version of Extension Compiler is downloadable at this location.

A french translation of the manual is downloadable at this location.

To help understand how it works, here are two examples of extension projects :

A simple extension

The archive SimpleDemo.zip contains the files necessary to compile the extension Images Embedder version 1.0.0. This extension installs a Basic program, without dialogs, and a menu item in Tools > Add-Ons. This menu item displays in several languages.

The archive unzips into a directory named ImagesEmbedder/.

Open the document ImagesEmbedder.odt, then at chapter 2 click the button Run macro : myExtension. The oxt file will be created in the same folder.

A sophisticated extension

The file ExtensionDemo.zip shows more interesting features. It requires at least OpenOffice.org version 3.1.0.

This archive unzips into a directory named Demo/. It contains all the data to create the extension ExtExample. The compiled extension package is also in the folder.

ExtExample adds a toolbar and some commands in the menu Tools > Add-Ons of Writer and Calc. In Writer, Tools > Add-Ons sub-menu can start sample scripts in Basic, Python BeanShell, JavaScript, Java macro.

Documentation caution.png Java-like scripts won't be recognized at first (Issue 99858 ).

Work-around : after installing the extension, click button Disable. When finished, click button Enable.

Contacting author

Extension Compiler is written by Bernard Marcelly. Please send your suggestions and bug reports at the address indicated in the document. Feedbacks are welcome.

Personal tools