Page 1 of 1
[Solved] Writing an add-on
Posted: Mon Jul 30, 2012 2:34 am
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
Re: Writing an add-on
Posted: Mon Jul 30, 2012 6:00 pm
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.
Re: Writing an add-on
Posted: Mon Jul 30, 2012 9:30 pm
by rjsteele
Re: Writing an add-on
Posted: Tue Jul 31, 2012 12:18 am
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>
Re: Writing an add-on
Posted: Tue Jul 31, 2012 3:07 am
by hanya
The root node must be oor:component-data element for configuration data.
Re: Writing an add-on
Posted: Tue Jul 31, 2012 3:44 am
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
Re: Writing an add-on
Posted: Tue Jul 31, 2012 4:37 am
by hanya
It works for me installed as configuration data. Add the entry for the configuration file to your META-INF/manifest.xml file.
Re: Writing an add-on
Posted: Tue Jul 31, 2012 6:21 am
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
Re: Writing an add-on
Posted: Tue Jul 31, 2012 7:47 am
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>
Re: Writing an add-on
Posted: Tue Jul 31, 2012 10:31 pm
by saleem145
Yes I tried this...no luck though..the menu item is no where to be found??
Re: Writing an add-on
Posted: Wed Aug 01, 2012 2:35 am
by saleem145
This issue is resolved too...I was making a zip file....need to make an oxt. Thanks.
Re: [Solved] Writing an add-on
Posted: Tue Feb 19, 2013 8:41 pm
by dysmas
Thanks a lot for the answer @hanya, it works.