[Solved] Writing an add-on

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
saleem145
Posts: 130
Joined: Mon Jul 02, 2012 4:47 pm

[Solved] Writing an add-on

Post by saleem145 »

Hello,

Is there an example of developing an addon (as opposed to addin). We have developed a charting application within a spreadsheet using python. And now would like to embed the core functionality within an addon.

Also can an addon and and addin be integrated within one OXT file.

Saleem
Last edited by RoryOF on Wed Aug 01, 2012 7:41 am, edited 2 times in total.
Reason: Added green tick (RoryOF, moderator)
OpenOffice 3.4.0
Mac OS X 10.5.8
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: Writing an add-on

Post by hanya »

See the following thread and links in the page: http://user.services.openoffice.org/en/ ... 47&t=55208
and see also: http://wiki.services.openoffice.org/wiki/Extensions
Also can an addon and and addin be integrated within one OXT file.
Multiple UNO service implementations can be put in an oxt package.
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
rjsteele
Posts: 23
Joined: Fri Jul 27, 2012 9:20 pm

Re: Writing an add-on

Post by rjsteele »

Raymond
Solaris 10 x86 StarrOffice 9 - basis3.1
saleem145
Posts: 130
Joined: Mon Jul 02, 2012 4:47 pm

Re: Writing an add-on

Post by saleem145 »

http://www.linuxjournal.com/content/pyt ... openoffice

Exactly what I am looking for but does not work....something wrong with the xcu file....any ideas?? "Bad Root Element node"

Saleem

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<oor:node xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Addons" oor:package="org.openoffice.Offic
e">
  <node oor:name="AddonUI">
    <node oor:name="AddonMenu">
      <node oor:name="org.openoffice.comp.pyuno.demo.HelloWorld" oor:op="replace">
        <prop oor:name="URL" oor:type="xs:string">
          <value>service:org.openoffice.comp.pyuno.demo.HelloWorld?insert</value>
        </prop>
        <prop oor:name="ImageIdentifier" oor:type="xs:string">
          <value>private:image/3216</value>
        </prop>
        <prop oor:name="Title" oor:type="xs:string">
          <value xml:lang="en-US">Insert Hello World</value>
        </prop>
      </node>
    </node>
  </node>
</oor:node>
OpenOffice 3.4.0
Mac OS X 10.5.8
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: Writing an add-on

Post by hanya »

The root node must be oor:component-data element for configuration data.
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
saleem145
Posts: 130
Joined: Mon Jul 02, 2012 4:47 pm

Re: Writing an add-on

Post by saleem145 »

I changed my Add-on xcu.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry"
             xmlns:xs="http://www.w3.org/2001/XMLSchema"
             oor:name="Addons" oor:package="org.openoffice.Office">
  <node oor:name="AddonUI">
    <node oor:name="AddonMenu">
      <node oor:name="org.openoffice.comp.pyuno.demo.HelloWorld" oor:op="replace">
        <prop oor:name="URL" oor:type="xs:string">
          <value>service:org.openoffice.comp.pyuno.demo.HelloWorld?insert</value>
        </prop>
        <prop oor:name="ImageIdentifier" oor:type="xs:string">
          <value>private:image/3216</value>
        </prop>
        <prop oor:name="Title" oor:type="xs:string">
          <value xml:lang="en-US">Insert Hello World</value>
        </prop>
      </node>
    </node>
  </node>
</oor:component-data>
The add-on loads correctly and shows up in extension manager. But under Tools menu, there is no subentry for Add-on and no Insert Hello World menu item. So I think there is something else wrong with the xcu as well.

Thanks,

Saleem
OpenOffice 3.4.0
Mac OS X 10.5.8
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: Writing an add-on

Post by hanya »

It works for me installed as configuration data. Add the entry for the configuration file to your META-INF/manifest.xml file.
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
saleem145
Posts: 130
Joined: Mon Jul 02, 2012 4:47 pm

Re: Writing an add-on

Post by saleem145 »

Hi Hanya,

Thanks for your response. I do not have a manifest file.

Please can you post your Addon.xcu and manifest.xml??

Thanks,

Saleem
OpenOffice 3.4.0
Mac OS X 10.5.8
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: Writing an add-on

Post by hanya »

Your Addon.xcu file looks working, here is manifest.xml content:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest">
  <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
                       manifest:full-path="Addons.xcu"/>
</manifest:manifest>
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
saleem145
Posts: 130
Joined: Mon Jul 02, 2012 4:47 pm

Re: Writing an add-on

Post by saleem145 »

Yes I tried this...no luck though..the menu item is no where to be found??
OpenOffice 3.4.0
Mac OS X 10.5.8
saleem145
Posts: 130
Joined: Mon Jul 02, 2012 4:47 pm

Re: Writing an add-on

Post by saleem145 »

This issue is resolved too...I was making a zip file....need to make an oxt. Thanks.
OpenOffice 3.4.0
Mac OS X 10.5.8
dysmas
Posts: 1
Joined: Tue Feb 19, 2013 8:39 pm

Re: [Solved] Writing an add-on

Post by dysmas »

Thanks a lot for the answer @hanya, it works.
OpenOffice 3.4 on Windows XP SP4
Post Reply