Extend OpenOffice.org

It's easier than you might think to create your own OpenOffice.org extensions.
Tweaking Extensions

The Addon Creator conveniently hides the technical part of the process, which is good if you don't want to spend time doing the donkey work manually. This is, however, less useful if you want to gain a better understanding of what makes extensions tick—not only to satisfy your curiosity, but also to be able to troubleshoot your extensions and tweak them without running the Addon Creator every single time.

If you look inside the zip package, you will notice that it contains the familiar META-INF folder, a folder with the macro files and the addon.xcu file (Listing 2). The latter is the key element of the extension, as it contains all the configuration data. The addon.xcu is based on XML, and even if you have only a basic knowledge of XML, you easily can figure out how it works simply by looking at its contents.

The XML file contains a number of nodes, and each node has properties, which, in turn, have values. For example, the top node <node oor:name="AddonMenu"> has multiple properties, such as <prop oor:name="Title" oor:type="xs:string">, that have a value containing the extension's menu title <value>Lorem ipsum</value>. The <prop oor:name="URL" oor:type="xs:string"> property has the <value>macro:///LoremipsumLib.LoremipsumModule.LoremipsumMacro</value> value, which contains the link to the appropriate macro. Knowing that, you can modify the extension by tweaking its addon.xcu file. For example, if you want to change the menu title, you simply can edit the <value>Lorem ipsum</value> value as follows:


<prop oor:name="Title" oor:type="xs:string">
  <value>Insert dummy text</value>
</prop>

In more complex macros, you even can add new menus and commands simply by cloning and modifying parts of the configuration file.

Final Word

Now that you know the basics, you can start building your own OpenOffice.org extensions. If you want to share your creations with other users, you can add them to the official extension repository (wiki.services.openoffice.org/wiki/Extensions_repository). Most of the extensions there are released under the GPL, so you can dismantle them to see how they work and get new ideas.

Dmitri Popov is a freelance writer whose articles have appeared in Russian, British and Danish computer magazines. His articles cover open-source software, Linux, Web applications and other computer-related topics.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

openoffice

tom pitts's picture

with some organizations resisting the MS Office 2007 file formats, maybe the openoffice file formats gain have some traction.

a lot of people complain they couldn't get by with just openoffice, but i used it throughout college and still do at home.

Its the extensions that will make it great

Charley Uchea's picture

Being able to extend the functionality of an office suit will, in its maturity, allow openoffice to become the ms office killer it should be

Hallo

Anonymous's picture

Hallo

Open Office

Klettergriffe's picture

Thnaks for these very interesting posting. I will try it out now.

Open Office

AdiX's picture

It thanks for article. Open Office is essential in work me!

Something wrong with the date?

Michael's picture

Either you live in the future or something is wrong with the post date. It is the same with the next post. The following posts are okay.