The mind boggles. I read:

http://api.openoffice.org/docs/DevelopersGuide/Components/Components.xhtml#1_9_1_UNO_Package_Installation_Using_unopkg , 4.9.1

and

http://api.openoffice.org/docs/DevelopersGuide/Components/Components.xhtml, 4.7.3


several times. What I don't find in there is what names those files need to have. OK, there is this:

example_addon.zip:
    Addons.xcu
    ProtocolHandler.xcu
    windows.plt/
        example_addon.dll


now what goes itno Addons.xcu and what goes into ProtocolHandler.xcu? There is a lot of xml in the paragraphs preceding this example, from which I distilled the following, since I only want to add a toolbar to my package:

<?xml version='1.0' encoding='UTF-8'?>
<oor:component-schema oor:name="Addons" oor:package="org.openoffice.Office" xml:lang="en-US" xmlns:oor=" http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance ">
    <templates>
        <group oor:name="ToolBarItem">
            <prop oor:name="URL" oor:type="xs:string"/>
            <prop oor:name="Title" oor:type="xs:string" oor:localized="true"/>
            <prop oor:name="ImageIdentifier" oor:type="xs:string"/>
            <prop oor:name="Target" oor:type="xs:string"/>
            <prop oor:name="Context" oor:type="xs:string"/>
        </group>
        <group oor:name="UserDefinedImages">
            <prop oor:name="ImageSmall" oor:type="xs:hexBinary"/>
            <prop oor:name="ImageBig" oor:type="xs:hexBinary"/>
            <prop oor:name="ImageSmallHC" oor:type="xs:hexBinary"/>
            <prop oor:name="ImageBigHC" oor:type="xs:hexBinary"/>
            <prop oor:name="ImageSmallURL" oor:type="xs:string"/>
            <prop oor:name="ImageBigURL" oor:type="xs:string"/>
            <prop oor:name="ImageSmallHCURL" oor:type="xs:string"/>
            <prop oor:name="ImageBigHCURL" oor:type="xs:string"/>
        </group>
        <group oor:name="Images">
            <prop oor:name="URL" oor:type="xs:string"/>
            <node-ref oor:name="UserDefinedImages" oor:node-type="UserDefinedImages"/>
        </group>
        <set oor:name="ToolBarItems" oor:node-type="ToolBarItem"/>
    </templates>
    <component>
        <group oor:name="AddonUI">
            <set oor:name="Images" oor:node-type="Images"/>
            <set oor:name="OfficeToolBar" oor:node-type="ToolBarItems"/>
        </group>
    </component>
</oor:component-schema>

<?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="OfficeToolBar">
            <node oor:name="org.openoffice.Office.addon.example" oor:op="replace">
                <node oor:name="m1">
                    <prop oor:name="URL" oor:type="xs:string">
                        <value>org.openoffice.Office.addon.example:Function1</value>
                    </prop>
                    <prop oor:name="Title" oor:type="xs:string">
                        <value/>
                        <value xml:lang="en-US">Function 1</value>
                        <value xml:lang="de">Funktion 1</value>
                    </prop>
                    <prop oor:name="Target" oor:type="xs:string">
                        <value>_self</value>
                    </prop>
                    <prop oor:name="Context" oor:type="xs:string">
                        <value> com.sun.star.text.TextDocument</value>
                    </prop>
                </node>
            </node>
        </node>
    </node>
</oor:component-data>

Those are the examples, minus everything related to menus and help files.

I created a toolbar in OOo and I had hoped that I would be able to just grab the code that I found in C:\Documents and Settings\MyUserName\Application Data\OpenOffice.org2\user\config\soffice.cfg\modules\swriter\toolbar\custom_toolbar_1.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
<toolbar:toolbar xmlns:toolbar=" http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:uiname="ETUC">
    <toolbar:toolbaritem xlink:href="" toolbar:text="Insert Logo" toolbar:helpid="vnd.sun.star.script:ETUC.ETUC.InsertETUCLogo?language=Basic&amp ;location=application"/>
    <toolbar:toolbaritem xlink:href="" toolbar:text="Insert Footer" toolbar:helpid=" vnd.sun.star.script:ETUC.ETUC.InsertFooterFrame?language=Basic&amp;location=application"/>
    <toolbar:toolbaritem xlink:href="" toolbar:text="Date Fr" toolbar:helpid=" vnd.sun.star.script:ETUC.ETUC.InsertEurDate?language=Basic&amp;location=application"/>
    <toolbar:toolbaritem xlink:href="" toolbar:text="Date En" toolbar:helpid=" vnd.sun.star.script:ETUC.ETUC.InsertUSDate?language=Basic&amp;location=application"/>
    <toolbar:toolbaritem xlink:href="" toolbar:text="Saut de page" toolbar:helpid=" vnd.sun.star.script:ETUC.ETUC.InsertPageBreak?language=Basic&amp;location=application"/>
    <toolbar:toolbaritem xlink:href="" toolbar:text="concern." toolbar:helpid=" vnd.sun.star.script:ETUC.ETUC.InsertConcernTable?language=Basic&amp;location=application"/>
    <toolbar:toolbaritem xlink:href="" ;location=application" toolbar:text="2 sign." toolbar:helpid="vnd.sun.star.script:ETUC.ETUC.Insert2SignaturesTable?language=Basic&amp;location=application"/>
    <toolbar:toolbaritem xlink:href="" vnd.sun.star.script:ETUC.ETUC.InsertAnnexes?language=Basic&amp;location=application" toolbar:text="annex" toolbar:helpid="vnd.sun.star.script:ETUC.ETUC.InsertAnnexes?language=Basic&amp;location=application"/>
    <toolbar:toolbaritem xlink:href="" toolbar:text="Cc:" toolbar:helpid="vnd.sun.star.script:ETUC.ETUC.InsertCc?language=Basic&amp ;location=application"/>
</toolbar:toolbar>

and here: C:\Documents and Settings\MyUserName\Application Data\OpenOffice.org2\user\config\soffice.cfg\modules\swriter\images\sc_imagelist.xml

<?xml version=" 1.0" encoding="UTF-8"?>
<!DOCTYPE image:imagecontainer PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "image.dtd">
<image:imagescontainer xmlns:image=" http://openoffice.org/2001/image" xmlns:xlink="http://www.w3.org/1999/xlink">
    <image:images xlink:type="simple" xlink:href="" image:maskcolor="#0" image:maskmode="maskcolor">
        <image:entry image:bitmap-index="0" image:command="vnd.sun.star.script:ETUC.ETUC.InsertPageBreak?language=Basic&amp;location=application"/>
        <image:entry image:bitmap-index="1" image:command=" vnd.sun.star.script:ETUC.ETUC.InsertFooterFrame?language=Basic&amp;location=application"/>
        <image:entry image:bitmap-index="2" image:command="vnd.sun.star.script:ETUC.ETUC.InsertEurDate?language=Basic&amp ;location=application"/>
        <image:entry image:bitmap-index="3" image:command="vnd.sun.star.script:ETUC.ETUC.InsertUSDate?language=Basic&amp;location=application"/>
        <image:entry image:bitmap-index="4" image:command=" vnd.sun.star.script:ETUC.ETUC.Insert2SignaturesTable?language=Basic&amp;location=application"/>
        <image:entry image:bitmap-index="5" image:command="vnd.sun.star.script:ETUC.ETUC.InsertETUCLogo?language=Basic&amp ;location=application"/>
    </image:images>
</image:imagescontainer>

I even found this:

C:\Documents and Settings\MyUserName\Application Data\OpenOffice.org2\user\config\soffice.cfg\modules\swriter\images\Bitmaps\sc_userimages.png

containing all the icons I used for the toolbar. How do I convert that to a value that can be used as follows:

<node oor:name="UserDefinedImages">
                    <prop oor:name="ImageSmall">
<value>424df80000000000000076000000280000001000000010000000010004000000000000000000120b0000120b000000000000000000000000ff0000ffff0000ff0000ffff0000ff000000ff00ff00ffffff00c0c0c0008080800000000000000080000080800000800000808000008000000080008000cccccccccccccccc2c266b181b666c2c5cc66b818b6665c555566b181b66655555566b818b66655555566b181b6665555a8666bbb6668a55a0a866666668a0a5000a8666668a000a6000a86668a000a556000a868a000a55556000a8a000a5555556000a000a55555555600000a55555555556000a55555555555560a55555550000</value>
                    </prop>
                    <prop oor:name="ImageSmallHCURL">
                        <value>%origin%/function1.bmp</value>
                    </prop>
                </node>


I'm starting to doubt that I'm smart enough for this stuff. It's great that there is documentation, but I would be nice to find out what needs to be saved in which files and it would be great to have an easy way to get from what OOo generates to work with to what is expected for this uno.pkg structure.

Kind regards,

Jo

Reply via email to