<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sg</id>
	<title>Apache OpenOffice Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sg"/>
	<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/wiki/Special:Contributions/Sg"/>
	<updated>2026-11-28T12:01:48Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=OpenOffice_Add-On_Project_Type&amp;diff=95996</id>
		<title>OpenOffice Add-On Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=OpenOffice_Add-On_Project_Type&amp;diff=95996"/>
		<updated>2008-10-15T16:12:03Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Generated Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The Add-On wizard will enable users to create an OpenOffice.org component that including support of UI extensions. The component is based on a on a J2SE class library project and supports additional targets to create and deploy the package into the office installation.&lt;br /&gt;
All interface methods are default implemented and do nothing. In a second step you can insert your implementation in the generated skeleton, rebuild the extension and deploy it again to see the effect in your office.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard  is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Add-On&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn1.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, Add-On name, an optional package and the project location&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn2.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The necessary xcu files are generated and become part of the final &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; package. These xcu files can be easily adapted later to extend the initial project to a more complex Add-On example. The generated Add-On skeleton implements a simple [http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Protocol_Handler com.sun.star.frame.ProtocolHandler] Add-On.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 3&amp;#039;&amp;#039;&amp;#039;: Defining the new commands, including icons.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn3-1.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Defining the top level menu&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn3.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;On this panel you can define the top level menus with sub-menus on a higher abstraction level. You will not have to deal with xcu files directly. You can modify the default menu, add new menus and commands, and you can define the context in which the command should appear. When you have deployed the package, the newly defined menus are visible in the specified context. For example, if you choose the context &amp;#039;&amp;#039;&amp;#039;Writer&amp;#039;&amp;#039;&amp;#039;, the menu is visible when you open or create a text document. Not selecting a context means all contexts, even the back-end window. For more detailed descriptions of the different fields simply press the help button or read the appropriate chapter in the [http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Protocol_Handler Protocol Handler]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn4.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 5&amp;#039;&amp;#039;&amp;#039;: Definig the toolbar is similar to the menu. There is no top level toolbar, of course.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn5.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 6&amp;#039;&amp;#039;&amp;#039;: Deploying the extension package&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Calc_AddIn4.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Deploy and Run Extension in OpenOffice.org&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The AddOn deployed in OpenOffice.org is visible in the back-end window.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn6.png|center]]&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
Two (.xcu) files for the Add-On are created that describe the Add-On commands with descriptions, displaynames etc., (Addons.xcu) and the protocol that is used to access these commands (ProtocolHandler.xcu). For the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Addons.xcu&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;xcu file defining the new menus with submenus and commands. This file can be easily extended to support toolbars as well (toolbar support will be added later to the wizard).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;#039;1.0&amp;#039; encoding=&amp;#039;UTF-8&amp;#039;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;oor:component-data xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; oor:name=&amp;quot;Addons&amp;quot; oor:package=&amp;quot;org.openoffice.Office&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;AddonUI&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;OfficeMenuBar&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;org.openoffice.testaddon.testaddon&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Title&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
          &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;My Menu&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Target&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;_self&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;ImageIdentifier&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;Submenu&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;m1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;URL&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value&amp;gt;org.openoffice.testaddon.testaddon:HelloWorld&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;ImageIdentifier&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value/&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;Target&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value&amp;gt;_self&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;Context&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value/&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;Title&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value/&amp;gt;&lt;br /&gt;
              &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;Hello World&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;/node&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;OfficeToolBar&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;org.openoffice.testaddon.testaddon&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;m1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;URL&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;org.openoffice.testaddon.testaddon:HelloWorld&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;ImageIdentifier&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Target&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;_self&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Context&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Title&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
          &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;Hello World&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;Images&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;org.openoffice.testaddon.testaddon.helloworld.images&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;URL&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;org.openoffice.testaddon.testaddon:HelloWorld&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;UserDefinedImages&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;ImageSmallURL&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value&amp;gt;%origin%/idlfile.png&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;ImageBigURL&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value&amp;gt;%origin%/idlfile.png&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;ImageSmallHCURL&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value&amp;gt;%origin%/idlfile.png&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;ImageBigHCURL&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value&amp;gt;%origin%/idlfile.png&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/oor:component-data&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestAddOn.jar&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.configuration-data&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;registry/data/org/openoffice/Office/Addons.xcu&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.configuration-data&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;registry/data/org/openoffice/Office/ProtocolHandler.xcu&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/testaddon/TestAddOn.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated Add-On code skeleton where the generated class acts itself as the dispatch object (can be easily changed to support more complex Add-Ons). Most of the methods are already implemented and you simply have to add your own code in the dispatch method in the right place for each specified command.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;Java&amp;quot;&amp;gt;&lt;br /&gt;
package org.openoffice.testaddon;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestAddOn extends WeakBase&lt;br /&gt;
   implements com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              com.sun.star.frame.XDispatchProvider,&lt;br /&gt;
              com.sun.star.lang.XInitialization,&lt;br /&gt;
              com.sun.star.frame.XDispatch&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private com.sun.star.frame.XFrame m_xFrame;&lt;br /&gt;
    private static final String m_implementationName = TestAddOn.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;com.sun.star.frame.ProtocolHandler&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    public TestAddOn( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory( String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestAddOn.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo( XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.frame.XDispatchProvider:&lt;br /&gt;
    public com.sun.star.frame.XDispatch queryDispatch( com.sun.star.util.URL aURL,&lt;br /&gt;
                                                       String sTargetFrameName,&lt;br /&gt;
                                                       int iSearchFlags )&lt;br /&gt;
    {&lt;br /&gt;
        if ( aURL.Protocol.compareTo(&amp;quot;org.openoffice.testaddon.testaddon:&amp;quot;) == 0 )&lt;br /&gt;
        {&lt;br /&gt;
            if ( aURL.Path.compareTo(&amp;quot;mycommands&amp;quot;) == 0 )&lt;br /&gt;
                return this;&lt;br /&gt;
        }&lt;br /&gt;
        return null;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.frame.XDispatchProvider:&lt;br /&gt;
    public com.sun.star.frame.XDispatch[] queryDispatches(&lt;br /&gt;
         com.sun.star.frame.DispatchDescriptor[] seqDescriptors )&lt;br /&gt;
    {&lt;br /&gt;
        int nCount = seqDescriptors.length;&lt;br /&gt;
        com.sun.star.frame.XDispatch[] seqDispatcher =&lt;br /&gt;
            new com.sun.star.frame.XDispatch[seqDescriptors.length];&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; nCount; ++i )&lt;br /&gt;
        {&lt;br /&gt;
            seqDispatcher[i] = queryDispatch(seqDescriptors[i].FeatureURL,&lt;br /&gt;
                                             seqDescriptors[i].FrameName,&lt;br /&gt;
                                             seqDescriptors[i].SearchFlags );&lt;br /&gt;
        }&lt;br /&gt;
        return seqDispatcher;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XInitialization:&lt;br /&gt;
    public void initialize( Object[] object )&lt;br /&gt;
        throws com.sun.star.uno.Exception&lt;br /&gt;
    {&lt;br /&gt;
        if ( object.length &amp;gt; 0 )&lt;br /&gt;
        {&lt;br /&gt;
            m_xFrame = (com.sun.star.frame.XFrame)UnoRuntime.queryInterface(&lt;br /&gt;
                com.sun.star.frame.XFrame.class, object[0]);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.frame.XDispatch:&lt;br /&gt;
     public void dispatch( com.sun.star.util.URL aURL,&lt;br /&gt;
                           com.sun.star.beans.PropertyValue[] aArguments )&lt;br /&gt;
    {&lt;br /&gt;
         if ( aURL.Protocol.compareTo(&amp;quot;org.openoffice.testaddon.testaddon:&amp;quot;) == 0 )&lt;br /&gt;
        {&lt;br /&gt;
            if ( aURL.Path.compareTo(&amp;quot;mycommands&amp;quot;) == 0 )&lt;br /&gt;
            {&lt;br /&gt;
                // add your own code here&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void addStatusListener( com.sun.star.frame.XStatusListener xControl,&lt;br /&gt;
                                    com.sun.star.util.URL aURL )&lt;br /&gt;
    {&lt;br /&gt;
        // add your own code here&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void removeStatusListener( com.sun.star.frame.XStatusListener xControl,&lt;br /&gt;
                                       com.sun.star.util.URL aURL )&lt;br /&gt;
    {&lt;br /&gt;
        // add your own code here&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Add-On]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=OpenOffice_Add-On_Project_Type&amp;diff=95995</id>
		<title>OpenOffice Add-On Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=OpenOffice_Add-On_Project_Type&amp;diff=95995"/>
		<updated>2008-10-15T16:11:14Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Generated Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The Add-On wizard will enable users to create an OpenOffice.org component that including support of UI extensions. The component is based on a on a J2SE class library project and supports additional targets to create and deploy the package into the office installation.&lt;br /&gt;
All interface methods are default implemented and do nothing. In a second step you can insert your implementation in the generated skeleton, rebuild the extension and deploy it again to see the effect in your office.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard  is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Add-On&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn1.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, Add-On name, an optional package and the project location&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn2.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The necessary xcu files are generated and become part of the final &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; package. These xcu files can be easily adapted later to extend the initial project to a more complex Add-On example. The generated Add-On skeleton implements a simple [http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Protocol_Handler com.sun.star.frame.ProtocolHandler] Add-On.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 3&amp;#039;&amp;#039;&amp;#039;: Defining the new commands, including icons.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn3-1.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Defining the top level menu&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn3.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;On this panel you can define the top level menus with sub-menus on a higher abstraction level. You will not have to deal with xcu files directly. You can modify the default menu, add new menus and commands, and you can define the context in which the command should appear. When you have deployed the package, the newly defined menus are visible in the specified context. For example, if you choose the context &amp;#039;&amp;#039;&amp;#039;Writer&amp;#039;&amp;#039;&amp;#039;, the menu is visible when you open or create a text document. Not selecting a context means all contexts, even the back-end window. For more detailed descriptions of the different fields simply press the help button or read the appropriate chapter in the [http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Protocol_Handler Protocol Handler]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn4.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 5&amp;#039;&amp;#039;&amp;#039;: Definig the toolbar is similar to the menu. There is no top level toolbar, of course.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn5.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 6&amp;#039;&amp;#039;&amp;#039;: Deploying the extension package&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Calc_AddIn4.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Deploy and Run Extension in OpenOffice.org&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The AddOn deployed in OpenOffice.org is visible in the back-end window.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn6.png|center]]&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
Two (.xcu) files for the Add-On are created that describe the Add-On commands with descriptions, displaynames etc., (Addons.xcu) and the protocol that is used to access these commands (ProtocolHandler.xcu). For the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Addons.xcu&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;xcu file defining the new menus with submenus and commands. This file can be easily extended to support toolbars as well (toolbar support will be added later to the wizard).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;#039;1.0&amp;#039; encoding=&amp;#039;UTF-8&amp;#039;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;oor:component-data xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; oor:name=&amp;quot;Addons&amp;quot; oor:package=&amp;quot;org.openoffice.Office&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;AddonUI&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;OfficeMenuBar&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;org.openoffice.testaddon.testaddon&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Title&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
          &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;My Menu&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Target&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;_self&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;ImageIdentifier&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;Submenu&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;m1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;URL&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value&amp;gt;org.openoffice.testaddon.testaddon:HelloWorld&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;ImageIdentifier&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value/&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;Target&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value&amp;gt;_self&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;Context&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value/&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;Title&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value/&amp;gt;&lt;br /&gt;
              &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;Hello World&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;/node&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;OfficeToolBar&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;org.openoffice.testaddon.testaddon&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;m1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;URL&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;org.openoffice.testaddon.testaddon:HelloWorld&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;ImageIdentifier&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Target&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;_self&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Context&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Title&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
          &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;Hello World&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;Images&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;org.openoffice.testaddon.testaddon.helloworld.images&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;URL&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;org.openoffice.testaddon.testaddon:HelloWorld&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;UserDefinedImages&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;ImageSmallURL&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value&amp;gt;%origin%/idlfile.png&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;ImageBigURL&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value&amp;gt;%origin%/idlfile.png&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;ImageSmallHCURL&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value&amp;gt;%origin%/idlfile.png&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;ImageBigHCURL&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value&amp;gt;%origin%/idlfile.png&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/oor:component-data&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestAddOn.jar&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.configuration-data&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;registry/data/org/openoffice/Office/Addons.xcu&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.configuration-data&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;registry/data/org/openoffice/Office/ProtocolHandler.xcu&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/testaddon/TestAddOn.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated Add-On code skeleton where the generated class acts itself as the dispatch object (can be easily changed to support more complex Add-Ons). Most of the methods are already implemented and you simply have to add your own code in the dispatch method in the right place for each specified command.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;Java&amp;quot;&amp;gt;&lt;br /&gt;
package org.openoffice.testaddon;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestAddOn extends WeakBase&lt;br /&gt;
   implements com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              com.sun.star.frame.XDispatchProvider,&lt;br /&gt;
              com.sun.star.lang.XInitialization,&lt;br /&gt;
              com.sun.star.frame.XDispatch&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private com.sun.star.frame.XFrame m_xFrame;&lt;br /&gt;
    private static final String m_implementationName = TestAddOn.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;com.sun.star.frame.ProtocolHandler&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    public TestAddOn( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory( String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestAddOn.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo( XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.frame.XDispatchProvider:&lt;br /&gt;
    public com.sun.star.frame.XDispatch queryDispatch( com.sun.star.util.URL aURL,&lt;br /&gt;
                                                       String sTargetFrameName,&lt;br /&gt;
                                                       int iSearchFlags )&lt;br /&gt;
    {&lt;br /&gt;
        if ( aURL.Protocol.compareTo(&amp;quot;org.openoffice.testaddon.testaddon:&amp;quot;) == 0 )&lt;br /&gt;
        {&lt;br /&gt;
            if ( aURL.Path.compareTo(&amp;quot;mycommands&amp;quot;) == 0 )&lt;br /&gt;
                return this;&lt;br /&gt;
        }&lt;br /&gt;
        return null;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.frame.XDispatchProvider:&lt;br /&gt;
    public com.sun.star.frame.XDispatch[] queryDispatches(&lt;br /&gt;
         com.sun.star.frame.DispatchDescriptor[] seqDescriptors )&lt;br /&gt;
    {&lt;br /&gt;
        int nCount = seqDescriptors.length;&lt;br /&gt;
        com.sun.star.frame.XDispatch[] seqDispatcher =&lt;br /&gt;
            new com.sun.star.frame.XDispatch[seqDescriptors.length];&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; nCount; ++i )&lt;br /&gt;
        {&lt;br /&gt;
            seqDispatcher[i] = queryDispatch(seqDescriptors[i].FeatureURL,&lt;br /&gt;
                                             seqDescriptors[i].FrameName,&lt;br /&gt;
                                             seqDescriptors[i].SearchFlags );&lt;br /&gt;
        }&lt;br /&gt;
        return seqDispatcher;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XInitialization:&lt;br /&gt;
    public void initialize( Object[] object )&lt;br /&gt;
        throws com.sun.star.uno.Exception&lt;br /&gt;
    {&lt;br /&gt;
        if ( object.length &amp;gt; 0 )&lt;br /&gt;
        {&lt;br /&gt;
            m_xFrame = (com.sun.star.frame.XFrame)UnoRuntime.queryInterface(&lt;br /&gt;
                com.sun.star.frame.XFrame.class, object[0]);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.frame.XDispatch:&lt;br /&gt;
     public void dispatch( com.sun.star.util.URL aURL,&lt;br /&gt;
                           com.sun.star.beans.PropertyValue[] aArguments )&lt;br /&gt;
    {&lt;br /&gt;
         if ( aURL.Protocol.compareTo(&amp;quot;org.openoffice.testaddon.testaddon:&amp;quot;) == 0 )&lt;br /&gt;
        {&lt;br /&gt;
            if ( aURL.Path.compareTo(&amp;quot;mycommands&amp;quot;) == 0 )&lt;br /&gt;
            {&lt;br /&gt;
                // add your own code here&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void addStatusListener( com.sun.star.frame.XStatusListener xControl,&lt;br /&gt;
                                    com.sun.star.util.URL aURL )&lt;br /&gt;
    {&lt;br /&gt;
        // add your own code here&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void removeStatusListener( com.sun.star.frame.XStatusListener xControl,&lt;br /&gt;
                                       com.sun.star.util.URL aURL )&lt;br /&gt;
    {&lt;br /&gt;
        // add your own code here&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Add-On]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=OpenOffice_Add-On_Project_Type&amp;diff=95994</id>
		<title>OpenOffice Add-On Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=OpenOffice_Add-On_Project_Type&amp;diff=95994"/>
		<updated>2008-10-15T16:10:25Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Generated Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The Add-On wizard will enable users to create an OpenOffice.org component that including support of UI extensions. The component is based on a on a J2SE class library project and supports additional targets to create and deploy the package into the office installation.&lt;br /&gt;
All interface methods are default implemented and do nothing. In a second step you can insert your implementation in the generated skeleton, rebuild the extension and deploy it again to see the effect in your office.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard  is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Add-On&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn1.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, Add-On name, an optional package and the project location&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn2.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The necessary xcu files are generated and become part of the final &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; package. These xcu files can be easily adapted later to extend the initial project to a more complex Add-On example. The generated Add-On skeleton implements a simple [http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Protocol_Handler com.sun.star.frame.ProtocolHandler] Add-On.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 3&amp;#039;&amp;#039;&amp;#039;: Defining the new commands, including icons.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn3-1.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Defining the top level menu&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn3.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;On this panel you can define the top level menus with sub-menus on a higher abstraction level. You will not have to deal with xcu files directly. You can modify the default menu, add new menus and commands, and you can define the context in which the command should appear. When you have deployed the package, the newly defined menus are visible in the specified context. For example, if you choose the context &amp;#039;&amp;#039;&amp;#039;Writer&amp;#039;&amp;#039;&amp;#039;, the menu is visible when you open or create a text document. Not selecting a context means all contexts, even the back-end window. For more detailed descriptions of the different fields simply press the help button or read the appropriate chapter in the [http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Protocol_Handler Protocol Handler]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn4.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 5&amp;#039;&amp;#039;&amp;#039;: Definig the toolbar is similar to the menu. There is no top level toolbar, of course.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn5.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 6&amp;#039;&amp;#039;&amp;#039;: Deploying the extension package&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Calc_AddIn4.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Deploy and Run Extension in OpenOffice.org&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The AddOn deployed in OpenOffice.org is visible in the back-end window.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn6.png|center]]&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
Two (.xcu) files for the Add-On are created that describe the Add-On commands with descriptions, displaynames etc., (Addons.xcu) and the protocol that is used to access these commands (ProtocolHandler.xcu). For the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Addons.xcu&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;xcu file defining the new menus with submenus and commands. This file can be easily extended to support toolbars as well (toolbar support will be added later to the wizard).&lt;br /&gt;
&amp;lt;code lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;#039;1.0&amp;#039; encoding=&amp;#039;UTF-8&amp;#039;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;oor:component-data xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; oor:name=&amp;quot;Addons&amp;quot; oor:package=&amp;quot;org.openoffice.Office&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;AddonUI&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;OfficeMenuBar&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;org.openoffice.testaddon.testaddon&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Title&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
          &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;My Menu&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Target&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;_self&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;ImageIdentifier&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;Submenu&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;m1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;URL&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value&amp;gt;org.openoffice.testaddon.testaddon:HelloWorld&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;ImageIdentifier&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value/&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;Target&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value&amp;gt;_self&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;Context&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value/&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;Title&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value/&amp;gt;&lt;br /&gt;
              &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;Hello World&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;/node&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;OfficeToolBar&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;org.openoffice.testaddon.testaddon&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;m1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;URL&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;org.openoffice.testaddon.testaddon:HelloWorld&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;ImageIdentifier&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Target&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;_self&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Context&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Title&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
          &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;Hello World&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;Images&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;org.openoffice.testaddon.testaddon.helloworld.images&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;URL&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;org.openoffice.testaddon.testaddon:HelloWorld&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;UserDefinedImages&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;ImageSmallURL&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value&amp;gt;%origin%/idlfile.png&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;ImageBigURL&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value&amp;gt;%origin%/idlfile.png&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;ImageSmallHCURL&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value&amp;gt;%origin%/idlfile.png&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;ImageBigHCURL&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value&amp;gt;%origin%/idlfile.png&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/oor:component-data&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;&lt;br /&gt;
&amp;lt;code lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestAddOn.jar&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.configuration-data&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;registry/data/org/openoffice/Office/Addons.xcu&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.configuration-data&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;registry/data/org/openoffice/Office/ProtocolHandler.xcu&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/testaddon/TestAddOn.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated Add-On code skeleton where the generated class acts itself as the dispatch object (can be easily changed to support more complex Add-Ons). Most of the methods are already implemented and you simply have to add your own code in the dispatch method in the right place for each specified command.&lt;br /&gt;
&amp;lt;code lang=&amp;quot;Java&amp;quot;&amp;gt;&lt;br /&gt;
package org.openoffice.testaddon;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestAddOn extends WeakBase&lt;br /&gt;
   implements com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              com.sun.star.frame.XDispatchProvider,&lt;br /&gt;
              com.sun.star.lang.XInitialization,&lt;br /&gt;
              com.sun.star.frame.XDispatch&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private com.sun.star.frame.XFrame m_xFrame;&lt;br /&gt;
    private static final String m_implementationName = TestAddOn.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;com.sun.star.frame.ProtocolHandler&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    public TestAddOn( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory( String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestAddOn.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo( XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.frame.XDispatchProvider:&lt;br /&gt;
    public com.sun.star.frame.XDispatch queryDispatch( com.sun.star.util.URL aURL,&lt;br /&gt;
                                                       String sTargetFrameName,&lt;br /&gt;
                                                       int iSearchFlags )&lt;br /&gt;
    {&lt;br /&gt;
        if ( aURL.Protocol.compareTo(&amp;quot;org.openoffice.testaddon.testaddon:&amp;quot;) == 0 )&lt;br /&gt;
        {&lt;br /&gt;
            if ( aURL.Path.compareTo(&amp;quot;mycommands&amp;quot;) == 0 )&lt;br /&gt;
                return this;&lt;br /&gt;
        }&lt;br /&gt;
        return null;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.frame.XDispatchProvider:&lt;br /&gt;
    public com.sun.star.frame.XDispatch[] queryDispatches(&lt;br /&gt;
         com.sun.star.frame.DispatchDescriptor[] seqDescriptors )&lt;br /&gt;
    {&lt;br /&gt;
        int nCount = seqDescriptors.length;&lt;br /&gt;
        com.sun.star.frame.XDispatch[] seqDispatcher =&lt;br /&gt;
            new com.sun.star.frame.XDispatch[seqDescriptors.length];&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; nCount; ++i )&lt;br /&gt;
        {&lt;br /&gt;
            seqDispatcher[i] = queryDispatch(seqDescriptors[i].FeatureURL,&lt;br /&gt;
                                             seqDescriptors[i].FrameName,&lt;br /&gt;
                                             seqDescriptors[i].SearchFlags );&lt;br /&gt;
        }&lt;br /&gt;
        return seqDispatcher;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XInitialization:&lt;br /&gt;
    public void initialize( Object[] object )&lt;br /&gt;
        throws com.sun.star.uno.Exception&lt;br /&gt;
    {&lt;br /&gt;
        if ( object.length &amp;gt; 0 )&lt;br /&gt;
        {&lt;br /&gt;
            m_xFrame = (com.sun.star.frame.XFrame)UnoRuntime.queryInterface(&lt;br /&gt;
                com.sun.star.frame.XFrame.class, object[0]);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.frame.XDispatch:&lt;br /&gt;
     public void dispatch( com.sun.star.util.URL aURL,&lt;br /&gt;
                           com.sun.star.beans.PropertyValue[] aArguments )&lt;br /&gt;
    {&lt;br /&gt;
         if ( aURL.Protocol.compareTo(&amp;quot;org.openoffice.testaddon.testaddon:&amp;quot;) == 0 )&lt;br /&gt;
        {&lt;br /&gt;
            if ( aURL.Path.compareTo(&amp;quot;mycommands&amp;quot;) == 0 )&lt;br /&gt;
            {&lt;br /&gt;
                // add your own code here&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void addStatusListener( com.sun.star.frame.XStatusListener xControl,&lt;br /&gt;
                                    com.sun.star.util.URL aURL )&lt;br /&gt;
    {&lt;br /&gt;
        // add your own code here&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void removeStatusListener( com.sun.star.frame.XStatusListener xControl,&lt;br /&gt;
                                       com.sun.star.util.URL aURL )&lt;br /&gt;
    {&lt;br /&gt;
        // add your own code here&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Add-On]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=OpenOffice_Add-On_Project_Type&amp;diff=95992</id>
		<title>OpenOffice Add-On Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=OpenOffice_Add-On_Project_Type&amp;diff=95992"/>
		<updated>2008-10-15T16:06:26Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Project Wizard */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The Add-On wizard will enable users to create an OpenOffice.org component that including support of UI extensions. The component is based on a on a J2SE class library project and supports additional targets to create and deploy the package into the office installation.&lt;br /&gt;
All interface methods are default implemented and do nothing. In a second step you can insert your implementation in the generated skeleton, rebuild the extension and deploy it again to see the effect in your office.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard  is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Add-On&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn1.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, Add-On name, an optional package and the project location&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn2.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The necessary xcu files are generated and become part of the final &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; package. These xcu files can be easily adapted later to extend the initial project to a more complex Add-On example. The generated Add-On skeleton implements a simple [http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Protocol_Handler com.sun.star.frame.ProtocolHandler] Add-On.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 3&amp;#039;&amp;#039;&amp;#039;: Defining the new commands, including icons.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn3-1.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Defining the top level menu&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn3.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;On this panel you can define the top level menus with sub-menus on a higher abstraction level. You will not have to deal with xcu files directly. You can modify the default menu, add new menus and commands, and you can define the context in which the command should appear. When you have deployed the package, the newly defined menus are visible in the specified context. For example, if you choose the context &amp;#039;&amp;#039;&amp;#039;Writer&amp;#039;&amp;#039;&amp;#039;, the menu is visible when you open or create a text document. Not selecting a context means all contexts, even the back-end window. For more detailed descriptions of the different fields simply press the help button or read the appropriate chapter in the [http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Protocol_Handler Protocol Handler]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn4.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 5&amp;#039;&amp;#039;&amp;#039;: Definig the toolbar is similar to the menu. There is no top level toolbar, of course.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn5.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 6&amp;#039;&amp;#039;&amp;#039;: Deploying the extension package&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Calc_AddIn4.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Deploy and Run Extension in OpenOffice.org&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The AddOn deployed in OpenOffice.org is visible in the back-end window.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn6.png|center]]&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
Two (.xcu) files for the Add-On are created that describe the Add-On commands with descriptions, displaynames etc., (Addons.xcu) and the protocol that is used to access these commands (ProtocolHandler.xcu). For the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Addons.xcu&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;xcu file defining the new menus with submenus and commands. This file can be easily extended to support toolbars as well (toolbar support will be added later to the wizard).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;#039;1.0&amp;#039; encoding=&amp;#039;UTF-8&amp;#039;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;oor:component-data xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; oor:name=&amp;quot;Addons&amp;quot; oor:package=&amp;quot;org.openoffice.Office&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;AddonUI&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;OfficeMenuBar&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;org.openoffice.testaddon.testaddon&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Title&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
          &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;My Menu&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Target&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;_self&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;ImageIdentifier&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;Submenu&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;m1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;URL&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value&amp;gt;org.openoffice.testaddon.testaddon:mycommands&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;ImageIdentifier&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value/&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;Target&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value&amp;gt;_self&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;Context&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value/&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;Title&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value/&amp;gt;&lt;br /&gt;
              &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;Hello World&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;/node&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;Images&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;org.openoffice.testaddon.testaddon.mycommands.images&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;URL&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;org.openoffice.testaddon.testaddon:mycommands&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;UserDefinedImages&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;ImageSmallURL&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value/&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/oor:component-data&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ProtocolHandler.xcu&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;xcu file defining the automatically generated protocol. The protocol is generated based on the package name and Add-On name.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;#039;1.0&amp;#039; encoding=&amp;#039;UTF-8&amp;#039;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;oor:component-data oor:name=&amp;quot;ProtocolHandler&amp;quot; oor:package=&amp;quot;org.openoffice.Office&amp;quot; xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;HandlerSet&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;org.openoffice.testaddon.TestAddOn&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;prop oor:name=&amp;quot;Protocols&amp;quot; oor:type=&amp;quot;oor:string-list&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;value&amp;gt;org.openoffice.testaddon.testaddon:*&amp;lt;/value&amp;gt;&lt;br /&gt;
      &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/oor:component-data&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.configuration-data&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;ProtocolHandler.xcu&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.configuration-data&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;Addons.xcu&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestAddOn.jar&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/testaddon/TestAddOn.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated Add-On code skeleton where the generated class acts itself as the dispatch object (can be easily changed to support more complex Add-Ons). Most of the methods are already implemented and you simply have to add your own code in the dispatch method in the right place for each specified command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package org.openoffice.testaddon;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestAddOn extends WeakBase&lt;br /&gt;
   implements com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              com.sun.star.frame.XDispatchProvider,&lt;br /&gt;
              com.sun.star.lang.XInitialization,&lt;br /&gt;
              com.sun.star.frame.XDispatch&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private com.sun.star.frame.XFrame m_xFrame;&lt;br /&gt;
    private static final String m_implementationName = TestAddOn.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;com.sun.star.frame.ProtocolHandler&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    public TestAddOn( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory( String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestAddOn.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo( XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.frame.XDispatchProvider:&lt;br /&gt;
    public com.sun.star.frame.XDispatch queryDispatch( com.sun.star.util.URL aURL,&lt;br /&gt;
                                                       String sTargetFrameName,&lt;br /&gt;
                                                       int iSearchFlags )&lt;br /&gt;
    {&lt;br /&gt;
        if ( aURL.Protocol.compareTo(&amp;quot;org.openoffice.testaddon.testaddon:&amp;quot;) == 0 )&lt;br /&gt;
        {&lt;br /&gt;
            if ( aURL.Path.compareTo(&amp;quot;mycommands&amp;quot;) == 0 )&lt;br /&gt;
                return this;&lt;br /&gt;
        }&lt;br /&gt;
        return null;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.frame.XDispatchProvider:&lt;br /&gt;
    public com.sun.star.frame.XDispatch[] queryDispatches(&lt;br /&gt;
         com.sun.star.frame.DispatchDescriptor[] seqDescriptors )&lt;br /&gt;
    {&lt;br /&gt;
        int nCount = seqDescriptors.length;&lt;br /&gt;
        com.sun.star.frame.XDispatch[] seqDispatcher =&lt;br /&gt;
            new com.sun.star.frame.XDispatch[seqDescriptors.length];&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; nCount; ++i )&lt;br /&gt;
        {&lt;br /&gt;
            seqDispatcher[i] = queryDispatch(seqDescriptors[i].FeatureURL,&lt;br /&gt;
                                             seqDescriptors[i].FrameName,&lt;br /&gt;
                                             seqDescriptors[i].SearchFlags );&lt;br /&gt;
        }&lt;br /&gt;
        return seqDispatcher;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XInitialization:&lt;br /&gt;
    public void initialize( Object[] object )&lt;br /&gt;
        throws com.sun.star.uno.Exception&lt;br /&gt;
    {&lt;br /&gt;
        if ( object.length &amp;gt; 0 )&lt;br /&gt;
        {&lt;br /&gt;
            m_xFrame = (com.sun.star.frame.XFrame)UnoRuntime.queryInterface(&lt;br /&gt;
                com.sun.star.frame.XFrame.class, object[0]);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.frame.XDispatch:&lt;br /&gt;
     public void dispatch( com.sun.star.util.URL aURL,&lt;br /&gt;
                           com.sun.star.beans.PropertyValue[] aArguments )&lt;br /&gt;
    {&lt;br /&gt;
         if ( aURL.Protocol.compareTo(&amp;quot;org.openoffice.testaddon.testaddon:&amp;quot;) == 0 )&lt;br /&gt;
        {&lt;br /&gt;
            if ( aURL.Path.compareTo(&amp;quot;mycommands&amp;quot;) == 0 )&lt;br /&gt;
            {&lt;br /&gt;
                // add your own code here&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void addStatusListener( com.sun.star.frame.XStatusListener xControl,&lt;br /&gt;
                                    com.sun.star.util.URL aURL )&lt;br /&gt;
    {&lt;br /&gt;
        // add your own code here&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void removeStatusListener( com.sun.star.frame.XStatusListener xControl,&lt;br /&gt;
                                       com.sun.star.util.URL aURL )&lt;br /&gt;
    {&lt;br /&gt;
        // add your own code here&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Add-On]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:AddOn6.png&amp;diff=95990</id>
		<title>File:AddOn6.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:AddOn6.png&amp;diff=95990"/>
		<updated>2008-10-15T16:03:40Z</updated>

		<summary type="html">&lt;p&gt;Sg: AddOn in back-end of OOo; version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AddOn in back-end of OOo; version 2.0.0&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=OpenOffice_Add-On_Project_Type&amp;diff=95975</id>
		<title>OpenOffice Add-On Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=OpenOffice_Add-On_Project_Type&amp;diff=95975"/>
		<updated>2008-10-15T16:01:27Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Project Wizard */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The Add-On wizard will enable users to create an OpenOffice.org component that including support of UI extensions. The component is based on a on a J2SE class library project and supports additional targets to create and deploy the package into the office installation.&lt;br /&gt;
All interface methods are default implemented and do nothing. In a second step you can insert your implementation in the generated skeleton, rebuild the extension and deploy it again to see the effect in your office.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard  is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; StarOffice/OpenOffice.org -&amp;gt; StarOffice/OpenOffice.org Add-On&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn1.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, Add-On name, an optional package and the project location&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn2.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The necessary xcu files are generated and become part of the final &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; package. These xcu files can be easily adapted later to extend the initial project to a more complex Add-On example. The generated Add-On skeleton implements a simple [http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Protocol_Handler com.sun.star.frame.ProtocolHandler] Add-On.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 3&amp;#039;&amp;#039;&amp;#039;: Defining the new commands, including icons.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn3-1.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Defining the top level menu&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn3.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;On this panel you can define the top level menus with sub-menus on a higher abstraction level. You will not have to deal with xcu files directly. You can modify the default menu, add new menus and commands, and you can define the context in which the command should appear. When you have deployed the package, the newly defined menus are visible in the specified context. For example, if you choose the context &amp;#039;&amp;#039;&amp;#039;Writer&amp;#039;&amp;#039;&amp;#039;, the menu is visible when you open or create a text document. Not selecting a context means all contexts, even the back-end window. For more detailed descriptions of the different fields simply press the help button or read the appropriate chapter in the [http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Protocol_Handler Protocol Handler]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn4.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 5&amp;#039;&amp;#039;&amp;#039;: Definig the toolbar is similar to the menu. There is no top level toolbar, of course.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn5.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 6&amp;#039;&amp;#039;&amp;#039;: Deploying the extension package&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Calc_AddIn4.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Deploy and Run Extension in OpenOffice.org&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:AddOn6.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
Two (.xcu) files for the Add-On are created that describe the Add-On commands with descriptions, displaynames etc., (Addons.xcu) and the protocol that is used to access these commands (ProtocolHandler.xcu). For the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Addons.xcu&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;xcu file defining the new menus with submenus and commands. This file can be easily extended to support toolbars as well (toolbar support will be added later to the wizard).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;#039;1.0&amp;#039; encoding=&amp;#039;UTF-8&amp;#039;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;oor:component-data xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; oor:name=&amp;quot;Addons&amp;quot; oor:package=&amp;quot;org.openoffice.Office&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;AddonUI&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;OfficeMenuBar&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;org.openoffice.testaddon.testaddon&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Title&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
          &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;My Menu&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Target&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;_self&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;ImageIdentifier&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;Submenu&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;m1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;URL&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value&amp;gt;org.openoffice.testaddon.testaddon:mycommands&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;ImageIdentifier&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value/&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;Target&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value&amp;gt;_self&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;Context&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value/&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;Title&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value/&amp;gt;&lt;br /&gt;
              &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;Hello World&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;/node&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;Images&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;org.openoffice.testaddon.testaddon.mycommands.images&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;URL&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;org.openoffice.testaddon.testaddon:mycommands&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;UserDefinedImages&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;ImageSmallURL&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value/&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/oor:component-data&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ProtocolHandler.xcu&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;xcu file defining the automatically generated protocol. The protocol is generated based on the package name and Add-On name.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;#039;1.0&amp;#039; encoding=&amp;#039;UTF-8&amp;#039;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;oor:component-data oor:name=&amp;quot;ProtocolHandler&amp;quot; oor:package=&amp;quot;org.openoffice.Office&amp;quot; xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;HandlerSet&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;org.openoffice.testaddon.TestAddOn&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;prop oor:name=&amp;quot;Protocols&amp;quot; oor:type=&amp;quot;oor:string-list&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;value&amp;gt;org.openoffice.testaddon.testaddon:*&amp;lt;/value&amp;gt;&lt;br /&gt;
      &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/oor:component-data&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.configuration-data&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;ProtocolHandler.xcu&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.configuration-data&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;Addons.xcu&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestAddOn.jar&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/testaddon/TestAddOn.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated Add-On code skeleton where the generated class acts itself as the dispatch object (can be easily changed to support more complex Add-Ons). Most of the methods are already implemented and you simply have to add your own code in the dispatch method in the right place for each specified command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package org.openoffice.testaddon;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestAddOn extends WeakBase&lt;br /&gt;
   implements com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              com.sun.star.frame.XDispatchProvider,&lt;br /&gt;
              com.sun.star.lang.XInitialization,&lt;br /&gt;
              com.sun.star.frame.XDispatch&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private com.sun.star.frame.XFrame m_xFrame;&lt;br /&gt;
    private static final String m_implementationName = TestAddOn.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;com.sun.star.frame.ProtocolHandler&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    public TestAddOn( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory( String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestAddOn.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo( XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.frame.XDispatchProvider:&lt;br /&gt;
    public com.sun.star.frame.XDispatch queryDispatch( com.sun.star.util.URL aURL,&lt;br /&gt;
                                                       String sTargetFrameName,&lt;br /&gt;
                                                       int iSearchFlags )&lt;br /&gt;
    {&lt;br /&gt;
        if ( aURL.Protocol.compareTo(&amp;quot;org.openoffice.testaddon.testaddon:&amp;quot;) == 0 )&lt;br /&gt;
        {&lt;br /&gt;
            if ( aURL.Path.compareTo(&amp;quot;mycommands&amp;quot;) == 0 )&lt;br /&gt;
                return this;&lt;br /&gt;
        }&lt;br /&gt;
        return null;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.frame.XDispatchProvider:&lt;br /&gt;
    public com.sun.star.frame.XDispatch[] queryDispatches(&lt;br /&gt;
         com.sun.star.frame.DispatchDescriptor[] seqDescriptors )&lt;br /&gt;
    {&lt;br /&gt;
        int nCount = seqDescriptors.length;&lt;br /&gt;
        com.sun.star.frame.XDispatch[] seqDispatcher =&lt;br /&gt;
            new com.sun.star.frame.XDispatch[seqDescriptors.length];&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; nCount; ++i )&lt;br /&gt;
        {&lt;br /&gt;
            seqDispatcher[i] = queryDispatch(seqDescriptors[i].FeatureURL,&lt;br /&gt;
                                             seqDescriptors[i].FrameName,&lt;br /&gt;
                                             seqDescriptors[i].SearchFlags );&lt;br /&gt;
        }&lt;br /&gt;
        return seqDispatcher;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XInitialization:&lt;br /&gt;
    public void initialize( Object[] object )&lt;br /&gt;
        throws com.sun.star.uno.Exception&lt;br /&gt;
    {&lt;br /&gt;
        if ( object.length &amp;gt; 0 )&lt;br /&gt;
        {&lt;br /&gt;
            m_xFrame = (com.sun.star.frame.XFrame)UnoRuntime.queryInterface(&lt;br /&gt;
                com.sun.star.frame.XFrame.class, object[0]);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.frame.XDispatch:&lt;br /&gt;
     public void dispatch( com.sun.star.util.URL aURL,&lt;br /&gt;
                           com.sun.star.beans.PropertyValue[] aArguments )&lt;br /&gt;
    {&lt;br /&gt;
         if ( aURL.Protocol.compareTo(&amp;quot;org.openoffice.testaddon.testaddon:&amp;quot;) == 0 )&lt;br /&gt;
        {&lt;br /&gt;
            if ( aURL.Path.compareTo(&amp;quot;mycommands&amp;quot;) == 0 )&lt;br /&gt;
            {&lt;br /&gt;
                // add your own code here&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void addStatusListener( com.sun.star.frame.XStatusListener xControl,&lt;br /&gt;
                                    com.sun.star.util.URL aURL )&lt;br /&gt;
    {&lt;br /&gt;
        // add your own code here&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void removeStatusListener( com.sun.star.frame.XStatusListener xControl,&lt;br /&gt;
                                       com.sun.star.util.URL aURL )&lt;br /&gt;
    {&lt;br /&gt;
        // add your own code here&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Add-On]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:AddOn5.png&amp;diff=95974</id>
		<title>File:AddOn5.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:AddOn5.png&amp;diff=95974"/>
		<updated>2008-10-15T15:31:14Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:AddOn5.png&amp;quot;: version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:AddOn4.png&amp;diff=95973</id>
		<title>File:AddOn4.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:AddOn4.png&amp;diff=95973"/>
		<updated>2008-10-15T15:15:32Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:AddOn4.png&amp;quot;: version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:AddOn3.png&amp;diff=95972</id>
		<title>File:AddOn3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:AddOn3.png&amp;diff=95972"/>
		<updated>2008-10-15T15:13:19Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:AddOn3.png&amp;quot;: version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=OpenOffice_Add-On_Project_Type&amp;diff=95870</id>
		<title>OpenOffice Add-On Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=OpenOffice_Add-On_Project_Type&amp;diff=95870"/>
		<updated>2008-10-14T12:54:54Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Project Wizard */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The Add-On wizard will enable users to create an OpenOffice.org component that including support of UI extensions. The component is based on a on a J2SE class library project and supports additional targets to create and deploy the package into the office installation.&lt;br /&gt;
All interface methods are default implemented and do nothing. In a second step you can insert your implementation in the generated skeleton, rebuild the extension and deploy it again to see the effect in your office.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard  is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; StarOffice/OpenOffice.org -&amp;gt; StarOffice/OpenOffice.org Add-On&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:AddOn1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, Add-On name, an optional package and the project location &lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:AddOn2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
The necessary xcu files are generated and become part of the final &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; package. These xcu files can be easily adapted later to extend the initial project to a more complex Add-On example. The generated Add-On skeleton implements a simple [http://api.openoffice.org/docs/common/ref/com/sun/star/frame/ProtocolHandler.html com.sun.star.frame.ProtocolHandler] Add-On.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 3&amp;#039;&amp;#039;&amp;#039;: Defining the new commands, including icons.&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:AddOn3-1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
This part is missing. See also discussion.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Defining the new toplevel menu&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:AddOn3.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:AddOn4.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
On this panel you can define new toplevel menus with submenus on a higher abstraction level. You will not have to deal with xcu files directly. You can modify the default menu and commands, add new menus and commands, and you can insert localized displaynames. For more detailed descriptions of the different fields simply press the help button or read the appropriate chapter in the [http://api.openoffice.org/docs/DevelopersGuide/Components/Components.xhtml#1_7_1_Protocol_Handler Developer&amp;#039;s Guide - Writing UNO components - Integrating Components into OpenOffice.org - Protocol Handler]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you add a new language you can select languages from a list of supported languages. When you delete a language, you can only delete the languages you have added.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn3a.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn3b.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 5&amp;#039;&amp;#039;&amp;#039;: Deploying the extension package&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn4.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&lt;br /&gt;
::&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Create OXT | Deploy Office Extension&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you have deployed the package, the newly defined menus are visible in the specified context. For example, if you choose the context &amp;#039;&amp;#039;&amp;#039;Writer&amp;#039;&amp;#039;&amp;#039;, the menu is visible when you open or create a text document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:AddOn5.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
Two (.xcu) files for the Add-On are created that describe the Add-On commands with descriptions, displaynames etc., (Addons.xcu) and the protocol that is used to access these commands (ProtocolHandler.xcu). For the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Addons.xcu&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;xcu file defining the new menus with submenus and commands. This file can be easily extended to support toolbars as well (toolbar support will be added later to the wizard).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;#039;1.0&amp;#039; encoding=&amp;#039;UTF-8&amp;#039;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;oor:component-data xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; oor:name=&amp;quot;Addons&amp;quot; oor:package=&amp;quot;org.openoffice.Office&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;AddonUI&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;OfficeMenuBar&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;org.openoffice.testaddon.testaddon&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Title&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
          &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;My Menu&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Target&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;_self&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;ImageIdentifier&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value/&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;Submenu&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;m1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;URL&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value&amp;gt;org.openoffice.testaddon.testaddon:mycommands&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;ImageIdentifier&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value/&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;Target&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value&amp;gt;_self&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;Context&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value/&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;Title&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value/&amp;gt;&lt;br /&gt;
              &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;Hello World&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;/node&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;Images&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;org.openoffice.testaddon.testaddon.mycommands.images&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;URL&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;org.openoffice.testaddon.testaddon:mycommands&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;UserDefinedImages&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;ImageSmallURL&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value/&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/oor:component-data&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ProtocolHandler.xcu&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;xcu file defining the automatically generated protocol. The protocol is generated based on the package name and Add-On name.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;#039;1.0&amp;#039; encoding=&amp;#039;UTF-8&amp;#039;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;oor:component-data oor:name=&amp;quot;ProtocolHandler&amp;quot; oor:package=&amp;quot;org.openoffice.Office&amp;quot; xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;HandlerSet&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;org.openoffice.testaddon.TestAddOn&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;prop oor:name=&amp;quot;Protocols&amp;quot; oor:type=&amp;quot;oor:string-list&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;value&amp;gt;org.openoffice.testaddon.testaddon:*&amp;lt;/value&amp;gt;&lt;br /&gt;
      &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/oor:component-data&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.configuration-data&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;ProtocolHandler.xcu&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.configuration-data&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;Addons.xcu&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestAddOn.jar&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/testaddon/TestAddOn.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated Add-On code skeleton where the generated class acts itself as the dispatch object (can be easily changed to support more complex Add-Ons). Most of the methods are already implemented and you simply have to add your own code in the dispatch method in the right place for each specified command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package org.openoffice.testaddon;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestAddOn extends WeakBase&lt;br /&gt;
   implements com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              com.sun.star.frame.XDispatchProvider,&lt;br /&gt;
              com.sun.star.lang.XInitialization,&lt;br /&gt;
              com.sun.star.frame.XDispatch&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private com.sun.star.frame.XFrame m_xFrame;&lt;br /&gt;
    private static final String m_implementationName = TestAddOn.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;com.sun.star.frame.ProtocolHandler&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    public TestAddOn( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory( String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestAddOn.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo( XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.frame.XDispatchProvider:&lt;br /&gt;
    public com.sun.star.frame.XDispatch queryDispatch( com.sun.star.util.URL aURL,&lt;br /&gt;
                                                       String sTargetFrameName,&lt;br /&gt;
                                                       int iSearchFlags )&lt;br /&gt;
    {&lt;br /&gt;
        if ( aURL.Protocol.compareTo(&amp;quot;org.openoffice.testaddon.testaddon:&amp;quot;) == 0 )&lt;br /&gt;
        {&lt;br /&gt;
            if ( aURL.Path.compareTo(&amp;quot;mycommands&amp;quot;) == 0 )&lt;br /&gt;
                return this;&lt;br /&gt;
        }&lt;br /&gt;
        return null;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.frame.XDispatchProvider:&lt;br /&gt;
    public com.sun.star.frame.XDispatch[] queryDispatches(&lt;br /&gt;
         com.sun.star.frame.DispatchDescriptor[] seqDescriptors )&lt;br /&gt;
    {&lt;br /&gt;
        int nCount = seqDescriptors.length;&lt;br /&gt;
        com.sun.star.frame.XDispatch[] seqDispatcher =&lt;br /&gt;
            new com.sun.star.frame.XDispatch[seqDescriptors.length];&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; nCount; ++i )&lt;br /&gt;
        {&lt;br /&gt;
            seqDispatcher[i] = queryDispatch(seqDescriptors[i].FeatureURL,&lt;br /&gt;
                                             seqDescriptors[i].FrameName,&lt;br /&gt;
                                             seqDescriptors[i].SearchFlags );&lt;br /&gt;
        }&lt;br /&gt;
        return seqDispatcher;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XInitialization:&lt;br /&gt;
    public void initialize( Object[] object )&lt;br /&gt;
        throws com.sun.star.uno.Exception&lt;br /&gt;
    {&lt;br /&gt;
        if ( object.length &amp;gt; 0 )&lt;br /&gt;
        {&lt;br /&gt;
            m_xFrame = (com.sun.star.frame.XFrame)UnoRuntime.queryInterface(&lt;br /&gt;
                com.sun.star.frame.XFrame.class, object[0]);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.frame.XDispatch:&lt;br /&gt;
     public void dispatch( com.sun.star.util.URL aURL,&lt;br /&gt;
                           com.sun.star.beans.PropertyValue[] aArguments )&lt;br /&gt;
    {&lt;br /&gt;
         if ( aURL.Protocol.compareTo(&amp;quot;org.openoffice.testaddon.testaddon:&amp;quot;) == 0 )&lt;br /&gt;
        {&lt;br /&gt;
            if ( aURL.Path.compareTo(&amp;quot;mycommands&amp;quot;) == 0 )&lt;br /&gt;
            {&lt;br /&gt;
                // add your own code here&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void addStatusListener( com.sun.star.frame.XStatusListener xControl,&lt;br /&gt;
                                    com.sun.star.util.URL aURL )&lt;br /&gt;
    {&lt;br /&gt;
        // add your own code here&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void removeStatusListener( com.sun.star.frame.XStatusListener xControl,&lt;br /&gt;
                                       com.sun.star.util.URL aURL )&lt;br /&gt;
    {&lt;br /&gt;
        // add your own code here&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Add-On]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:AddOn3-1.png&amp;diff=95869</id>
		<title>File:AddOn3-1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:AddOn3-1.png&amp;diff=95869"/>
		<updated>2008-10-14T12:50:40Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:AddOn3-1.png&amp;quot;: version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AddOn screen 3&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:AddOn2.png&amp;diff=95868</id>
		<title>File:AddOn2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:AddOn2.png&amp;diff=95868"/>
		<updated>2008-10-14T12:41:53Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:AddOn2.png&amp;quot;: version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:AddOn1.png&amp;diff=95866</id>
		<title>File:AddOn1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:AddOn1.png&amp;diff=95866"/>
		<updated>2008-10-14T12:39:39Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:AddOn1.png&amp;quot;: version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95865</id>
		<title>General UNO Component Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95865"/>
		<updated>2008-10-14T12:36:38Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Time Frame */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Component wizard creates a new project based on a J2SE class library project and supports additional targets to create a complete OpenOffice.org extension package and to deploy this package into the configured OpenOffice.org installation.&amp;lt;br&amp;gt;&lt;br /&gt;
The wizard collects all necessary information and allows you to select the existing services and interfaces that should be implemented. In the same wizard step you can also define completely new services and interfaces (and additional data types based on IDL) to design abstract interfaces for completely new functionality.&amp;lt;br&amp;gt;&lt;br /&gt;
After finishing the wizard you can directly build the project and can create and deploy the OpenOffice.org extension package. All interface methods are implemented by default, and do nothing. In a second step you can insert your implementation in the generated skeleton, rebuild the extension and deploy it again to see the effect.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Component&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, implementation class name, an package and the project location &lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Specifiy or define the UNO IDL services and interfaces which should be implemented.&lt;br /&gt;
** To provide an own defined interface, choose the &amp;#039;&amp;#039;&amp;#039;Interface&amp;#039;&amp;#039;&amp;#039; node and click on &amp;#039;&amp;#039;&amp;#039;Define New Data Type&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Interface1.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Create the interface as shown in this picture&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Interface.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Back at the New Project window, select the &amp;#039;&amp;#039;&amp;#039;Service&amp;#039;&amp;#039;&amp;#039; node and click again on &amp;#039;&amp;#039;&amp;#039;Define New Data Type&amp;#039;&amp;#039;&amp;#039;. Create the service as follows:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Service.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Back at the New Project window, click on &amp;#039;&amp;#039;&amp;#039;Add Service/Interface&amp;#039;&amp;#039;&amp;#039;. Select the new created service. The interface will be added automatically:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_TypeBrowser.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** When everything looks like this, click &amp;#039;&amp;#039;&amp;#039;OK&amp;#039;&amp;#039;&amp;#039;:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component3.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&lt;br /&gt;
::&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Deploy and Run Extension in OpenOffice.org&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you have deployed the package, the usage of the new UNO component in OpenOffice.org is straight forward. Either you have implemented a special service provider interface (SPI) and can use it in the same way as any other implementations of this SPI can be used, or you have defined some new service and/or interfaces and can instantiate your component as a normal service over the global service manager.&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
The wizard generates more code for a UNO component, but it depends on the selected UNO IDL types. If only existing types are selected and no new UNO IDL types are defined, the wizard will not generate any UNO IDL files.  For the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;. The content of the uno-extension-manifest.xml depends on the selection or definition of the IDL types. If no new types are defined, no type library is specified. Own IDL types are packed in an additional jar referenced here. Without new IDL types, this jar will also not exist.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-typelibrary;type=RDB&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;types.rdb&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestComponent.jar&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-typelibrary;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestComponent_IDL_types.jar&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/MyTestService.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test service definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * MyTestService.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_MyTestService_&lt;br /&gt;
#define _org_openoffice_test_MyTestService_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;XMyTest.idl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    service MyTestService : XMyTest;&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/XMyTest.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test interface definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * XMyTest.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_XMyTest_&lt;br /&gt;
#define _org_openoffice_test_XMyTest_&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/uno/XInterface.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    interface XMyTest {&lt;br /&gt;
&lt;br /&gt;
        string helloWorld([in] string sMessage);&lt;br /&gt;
            raises ( com::sun::star::lang::IllegalArgumentException );&lt;br /&gt;
    };&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/TestComponentImpl.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated code skeleton where all selected services and interface are implemented by defualt plus some UNO component base interfaces, so that the newly generated project can be built and the extension can be deployed directly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package org.openoffice.test;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestComponentImpl extends WeakBase&lt;br /&gt;
   implements com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              org.openoffice.test.XMyTest&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private static final String m_implementationName = TestComponentImpl.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;org.openoffice.test.MyTestService&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    public TestComponentImpl( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory(String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestComponentImpl.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo(XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String sMessage) throws com.sun.star.lang.IllegalArgumentException&lt;br /&gt;
    {&lt;br /&gt;
        // TODO !!!&lt;br /&gt;
        // Exchange the default return implementation.&lt;br /&gt;
        // NOTE: Default initialized polymorphic structs can cause problems&lt;br /&gt;
        // because of missing default initialization of primitive types of&lt;br /&gt;
        // some C++ compilers or different Any initialization in Java and C++&lt;br /&gt;
        // polymorphic structs.&lt;br /&gt;
        return new String();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Result Use Example : OOoBasic Macro Call =&lt;br /&gt;
&lt;br /&gt;
For using the previous skeleton for an OOoBasic service call, we only have to alter the last method helloWorld and redeploy the oxt extension&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String message)&lt;br /&gt;
    {&lt;br /&gt;
        String response = new String();&lt;br /&gt;
        response = &amp;quot;Hello &amp;quot; + message;   &lt;br /&gt;
        return response;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, opening a new OpenOffice.org, your component is available for any macro you may need. It is seen as any legacy service and is manipulated the same way. Even introspection is available, letting you verify that all your properties and methods are available, as the xRay call can show.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
sub TestHelloWorld()&lt;br /&gt;
	&amp;#039; Create the new UNO service&lt;br /&gt;
	myService = createUNOService(&amp;quot;org.openoffice.test.MyTestService&amp;quot;)&lt;br /&gt;
	&amp;#039; The new service with its properties &amp;amp; methods is available&lt;br /&gt;
	msgbox myService.helloWorld (&amp;quot;Laurent&amp;quot;)&lt;br /&gt;
	&amp;#039; It is also available through Xray introspection&lt;br /&gt;
	xRay myService&lt;br /&gt;
end sub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:hello_testing_netbeans.png|center]]&lt;br /&gt;
| [[Image:xray_helloworld_netbeans.png|center]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* Daniel Bölzle&amp;#039;s tutorial : [[Uno/Cpp/Tutorials/component_tutorial|Writing a simple UNO component]]&lt;br /&gt;
* [[Documentation/DevGuide/WritingUNO/Writing_UNO_Components|Writing UNO Components]] in Developer&amp;#039;s Guide&lt;br /&gt;
* [[Constructing_Components|Constructing Components in C++]]&lt;br /&gt;
* [[Extensions_Packager|Extensions Packager]] (BasicAddonBuilder from [mailto:paolomantovani@openoffice.org Paolo Mantovani])&lt;br /&gt;
* [[BASIC/UNO_Object_Browser|BASIC UNO Object Browser]] : You can see the corresponding code as a complex component.&lt;br /&gt;
* [[API/Samples/Java/Office/MinimalComponent|Minimal Java Component]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95863</id>
		<title>General UNO Component Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95863"/>
		<updated>2008-10-14T12:34:49Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Generated Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Component wizard creates a new project based on a J2SE class library project and supports additional targets to create a complete OpenOffice.org extension package and to deploy this package into the configured OpenOffice.org installation.&amp;lt;br&amp;gt;&lt;br /&gt;
The wizard collects all necessary information and allows you to select the existing services and interfaces that should be implemented. In the same wizard step you can also define completely new services and interfaces (and additional data types based on IDL) to design abstract interfaces for completely new functionality.&amp;lt;br&amp;gt;&lt;br /&gt;
After finishing the wizard you can directly build the project and can create and deploy the OpenOffice.org extension package. All interface methods are implemented by default, and do nothing. In a second step you can insert your implementation in the generated skeleton, rebuild the extension and deploy it again to see the effect.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Component&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, implementation class name, an package and the project location &lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Specifiy or define the UNO IDL services and interfaces which should be implemented.&lt;br /&gt;
** To provide an own defined interface, choose the &amp;#039;&amp;#039;&amp;#039;Interface&amp;#039;&amp;#039;&amp;#039; node and click on &amp;#039;&amp;#039;&amp;#039;Define New Data Type&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Interface1.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Create the interface as shown in this picture&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Interface.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Back at the New Project window, select the &amp;#039;&amp;#039;&amp;#039;Service&amp;#039;&amp;#039;&amp;#039; node and click again on &amp;#039;&amp;#039;&amp;#039;Define New Data Type&amp;#039;&amp;#039;&amp;#039;. Create the service as follows:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Service.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Back at the New Project window, click on &amp;#039;&amp;#039;&amp;#039;Add Service/Interface&amp;#039;&amp;#039;&amp;#039;. Select the new created service. The interface will be added automatically:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_TypeBrowser.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** When everything looks like this, click &amp;#039;&amp;#039;&amp;#039;OK&amp;#039;&amp;#039;&amp;#039;:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component3.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&lt;br /&gt;
::&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Deploy and Run Extension in OpenOffice.org&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you have deployed the package, the usage of the new UNO component in OpenOffice.org is straight forward. Either you have implemented a special service provider interface (SPI) and can use it in the same way as any other implementations of this SPI can be used, or you have defined some new service and/or interfaces and can instantiate your component as a normal service over the global service manager.&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
The wizard generates more code for a UNO component, but it depends on the selected UNO IDL types. If only existing types are selected and no new UNO IDL types are defined, the wizard will not generate any UNO IDL files.  For the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;. The content of the uno-extension-manifest.xml depends on the selection or definition of the IDL types. If no new types are defined, no type library is specified. Own IDL types are packed in an additional jar referenced here. Without new IDL types, this jar will also not exist.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-typelibrary;type=RDB&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;types.rdb&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestComponent.jar&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-typelibrary;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestComponent_IDL_types.jar&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/MyTestService.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test service definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * MyTestService.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_MyTestService_&lt;br /&gt;
#define _org_openoffice_test_MyTestService_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;XMyTest.idl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    service MyTestService : XMyTest;&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/XMyTest.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test interface definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * XMyTest.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_XMyTest_&lt;br /&gt;
#define _org_openoffice_test_XMyTest_&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/uno/XInterface.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    interface XMyTest {&lt;br /&gt;
&lt;br /&gt;
        string helloWorld([in] string sMessage);&lt;br /&gt;
            raises ( com::sun::star::lang::IllegalArgumentException );&lt;br /&gt;
    };&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/TestComponentImpl.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated code skeleton where all selected services and interface are implemented by defualt plus some UNO component base interfaces, so that the newly generated project can be built and the extension can be deployed directly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package org.openoffice.test;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestComponentImpl extends WeakBase&lt;br /&gt;
   implements com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              org.openoffice.test.XMyTest&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private static final String m_implementationName = TestComponentImpl.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;org.openoffice.test.MyTestService&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    public TestComponentImpl( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory(String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestComponentImpl.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo(XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String sMessage) throws com.sun.star.lang.IllegalArgumentException&lt;br /&gt;
    {&lt;br /&gt;
        // TODO !!!&lt;br /&gt;
        // Exchange the default return implementation.&lt;br /&gt;
        // NOTE: Default initialized polymorphic structs can cause problems&lt;br /&gt;
        // because of missing default initialization of primitive types of&lt;br /&gt;
        // some C++ compilers or different Any initialization in Java and C++&lt;br /&gt;
        // polymorphic structs.&lt;br /&gt;
        return new String();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Result Use Example : OOoBasic Macro Call =&lt;br /&gt;
&lt;br /&gt;
For using the previous skeleton for an OOoBasic service call, we only have to alter the last method helloWorld and redeploy the oxt extension&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String message)&lt;br /&gt;
    {&lt;br /&gt;
        String response = new String();&lt;br /&gt;
        response = &amp;quot;Hello &amp;quot; + message;   &lt;br /&gt;
        return response;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, opening a new OpenOffice.org, your component is available for any macro you may need. It is seen as any legacy service and is manipulated the same way. Even introspection is available, letting you verify that all your properties and methods are available, as the xRay call can show.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
sub TestHelloWorld()&lt;br /&gt;
	&amp;#039; Create the new UNO service&lt;br /&gt;
	myService = createUNOService(&amp;quot;org.openoffice.test.MyTestService&amp;quot;)&lt;br /&gt;
	&amp;#039; The new service with its properties &amp;amp; methods is available&lt;br /&gt;
	msgbox myService.helloWorld (&amp;quot;Laurent&amp;quot;)&lt;br /&gt;
	&amp;#039; It is also available through Xray introspection&lt;br /&gt;
	xRay myService&lt;br /&gt;
end sub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:hello_testing_netbeans.png|center]]&lt;br /&gt;
| [[Image:xray_helloworld_netbeans.png|center]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Time Frame =&lt;br /&gt;
&lt;br /&gt;
Another update of this wizard is due on November 30th.&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* Daniel Bölzle&amp;#039;s tutorial : [[Uno/Cpp/Tutorials/component_tutorial|Writing a simple UNO component]]&lt;br /&gt;
* [[Documentation/DevGuide/WritingUNO/Writing_UNO_Components|Writing UNO Components]] in Developer&amp;#039;s Guide&lt;br /&gt;
* [[Constructing_Components|Constructing Components in C++]]&lt;br /&gt;
* [[Extensions_Packager|Extensions Packager]] (BasicAddonBuilder from [mailto:paolomantovani@openoffice.org Paolo Mantovani])&lt;br /&gt;
* [[BASIC/UNO_Object_Browser|BASIC UNO Object Browser]] : You can see the corresponding code as a complex component.&lt;br /&gt;
* [[API/Samples/Java/Office/MinimalComponent|Minimal Java Component]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95862</id>
		<title>General UNO Component Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95862"/>
		<updated>2008-10-14T12:34:02Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Generated Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Component wizard creates a new project based on a J2SE class library project and supports additional targets to create a complete OpenOffice.org extension package and to deploy this package into the configured OpenOffice.org installation.&amp;lt;br&amp;gt;&lt;br /&gt;
The wizard collects all necessary information and allows you to select the existing services and interfaces that should be implemented. In the same wizard step you can also define completely new services and interfaces (and additional data types based on IDL) to design abstract interfaces for completely new functionality.&amp;lt;br&amp;gt;&lt;br /&gt;
After finishing the wizard you can directly build the project and can create and deploy the OpenOffice.org extension package. All interface methods are implemented by default, and do nothing. In a second step you can insert your implementation in the generated skeleton, rebuild the extension and deploy it again to see the effect.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Component&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, implementation class name, an package and the project location &lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Specifiy or define the UNO IDL services and interfaces which should be implemented.&lt;br /&gt;
** To provide an own defined interface, choose the &amp;#039;&amp;#039;&amp;#039;Interface&amp;#039;&amp;#039;&amp;#039; node and click on &amp;#039;&amp;#039;&amp;#039;Define New Data Type&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Interface1.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Create the interface as shown in this picture&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Interface.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Back at the New Project window, select the &amp;#039;&amp;#039;&amp;#039;Service&amp;#039;&amp;#039;&amp;#039; node and click again on &amp;#039;&amp;#039;&amp;#039;Define New Data Type&amp;#039;&amp;#039;&amp;#039;. Create the service as follows:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Service.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Back at the New Project window, click on &amp;#039;&amp;#039;&amp;#039;Add Service/Interface&amp;#039;&amp;#039;&amp;#039;. Select the new created service. The interface will be added automatically:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_TypeBrowser.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** When everything looks like this, click &amp;#039;&amp;#039;&amp;#039;OK&amp;#039;&amp;#039;&amp;#039;:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component3.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&lt;br /&gt;
::&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Deploy and Run Extension in OpenOffice.org&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you have deployed the package, the usage of the new UNO component in OpenOffice.org is straight forward. Either you have implemented a special service provider interface (SPI) and can use it in the same way as any other implementations of this SPI can be used, or you have defined some new service and/or interfaces and can instantiate your component as a normal service over the global service manager.&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
The wizard generates more code for a UNO component, but it depends on the selected UNO IDL types. If only existing types are selected and no new UNO IDL types are defined, the wizard will not generate any UNO IDL files.  For the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;. The content of the uno-extension-manifest.xml depends on the selection or definition of the IDL types. If no new types are defined, no type library is specified. Own IDL types are packed in an additional jar referenced here. Without IDL types, this jar will also not be there.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-typelibrary;type=RDB&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;types.rdb&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestComponent.jar&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-typelibrary;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestComponent_IDL_types.jar&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/MyTestService.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test service definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * MyTestService.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_MyTestService_&lt;br /&gt;
#define _org_openoffice_test_MyTestService_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;XMyTest.idl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    service MyTestService : XMyTest;&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/XMyTest.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test interface definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * XMyTest.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_XMyTest_&lt;br /&gt;
#define _org_openoffice_test_XMyTest_&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/uno/XInterface.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    interface XMyTest {&lt;br /&gt;
&lt;br /&gt;
        string helloWorld([in] string sMessage);&lt;br /&gt;
            raises ( com::sun::star::lang::IllegalArgumentException );&lt;br /&gt;
    };&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/TestComponentImpl.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated code skeleton where all selected services and interface are implemented by defualt plus some UNO component base interfaces, so that the newly generated project can be built and the extension can be deployed directly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package org.openoffice.test;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestComponentImpl extends WeakBase&lt;br /&gt;
   implements com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              org.openoffice.test.XMyTest&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private static final String m_implementationName = TestComponentImpl.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;org.openoffice.test.MyTestService&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    public TestComponentImpl( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory(String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestComponentImpl.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo(XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String sMessage) throws com.sun.star.lang.IllegalArgumentException&lt;br /&gt;
    {&lt;br /&gt;
        // TODO !!!&lt;br /&gt;
        // Exchange the default return implementation.&lt;br /&gt;
        // NOTE: Default initialized polymorphic structs can cause problems&lt;br /&gt;
        // because of missing default initialization of primitive types of&lt;br /&gt;
        // some C++ compilers or different Any initialization in Java and C++&lt;br /&gt;
        // polymorphic structs.&lt;br /&gt;
        return new String();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Result Use Example : OOoBasic Macro Call =&lt;br /&gt;
&lt;br /&gt;
For using the previous skeleton for an OOoBasic service call, we only have to alter the last method helloWorld and redeploy the oxt extension&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String message)&lt;br /&gt;
    {&lt;br /&gt;
        String response = new String();&lt;br /&gt;
        response = &amp;quot;Hello &amp;quot; + message;   &lt;br /&gt;
        return response;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, opening a new OpenOffice.org, your component is available for any macro you may need. It is seen as any legacy service and is manipulated the same way. Even introspection is available, letting you verify that all your properties and methods are available, as the xRay call can show.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
sub TestHelloWorld()&lt;br /&gt;
	&amp;#039; Create the new UNO service&lt;br /&gt;
	myService = createUNOService(&amp;quot;org.openoffice.test.MyTestService&amp;quot;)&lt;br /&gt;
	&amp;#039; The new service with its properties &amp;amp; methods is available&lt;br /&gt;
	msgbox myService.helloWorld (&amp;quot;Laurent&amp;quot;)&lt;br /&gt;
	&amp;#039; It is also available through Xray introspection&lt;br /&gt;
	xRay myService&lt;br /&gt;
end sub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:hello_testing_netbeans.png|center]]&lt;br /&gt;
| [[Image:xray_helloworld_netbeans.png|center]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Time Frame =&lt;br /&gt;
&lt;br /&gt;
Another update of this wizard is due on November 30th.&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* Daniel Bölzle&amp;#039;s tutorial : [[Uno/Cpp/Tutorials/component_tutorial|Writing a simple UNO component]]&lt;br /&gt;
* [[Documentation/DevGuide/WritingUNO/Writing_UNO_Components|Writing UNO Components]] in Developer&amp;#039;s Guide&lt;br /&gt;
* [[Constructing_Components|Constructing Components in C++]]&lt;br /&gt;
* [[Extensions_Packager|Extensions Packager]] (BasicAddonBuilder from [mailto:paolomantovani@openoffice.org Paolo Mantovani])&lt;br /&gt;
* [[BASIC/UNO_Object_Browser|BASIC UNO Object Browser]] : You can see the corresponding code as a complex component.&lt;br /&gt;
* [[API/Samples/Java/Office/MinimalComponent|Minimal Java Component]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Component_Interface.png&amp;diff=95861</id>
		<title>File:Component Interface.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Component_Interface.png&amp;diff=95861"/>
		<updated>2008-10-14T12:31:34Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:Component Interface.png&amp;quot;: version 2.0.0 screenshot bugfix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95860</id>
		<title>General UNO Component Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95860"/>
		<updated>2008-10-14T12:27:38Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Project Wizard */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Component wizard creates a new project based on a J2SE class library project and supports additional targets to create a complete OpenOffice.org extension package and to deploy this package into the configured OpenOffice.org installation.&amp;lt;br&amp;gt;&lt;br /&gt;
The wizard collects all necessary information and allows you to select the existing services and interfaces that should be implemented. In the same wizard step you can also define completely new services and interfaces (and additional data types based on IDL) to design abstract interfaces for completely new functionality.&amp;lt;br&amp;gt;&lt;br /&gt;
After finishing the wizard you can directly build the project and can create and deploy the OpenOffice.org extension package. All interface methods are implemented by default, and do nothing. In a second step you can insert your implementation in the generated skeleton, rebuild the extension and deploy it again to see the effect.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Component&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, implementation class name, an package and the project location &lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Specifiy or define the UNO IDL services and interfaces which should be implemented.&lt;br /&gt;
** To provide an own defined interface, choose the &amp;#039;&amp;#039;&amp;#039;Interface&amp;#039;&amp;#039;&amp;#039; node and click on &amp;#039;&amp;#039;&amp;#039;Define New Data Type&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Interface1.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Create the interface as shown in this picture&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Interface.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Back at the New Project window, select the &amp;#039;&amp;#039;&amp;#039;Service&amp;#039;&amp;#039;&amp;#039; node and click again on &amp;#039;&amp;#039;&amp;#039;Define New Data Type&amp;#039;&amp;#039;&amp;#039;. Create the service as follows:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Service.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Back at the New Project window, click on &amp;#039;&amp;#039;&amp;#039;Add Service/Interface&amp;#039;&amp;#039;&amp;#039;. Select the new created service. The interface will be added automatically:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_TypeBrowser.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** When everything looks like this, click &amp;#039;&amp;#039;&amp;#039;OK&amp;#039;&amp;#039;&amp;#039;:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component3.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&lt;br /&gt;
::&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Deploy and Run Extension in OpenOffice.org&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you have deployed the package, the usage of the new UNO component in OpenOffice.org is straight forward. Either you have implemented a special service provider interface (SPI) and can use it in the same way as any other implementations of this SPI can be used, or you have defined some new service and/or interfaces and can instantiate your component as a normal service over the global service manager.&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
The wizard generates more code for a UNO component, but it depends on the selected UNO IDL types. If only existing types are selected and no new UNO IDL types are defined, the wizard will not generate any UNO IDL files.  For the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;. The content of the uno-extension-manifest.xml depends on the selection or definition of the IDL types. If no new types are defined, no type library is specified.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-typelibrary;type=RDB&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;types.rdb&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestComponent.jar&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/MyTestService.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test service definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * MyTestService.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_MyTestService_&lt;br /&gt;
#define _org_openoffice_test_MyTestService_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;XMyTest.idl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    service MyTestService : XMyTest;&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/XMyTest.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test interface definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * XMyTest.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_XMyTest_&lt;br /&gt;
#define _org_openoffice_test_XMyTest_&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/uno/XInterface.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    interface XMyTest {&lt;br /&gt;
&lt;br /&gt;
        string helloWorld([in] string sMessage);&lt;br /&gt;
            raises ( com::sun::star::lang::IllegalArgumentException );&lt;br /&gt;
    };&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/TestComponentImpl.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated code skeleton where all selected services and interface are implemented by defualt plus some UNO component base interfaces, so that the newly generated project can be built and the extension can be deployed directly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package org.openoffice.test;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestComponentImpl extends WeakBase&lt;br /&gt;
   implements com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              org.openoffice.test.XMyTest&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private static final String m_implementationName = TestComponentImpl.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;org.openoffice.test.MyTestService&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    public TestComponentImpl( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory(String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestComponentImpl.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo(XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String sMessage) throws com.sun.star.lang.IllegalArgumentException&lt;br /&gt;
    {&lt;br /&gt;
        // TODO !!!&lt;br /&gt;
        // Exchange the default return implementation.&lt;br /&gt;
        // NOTE: Default initialized polymorphic structs can cause problems&lt;br /&gt;
        // because of missing default initialization of primitive types of&lt;br /&gt;
        // some C++ compilers or different Any initialization in Java and C++&lt;br /&gt;
        // polymorphic structs.&lt;br /&gt;
        return new String();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Result Use Example : OOoBasic Macro Call =&lt;br /&gt;
&lt;br /&gt;
For using the previous skeleton for an OOoBasic service call, we only have to alter the last method helloWorld and redeploy the oxt extension&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String message)&lt;br /&gt;
    {&lt;br /&gt;
        String response = new String();&lt;br /&gt;
        response = &amp;quot;Hello &amp;quot; + message;   &lt;br /&gt;
        return response;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, opening a new OpenOffice.org, your component is available for any macro you may need. It is seen as any legacy service and is manipulated the same way. Even introspection is available, letting you verify that all your properties and methods are available, as the xRay call can show.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
sub TestHelloWorld()&lt;br /&gt;
	&amp;#039; Create the new UNO service&lt;br /&gt;
	myService = createUNOService(&amp;quot;org.openoffice.test.MyTestService&amp;quot;)&lt;br /&gt;
	&amp;#039; The new service with its properties &amp;amp; methods is available&lt;br /&gt;
	msgbox myService.helloWorld (&amp;quot;Laurent&amp;quot;)&lt;br /&gt;
	&amp;#039; It is also available through Xray introspection&lt;br /&gt;
	xRay myService&lt;br /&gt;
end sub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:hello_testing_netbeans.png|center]]&lt;br /&gt;
| [[Image:xray_helloworld_netbeans.png|center]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Time Frame =&lt;br /&gt;
&lt;br /&gt;
Another update of this wizard is due on November 30th.&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* Daniel Bölzle&amp;#039;s tutorial : [[Uno/Cpp/Tutorials/component_tutorial|Writing a simple UNO component]]&lt;br /&gt;
* [[Documentation/DevGuide/WritingUNO/Writing_UNO_Components|Writing UNO Components]] in Developer&amp;#039;s Guide&lt;br /&gt;
* [[Constructing_Components|Constructing Components in C++]]&lt;br /&gt;
* [[Extensions_Packager|Extensions Packager]] (BasicAddonBuilder from [mailto:paolomantovani@openoffice.org Paolo Mantovani])&lt;br /&gt;
* [[BASIC/UNO_Object_Browser|BASIC UNO Object Browser]] : You can see the corresponding code as a complex component.&lt;br /&gt;
* [[API/Samples/Java/Office/MinimalComponent|Minimal Java Component]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Component_TypeBrowser.png&amp;diff=95859</id>
		<title>File:Component TypeBrowser.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Component_TypeBrowser.png&amp;diff=95859"/>
		<updated>2008-10-14T12:24:39Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:Component TypeBrowser.png&amp;quot;: version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95856</id>
		<title>General UNO Component Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95856"/>
		<updated>2008-10-14T11:57:53Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Project Wizard */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Component wizard creates a new project based on a J2SE class library project and supports additional targets to create a complete OpenOffice.org extension package and to deploy this package into the configured OpenOffice.org installation.&amp;lt;br&amp;gt;&lt;br /&gt;
The wizard collects all necessary information and allows you to select the existing services and interfaces that should be implemented. In the same wizard step you can also define completely new services and interfaces (and additional data types based on IDL) to design abstract interfaces for completely new functionality.&amp;lt;br&amp;gt;&lt;br /&gt;
After finishing the wizard you can directly build the project and can create and deploy the OpenOffice.org extension package. All interface methods are implemented by default, and do nothing. In a second step you can insert your implementation in the generated skeleton, rebuild the extension and deploy it again to see the effect.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Component&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, implementation class name, an package and the project location &lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Specifiy or define the UNO IDL services and interfaces which should be implemented.&lt;br /&gt;
** To provide an own defined interface, choose the &amp;#039;&amp;#039;&amp;#039;Interface&amp;#039;&amp;#039;&amp;#039; node and click on &amp;#039;&amp;#039;&amp;#039;Define New Data Type&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Interface1.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Create the interface as shown in this picture&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Interface.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Back at the New Project window, select the &amp;#039;&amp;#039;&amp;#039;Service&amp;#039;&amp;#039;&amp;#039; node and click again on &amp;#039;&amp;#039;&amp;#039;Define New Data Type&amp;#039;&amp;#039;&amp;#039;. Create the service as follows:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Service.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Back at the New Project window, click on &amp;#039;&amp;#039;&amp;#039;Add Service/Interface&amp;#039;&amp;#039;&amp;#039;. Select the new created service. The interface will be added automatically:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component3.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component_TypeBrowser.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&lt;br /&gt;
::&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Create OXT|Deploy Office Extension&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you have deployed the package, the usage of the new UNO component in OpenOffice.org is straight forward. Either you have implemented a special service provider interface (SPI) and can use it in the same way as any other implementations of this SPI can be used, or you have defined some new service and/or interfaces and can instantiate your component as a normal service over the global service manager.&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
The wizard generates more code for a UNO component, but it depends on the selected UNO IDL types. If only existing types are selected and no new UNO IDL types are defined, the wizard will not generate any UNO IDL files.  For the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;. The content of the uno-extension-manifest.xml depends on the selection or definition of the IDL types. If no new types are defined, no type library is specified.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-typelibrary;type=RDB&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;types.rdb&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestComponent.jar&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/MyTestService.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test service definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * MyTestService.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_MyTestService_&lt;br /&gt;
#define _org_openoffice_test_MyTestService_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;XMyTest.idl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    service MyTestService : XMyTest;&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/XMyTest.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test interface definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * XMyTest.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_XMyTest_&lt;br /&gt;
#define _org_openoffice_test_XMyTest_&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/uno/XInterface.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    interface XMyTest {&lt;br /&gt;
&lt;br /&gt;
        string helloWorld([in] string sMessage);&lt;br /&gt;
            raises ( com::sun::star::lang::IllegalArgumentException );&lt;br /&gt;
    };&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/TestComponentImpl.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated code skeleton where all selected services and interface are implemented by defualt plus some UNO component base interfaces, so that the newly generated project can be built and the extension can be deployed directly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package org.openoffice.test;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestComponentImpl extends WeakBase&lt;br /&gt;
   implements com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              org.openoffice.test.XMyTest&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private static final String m_implementationName = TestComponentImpl.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;org.openoffice.test.MyTestService&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    public TestComponentImpl( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory(String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestComponentImpl.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo(XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String sMessage) throws com.sun.star.lang.IllegalArgumentException&lt;br /&gt;
    {&lt;br /&gt;
        // TODO !!!&lt;br /&gt;
        // Exchange the default return implementation.&lt;br /&gt;
        // NOTE: Default initialized polymorphic structs can cause problems&lt;br /&gt;
        // because of missing default initialization of primitive types of&lt;br /&gt;
        // some C++ compilers or different Any initialization in Java and C++&lt;br /&gt;
        // polymorphic structs.&lt;br /&gt;
        return new String();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Result Use Example : OOoBasic Macro Call =&lt;br /&gt;
&lt;br /&gt;
For using the previous skeleton for an OOoBasic service call, we only have to alter the last method helloWorld and redeploy the oxt extension&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String message)&lt;br /&gt;
    {&lt;br /&gt;
        String response = new String();&lt;br /&gt;
        response = &amp;quot;Hello &amp;quot; + message;   &lt;br /&gt;
        return response;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, opening a new OpenOffice.org, your component is available for any macro you may need. It is seen as any legacy service and is manipulated the same way. Even introspection is available, letting you verify that all your properties and methods are available, as the xRay call can show.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
sub TestHelloWorld()&lt;br /&gt;
	&amp;#039; Create the new UNO service&lt;br /&gt;
	myService = createUNOService(&amp;quot;org.openoffice.test.MyTestService&amp;quot;)&lt;br /&gt;
	&amp;#039; The new service with its properties &amp;amp; methods is available&lt;br /&gt;
	msgbox myService.helloWorld (&amp;quot;Laurent&amp;quot;)&lt;br /&gt;
	&amp;#039; It is also available through Xray introspection&lt;br /&gt;
	xRay myService&lt;br /&gt;
end sub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:hello_testing_netbeans.png|center]]&lt;br /&gt;
| [[Image:xray_helloworld_netbeans.png|center]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Time Frame =&lt;br /&gt;
&lt;br /&gt;
Another update of this wizard is due on November 30th.&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* Daniel Bölzle&amp;#039;s tutorial : [[Uno/Cpp/Tutorials/component_tutorial|Writing a simple UNO component]]&lt;br /&gt;
* [[Documentation/DevGuide/WritingUNO/Writing_UNO_Components|Writing UNO Components]] in Developer&amp;#039;s Guide&lt;br /&gt;
* [[Constructing_Components|Constructing Components in C++]]&lt;br /&gt;
* [[Extensions_Packager|Extensions Packager]] (BasicAddonBuilder from [mailto:paolomantovani@openoffice.org Paolo Mantovani])&lt;br /&gt;
* [[BASIC/UNO_Object_Browser|BASIC UNO Object Browser]] : You can see the corresponding code as a complex component.&lt;br /&gt;
* [[API/Samples/Java/Office/MinimalComponent|Minimal Java Component]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95855</id>
		<title>General UNO Component Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95855"/>
		<updated>2008-10-14T11:57:02Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Project Wizard */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Component wizard creates a new project based on a J2SE class library project and supports additional targets to create a complete OpenOffice.org extension package and to deploy this package into the configured OpenOffice.org installation.&amp;lt;br&amp;gt;&lt;br /&gt;
The wizard collects all necessary information and allows you to select the existing services and interfaces that should be implemented. In the same wizard step you can also define completely new services and interfaces (and additional data types based on IDL) to design abstract interfaces for completely new functionality.&amp;lt;br&amp;gt;&lt;br /&gt;
After finishing the wizard you can directly build the project and can create and deploy the OpenOffice.org extension package. All interface methods are implemented by default, and do nothing. In a second step you can insert your implementation in the generated skeleton, rebuild the extension and deploy it again to see the effect.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Component&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, implementation class name, an package and the project location &lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Specifiy or define the UNO IDL services and interfaces which should be implemented.&lt;br /&gt;
** To provide an own defined interface, choose the &amp;#039;&amp;#039;&amp;#039;Interface&amp;#039;&amp;#039;&amp;#039; node and click on &amp;#039;&amp;#039;&amp;#039;Define New Data Type&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Interface1.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Create the interface as shown in this picture&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Interface.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Back at the New Project window, select the &amp;#039;&amp;#039;&amp;#039;Service&amp;#039;&amp;#039;&amp;#039; node and click again on &amp;#039;&amp;#039;&amp;#039;Define New Data Type&amp;#039;&amp;#039;&amp;#039;. Create the service as follows:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Service.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Back at the New Project window, click on &amp;#039;&amp;#039;&amp;#039;Add Service/Interface&amp;#039;&amp;#039;&amp;#039;. Create the service as follows:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component3.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component_TypeBrowser.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&lt;br /&gt;
::&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Create OXT|Deploy Office Extension&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you have deployed the package, the usage of the new UNO component in OpenOffice.org is straight forward. Either you have implemented a special service provider interface (SPI) and can use it in the same way as any other implementations of this SPI can be used, or you have defined some new service and/or interfaces and can instantiate your component as a normal service over the global service manager.&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
The wizard generates more code for a UNO component, but it depends on the selected UNO IDL types. If only existing types are selected and no new UNO IDL types are defined, the wizard will not generate any UNO IDL files.  For the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;. The content of the uno-extension-manifest.xml depends on the selection or definition of the IDL types. If no new types are defined, no type library is specified.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-typelibrary;type=RDB&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;types.rdb&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestComponent.jar&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/MyTestService.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test service definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * MyTestService.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_MyTestService_&lt;br /&gt;
#define _org_openoffice_test_MyTestService_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;XMyTest.idl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    service MyTestService : XMyTest;&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/XMyTest.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test interface definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * XMyTest.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_XMyTest_&lt;br /&gt;
#define _org_openoffice_test_XMyTest_&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/uno/XInterface.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    interface XMyTest {&lt;br /&gt;
&lt;br /&gt;
        string helloWorld([in] string sMessage);&lt;br /&gt;
            raises ( com::sun::star::lang::IllegalArgumentException );&lt;br /&gt;
    };&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/TestComponentImpl.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated code skeleton where all selected services and interface are implemented by defualt plus some UNO component base interfaces, so that the newly generated project can be built and the extension can be deployed directly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package org.openoffice.test;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestComponentImpl extends WeakBase&lt;br /&gt;
   implements com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              org.openoffice.test.XMyTest&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private static final String m_implementationName = TestComponentImpl.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;org.openoffice.test.MyTestService&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    public TestComponentImpl( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory(String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestComponentImpl.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo(XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String sMessage) throws com.sun.star.lang.IllegalArgumentException&lt;br /&gt;
    {&lt;br /&gt;
        // TODO !!!&lt;br /&gt;
        // Exchange the default return implementation.&lt;br /&gt;
        // NOTE: Default initialized polymorphic structs can cause problems&lt;br /&gt;
        // because of missing default initialization of primitive types of&lt;br /&gt;
        // some C++ compilers or different Any initialization in Java and C++&lt;br /&gt;
        // polymorphic structs.&lt;br /&gt;
        return new String();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Result Use Example : OOoBasic Macro Call =&lt;br /&gt;
&lt;br /&gt;
For using the previous skeleton for an OOoBasic service call, we only have to alter the last method helloWorld and redeploy the oxt extension&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String message)&lt;br /&gt;
    {&lt;br /&gt;
        String response = new String();&lt;br /&gt;
        response = &amp;quot;Hello &amp;quot; + message;   &lt;br /&gt;
        return response;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, opening a new OpenOffice.org, your component is available for any macro you may need. It is seen as any legacy service and is manipulated the same way. Even introspection is available, letting you verify that all your properties and methods are available, as the xRay call can show.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
sub TestHelloWorld()&lt;br /&gt;
	&amp;#039; Create the new UNO service&lt;br /&gt;
	myService = createUNOService(&amp;quot;org.openoffice.test.MyTestService&amp;quot;)&lt;br /&gt;
	&amp;#039; The new service with its properties &amp;amp; methods is available&lt;br /&gt;
	msgbox myService.helloWorld (&amp;quot;Laurent&amp;quot;)&lt;br /&gt;
	&amp;#039; It is also available through Xray introspection&lt;br /&gt;
	xRay myService&lt;br /&gt;
end sub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:hello_testing_netbeans.png|center]]&lt;br /&gt;
| [[Image:xray_helloworld_netbeans.png|center]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Time Frame =&lt;br /&gt;
&lt;br /&gt;
Another update of this wizard is due on November 30th.&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* Daniel Bölzle&amp;#039;s tutorial : [[Uno/Cpp/Tutorials/component_tutorial|Writing a simple UNO component]]&lt;br /&gt;
* [[Documentation/DevGuide/WritingUNO/Writing_UNO_Components|Writing UNO Components]] in Developer&amp;#039;s Guide&lt;br /&gt;
* [[Constructing_Components|Constructing Components in C++]]&lt;br /&gt;
* [[Extensions_Packager|Extensions Packager]] (BasicAddonBuilder from [mailto:paolomantovani@openoffice.org Paolo Mantovani])&lt;br /&gt;
* [[BASIC/UNO_Object_Browser|BASIC UNO Object Browser]] : You can see the corresponding code as a complex component.&lt;br /&gt;
* [[API/Samples/Java/Office/MinimalComponent|Minimal Java Component]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Component_Service.png&amp;diff=95854</id>
		<title>File:Component Service.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Component_Service.png&amp;diff=95854"/>
		<updated>2008-10-14T11:55:08Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:Component Service.png&amp;quot;: version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95853</id>
		<title>General UNO Component Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95853"/>
		<updated>2008-10-14T11:52:39Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Project Wizard */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Component wizard creates a new project based on a J2SE class library project and supports additional targets to create a complete OpenOffice.org extension package and to deploy this package into the configured OpenOffice.org installation.&amp;lt;br&amp;gt;&lt;br /&gt;
The wizard collects all necessary information and allows you to select the existing services and interfaces that should be implemented. In the same wizard step you can also define completely new services and interfaces (and additional data types based on IDL) to design abstract interfaces for completely new functionality.&amp;lt;br&amp;gt;&lt;br /&gt;
After finishing the wizard you can directly build the project and can create and deploy the OpenOffice.org extension package. All interface methods are implemented by default, and do nothing. In a second step you can insert your implementation in the generated skeleton, rebuild the extension and deploy it again to see the effect.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Component&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, implementation class name, an package and the project location &lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Specifiy or define the UNO IDL services and interfaces which should be implemented.&lt;br /&gt;
** To provide an own defined interface, choose the &amp;#039;&amp;#039;&amp;#039;Interface&amp;#039;&amp;#039;&amp;#039; node and click on &amp;#039;&amp;#039;&amp;#039;Define New Data Type&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Interface1.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Create the interface as shown in this picture&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Interface.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
** Back at the New Project window, select the &amp;#039;&amp;#039;&amp;#039;Service&amp;#039;&amp;#039;&amp;#039; node and click again on &amp;#039;&amp;#039;&amp;#039;Define New Data Type&amp;#039;&amp;#039;&amp;#039;. Create the service as follows:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[Image:Component_Service.png|center]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component3.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component_TypeBrowser.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&lt;br /&gt;
::&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Create OXT|Deploy Office Extension&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you have deployed the package, the usage of the new UNO component in OpenOffice.org is straight forward. Either you have implemented a special service provider interface (SPI) and can use it in the same way as any other implementations of this SPI can be used, or you have defined some new service and/or interfaces and can instantiate your component as a normal service over the global service manager.&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
The wizard generates more code for a UNO component, but it depends on the selected UNO IDL types. If only existing types are selected and no new UNO IDL types are defined, the wizard will not generate any UNO IDL files.  For the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;. The content of the uno-extension-manifest.xml depends on the selection or definition of the IDL types. If no new types are defined, no type library is specified.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-typelibrary;type=RDB&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;types.rdb&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestComponent.jar&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/MyTestService.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test service definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * MyTestService.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_MyTestService_&lt;br /&gt;
#define _org_openoffice_test_MyTestService_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;XMyTest.idl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    service MyTestService : XMyTest;&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/XMyTest.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test interface definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * XMyTest.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_XMyTest_&lt;br /&gt;
#define _org_openoffice_test_XMyTest_&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/uno/XInterface.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    interface XMyTest {&lt;br /&gt;
&lt;br /&gt;
        string helloWorld([in] string sMessage);&lt;br /&gt;
            raises ( com::sun::star::lang::IllegalArgumentException );&lt;br /&gt;
    };&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/TestComponentImpl.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated code skeleton where all selected services and interface are implemented by defualt plus some UNO component base interfaces, so that the newly generated project can be built and the extension can be deployed directly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package org.openoffice.test;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestComponentImpl extends WeakBase&lt;br /&gt;
   implements com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              org.openoffice.test.XMyTest&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private static final String m_implementationName = TestComponentImpl.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;org.openoffice.test.MyTestService&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    public TestComponentImpl( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory(String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestComponentImpl.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo(XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String sMessage) throws com.sun.star.lang.IllegalArgumentException&lt;br /&gt;
    {&lt;br /&gt;
        // TODO !!!&lt;br /&gt;
        // Exchange the default return implementation.&lt;br /&gt;
        // NOTE: Default initialized polymorphic structs can cause problems&lt;br /&gt;
        // because of missing default initialization of primitive types of&lt;br /&gt;
        // some C++ compilers or different Any initialization in Java and C++&lt;br /&gt;
        // polymorphic structs.&lt;br /&gt;
        return new String();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Result Use Example : OOoBasic Macro Call =&lt;br /&gt;
&lt;br /&gt;
For using the previous skeleton for an OOoBasic service call, we only have to alter the last method helloWorld and redeploy the oxt extension&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String message)&lt;br /&gt;
    {&lt;br /&gt;
        String response = new String();&lt;br /&gt;
        response = &amp;quot;Hello &amp;quot; + message;   &lt;br /&gt;
        return response;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, opening a new OpenOffice.org, your component is available for any macro you may need. It is seen as any legacy service and is manipulated the same way. Even introspection is available, letting you verify that all your properties and methods are available, as the xRay call can show.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
sub TestHelloWorld()&lt;br /&gt;
	&amp;#039; Create the new UNO service&lt;br /&gt;
	myService = createUNOService(&amp;quot;org.openoffice.test.MyTestService&amp;quot;)&lt;br /&gt;
	&amp;#039; The new service with its properties &amp;amp; methods is available&lt;br /&gt;
	msgbox myService.helloWorld (&amp;quot;Laurent&amp;quot;)&lt;br /&gt;
	&amp;#039; It is also available through Xray introspection&lt;br /&gt;
	xRay myService&lt;br /&gt;
end sub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:hello_testing_netbeans.png|center]]&lt;br /&gt;
| [[Image:xray_helloworld_netbeans.png|center]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Time Frame =&lt;br /&gt;
&lt;br /&gt;
Another update of this wizard is due on November 30th.&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* Daniel Bölzle&amp;#039;s tutorial : [[Uno/Cpp/Tutorials/component_tutorial|Writing a simple UNO component]]&lt;br /&gt;
* [[Documentation/DevGuide/WritingUNO/Writing_UNO_Components|Writing UNO Components]] in Developer&amp;#039;s Guide&lt;br /&gt;
* [[Constructing_Components|Constructing Components in C++]]&lt;br /&gt;
* [[Extensions_Packager|Extensions Packager]] (BasicAddonBuilder from [mailto:paolomantovani@openoffice.org Paolo Mantovani])&lt;br /&gt;
* [[BASIC/UNO_Object_Browser|BASIC UNO Object Browser]] : You can see the corresponding code as a complex component.&lt;br /&gt;
* [[API/Samples/Java/Office/MinimalComponent|Minimal Java Component]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95852</id>
		<title>General UNO Component Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95852"/>
		<updated>2008-10-14T11:51:09Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Project Wizard */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Component wizard creates a new project based on a J2SE class library project and supports additional targets to create a complete OpenOffice.org extension package and to deploy this package into the configured OpenOffice.org installation.&amp;lt;br&amp;gt;&lt;br /&gt;
The wizard collects all necessary information and allows you to select the existing services and interfaces that should be implemented. In the same wizard step you can also define completely new services and interfaces (and additional data types based on IDL) to design abstract interfaces for completely new functionality.&amp;lt;br&amp;gt;&lt;br /&gt;
After finishing the wizard you can directly build the project and can create and deploy the OpenOffice.org extension package. All interface methods are implemented by default, and do nothing. In a second step you can insert your implementation in the generated skeleton, rebuild the extension and deploy it again to see the effect.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Component&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, implementation class name, an package and the project location &lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Specifiy or define the UNO IDL services and interfaces which should be implemented.&lt;br /&gt;
** To provide an own defined interface, choose the Interface node and click on &amp;#039;&amp;#039;&amp;#039;Define New Data Type&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;[[Image:Component_Interface1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
** Create the interface as shown in this picture&amp;lt;br&amp;gt;[[Image:Component_Interface.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
** Back at the New Project window, select the &amp;amp;quot;Service&amp;amp;quot; node and click again on &amp;#039;&amp;#039;&amp;#039;Define New Data Type&amp;#039;&amp;#039;&amp;#039;. Create the service as follows:&amp;lt;br&amp;gt;[[Image:Component_Service.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component3.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component_TypeBrowser.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&lt;br /&gt;
::&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Create OXT|Deploy Office Extension&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you have deployed the package, the usage of the new UNO component in OpenOffice.org is straight forward. Either you have implemented a special service provider interface (SPI) and can use it in the same way as any other implementations of this SPI can be used, or you have defined some new service and/or interfaces and can instantiate your component as a normal service over the global service manager.&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
The wizard generates more code for a UNO component, but it depends on the selected UNO IDL types. If only existing types are selected and no new UNO IDL types are defined, the wizard will not generate any UNO IDL files.  For the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;. The content of the uno-extension-manifest.xml depends on the selection or definition of the IDL types. If no new types are defined, no type library is specified.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-typelibrary;type=RDB&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;types.rdb&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestComponent.jar&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/MyTestService.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test service definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * MyTestService.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_MyTestService_&lt;br /&gt;
#define _org_openoffice_test_MyTestService_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;XMyTest.idl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    service MyTestService : XMyTest;&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/XMyTest.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test interface definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * XMyTest.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_XMyTest_&lt;br /&gt;
#define _org_openoffice_test_XMyTest_&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/uno/XInterface.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    interface XMyTest {&lt;br /&gt;
&lt;br /&gt;
        string helloWorld([in] string sMessage);&lt;br /&gt;
            raises ( com::sun::star::lang::IllegalArgumentException );&lt;br /&gt;
    };&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/TestComponentImpl.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated code skeleton where all selected services and interface are implemented by defualt plus some UNO component base interfaces, so that the newly generated project can be built and the extension can be deployed directly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package org.openoffice.test;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestComponentImpl extends WeakBase&lt;br /&gt;
   implements com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              org.openoffice.test.XMyTest&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private static final String m_implementationName = TestComponentImpl.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;org.openoffice.test.MyTestService&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    public TestComponentImpl( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory(String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestComponentImpl.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo(XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String sMessage) throws com.sun.star.lang.IllegalArgumentException&lt;br /&gt;
    {&lt;br /&gt;
        // TODO !!!&lt;br /&gt;
        // Exchange the default return implementation.&lt;br /&gt;
        // NOTE: Default initialized polymorphic structs can cause problems&lt;br /&gt;
        // because of missing default initialization of primitive types of&lt;br /&gt;
        // some C++ compilers or different Any initialization in Java and C++&lt;br /&gt;
        // polymorphic structs.&lt;br /&gt;
        return new String();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Result Use Example : OOoBasic Macro Call =&lt;br /&gt;
&lt;br /&gt;
For using the previous skeleton for an OOoBasic service call, we only have to alter the last method helloWorld and redeploy the oxt extension&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String message)&lt;br /&gt;
    {&lt;br /&gt;
        String response = new String();&lt;br /&gt;
        response = &amp;quot;Hello &amp;quot; + message;   &lt;br /&gt;
        return response;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, opening a new OpenOffice.org, your component is available for any macro you may need. It is seen as any legacy service and is manipulated the same way. Even introspection is available, letting you verify that all your properties and methods are available, as the xRay call can show.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
sub TestHelloWorld()&lt;br /&gt;
	&amp;#039; Create the new UNO service&lt;br /&gt;
	myService = createUNOService(&amp;quot;org.openoffice.test.MyTestService&amp;quot;)&lt;br /&gt;
	&amp;#039; The new service with its properties &amp;amp; methods is available&lt;br /&gt;
	msgbox myService.helloWorld (&amp;quot;Laurent&amp;quot;)&lt;br /&gt;
	&amp;#039; It is also available through Xray introspection&lt;br /&gt;
	xRay myService&lt;br /&gt;
end sub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:hello_testing_netbeans.png|center]]&lt;br /&gt;
| [[Image:xray_helloworld_netbeans.png|center]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Time Frame =&lt;br /&gt;
&lt;br /&gt;
Another update of this wizard is due on November 30th.&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* Daniel Bölzle&amp;#039;s tutorial : [[Uno/Cpp/Tutorials/component_tutorial|Writing a simple UNO component]]&lt;br /&gt;
* [[Documentation/DevGuide/WritingUNO/Writing_UNO_Components|Writing UNO Components]] in Developer&amp;#039;s Guide&lt;br /&gt;
* [[Constructing_Components|Constructing Components in C++]]&lt;br /&gt;
* [[Extensions_Packager|Extensions Packager]] (BasicAddonBuilder from [mailto:paolomantovani@openoffice.org Paolo Mantovani])&lt;br /&gt;
* [[BASIC/UNO_Object_Browser|BASIC UNO Object Browser]] : You can see the corresponding code as a complex component.&lt;br /&gt;
* [[API/Samples/Java/Office/MinimalComponent|Minimal Java Component]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95851</id>
		<title>General UNO Component Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95851"/>
		<updated>2008-10-14T11:44:36Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Project Wizard */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Component wizard creates a new project based on a J2SE class library project and supports additional targets to create a complete OpenOffice.org extension package and to deploy this package into the configured OpenOffice.org installation.&amp;lt;br&amp;gt;&lt;br /&gt;
The wizard collects all necessary information and allows you to select the existing services and interfaces that should be implemented. In the same wizard step you can also define completely new services and interfaces (and additional data types based on IDL) to design abstract interfaces for completely new functionality.&amp;lt;br&amp;gt;&lt;br /&gt;
After finishing the wizard you can directly build the project and can create and deploy the OpenOffice.org extension package. All interface methods are implemented by default, and do nothing. In a second step you can insert your implementation in the generated skeleton, rebuild the extension and deploy it again to see the effect.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Component&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, implementation class name, an package and the project location &lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Specifiy or define the UNO IDL services and interfaces which should be implemented.&lt;br /&gt;
** To provide an own defined interface, choose the Interface node and click on &amp;#039;&amp;#039;&amp;#039;Define New Data Type&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component_Interface1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
** Create the interface as shown in this picture&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component_Interface.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component3.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component_TypeBrowser.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component_Service.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&lt;br /&gt;
::&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Create OXT|Deploy Office Extension&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you have deployed the package, the usage of the new UNO component in OpenOffice.org is straight forward. Either you have implemented a special service provider interface (SPI) and can use it in the same way as any other implementations of this SPI can be used, or you have defined some new service and/or interfaces and can instantiate your component as a normal service over the global service manager.&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
The wizard generates more code for a UNO component, but it depends on the selected UNO IDL types. If only existing types are selected and no new UNO IDL types are defined, the wizard will not generate any UNO IDL files.  For the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;. The content of the uno-extension-manifest.xml depends on the selection or definition of the IDL types. If no new types are defined, no type library is specified.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-typelibrary;type=RDB&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;types.rdb&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestComponent.jar&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/MyTestService.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test service definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * MyTestService.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_MyTestService_&lt;br /&gt;
#define _org_openoffice_test_MyTestService_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;XMyTest.idl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    service MyTestService : XMyTest;&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/XMyTest.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test interface definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * XMyTest.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_XMyTest_&lt;br /&gt;
#define _org_openoffice_test_XMyTest_&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/uno/XInterface.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    interface XMyTest {&lt;br /&gt;
&lt;br /&gt;
        string helloWorld([in] string sMessage);&lt;br /&gt;
            raises ( com::sun::star::lang::IllegalArgumentException );&lt;br /&gt;
    };&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/TestComponentImpl.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated code skeleton where all selected services and interface are implemented by defualt plus some UNO component base interfaces, so that the newly generated project can be built and the extension can be deployed directly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package org.openoffice.test;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestComponentImpl extends WeakBase&lt;br /&gt;
   implements com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              org.openoffice.test.XMyTest&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private static final String m_implementationName = TestComponentImpl.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;org.openoffice.test.MyTestService&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    public TestComponentImpl( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory(String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestComponentImpl.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo(XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String sMessage) throws com.sun.star.lang.IllegalArgumentException&lt;br /&gt;
    {&lt;br /&gt;
        // TODO !!!&lt;br /&gt;
        // Exchange the default return implementation.&lt;br /&gt;
        // NOTE: Default initialized polymorphic structs can cause problems&lt;br /&gt;
        // because of missing default initialization of primitive types of&lt;br /&gt;
        // some C++ compilers or different Any initialization in Java and C++&lt;br /&gt;
        // polymorphic structs.&lt;br /&gt;
        return new String();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Result Use Example : OOoBasic Macro Call =&lt;br /&gt;
&lt;br /&gt;
For using the previous skeleton for an OOoBasic service call, we only have to alter the last method helloWorld and redeploy the oxt extension&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String message)&lt;br /&gt;
    {&lt;br /&gt;
        String response = new String();&lt;br /&gt;
        response = &amp;quot;Hello &amp;quot; + message;   &lt;br /&gt;
        return response;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, opening a new OpenOffice.org, your component is available for any macro you may need. It is seen as any legacy service and is manipulated the same way. Even introspection is available, letting you verify that all your properties and methods are available, as the xRay call can show.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
sub TestHelloWorld()&lt;br /&gt;
	&amp;#039; Create the new UNO service&lt;br /&gt;
	myService = createUNOService(&amp;quot;org.openoffice.test.MyTestService&amp;quot;)&lt;br /&gt;
	&amp;#039; The new service with its properties &amp;amp; methods is available&lt;br /&gt;
	msgbox myService.helloWorld (&amp;quot;Laurent&amp;quot;)&lt;br /&gt;
	&amp;#039; It is also available through Xray introspection&lt;br /&gt;
	xRay myService&lt;br /&gt;
end sub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:hello_testing_netbeans.png|center]]&lt;br /&gt;
| [[Image:xray_helloworld_netbeans.png|center]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Time Frame =&lt;br /&gt;
&lt;br /&gt;
Another update of this wizard is due on November 30th.&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* Daniel Bölzle&amp;#039;s tutorial : [[Uno/Cpp/Tutorials/component_tutorial|Writing a simple UNO component]]&lt;br /&gt;
* [[Documentation/DevGuide/WritingUNO/Writing_UNO_Components|Writing UNO Components]] in Developer&amp;#039;s Guide&lt;br /&gt;
* [[Constructing_Components|Constructing Components in C++]]&lt;br /&gt;
* [[Extensions_Packager|Extensions Packager]] (BasicAddonBuilder from [mailto:paolomantovani@openoffice.org Paolo Mantovani])&lt;br /&gt;
* [[BASIC/UNO_Object_Browser|BASIC UNO Object Browser]] : You can see the corresponding code as a complex component.&lt;br /&gt;
* [[API/Samples/Java/Office/MinimalComponent|Minimal Java Component]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Component_Interface.png&amp;diff=95850</id>
		<title>File:Component Interface.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Component_Interface.png&amp;diff=95850"/>
		<updated>2008-10-14T11:44:01Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:Component Interface.png&amp;quot;: version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Component_Interface1.png&amp;diff=95844</id>
		<title>File:Component Interface1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Component_Interface1.png&amp;diff=95844"/>
		<updated>2008-10-14T11:15:55Z</updated>

		<summary type="html">&lt;p&gt;Sg: version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;version 2.0.0&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Component3.png&amp;diff=95840</id>
		<title>File:Component3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Component3.png&amp;diff=95840"/>
		<updated>2008-10-14T11:11:18Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:Component3.png&amp;quot;: version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Component2.png&amp;diff=95838</id>
		<title>File:Component2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Component2.png&amp;diff=95838"/>
		<updated>2008-10-14T11:08:11Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:Component2.png&amp;quot;: version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95836</id>
		<title>General UNO Component Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=General_UNO_Component_Project_Type&amp;diff=95836"/>
		<updated>2008-10-14T11:06:37Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Project Wizard */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Component wizard creates a new project based on a J2SE class library project and supports additional targets to create a complete OpenOffice.org extension package and to deploy this package into the configured OpenOffice.org installation.&amp;lt;br&amp;gt;&lt;br /&gt;
The wizard collects all necessary information and allows you to select the existing services and interfaces that should be implemented. In the same wizard step you can also define completely new services and interfaces (and additional data types based on IDL) to design abstract interfaces for completely new functionality.&amp;lt;br&amp;gt;&lt;br /&gt;
After finishing the wizard you can directly build the project and can create and deploy the OpenOffice.org extension package. All interface methods are implemented by default, and do nothing. In a second step you can insert your implementation in the generated skeleton, rebuild the extension and deploy it again to see the effect.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Component&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, implementation class name, an package and the project location &lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Specifiy or define the UNO IDL services and interfaces which should be implemented&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component3.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component_TypeBrowser.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component_Service.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Component_Interface.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&lt;br /&gt;
::&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Create OXT|Deploy Office Extension&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you have deployed the package, the usage of the new UNO component in OpenOffice.org is straight forward. Either you have implemented a special service provider interface (SPI) and can use it in the same way as any other implementations of this SPI can be used, or you have defined some new service and/or interfaces and can instantiate your component as a normal service over the global service manager.&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
The wizard generates more code for a UNO component, but it depends on the selected UNO IDL types. If only existing types are selected and no new UNO IDL types are defined, the wizard will not generate any UNO IDL files.  For the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;. The content of the uno-extension-manifest.xml depends on the selection or definition of the IDL types. If no new types are defined, no type library is specified.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-typelibrary;type=RDB&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;types.rdb&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestComponent.jar&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/MyTestService.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test service definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * MyTestService.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_MyTestService_&lt;br /&gt;
#define _org_openoffice_test_MyTestService_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;XMyTest.idl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    service MyTestService : XMyTest;&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/XMyTest.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the test interface definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * XMyTest.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 11.09.2006 - 17:42:17&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_test_XMyTest_&lt;br /&gt;
#define _org_openoffice_test_XMyTest_&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/uno/XInterface.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module test {&lt;br /&gt;
    interface XMyTest {&lt;br /&gt;
&lt;br /&gt;
        string helloWorld([in] string sMessage);&lt;br /&gt;
            raises ( com::sun::star::lang::IllegalArgumentException );&lt;br /&gt;
    };&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/openoffice/test/TestComponentImpl.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated code skeleton where all selected services and interface are implemented by defualt plus some UNO component base interfaces, so that the newly generated project can be built and the extension can be deployed directly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package org.openoffice.test;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestComponentImpl extends WeakBase&lt;br /&gt;
   implements com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              org.openoffice.test.XMyTest&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private static final String m_implementationName = TestComponentImpl.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;org.openoffice.test.MyTestService&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    public TestComponentImpl( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory(String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestComponentImpl.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo(XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String sMessage) throws com.sun.star.lang.IllegalArgumentException&lt;br /&gt;
    {&lt;br /&gt;
        // TODO !!!&lt;br /&gt;
        // Exchange the default return implementation.&lt;br /&gt;
        // NOTE: Default initialized polymorphic structs can cause problems&lt;br /&gt;
        // because of missing default initialization of primitive types of&lt;br /&gt;
        // some C++ compilers or different Any initialization in Java and C++&lt;br /&gt;
        // polymorphic structs.&lt;br /&gt;
        return new String();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Result Use Example : OOoBasic Macro Call =&lt;br /&gt;
&lt;br /&gt;
For using the previous skeleton for an OOoBasic service call, we only have to alter the last method helloWorld and redeploy the oxt extension&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
    // org.openoffice.test.XMyTest:&lt;br /&gt;
    public String helloWorld(String message)&lt;br /&gt;
    {&lt;br /&gt;
        String response = new String();&lt;br /&gt;
        response = &amp;quot;Hello &amp;quot; + message;   &lt;br /&gt;
        return response;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, opening a new OpenOffice.org, your component is available for any macro you may need. It is seen as any legacy service and is manipulated the same way. Even introspection is available, letting you verify that all your properties and methods are available, as the xRay call can show.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
sub TestHelloWorld()&lt;br /&gt;
	&amp;#039; Create the new UNO service&lt;br /&gt;
	myService = createUNOService(&amp;quot;org.openoffice.test.MyTestService&amp;quot;)&lt;br /&gt;
	&amp;#039; The new service with its properties &amp;amp; methods is available&lt;br /&gt;
	msgbox myService.helloWorld (&amp;quot;Laurent&amp;quot;)&lt;br /&gt;
	&amp;#039; It is also available through Xray introspection&lt;br /&gt;
	xRay myService&lt;br /&gt;
end sub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:hello_testing_netbeans.png|center]]&lt;br /&gt;
| [[Image:xray_helloworld_netbeans.png|center]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Time Frame =&lt;br /&gt;
&lt;br /&gt;
Another update of this wizard is due on November 30th.&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* Daniel Bölzle&amp;#039;s tutorial : [[Uno/Cpp/Tutorials/component_tutorial|Writing a simple UNO component]]&lt;br /&gt;
* [[Documentation/DevGuide/WritingUNO/Writing_UNO_Components|Writing UNO Components]] in Developer&amp;#039;s Guide&lt;br /&gt;
* [[Constructing_Components|Constructing Components in C++]]&lt;br /&gt;
* [[Extensions_Packager|Extensions Packager]] (BasicAddonBuilder from [mailto:paolomantovani@openoffice.org Paolo Mantovani])&lt;br /&gt;
* [[BASIC/UNO_Object_Browser|BASIC UNO Object Browser]] : You can see the corresponding code as a complex component.&lt;br /&gt;
* [[API/Samples/Java/Office/MinimalComponent|Minimal Java Component]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Component1.png&amp;diff=95834</id>
		<title>File:Component1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Component1.png&amp;diff=95834"/>
		<updated>2008-10-14T11:06:15Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:Component1.png&amp;quot;: version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Add-In/Project_Type&amp;diff=95833</id>
		<title>Calc/Add-In/Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Add-In/Project_Type&amp;diff=95833"/>
		<updated>2008-10-14T11:02:13Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Generated Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Calc Add-In wizard creates a new project based on a J2SE class library project. It supports additional targets to create a complete OpenOffice.org extension package and to deploy this package into the configured OpenOffice.org installation.&amp;lt;br&amp;gt;&lt;br /&gt;
The wizard collects all necessary information and allows you to define new built-in Calc functions.  The new Calc functions can be used directly in Calc after you deploy the extension and restart OpenOffice.org.&amp;lt;br&amp;gt;&lt;br /&gt;
After finishing the wizard you can build the project, and create and deploy the OpenOffice.org extension package. The built-in functions you just created are implemented, but do nothing yet. In a second step you can insert your implementation in the generated skeleton (searching for the add-in function body), rebuild the extension and deploy it again to see the effect in your OpenOffice.org installation.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard  is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Calc Add-In&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, Add-In name, an optional package and the project location &lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
Since OpenOffice.org 2.0.4 the spreadsheet application takes care of a new configuration schema for Calc Add-In functions. An appropriate xcu file is generated as well and becomes part of the final &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; package.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Define the new Add-In functions&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn3.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
On this panel you can define new Calc Add-In methods on a higher abstraction level, you do not have to deal with UNO IDL or xcu files directly. You can modify the default method, and insert localized descriptions and display names ... For more detailed descriptions of the different fields simply press the help button or read the appropriate chapter in the [http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Spreadsheet_Add-Ins Developer&amp;#039;s Guide - Spreadsheet - Add-Ins]&amp;lt;br&amp;gt;&lt;br /&gt;
Add a new function will always add the new function on top of the list. Add parameter will add the parameter as the first parameter when the function node is selected, or will append the parameter behind the currently selected parameter. When you add a new language you can choose from a list of supported languages which are not added. When you delete a language, you can only remove languages that have been added.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn3a.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn3b.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 5&amp;#039;&amp;#039;&amp;#039;: Deploy the extension package&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn4.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&lt;br /&gt;
::&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Deploy and Run Extension in OpenOffice.org&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use the Calc Add-In function(s) after you have deployed them, open a new spreadsheet document -&amp;gt; open the built-in function dialog -&amp;gt; select the “Add-In” category -&amp;gt; search for a new Add-In function (uppercase notation) -&amp;gt; click next -&amp;gt; enter parameters ... -&amp;gt; ok&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn5.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn6.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
The Calc Add-In wizard generates more code than can be shown here. A new config (.xcu) file for the Add-In is generated.  The config file describes the Add-In functions with descriptions, displaynames etc. The new configuration allows you to support localization of the description and display names. The underlying schema comes with OpenOffice.org 2.0.4 and will be part of the backward compatible Add-In extension packages. In the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CalcAddIn.xcu&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the mentioned new configuration file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;#039;1.0&amp;#039; encoding=&amp;#039;UTF-8&amp;#039;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;oor:component-data xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot;&lt;br /&gt;
  xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; oor:name=&amp;quot;CalcAddIns&amp;quot;&lt;br /&gt;
  oor:package=&amp;quot;org.openoffice.Office&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;AddInInfo&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;org.openoffice.addin.TestAddin&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;AddInFunctions&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;redouble&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;DisplayName&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;redouble&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;verdoppeln&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;Description&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;simply returns the redoubled input parameter&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;liefert einfach den verdoppleten Wert des Eingabeparameters&lt;br /&gt;
                     zurÃ¼ck&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;Category&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value&amp;gt;Add-In&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;CompatibilityName&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value/&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;Parameters&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;node oor:name=&amp;quot;nValue&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;DisplayName&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;nValue&amp;lt;/value&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;nWert&amp;lt;/value&amp;gt;&lt;br /&gt;
              &amp;lt;/prop&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;Description&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;the input value&amp;lt;/value&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;der Eingabewert&amp;lt;/value&amp;gt;&lt;br /&gt;
              &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;/node&amp;gt;&lt;br /&gt;
          &amp;lt;/node&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/oor:component-data&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;, notice that a jar containing the compiled idl types is additionally created and referenced here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.configuration-data&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;CalcAddins.xcu&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-typelibrary;type=RDB&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;types.rdb&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestAddin.jar&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-typelibrary;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestAddIn_IDL_types.jar&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/test/addin/XTestAddIn.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the Add-In interface describing the new Add-In functions&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * XTestAddin.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 05.09.2006 - 16:25:54&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_addin_XTestAddin_&lt;br /&gt;
#define _org_openoffice_addin_XTestAddin_&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/lang/XLocalizable.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/uno/XInterface.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module addin {&lt;br /&gt;
    interface XTestAddin {&lt;br /&gt;
        /// used to set an add-in locale for formatting reasons for example&lt;br /&gt;
        [optional] interface ::com::sun::star::lang::XLocalizable;&lt;br /&gt;
&lt;br /&gt;
        long redouble([in] long nValue);&lt;br /&gt;
    };&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/test/addin/TestAddIn.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the appropriate Add-In service definition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * TestAddin.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 05.09.2006 - 16:25:54&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_addin_TestAddin_&lt;br /&gt;
#define _org_openoffice_addin_TestAddin_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;XTestAddin.idl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module addin {&lt;br /&gt;
    service TestAddin : XTestAddin;&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/test/addin/TestAddinImpl.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated Add-In code skeleton where only the Add-In functions have to be implemented. Everything else is already implemented and even the Add-In functions are implemented by default, so that the new generated project can be built and the extension can be deployed directly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package org.openoffice.addin;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestAddinImpl extends WeakBase&lt;br /&gt;
   implements org.openoffice.addin.XTestAddin,&lt;br /&gt;
              com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              com.sun.star.lang.XLocalizable&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private static final String m_implementationName = TestAddinImpl.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;org.openoffice.addin.TestAddin&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
    private com.sun.star.lang.Locale m_locale = new com.sun.star.lang.Locale();&lt;br /&gt;
&lt;br /&gt;
    public TestAddinImpl( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory(String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestAddinImpl.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo(XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // org.openoffice.addin.XTestAddin:&lt;br /&gt;
    public int redouble(int nValue)&lt;br /&gt;
    {&lt;br /&gt;
        // TODO !!!&lt;br /&gt;
        // Exchange the default return implementation.&lt;br /&gt;
        // NOTE: Default initialized polymorphic structs can cause problems&lt;br /&gt;
        // because of missing default initialization of primitive types of&lt;br /&gt;
        // some C++ compilers or different Any initialization in Java and C++&lt;br /&gt;
        // polymorphic structs.&lt;br /&gt;
        return 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XLocalizable:&lt;br /&gt;
    public void setLocale(com.sun.star.lang.Locale eLocale)&lt;br /&gt;
    {&lt;br /&gt;
        m_locale = eLocale;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public com.sun.star.lang.Locale getLocale()&lt;br /&gt;
    {&lt;br /&gt;
        return m_locale;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Calc|Add-In/Project Type]]&lt;br /&gt;
[[Category:Add-In|Calc/Project Type]]&lt;br /&gt;
[[Category:Development|Calc/Add-In/Project Type]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=OpenOffice_Simple_UNO_Client_Application_Project_Type&amp;diff=95831</id>
		<title>OpenOffice Simple UNO Client Application Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=OpenOffice_Simple_UNO_Client_Application_Project_Type&amp;diff=95831"/>
		<updated>2008-10-14T10:53:52Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Generated Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Client Application wizard creates a new J2SE project with OpenOffice.org API support.  This means the OpenOffice.org library is added to the project to provide code completion and context sensitive help for the OpenOffice.org API. The generated main function contains some code to bootstrap an UNO environment and returns the remote OpenOffice.org context object of the default OpenOffice.org installation on the system. This works only if a default installation of OpenOffice.org was made and the soffice binary in the &amp;lt;office&amp;gt;/program directory is in the path (at least reachable over a symbolic link). There are some fallback strategies possible which are not further discussed here.&amp;lt;br&amp;gt;&lt;br /&gt;
The project builds a customized jar file containing special UNO bootstrap classes from the OpenOffice.org SDK  and special manifest entries to support the simple UNO bootstrap feature. The UNO bootstrap feature enables the application jar to run without any further environment preparation and has full access to the OpenOffice.org API to control and automate the OpenOffice.org process.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard is quite simple to use. Choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Client Application&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Simple_Client1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project, class name, an optional package and the project location&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Simple_Client2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
The generated code looks like &lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * TestClient.java&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 10.06.2006 - 17:45:42&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
package org.test;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.comp.helper.Bootstrap;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 *&lt;br /&gt;
 * @author XXXXX&lt;br /&gt;
 */&lt;br /&gt;
public class TestClient {&lt;br /&gt;
    &lt;br /&gt;
    /** Creates a new instance of TestClient */&lt;br /&gt;
    public TestClient() {&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * @param args the command line arguments&lt;br /&gt;
     */&lt;br /&gt;
    public static void main(String[] args) {&lt;br /&gt;
        try {&lt;br /&gt;
            // get the remote office component context&lt;br /&gt;
            XComponentContext xContext = Bootstrap.bootstrap();&lt;br /&gt;
            if (xContext == null) {&lt;br /&gt;
                System.err.println(&amp;quot;ERROR: Could not bootstrap default Office.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        catch (java.lang.Exception e){&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        finally {&lt;br /&gt;
            System.exit( 0 );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Line 29 contains the UNO bootstrap call which returns the remote office context object. The remote context is main entry point to work with the OpenOffice.org API. The code is quite simple and should only show the first step. The generated project is buildable, runnable and can be started or debugged directly from within NetBeans as a normal J2SE application.&lt;br /&gt;
&lt;br /&gt;
== Manifest Entries for the UNO Bootstrap Mechanism ==&lt;br /&gt;
The manifest needs some special entries to support the simple UNO bootstrap feature:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Main-Class: com.sun.star.lib.loader.Loader&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Name: com/sun/star/lib/loader/Loader.class&amp;lt;br&amp;gt;&lt;br /&gt;
Application-Class: org.test.TestClient&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
where &amp;#039;&amp;#039;org.test.TestClient&amp;#039;&amp;#039; is the original main class.&lt;br /&gt;
&lt;br /&gt;
== Bundled UNO Bootstrap Glue Code ==&lt;br /&gt;
The following precompiled class files and the dll from the SDK are bundled with the client application jar.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/Loader$CustomURLClassLoader.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/Loader.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/InstallationFinder$StreamGobbler.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/InstallationFinder.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/WinRegKey.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/WinRegKeyException.class&amp;lt;br&amp;gt;&lt;br /&gt;
win/unowinreg.dll&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
The &amp;#039;&amp;#039;unowinreg.dll&amp;#039;&amp;#039; is included so that the client application can be platform independent.  It is used to find the default OpenOffice.org installation on Windows.&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* [[JavaEclipseTuto|Java Eclipse Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Add-In/Project_Type&amp;diff=95830</id>
		<title>Calc/Add-In/Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Add-In/Project_Type&amp;diff=95830"/>
		<updated>2008-10-14T10:51:49Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Generated Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Calc Add-In wizard creates a new project based on a J2SE class library project. It supports additional targets to create a complete OpenOffice.org extension package and to deploy this package into the configured OpenOffice.org installation.&amp;lt;br&amp;gt;&lt;br /&gt;
The wizard collects all necessary information and allows you to define new built-in Calc functions.  The new Calc functions can be used directly in Calc after you deploy the extension and restart OpenOffice.org.&amp;lt;br&amp;gt;&lt;br /&gt;
After finishing the wizard you can build the project, and create and deploy the OpenOffice.org extension package. The built-in functions you just created are implemented, but do nothing yet. In a second step you can insert your implementation in the generated skeleton (searching for the add-in function body), rebuild the extension and deploy it again to see the effect in your OpenOffice.org installation.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard  is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Calc Add-In&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, Add-In name, an optional package and the project location &lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
Since OpenOffice.org 2.0.4 the spreadsheet application takes care of a new configuration schema for Calc Add-In functions. An appropriate xcu file is generated as well and becomes part of the final &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; package.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Define the new Add-In functions&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn3.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
On this panel you can define new Calc Add-In methods on a higher abstraction level, you do not have to deal with UNO IDL or xcu files directly. You can modify the default method, and insert localized descriptions and display names ... For more detailed descriptions of the different fields simply press the help button or read the appropriate chapter in the [http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Spreadsheet_Add-Ins Developer&amp;#039;s Guide - Spreadsheet - Add-Ins]&amp;lt;br&amp;gt;&lt;br /&gt;
Add a new function will always add the new function on top of the list. Add parameter will add the parameter as the first parameter when the function node is selected, or will append the parameter behind the currently selected parameter. When you add a new language you can choose from a list of supported languages which are not added. When you delete a language, you can only remove languages that have been added.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn3a.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn3b.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 5&amp;#039;&amp;#039;&amp;#039;: Deploy the extension package&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn4.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&lt;br /&gt;
::&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Deploy and Run Extension in OpenOffice.org&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use the Calc Add-In function(s) after you have deployed them, open a new spreadsheet document -&amp;gt; open the built-in function dialog -&amp;gt; select the “Add-In” category -&amp;gt; search for a new Add-In function (uppercase notation) -&amp;gt; click next -&amp;gt; enter parameters ... -&amp;gt; ok&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn5.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn6.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
The Calc Add-In wizard generates more code than can be shown here. A new config (.xcu) file for the Add-In is generated.  The config file describes the Add-In functions with descriptions, displaynames etc. The new configuration allows you to support localization of the description and display names. The underlying schema comes with OpenOffice.org 2.0.4 and will be part of the backward compatible Add-In extension packages. In the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CalcAddIn.xcu&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the mentioned new configuration file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;#039;1.0&amp;#039; encoding=&amp;#039;UTF-8&amp;#039;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;oor:component-data xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot;&lt;br /&gt;
  xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; oor:name=&amp;quot;CalcAddIns&amp;quot;&lt;br /&gt;
  oor:package=&amp;quot;org.openoffice.Office&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;AddInInfo&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;org.openoffice.addin.TestAddin&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;AddInFunctions&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;redouble&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;DisplayName&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;redouble&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;verdoppeln&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;Description&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;simply returns the redoubled input parameter&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;liefert einfach den verdoppleten Wert des Eingabeparameters&lt;br /&gt;
                     zurÃ¼ck&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;Category&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value&amp;gt;Add-In&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;CompatibilityName&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value/&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;Parameters&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;node oor:name=&amp;quot;nValue&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;DisplayName&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;nValue&amp;lt;/value&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;nWert&amp;lt;/value&amp;gt;&lt;br /&gt;
              &amp;lt;/prop&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;Description&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;the input value&amp;lt;/value&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;der Eingabewert&amp;lt;/value&amp;gt;&lt;br /&gt;
              &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;/node&amp;gt;&lt;br /&gt;
          &amp;lt;/node&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/oor:component-data&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.configuration-data&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;CalcAddins.xcu&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-typelibrary;type=RDB&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;types.rdb&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestAddin.jar&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/test/addin/XTestAddIn.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the Add-In interface describing the new Add-In functions&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * XTestAddin.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 05.09.2006 - 16:25:54&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_addin_XTestAddin_&lt;br /&gt;
#define _org_openoffice_addin_XTestAddin_&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/lang/XLocalizable.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/uno/XInterface.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module addin {&lt;br /&gt;
    interface XTestAddin {&lt;br /&gt;
        /// used to set an add-in locale for formatting reasons for example&lt;br /&gt;
        [optional] interface ::com::sun::star::lang::XLocalizable;&lt;br /&gt;
&lt;br /&gt;
        long redouble([in] long nValue);&lt;br /&gt;
    };&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/test/addin/TestAddIn.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the appropriate Add-In service definition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * TestAddin.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 05.09.2006 - 16:25:54&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_addin_TestAddin_&lt;br /&gt;
#define _org_openoffice_addin_TestAddin_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;XTestAddin.idl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module addin {&lt;br /&gt;
    service TestAddin : XTestAddin;&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/test/addin/TestAddinImpl.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated Add-In code skeleton where only the Add-In functions have to be implemented. Everything else is already implemented and even the Add-In functions are implemented by default, so that the new generated project can be built and the extension can be deployed directly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package org.openoffice.addin;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestAddinImpl extends WeakBase&lt;br /&gt;
   implements org.openoffice.addin.XTestAddin,&lt;br /&gt;
              com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              com.sun.star.lang.XLocalizable&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private static final String m_implementationName = TestAddinImpl.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;org.openoffice.addin.TestAddin&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
    private com.sun.star.lang.Locale m_locale = new com.sun.star.lang.Locale();&lt;br /&gt;
&lt;br /&gt;
    public TestAddinImpl( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory(String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestAddinImpl.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo(XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // org.openoffice.addin.XTestAddin:&lt;br /&gt;
    public int redouble(int nValue)&lt;br /&gt;
    {&lt;br /&gt;
        // TODO !!!&lt;br /&gt;
        // Exchange the default return implementation.&lt;br /&gt;
        // NOTE: Default initialized polymorphic structs can cause problems&lt;br /&gt;
        // because of missing default initialization of primitive types of&lt;br /&gt;
        // some C++ compilers or different Any initialization in Java and C++&lt;br /&gt;
        // polymorphic structs.&lt;br /&gt;
        return 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XLocalizable:&lt;br /&gt;
    public void setLocale(com.sun.star.lang.Locale eLocale)&lt;br /&gt;
    {&lt;br /&gt;
        m_locale = eLocale;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public com.sun.star.lang.Locale getLocale()&lt;br /&gt;
    {&lt;br /&gt;
        return m_locale;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Calc|Add-In/Project Type]]&lt;br /&gt;
[[Category:Add-In|Calc/Project Type]]&lt;br /&gt;
[[Category:Development|Calc/Add-In/Project Type]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Add-In/Project_Type&amp;diff=95829</id>
		<title>Calc/Add-In/Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Add-In/Project_Type&amp;diff=95829"/>
		<updated>2008-10-14T10:50:36Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Project Wizard */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Calc Add-In wizard creates a new project based on a J2SE class library project. It supports additional targets to create a complete OpenOffice.org extension package and to deploy this package into the configured OpenOffice.org installation.&amp;lt;br&amp;gt;&lt;br /&gt;
The wizard collects all necessary information and allows you to define new built-in Calc functions.  The new Calc functions can be used directly in Calc after you deploy the extension and restart OpenOffice.org.&amp;lt;br&amp;gt;&lt;br /&gt;
After finishing the wizard you can build the project, and create and deploy the OpenOffice.org extension package. The built-in functions you just created are implemented, but do nothing yet. In a second step you can insert your implementation in the generated skeleton (searching for the add-in function body), rebuild the extension and deploy it again to see the effect in your OpenOffice.org installation.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard  is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Calc Add-In&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, Add-In name, an optional package and the project location &lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
Since OpenOffice.org 2.0.4 the spreadsheet application takes care of a new configuration schema for Calc Add-In functions. An appropriate xcu file is generated as well and becomes part of the final &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; package.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Define the new Add-In functions&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn3.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
On this panel you can define new Calc Add-In methods on a higher abstraction level, you do not have to deal with UNO IDL or xcu files directly. You can modify the default method, and insert localized descriptions and display names ... For more detailed descriptions of the different fields simply press the help button or read the appropriate chapter in the [http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Spreadsheet_Add-Ins Developer&amp;#039;s Guide - Spreadsheet - Add-Ins]&amp;lt;br&amp;gt;&lt;br /&gt;
Add a new function will always add the new function on top of the list. Add parameter will add the parameter as the first parameter when the function node is selected, or will append the parameter behind the currently selected parameter. When you add a new language you can choose from a list of supported languages which are not added. When you delete a language, you can only remove languages that have been added.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn3a.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn3b.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 5&amp;#039;&amp;#039;&amp;#039;: Deploy the extension package&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn4.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&lt;br /&gt;
::&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Deploy and Run Extension in OpenOffice.org&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use the Calc Add-In function(s) after you have deployed them, open a new spreadsheet document -&amp;gt; open the built-in function dialog -&amp;gt; select the “Add-In” category -&amp;gt; search for a new Add-In function (uppercase notation) -&amp;gt; click next -&amp;gt; enter parameters ... -&amp;gt; ok&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn5.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn6.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
The Calc Add-In wizard generates more code than can be shown here. A new config (.xcu) file for the Add-In is generated.  The config file describes the Add-In functions with descriptions, displaynames etc. The new configuration allows you to support localization of the description and displaynames. The underlying schema comes with OpenOffice.org 2.0.4 and will be part of the backward compatible Add-In extension packages. In the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CalcAddIn.xcu&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the mentioned new configuration file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;#039;1.0&amp;#039; encoding=&amp;#039;UTF-8&amp;#039;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;oor:component-data xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot;&lt;br /&gt;
  xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; oor:name=&amp;quot;CalcAddIns&amp;quot;&lt;br /&gt;
  oor:package=&amp;quot;org.openoffice.Office&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;AddInInfo&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;org.openoffice.addin.TestAddin&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;AddInFunctions&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;redouble&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;DisplayName&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;redouble&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;verdoppeln&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;Description&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;simply returns the redoubled input parameter&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;liefert einfach den verdoppleten Wert des Eingabeparameters&lt;br /&gt;
                     zurÃ¼ck&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;Category&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value&amp;gt;Add-In&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;CompatibilityName&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value/&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;Parameters&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;node oor:name=&amp;quot;nValue&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;DisplayName&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;nValue&amp;lt;/value&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;nWert&amp;lt;/value&amp;gt;&lt;br /&gt;
              &amp;lt;/prop&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;Description&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;the input value&amp;lt;/value&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;der Eingabewert&amp;lt;/value&amp;gt;&lt;br /&gt;
              &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;/node&amp;gt;&lt;br /&gt;
          &amp;lt;/node&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/oor:component-data&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.configuration-data&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;CalcAddins.xcu&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-typelibrary;type=RDB&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;types.rdb&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestAddin.jar&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/test/addin/XTestAddIn.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the Add-In interface describing the new Add-In functions&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * XTestAddin.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 05.09.2006 - 16:25:54&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_addin_XTestAddin_&lt;br /&gt;
#define _org_openoffice_addin_XTestAddin_&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/lang/XLocalizable.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/uno/XInterface.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module addin {&lt;br /&gt;
    interface XTestAddin {&lt;br /&gt;
        /// used to set an add-in locale for formatting reasons for example&lt;br /&gt;
        [optional] interface ::com::sun::star::lang::XLocalizable;&lt;br /&gt;
&lt;br /&gt;
        long redouble([in] long nValue);&lt;br /&gt;
    };&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/test/addin/TestAddIn.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the appropriate Add-In service definition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * TestAddin.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 05.09.2006 - 16:25:54&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_addin_TestAddin_&lt;br /&gt;
#define _org_openoffice_addin_TestAddin_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;XTestAddin.idl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module addin {&lt;br /&gt;
    service TestAddin : XTestAddin;&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/test/addin/TestAddinImpl.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated Add-In code skeleton where only the Add-In functions have to be implemented. Everything else is already implemented and even the Add-In functions are implemented by default, so that the new generated project can be built and the extension can be deployed directly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package org.openoffice.addin;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestAddinImpl extends WeakBase&lt;br /&gt;
   implements org.openoffice.addin.XTestAddin,&lt;br /&gt;
              com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              com.sun.star.lang.XLocalizable&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private static final String m_implementationName = TestAddinImpl.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;org.openoffice.addin.TestAddin&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
    private com.sun.star.lang.Locale m_locale = new com.sun.star.lang.Locale();&lt;br /&gt;
&lt;br /&gt;
    public TestAddinImpl( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory(String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestAddinImpl.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo(XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // org.openoffice.addin.XTestAddin:&lt;br /&gt;
    public int redouble(int nValue)&lt;br /&gt;
    {&lt;br /&gt;
        // TODO !!!&lt;br /&gt;
        // Exchange the default return implementation.&lt;br /&gt;
        // NOTE: Default initialized polymorphic structs can cause problems&lt;br /&gt;
        // because of missing default initialization of primitive types of&lt;br /&gt;
        // some C++ compilers or different Any initialization in Java and C++&lt;br /&gt;
        // polymorphic structs.&lt;br /&gt;
        return 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XLocalizable:&lt;br /&gt;
    public void setLocale(com.sun.star.lang.Locale eLocale)&lt;br /&gt;
    {&lt;br /&gt;
        m_locale = eLocale;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public com.sun.star.lang.Locale getLocale()&lt;br /&gt;
    {&lt;br /&gt;
        return m_locale;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Calc|Add-In/Project Type]]&lt;br /&gt;
[[Category:Add-In|Calc/Project Type]]&lt;br /&gt;
[[Category:Development|Calc/Add-In/Project Type]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Calc_AddIn6.png&amp;diff=95828</id>
		<title>File:Calc AddIn6.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Calc_AddIn6.png&amp;diff=95828"/>
		<updated>2008-10-14T10:50:24Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:Calc AddIn6.png&amp;quot;: version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Calc_AddIn5.png&amp;diff=95826</id>
		<title>File:Calc AddIn5.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Calc_AddIn5.png&amp;diff=95826"/>
		<updated>2008-10-14T10:46:57Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:Calc AddIn5.png&amp;quot;: version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Add-In/Project_Type&amp;diff=95813</id>
		<title>Calc/Add-In/Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Add-In/Project_Type&amp;diff=95813"/>
		<updated>2008-10-14T10:09:23Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Project Wizard */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Calc Add-In wizard creates a new project based on a J2SE class library project. It supports additional targets to create a complete OpenOffice.org extension package and to deploy this package into the configured OpenOffice.org installation.&amp;lt;br&amp;gt;&lt;br /&gt;
The wizard collects all necessary information and allows you to define new built-in Calc functions.  The new Calc functions can be used directly in Calc after you deploy the extension and restart OpenOffice.org.&amp;lt;br&amp;gt;&lt;br /&gt;
After finishing the wizard you can build the project, and create and deploy the OpenOffice.org extension package. The built-in functions you just created are implemented, but do nothing yet. In a second step you can insert your implementation in the generated skeleton (searching for the add-in function body), rebuild the extension and deploy it again to see the effect in your OpenOffice.org installation.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard  is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Calc Add-In&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, Add-In name, an optional package and the project location &lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
Since OpenOffice.org 2.0.4 the spreadsheet application takes care of a new configuration schema for Calc Add-In functions. An appropriate xcu file is generated as well and becomes part of the final &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; package.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Define the new Add-In functions&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn3.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
On this panel you can define new Calc Add-In methods on a higher abstraction level, you do not have to deal with UNO IDL or xcu files directly. You can modify the default method, and insert localized descriptions and display names ... For more detailed descriptions of the different fields simply press the help button or read the appropriate chapter in the [http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Spreadsheet_Add-Ins Developer&amp;#039;s Guide - Spreadsheet - Add-Ins]&amp;lt;br&amp;gt;&lt;br /&gt;
Add a new function will always add the new function on top of the list. Add parameter will add the parameter as the first parameter when the function node is selected, or will append the parameter behind the currently selected parameter. When you add a new language you can choose from a list of supported languages which are not added. When you delete a language, you can only remove languages that have been added.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn3a.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn3b.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 5&amp;#039;&amp;#039;&amp;#039;: Deploy the extension package&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn4.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&lt;br /&gt;
::&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Deploy and Run Extension in OpenOffice.org&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use the Calc Add-In function(s) after you have deployed them, open a new spreadsheet document -&amp;gt; open the built-in function dialog -&amp;gt; select the “AddIn” category -&amp;gt; search for a new Add-In function (uppercase notation) -&amp;gt; click next -&amp;gt; enter parameters ... -&amp;gt; ok&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn5.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn6.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
The Calc Add-In wizard generates more code than can be shown here. A new config (.xcu) file for the Add-In is generated.  The config file describes the Add-In functions with descriptions, displaynames etc. The new configuration allows you to support localization of the description and displaynames. The underlying schema comes with OpenOffice.org 2.0.4 and will be part of the backward compatible Add-In extension packages. In the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CalcAddIn.xcu&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the mentioned new configuration file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;#039;1.0&amp;#039; encoding=&amp;#039;UTF-8&amp;#039;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;oor:component-data xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot;&lt;br /&gt;
  xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; oor:name=&amp;quot;CalcAddIns&amp;quot;&lt;br /&gt;
  oor:package=&amp;quot;org.openoffice.Office&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;AddInInfo&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;org.openoffice.addin.TestAddin&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;AddInFunctions&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;redouble&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;DisplayName&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;redouble&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;verdoppeln&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;Description&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;simply returns the redoubled input parameter&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;liefert einfach den verdoppleten Wert des Eingabeparameters&lt;br /&gt;
                     zurÃ¼ck&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;Category&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value&amp;gt;Add-In&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;CompatibilityName&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value/&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;Parameters&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;node oor:name=&amp;quot;nValue&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;DisplayName&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;nValue&amp;lt;/value&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;nWert&amp;lt;/value&amp;gt;&lt;br /&gt;
              &amp;lt;/prop&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;Description&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;the input value&amp;lt;/value&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;der Eingabewert&amp;lt;/value&amp;gt;&lt;br /&gt;
              &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;/node&amp;gt;&lt;br /&gt;
          &amp;lt;/node&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/oor:component-data&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.configuration-data&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;CalcAddins.xcu&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-typelibrary;type=RDB&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;types.rdb&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestAddin.jar&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/test/addin/XTestAddIn.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the Add-In interface describing the new Add-In functions&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * XTestAddin.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 05.09.2006 - 16:25:54&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_addin_XTestAddin_&lt;br /&gt;
#define _org_openoffice_addin_XTestAddin_&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/lang/XLocalizable.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/uno/XInterface.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module addin {&lt;br /&gt;
    interface XTestAddin {&lt;br /&gt;
        /// used to set an add-in locale for formatting reasons for example&lt;br /&gt;
        [optional] interface ::com::sun::star::lang::XLocalizable;&lt;br /&gt;
&lt;br /&gt;
        long redouble([in] long nValue);&lt;br /&gt;
    };&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/test/addin/TestAddIn.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the appropriate Add-In service definition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * TestAddin.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 05.09.2006 - 16:25:54&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_addin_TestAddin_&lt;br /&gt;
#define _org_openoffice_addin_TestAddin_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;XTestAddin.idl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module addin {&lt;br /&gt;
    service TestAddin : XTestAddin;&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/test/addin/TestAddinImpl.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated Add-In code skeleton where only the Add-In functions have to be implemented. Everything else is already implemented and even the Add-In functions are implemented by default, so that the new generated project can be built and the extension can be deployed directly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package org.openoffice.addin;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestAddinImpl extends WeakBase&lt;br /&gt;
   implements org.openoffice.addin.XTestAddin,&lt;br /&gt;
              com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              com.sun.star.lang.XLocalizable&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private static final String m_implementationName = TestAddinImpl.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;org.openoffice.addin.TestAddin&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
    private com.sun.star.lang.Locale m_locale = new com.sun.star.lang.Locale();&lt;br /&gt;
&lt;br /&gt;
    public TestAddinImpl( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory(String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestAddinImpl.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo(XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // org.openoffice.addin.XTestAddin:&lt;br /&gt;
    public int redouble(int nValue)&lt;br /&gt;
    {&lt;br /&gt;
        // TODO !!!&lt;br /&gt;
        // Exchange the default return implementation.&lt;br /&gt;
        // NOTE: Default initialized polymorphic structs can cause problems&lt;br /&gt;
        // because of missing default initialization of primitive types of&lt;br /&gt;
        // some C++ compilers or different Any initialization in Java and C++&lt;br /&gt;
        // polymorphic structs.&lt;br /&gt;
        return 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XLocalizable:&lt;br /&gt;
    public void setLocale(com.sun.star.lang.Locale eLocale)&lt;br /&gt;
    {&lt;br /&gt;
        m_locale = eLocale;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public com.sun.star.lang.Locale getLocale()&lt;br /&gt;
    {&lt;br /&gt;
        return m_locale;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Calc|Add-In/Project Type]]&lt;br /&gt;
[[Category:Add-In|Calc/Project Type]]&lt;br /&gt;
[[Category:Development|Calc/Add-In/Project Type]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Calc_AddIn4.png&amp;diff=95807</id>
		<title>File:Calc AddIn4.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Calc_AddIn4.png&amp;diff=95807"/>
		<updated>2008-10-14T10:00:01Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:Calc AddIn4.png&amp;quot;: version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Add-In/Project_Type&amp;diff=95802</id>
		<title>Calc/Add-In/Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Add-In/Project_Type&amp;diff=95802"/>
		<updated>2008-10-14T09:38:13Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Project Wizard */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Calc Add-In wizard creates a new project based on a J2SE class library project. It supports additional targets to create a complete OpenOffice.org extension package and to deploy this package into the configured OpenOffice.org installation.&amp;lt;br&amp;gt;&lt;br /&gt;
The wizard collects all necessary information and allows you to define new built-in Calc functions.  The new Calc functions can be used directly in Calc after you deploy the extension and restart OpenOffice.org.&amp;lt;br&amp;gt;&lt;br /&gt;
After finishing the wizard you can build the project, and create and deploy the OpenOffice.org extension package. The built-in functions you just created are implemented, but do nothing yet. In a second step you can insert your implementation in the generated skeleton (searching for the add-in function body), rebuild the extension and deploy it again to see the effect in your OpenOffice.org installation.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard  is quite simple to use, you simply choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Calc Add-In&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project name, Add-In name, an optional package and the project location &lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
The checkbox &amp;#039;&amp;#039;&amp;#039;Create backward compatible Calc Add-In&amp;#039;&amp;#039;&amp;#039; should be selected if you want create a Calc Add-In that will work with older OpenOffice.org versions. The default mode creates a simplified code skeleton. Since OpenOffice.org 2.0.4 the spreadsheet application takes care of a new configuration schema for Calc Add-In functions. An appropriate xcu file is generated as well and becomes part of the final &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; package. The backward compatible mode maps the older Add-In interfaces to the configuration in the generated code and deploys the schema with the final extension.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 4&amp;#039;&amp;#039;&amp;#039;: Define the new Add-In functions&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn3.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
On this panel you can define new Calc Add-In methods on a higher abstraction level, you do not have to deal with UNO IDL or xcu files directly. You can modify the default method, and insert localized descriptions and displaynames ... For more detailed descriptions of the different fields simply press the help button or read the appropriate chapter in the [http://api.openoffice.org/docs/DevelopersGuide/Spreadsheet/Spreadsheet.xhtml#1_6_Spreadsheet_Add-Ins Developer&amp;#039;s Guide - Spreadsheet - Add-Ins]&amp;lt;br&amp;gt;&lt;br /&gt;
Add a new function will always add the new function on top of the list. Add parameter will add the parameter as the first parameter when the function node is selected, or will append the parameter behind the currently selected parameter. When you add a new language you can choose from a list of supported languages which are not added. When you delete a language, you can only remove languages that have been added.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn3a.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn3b.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 5&amp;#039;&amp;#039;&amp;#039;: Deploy the extension package&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn4.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
You can simply create or deploy the &amp;#039;&amp;#039;&amp;#039;oxt&amp;#039;&amp;#039;&amp;#039; extension package by choosing:&amp;lt;br&amp;gt;&lt;br /&gt;
::&amp;#039;&amp;#039;&amp;#039;Project View -&amp;gt; Project Node -&amp;gt; Context Menu -&amp;gt; Create OXT|Deploy Office Extension&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use the Calc Add-In function(s) after you have deployed them, open a new spreadsheet document -&amp;gt; open the built-in function dialog -&amp;gt; select the “AddIn” category -&amp;gt; search for a new Add-In function (uppercase notation) -&amp;gt; click next -&amp;gt; enter parameters ... -&amp;gt; ok&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn5.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Calc_AddIn6.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
The Calc Add-In wizard generates more code than can be shown here. A new config (.xcu) file for the Add-In is generated.  The config file describes the Add-In functions with descriptions, displaynames etc. The new configuration allows you to support localization of the description and displaynames. The underlying schema comes with OpenOffice.org 2.0.4 and will be part of the backward compatible Add-In extension packages. In the example shown above, the following files are generated:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CalcAddIn.xcu&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the mentioned new configuration file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;#039;1.0&amp;#039; encoding=&amp;#039;UTF-8&amp;#039;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;oor:component-data xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot;&lt;br /&gt;
  xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; oor:name=&amp;quot;CalcAddIns&amp;quot;&lt;br /&gt;
  oor:package=&amp;quot;org.openoffice.Office&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;AddInInfo&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;org.openoffice.addin.TestAddin&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;AddInFunctions&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;redouble&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;DisplayName&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;redouble&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;verdoppeln&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;Description&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;simply returns the redoubled input parameter&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;liefert einfach den verdoppleten Wert des Eingabeparameters&lt;br /&gt;
                     zurÃ¼ck&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;Category&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value&amp;gt;Add-In&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;prop oor:name=&amp;quot;CompatibilityName&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;value/&amp;gt;&lt;br /&gt;
          &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;Parameters&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;node oor:name=&amp;quot;nValue&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;DisplayName&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;nValue&amp;lt;/value&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;nWert&amp;lt;/value&amp;gt;&lt;br /&gt;
              &amp;lt;/prop&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;Description&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;en&amp;quot;&amp;gt;the input value&amp;lt;/value&amp;gt;&lt;br /&gt;
                &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;der Eingabewert&amp;lt;/value&amp;gt;&lt;br /&gt;
              &amp;lt;/prop&amp;gt;&lt;br /&gt;
            &amp;lt;/node&amp;gt;&lt;br /&gt;
          &amp;lt;/node&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/oor:component-data&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;uno-extension-manifest.xml&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the package descriptor, will be packed as &amp;amp;quot;META-INF/manifest.xml&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;manifest:manifest xmlns:manifest=&amp;quot;http://openoffice.org/2001/manifest&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.configuration-data&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;CalcAddins.xcu&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-typelibrary;type=RDB&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;types.rdb&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;manifest:file-entry manifest:media-type=&amp;quot;application/vnd.sun.star.uno-component;type=Java&amp;quot;&lt;br /&gt;
                       manifest:full-path=&amp;quot;TestAddin.jar&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/manifest:manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/test/addin/XTestAddIn.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the Add-In interface describing the new Add-In functions&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * XTestAddin.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 05.09.2006 - 16:25:54&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_addin_XTestAddin_&lt;br /&gt;
#define _org_openoffice_addin_XTestAddin_&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/lang/XLocalizable.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;com/sun/star/uno/XInterface.idl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module addin {&lt;br /&gt;
    interface XTestAddin {&lt;br /&gt;
        /// used to set an add-in locale for formatting reasons for example&lt;br /&gt;
        [optional] interface ::com::sun::star::lang::XLocalizable;&lt;br /&gt;
&lt;br /&gt;
        long redouble([in] long nValue);&lt;br /&gt;
    };&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/test/addin/TestAddIn.idl&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the appropriate Add-In service definition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * TestAddin.idl&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 05.09.2006 - 16:25:54&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef _org_openoffice_addin_TestAddin_&lt;br /&gt;
#define _org_openoffice_addin_TestAddin_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;XTestAddin.idl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
module org { module openoffice { module addin {&lt;br /&gt;
    service TestAddin : XTestAddin;&lt;br /&gt;
}; }; };&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;org/test/addin/TestAddinImpl.java&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;the generated Add-In code skeleton where only the Add-In functions have to be implemented. Everything else is already implemented and even the Add-In functions are implemented by default, so that the new generated project can be built and the extension can be deployed directly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package org.openoffice.addin;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.lib.uno.helper.Factory;&lt;br /&gt;
import com.sun.star.lang.XSingleComponentFactory;&lt;br /&gt;
import com.sun.star.registry.XRegistryKey;&lt;br /&gt;
import com.sun.star.lib.uno.helper.WeakBase;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public final class TestAddinImpl extends WeakBase&lt;br /&gt;
   implements org.openoffice.addin.XTestAddin,&lt;br /&gt;
              com.sun.star.lang.XServiceInfo,&lt;br /&gt;
              com.sun.star.lang.XLocalizable&lt;br /&gt;
{&lt;br /&gt;
    private final XComponentContext m_xContext;&lt;br /&gt;
    private static final String m_implementationName = TestAddinImpl.class.getName();&lt;br /&gt;
    private static final String[] m_serviceNames = {&lt;br /&gt;
        &amp;quot;org.openoffice.addin.TestAddin&amp;quot; };&lt;br /&gt;
&lt;br /&gt;
    private com.sun.star.lang.Locale m_locale = new com.sun.star.lang.Locale();&lt;br /&gt;
&lt;br /&gt;
    public TestAddinImpl( XComponentContext context )&lt;br /&gt;
    {&lt;br /&gt;
        m_xContext = context;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static XSingleComponentFactory __getComponentFactory(String sImplementationName ) {&lt;br /&gt;
        XSingleComponentFactory xFactory = null;&lt;br /&gt;
&lt;br /&gt;
        if ( sImplementationName.equals( m_implementationName ) )&lt;br /&gt;
            xFactory = Factory.createComponentFactory(TestAddinImpl.class, m_serviceNames);&lt;br /&gt;
        return xFactory;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static boolean __writeRegistryServiceInfo(XRegistryKey xRegistryKey ) {&lt;br /&gt;
        return Factory.writeRegistryServiceInfo(m_implementationName,&lt;br /&gt;
                                                m_serviceNames,&lt;br /&gt;
                                                xRegistryKey);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // org.openoffice.addin.XTestAddin:&lt;br /&gt;
    public int redouble(int nValue)&lt;br /&gt;
    {&lt;br /&gt;
        // TODO !!!&lt;br /&gt;
        // Exchange the default return implementation.&lt;br /&gt;
        // NOTE: Default initialized polymorphic structs can cause problems&lt;br /&gt;
        // because of missing default initialization of primitive types of&lt;br /&gt;
        // some C++ compilers or different Any initialization in Java and C++&lt;br /&gt;
        // polymorphic structs.&lt;br /&gt;
        return 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XServiceInfo:&lt;br /&gt;
    public String getImplementationName() {&lt;br /&gt;
         return m_implementationName;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public boolean supportsService( String sService ) {&lt;br /&gt;
        int len = m_serviceNames.length;&lt;br /&gt;
&lt;br /&gt;
        for( int i=0; i &amp;lt; len; i++) {&lt;br /&gt;
            if (sService.equals(m_serviceNames[i]))&lt;br /&gt;
                return true;&lt;br /&gt;
        }&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String[] getSupportedServiceNames() {&lt;br /&gt;
        return m_serviceNames;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // com.sun.star.lang.XLocalizable:&lt;br /&gt;
    public void setLocale(com.sun.star.lang.Locale eLocale)&lt;br /&gt;
    {&lt;br /&gt;
        m_locale = eLocale;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public com.sun.star.lang.Locale getLocale()&lt;br /&gt;
    {&lt;br /&gt;
        return m_locale;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Calc|Add-In/Project Type]]&lt;br /&gt;
[[Category:Add-In|Calc/Project Type]]&lt;br /&gt;
[[Category:Development|Calc/Add-In/Project Type]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Calc_AddIn3b.png&amp;diff=95801</id>
		<title>File:Calc AddIn3b.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Calc_AddIn3b.png&amp;diff=95801"/>
		<updated>2008-10-14T09:35:21Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:Calc AddIn3b.png&amp;quot;: version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Calc_AddIn3a.png&amp;diff=95800</id>
		<title>File:Calc AddIn3a.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Calc_AddIn3a.png&amp;diff=95800"/>
		<updated>2008-10-14T09:30:20Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:Calc AddIn3a.png&amp;quot;: version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Calc_AddIn3.png&amp;diff=95794</id>
		<title>File:Calc AddIn3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Calc_AddIn3.png&amp;diff=95794"/>
		<updated>2008-10-14T09:22:09Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:Calc AddIn3.png&amp;quot;: Screenshot of version 2.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Calc_AddIn2.png&amp;diff=95788</id>
		<title>File:Calc AddIn2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Calc_AddIn2.png&amp;diff=95788"/>
		<updated>2008-10-14T09:14:43Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:Calc AddIn2.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Calc_AddIn1.png&amp;diff=95785</id>
		<title>File:Calc AddIn1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Calc_AddIn1.png&amp;diff=95785"/>
		<updated>2008-10-14T09:12:27Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:Calc AddIn1.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=OpenOffice_Simple_UNO_Client_Application_Project_Type&amp;diff=95779</id>
		<title>OpenOffice Simple UNO Client Application Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=OpenOffice_Simple_UNO_Client_Application_Project_Type&amp;diff=95779"/>
		<updated>2008-10-14T09:07:55Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Generated Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Client Application wizard creates a new J2SE project with OpenOffice.org API support.  This means the OpenOffice.org library is added to the project to provide code completion and context sensitive help for the OpenOffice.org API. The generated main function contains some code to bootstrap an UNO environment and returns the remote OpenOffice.org context object of the default OpenOffice.org installation on the system. This works only if a default installation of OpenOffice.org was made and the soffice binary in the &amp;lt;office&amp;gt;/program directory is in the path (at least reachable over a symbolic link). There are some fallback strategies possible which are not further discussed here.&amp;lt;br&amp;gt;&lt;br /&gt;
The project builds a customized jar file containing special UNO bootstrap classes from the OpenOffice.org SDK  and special manifest entries to support the simple UNO bootstrap feature. The UNO bootstrap feature enables the application jar to run without any further environment preparation and has full access to the OpenOffice.org API to control and automate the OpenOffice.org process.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard is quite simple to use. Choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Client Application&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Simple_Client1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project, class name, an optional package and the project location&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Simple_Client2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
The generated code looks like &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * TestClient.java&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 10.06.2006 - 17:45:42&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
package org.test;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.comp.helper.Bootstrap;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 *&lt;br /&gt;
 * @author XXXXX&lt;br /&gt;
 */&lt;br /&gt;
public class TestClient {&lt;br /&gt;
    &lt;br /&gt;
    /** Creates a new instance of TestClient */&lt;br /&gt;
    public TestClient() {&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * @param args the command line arguments&lt;br /&gt;
     */&lt;br /&gt;
    public static void main(String[] args) {&lt;br /&gt;
        try {&lt;br /&gt;
            // get the remote office component context&lt;br /&gt;
            XComponentContext xContext = Bootstrap.bootstrap();&lt;br /&gt;
            if (xContext == null) {&lt;br /&gt;
                System.err.println(&amp;quot;ERROR: Could not bootstrap default Office.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        catch (java.lang.Exception e){&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        finally {&lt;br /&gt;
            System.exit( 0 );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Line 29 contains the UNO bootstrap call which returns the remote office context object. The remote context is main entry point to work with the OpenOffice.org API. The code is quite simple and should only show the first step. The generated project is buildable, runnable and can be started or debugged directly from within NetBeans as a normal J2SE application.&lt;br /&gt;
&lt;br /&gt;
== Manifest Entries for the UNO Bootstrap Mechanism ==&lt;br /&gt;
The manifest needs some special entries to support the simple UNO bootstrap feature:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Main-Class: com.sun.star.lib.loader.Loader&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Name: com/sun/star/lib/loader/Loader.class&amp;lt;br&amp;gt;&lt;br /&gt;
Application-Class: org.test.TestClient&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
where &amp;#039;&amp;#039;org.test.TestClient&amp;#039;&amp;#039; is the original main class.&lt;br /&gt;
&lt;br /&gt;
== Bundled UNO Bootstrap Glue Code ==&lt;br /&gt;
The following precompiled class files and the dll from the SDK are bundled with the client application jar.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/Loader$CustomURLClassLoader.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/Loader.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/InstallationFinder$StreamGobbler.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/InstallationFinder.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/WinRegKey.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/WinRegKeyException.class&amp;lt;br&amp;gt;&lt;br /&gt;
win/unowinreg.dll&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
The &amp;#039;&amp;#039;unowinreg.dll&amp;#039;&amp;#039; is included so that the client application can be platform independent.  It is used to find the default OpenOffice.org installation on Windows.&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* [[JavaEclipseTuto|Java Eclipse Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Simple_Client2.png&amp;diff=95761</id>
		<title>File:Simple Client2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Simple_Client2.png&amp;diff=95761"/>
		<updated>2008-10-14T08:55:18Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:Simple Client2.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=OpenOffice_Simple_UNO_Client_Application_Project_Type&amp;diff=95760</id>
		<title>OpenOffice Simple UNO Client Application Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=OpenOffice_Simple_UNO_Client_Application_Project_Type&amp;diff=95760"/>
		<updated>2008-10-14T08:53:07Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Project Wizard */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Client Application wizard creates a new J2SE project with OpenOffice.org API support.  This means the OpenOffice.org library is added to the project to provide code completion and context sensitive help for the OpenOffice.org API. The generated main function contains some code to bootstrap an UNO environment and returns the remote OpenOffice.org context object of the default OpenOffice.org installation on the system. This works only if a default installation of OpenOffice.org was made and the soffice binary in the &amp;lt;office&amp;gt;/program directory is in the path (at least reachable over a symbolic link). There are some fallback strategies possible which are not further discussed here.&amp;lt;br&amp;gt;&lt;br /&gt;
The project builds a customized jar file containing special UNO bootstrap classes from the OpenOffice.org SDK  and special manifest entries to support the simple UNO bootstrap feature. The UNO bootstrap feature enables the application jar to run without any further environment preparation and has full access to the OpenOffice.org API to control and automate the OpenOffice.org process.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard is quite simple to use. Choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; OpenOffice.org -&amp;gt; OpenOffice.org Client Application&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Simple_Client1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project, class name, an optional package and the project location&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Simple_Client2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
The generated code looks like &lt;br /&gt;
&amp;lt;code&amp;gt;[java]&lt;br /&gt;
/*&lt;br /&gt;
 * TestClient.java&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 10.06.2006 - 17:45:42&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
package org.test;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.comp.helper.Bootstrap;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 *&lt;br /&gt;
 * @author XXXXX&lt;br /&gt;
 */&lt;br /&gt;
public class TestClient {&lt;br /&gt;
    &lt;br /&gt;
    /** Creates a new instance of TestClient */&lt;br /&gt;
    public TestClient() {&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * @param args the command line arguments&lt;br /&gt;
     */&lt;br /&gt;
    public static void main(String[] args) {&lt;br /&gt;
        try {&lt;br /&gt;
            // get the remote office component context&lt;br /&gt;
            XComponentContext xContext = Bootstrap.bootstrap();&lt;br /&gt;
        }&lt;br /&gt;
        catch (java.lang.Exception e){&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        System.exit( 0 );&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Line 29 contains the UNO bootstrap call which returns the remote office context object. The remote context is main entry point to work with the OpenOffice.org API. The code is quite simple and should only show the first step. The generated project is buildable, runnable and can be started or debugged directly from within NetBeans as a normal J2SE application.&lt;br /&gt;
&lt;br /&gt;
== Manifest Entries for the UNO Bootstrap Mechanism ==&lt;br /&gt;
The manifest needs some special entries to support the simple UNO bootstrap feature:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Main-Class: com.sun.star.lib.loader.Loader&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Name: com/sun/star/lib/loader/Loader.class&amp;lt;br&amp;gt;&lt;br /&gt;
Application-Class: org.test.TestClient&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
where &amp;#039;&amp;#039;org.test.TestClient&amp;#039;&amp;#039; is the original main class.&lt;br /&gt;
&lt;br /&gt;
== Bundled UNO Bootstrap Glue Code ==&lt;br /&gt;
The following precompiled class files and the dll from the SDK are bundled with the client application jar.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/Loader$CustomURLClassLoader.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/Loader.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/InstallationFinder$StreamGobbler.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/InstallationFinder.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/WinRegKey.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/WinRegKeyException.class&amp;lt;br&amp;gt;&lt;br /&gt;
win/unowinreg.dll&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
The &amp;#039;&amp;#039;unowinreg.dll&amp;#039;&amp;#039; is included so that the client application can be platform independent.  It is used to find the default OpenOffice.org installation on Windows.&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* [[JavaEclipseTuto|Java Eclipse Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Simple_Client1.png&amp;diff=95759</id>
		<title>File:Simple Client1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Simple_Client1.png&amp;diff=95759"/>
		<updated>2008-10-14T08:52:37Z</updated>

		<summary type="html">&lt;p&gt;Sg: uploaded a new version of &amp;quot;Image:Simple Client1.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=OpenOffice_Simple_UNO_Client_Application_Project_Type&amp;diff=95757</id>
		<title>OpenOffice Simple UNO Client Application Project Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=OpenOffice_Simple_UNO_Client_Application_Project_Type&amp;diff=95757"/>
		<updated>2008-10-14T08:48:26Z</updated>

		<summary type="html">&lt;p&gt;Sg: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[OpenOffice_NetBeans_Integration|OpenOffice.org NetBeans Integration]]&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Client Application wizard creates a new J2SE project with OpenOffice.org API support.  This means the OpenOffice.org library is added to the project to provide code completion and context sensitive help for the OpenOffice.org API. The generated main function contains some code to bootstrap an UNO environment and returns the remote OpenOffice.org context object of the default OpenOffice.org installation on the system. This works only if a default installation of OpenOffice.org was made and the soffice binary in the &amp;lt;office&amp;gt;/program directory is in the path (at least reachable over a symbolic link). There are some fallback strategies possible which are not further discussed here.&amp;lt;br&amp;gt;&lt;br /&gt;
The project builds a customized jar file containing special UNO bootstrap classes from the OpenOffice.org SDK  and special manifest entries to support the simple UNO bootstrap feature. The UNO bootstrap feature enables the application jar to run without any further environment preparation and has full access to the OpenOffice.org API to control and automate the OpenOffice.org process.&lt;br /&gt;
&lt;br /&gt;
= Project Wizard =&lt;br /&gt;
The project wizard is quite simple to use. Choose&lt;br /&gt;
*&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;File -&amp;gt; New Project -&amp;gt; StarOffice/OpenOffice.org -&amp;gt; StarOffice/OpenOffice.org Client Application&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&lt;br /&gt;
and follow the wizard.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 1&amp;#039;&amp;#039;&amp;#039;: Select the project type&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Simple_Client1.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Step 2&amp;#039;&amp;#039;&amp;#039;: Define the project, class name, an optional package and the project location&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:Simple_Client2.png|center]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Generated Code =&lt;br /&gt;
The generated code looks like &lt;br /&gt;
&amp;lt;code&amp;gt;[java]&lt;br /&gt;
/*&lt;br /&gt;
 * TestClient.java&lt;br /&gt;
 *&lt;br /&gt;
 * Created on 10.06.2006 - 17:45:42&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
package org.test;&lt;br /&gt;
&lt;br /&gt;
import com.sun.star.uno.XComponentContext;&lt;br /&gt;
import com.sun.star.comp.helper.Bootstrap;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 *&lt;br /&gt;
 * @author XXXXX&lt;br /&gt;
 */&lt;br /&gt;
public class TestClient {&lt;br /&gt;
    &lt;br /&gt;
    /** Creates a new instance of TestClient */&lt;br /&gt;
    public TestClient() {&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * @param args the command line arguments&lt;br /&gt;
     */&lt;br /&gt;
    public static void main(String[] args) {&lt;br /&gt;
        try {&lt;br /&gt;
            // get the remote office component context&lt;br /&gt;
            XComponentContext xContext = Bootstrap.bootstrap();&lt;br /&gt;
        }&lt;br /&gt;
        catch (java.lang.Exception e){&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        System.exit( 0 );&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Line 29 contains the UNO bootstrap call which returns the remote office context object. The remote context is main entry point to work with the OpenOffice.org API. The code is quite simple and should only show the first step. The generated project is buildable, runnable and can be started or debugged directly from within NetBeans as a normal J2SE application.&lt;br /&gt;
&lt;br /&gt;
== Manifest Entries for the UNO Bootstrap Mechanism ==&lt;br /&gt;
The manifest needs some special entries to support the simple UNO bootstrap feature:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Main-Class: com.sun.star.lib.loader.Loader&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Name: com/sun/star/lib/loader/Loader.class&amp;lt;br&amp;gt;&lt;br /&gt;
Application-Class: org.test.TestClient&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
where &amp;#039;&amp;#039;org.test.TestClient&amp;#039;&amp;#039; is the original main class.&lt;br /&gt;
&lt;br /&gt;
== Bundled UNO Bootstrap Glue Code ==&lt;br /&gt;
The following precompiled class files and the dll from the SDK are bundled with the client application jar.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/Loader$CustomURLClassLoader.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/Loader.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/InstallationFinder$StreamGobbler.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/InstallationFinder.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/WinRegKey.class&amp;lt;br&amp;gt;&lt;br /&gt;
com/sun/star/lib/loader/WinRegKeyException.class&amp;lt;br&amp;gt;&lt;br /&gt;
win/unowinreg.dll&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
The &amp;#039;&amp;#039;unowinreg.dll&amp;#039;&amp;#039; is included so that the client application can be platform independent.  It is used to find the default OpenOffice.org installation on Windows.&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* [[JavaEclipseTuto|Java Eclipse Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Sg</name></author>
	</entry>
</feed>