<?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=Java1cprog</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=Java1cprog"/>
	<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/wiki/Special:Contributions/Java1cprog"/>
	<updated>2026-12-05T13:02:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Drawings/Transforming&amp;diff=183590</id>
		<title>Documentation/DevGuide/Drawings/Transforming</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Drawings/Transforming&amp;diff=183590"/>
		<updated>2010-09-15T02:37:43Z</updated>

		<summary type="html">&lt;p&gt;Java1cprog: change a code view&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/DrawingsTOC&lt;br /&gt;
|Drawing2c=block&lt;br /&gt;
|DrawingShapes=block&lt;br /&gt;
|DrawingOp=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Drawings/Rotating and Shearing&lt;br /&gt;
|NextPage=Documentation/DevGuide/Drawings/Ordering&lt;br /&gt;
}} {{Documentation/DevGuideLanguages|Documentation/DevGuide/Drawings/{{SUBPAGENAME}}}} &lt;br /&gt;
&lt;br /&gt;
 {{DISPLAYTITLE:Transforming}}&lt;br /&gt;
&lt;br /&gt;
Changing the size, rotation and shearing of an object can be done by using the transformation mechanism provided by {{PRODUCTNAME}}. The matrix of our API is a standard homogenous 3x3 matrix that may be used together with the java.awt.geom.AffineTransform class from Java. The transformation received describes the actual values of the transformations as a linear combination of the single matrices. The basic object without transformation has a size of (1, 1) and a position of (0, 0), and is not rotated or sheared. Thus, to transform an object get its matrix and multiply from the left side to influence the current appearance. To set the whole transformation directly, build a combined matrix of the single values mentioned above and apply it to the object. &amp;lt;!--[SOURCE:Drawing/ObjectTransformationDemo.java]--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  XPropertySet xPropSet = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, xShape );&lt;br /&gt;
 // take the current tranformation matrix&lt;br /&gt;
 HomogenMatrix3 aHomogenMatrix3 = (HomogenMatrix3)xPropSet.getPropertyValue(&amp;quot;Transformation&amp;quot;);&lt;br /&gt;
 java.awt.geom.AffineTransform aOriginalMatrix = &lt;br /&gt;
 new java.awt.geom.AffineTransform(aHomogenMatrix3.Line1.Column1, &lt;br /&gt;
                                  aHomogenMatrix3.Line2.Column1,&lt;br /&gt;
                                  aHomogenMatrix3.Line1.Column2, &lt;br /&gt;
                                  aHomogenMatrix3.Line2.Column2,&lt;br /&gt;
                                  aHomogenMatrix3.Line1.Column3, &lt;br /&gt;
                                  aHomogenMatrix3.Line2.Column3 );&lt;br /&gt;
 // rotate the object by 15 degrees&lt;br /&gt;
 AffineTransform aNewMatrix1 = new AffineTransform();&lt;br /&gt;
 aNewMatrix1.setToRotation(Math.toRadians(15));&lt;br /&gt;
 aNewMatrix1.concatenate(aOriginalMatrix);&lt;br /&gt;
 // and translate the object by 2cm on the x-axis&lt;br /&gt;
 AffineTransform aNewMatrix2 = new AffineTransform();&lt;br /&gt;
 aNewMatrix2.setToTranslation(2000, 0);&lt;br /&gt;
 aNewMatrix2.concatenate(aNewMatrix1);&lt;br /&gt;
 double aFlatMatrix[] = new double[6];aNewMatrix2.getMatrix(aFlatMatrix);&lt;br /&gt;
 // convert the flatMatrix to our HomogenMatrix3 structure&lt;br /&gt;
 aHomogenMatrix3.Line1.Column1 = aFlatMatrix[0];&lt;br /&gt;
 aHomogenMatrix3.Line2.Column1 = aFlatMatrix[1];&lt;br /&gt;
 aHomogenMatrix3.Line1.Column2 = aFlatMatrix[2];&lt;br /&gt;
 aHomogenMatrix3.Line2.Column2 = aFlatMatrix[3];&lt;br /&gt;
 aHomogenMatrix3.Line1.Column3 = aFlatMatrix[4];&lt;br /&gt;
 aHomogenMatrix3.Line2.Column3 = aFlatMatrix[5];&lt;br /&gt;
 xPropSet.setPropertyValue(&amp;quot;Transformation&amp;quot;, aHomogenMatrix3);&lt;br /&gt;
&lt;br /&gt;
{{PDL1}} &lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s_Guide/Drawing_Documents_and_Presentation_Documents]]&lt;/div&gt;</summary>
		<author><name>Java1cprog</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Disable_Commands&amp;diff=181190</id>
		<title>Documentation/DevGuide/WritingUNO/Disable Commands</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Disable_Commands&amp;diff=181190"/>
		<updated>2010-09-01T16:32:06Z</updated>

		<summary type="html">&lt;p&gt;Java1cprog: set more readable XML view&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/WritingUNOTOC&lt;br /&gt;
|WritingUNO2e=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/WritingUNO/AddOns/Installation&lt;br /&gt;
|NextPage=Documentation/DevGuide/WritingUNO/Intercepting Context Menus&lt;br /&gt;
}} {{Documentation/DevGuideLanguages|Documentation/DevGuide/WritingUNO/{{SUBPAGENAME}}}} {{DISPLAYTITLE:Disable Commands}} &lt;br /&gt;
In {{PRODUCTNAME}}, there may be situations where functions should be disabled to prevent users from changing or destroying documents inadvertently. {{PRODUCTNAME}} maintains a list of disabled commands that can be maintained by users and developers through the configuration API. &lt;br /&gt;
&lt;br /&gt;
A command request can be created by any object, but in most cases, user interface objects create these requests. Consider, for instance, a toolbox where different functions acting on the office component are presented as buttons. Once a button is clicked, the desired functionality should be executed. If the code assigned to the button is provided with a suitable command URL, the dispatch framework can handle the user action by creating the request and finding a component that can handle it. &lt;br /&gt;
&lt;br /&gt;
The dispatch framework works with the design pattern &amp;#039;&amp;#039;chain of responsibility&amp;#039;&amp;#039;: everything a component needs to know if it wants to execute a request is the last link in a chain of objects capable of executing requests. If this object gets the request, it checks whether it can handle it or otherwise passes it to the next chain member until the request is executed or the end of the chain is reached.The disable commands implementation is the first chain member and can therefore work as a wall for all disabled commands. They are not be sent to the next chain member, and disappear. &lt;br /&gt;
&lt;br /&gt;
The illustration below shows how the disable commands feature affects the normal command application flow. &lt;br /&gt;
&lt;br /&gt;
[[Image:DisableCommands ApplicationFlow.png|thumb|none|400px]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; {{Documentation/Caution|Since the disable commands implementation is the first part in the dispatch chain, there is no way to circumvent it. The disabled command must be removed from the list, otherwise it remains disabled.}} &lt;br /&gt;
&lt;br /&gt;
=== Configuration  ===&lt;br /&gt;
&lt;br /&gt;
The disable commands feature uses the configuration branch &amp;#039;&amp;#039;org.openoffice.Office.Commands&amp;#039;&amp;#039; to read which commands should be disabled. The following schema applies: &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;
  &amp;lt;oor:component-schema oor:name=&amp;quot;Commands&amp;quot; &lt;br /&gt;
                        oor:package=&amp;quot;org.openoffice.Office&amp;quot; &lt;br /&gt;
                        xml:lang=&amp;quot;en-US&amp;quot; &lt;br /&gt;
                        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; &lt;br /&gt;
                        xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;templates&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;CommandType&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;Command&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/group&amp;gt;&lt;br /&gt;
      &amp;lt;/templates&amp;gt;&lt;br /&gt;
      &amp;lt;component&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;Execute&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;set oor:name=&amp;quot;Disabled&amp;quot; oor:node-type=&amp;quot;CommandType&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/group&amp;gt;&lt;br /&gt;
      &amp;lt;/component&amp;gt;&lt;br /&gt;
  &amp;lt;/oor:component-schema&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt; The configuration schema for disabled commands is very simple. The &amp;#039;&amp;#039;org.openoffice.Office.Commands&amp;#039;&amp;#039; branch has a group called &amp;lt;code&amp;gt;Execute&amp;lt;/code&amp;gt;. This group has only one set called &amp;lt;code&amp;gt;Disabled&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;Disabled&amp;lt;/code&amp;gt; set supports nodes of the type &amp;lt;code&amp;gt;CommandType&amp;lt;/code&amp;gt;. The following table describes the supported properties of &amp;lt;code&amp;gt;CommandType&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#EDEDED&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Properties of the &amp;lt;code&amp;gt;CommandType&amp;lt;/code&amp;gt; group&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;oor:component-data&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. It must be unique inside the &amp;lt;code&amp;gt;Disabled&amp;lt;/code&amp;gt; set, but has no additional meaning for the implementation of the disable commands feature. Use a consecutive numbering scheme; even numbers are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Command&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. This is the command name with the preceding protocol. That means the command URL &amp;#039;&amp;#039;.uno:Open&amp;#039;&amp;#039; (which shows the &amp;#039;&amp;#039;&amp;#039;File – Open&amp;#039;&amp;#039;&amp;#039; dialog) must be written as &amp;lt;code&amp;gt;Open&amp;lt;/code&amp;gt;. &lt;br /&gt;
The valid commands can be found in the document &amp;#039;&amp;#039;Index of Command Names&amp;#039;&amp;#039; in the [http://framework.openoffice.org/servlets/ProjectDocumentList Documentation section of the framework project] on the OpenOffice.org web page. The {{PRODUCTNAME}} SDK also includes the latest [http://www.openoffice.org/files/documents/25/60/commands_11beta.html list of command names]. Additional information regarding Command names is available in: [http://wiki.services.openoffice.org/wiki/Framework/Article/OpenOffice.org_2.x_Commands] &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The example below shows a configuration file that disables the commands for &amp;#039;&amp;#039;&amp;#039;File – Open&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Edit – Select All&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Help – About {{PRODUCTNAME}}&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;File – Exit&amp;#039;&amp;#039;&amp;#039;. &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;oor:component-data oor:name=&amp;quot;Commands&amp;quot; &lt;br /&gt;
                      oor:package=&amp;quot;org.openoffice.Office&amp;quot; &lt;br /&gt;
                      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; &lt;br /&gt;
                      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;Execute&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;node oor:name=&amp;quot;com.mycompany.a-chosen-unique-name.m1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;Open&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 oor:name=&amp;quot;com.mycompany.a-chosen-unique-name.m2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;SelectAll&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 oor:name=&amp;quot;com.mycompany.a-chosen-unique-name.m3&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;About&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 oor:name=&amp;quot;com.mycompany.a-chosen-unique-name.m4&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;Quit&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;/oor:component-data&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A few lines on the node name &amp;#039;com.mycompany.a-chosen-unique-name.m1&amp;#039; in the xml example above. &lt;br /&gt;
&lt;br /&gt;
The node name is chosen in order to be unique in the &amp;#039;Disable&amp;#039; data set, and is given as a suggestion. &lt;br /&gt;
&lt;br /&gt;
You can use whatever name you like, it has no additional meaning for the implementation of the disable commands feature. &lt;br /&gt;
&lt;br /&gt;
A good idea would be to use a consecutive numbering at the name end, the name must be unique. &lt;br /&gt;
&lt;br /&gt;
=== Disabling Commands at Runtime  ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&amp;lt;idltopic&amp;gt;com.sun.star.configuration.ConfigurationUpdateAccess;com.sun.star.configuration.ConfigurationProvider;com.sun.star.util.XChangesBatch&amp;lt;/idltopic&amp;gt;--&amp;gt; The following code example first removes all commands that were defined in the user layer of the configuration branch &amp;lt;code&amp;gt;org.openoffice.Office.Commands&amp;lt;/code&amp;gt; as having a defined starting point. Then it checks if it can get dispatch objects for some pre-defined commands.Then the example disables these commands and tries to get dispatch objects for them again. At the end, the code removes the disabled commands again, otherwise {{PRODUCTNAME}} would not be fully usable any longer. &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  import com.sun.star.bridge.XUnoUrlResolver;&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.lang.XMultiComponentFactory;&lt;br /&gt;
  import com.sun.star.beans.XPropertySet;&lt;br /&gt;
  import com.sun.star.beans.PropertyValue;&lt;br /&gt;
  import com.sun.star.lang.XMultiServiceFactory;&lt;br /&gt;
  import com.sun.star.lang.XSingleServiceFactory;&lt;br /&gt;
  import com.sun.star.util.XURLTransformer;&lt;br /&gt;
  import com.sun.star.frame.XDesktop;&lt;br /&gt;
  &lt;br /&gt;
  import com.sun.star.beans.UnknownPropertyException;&lt;br /&gt;
  &lt;br /&gt;
  /*&lt;br /&gt;
   *  Provides example code how to enable/disable&lt;br /&gt;
   *  commands.&lt;br /&gt;
   */&lt;br /&gt;
  public class DisableCommandsTest extends java.lang.Object {&lt;br /&gt;
  &lt;br /&gt;
      /*&lt;br /&gt;
       *  A list of command names&lt;br /&gt;
       */&lt;br /&gt;
      final static private String[] aCommandURLTestSet =&lt;br /&gt;
      {&lt;br /&gt;
          &amp;quot;Open&amp;quot;,&lt;br /&gt;
          &amp;quot;About&amp;quot;,&lt;br /&gt;
          &amp;quot;SelectAll&amp;quot;,&lt;br /&gt;
          &amp;quot;Quit&amp;quot;,&lt;br /&gt;
      };&lt;br /&gt;
  &lt;br /&gt;
      private static XComponentContext xRemoteContext = null;&lt;br /&gt;
      private static XMultiComponentFactory xRemoteServiceManager = null;&lt;br /&gt;
      private static XURLTransformer xTransformer = null;&lt;br /&gt;
      private static XMultiServiceFactory xConfigProvider = null;&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;
      &lt;br /&gt;
          try {&lt;br /&gt;
              // connect&lt;br /&gt;
              XComponentContext xLocalContext =&lt;br /&gt;
              com.sun.star.comp.helper.Bootstrap.createInitialComponentContext(null);&lt;br /&gt;
              XMultiComponentFactory xLocalServiceManager = xLocalContext.getServiceManager();&lt;br /&gt;
              Object urlResolver = xLocalServiceManager.createInstanceWithContext(&lt;br /&gt;
                  &amp;quot;com.sun.star.bridge.UnoUrlResolver&amp;quot;, xLocalContext);&lt;br /&gt;
              XUnoUrlResolver xUnoUrlResolver = (XUnoUrlResolver) UnoRuntime.queryInterface( &lt;br /&gt;
                  XUnoUrlResolver.class, urlResolver );&lt;br /&gt;
              Object initialObject = xUnoUrlResolver.resolve( &lt;br /&gt;
              &amp;quot;uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager&amp;quot;);&lt;br /&gt;
              XPropertySet xPropertySet = (XPropertySet)UnoRuntime.queryInterface(&lt;br /&gt;
                  XPropertySet.class, initialObject);&lt;br /&gt;
              Object context = xPropertySet.getPropertyValue(&amp;quot;DefaultContext&amp;quot;);&lt;br /&gt;
              xRemoteContext = (XComponentContext)UnoRuntime.queryInterface(&lt;br /&gt;
                  XComponentContext.class, context);&lt;br /&gt;
              xRemoteServiceManager = xRemoteContext.getServiceManager();&lt;br /&gt;
              Object transformer = xRemoteServiceManager.createInstanceWithContext(&lt;br /&gt;
                  &amp;quot;com.sun.star.util.URLTransformer&amp;quot;, xRemoteContext);&lt;br /&gt;
              xTransformer = (com.sun.star.util.XURLTransformer)UnoRuntime.queryInterface(&lt;br /&gt;
                  com.sun.star.util.XURLTransformer.class, transformer);&lt;br /&gt;
      &lt;br /&gt;
              Object configProvider = xRemoteServiceManager.createInstanceWithContext(&lt;br /&gt;
                  &amp;quot;com.sun.star.configuration.ConfigurationProvider&amp;quot;, xRemoteContext);&lt;br /&gt;
              xConfigProvider = (com.sun.star.lang.XMultiServiceFactory)UnoRuntime.queryInterface(&lt;br /&gt;
                  com.sun.star.lang.XMultiServiceFactory.class, configProvider);&lt;br /&gt;
    &lt;br /&gt;
              // First we need a defined starting point. So we have to remove&lt;br /&gt;
              // all commands from the disabled set!&lt;br /&gt;
              enableCommands();&lt;br /&gt;
  &lt;br /&gt;
              // Check if the commands are usable&lt;br /&gt;
              testCommands(false);&lt;br /&gt;
          &lt;br /&gt;
              // Disable the commands&lt;br /&gt;
              disableCommands();&lt;br /&gt;
          &lt;br /&gt;
              // Now the commands should not be usable anymore&lt;br /&gt;
              testCommands(true);&lt;br /&gt;
  &lt;br /&gt;
              // Remove disable commands to make Office usable again&lt;br /&gt;
              enableCommands();&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;
       *  Test the commands that we enabled/disabled&lt;br /&gt;
       */&lt;br /&gt;
      private static void testCommands(boolean bDisabledCmds) throws com.sun.star.uno.Exception {&lt;br /&gt;
          // We need the desktop to get access to the current frame&lt;br /&gt;
          Object desktop = xRemoteServiceManager.createInstanceWithContext(&lt;br /&gt;
              &amp;quot;com.sun.star.frame.Desktop&amp;quot;, xRemoteContext );&lt;br /&gt;
          com.sun.star.frame.XDesktop xDesktop = (com.sun.star.frame.XDesktop)UnoRuntime.queryInterface(&lt;br /&gt;
              com.sun.star.frame.XDesktop.class, desktop);&lt;br /&gt;
          com.sun.star.frame.XFrame xFrame = xDesktop.getCurrentFrame();&lt;br /&gt;
          com.sun.star.frame.XDispatchProvider xDispatchProvider = null;&lt;br /&gt;
          if (xFrame != null) {&lt;br /&gt;
              // We have a frame. Now we need access to the dispatch provider.&lt;br /&gt;
              xDispatchProvider = (com.sun.star.frame.XDispatchProvider)UnoRuntime.queryInterface( &lt;br /&gt;
                  com.sun.star.frame.XDispatchProvider.class, xFrame );&lt;br /&gt;
              if (xDispatchProvider != null) {&lt;br /&gt;
                  // As we have the dispatch provider we can now check if we get a dispatch&lt;br /&gt;
                  // object or not.&lt;br /&gt;
                  for (int n = 0; n &amp;lt; aCommandURLTestSet.length; n++) {&lt;br /&gt;
                      // Prepare the URL&lt;br /&gt;
                      com.sun.star.util.URL[] aURL = new com.sun.star.util.URL[1];&lt;br /&gt;
                      aURL[0] = new com.sun.star.util.URL();&lt;br /&gt;
                      com.sun.star.frame.XDispatch xDispatch = null;&lt;br /&gt;
    &lt;br /&gt;
                      aURL[0].Complete = &amp;quot;.uno:&amp;quot; + aCommandURLTestSet[n];&lt;br /&gt;
                      xTransformer.parseSmart(aURL, &amp;quot;.uno:&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
                      // Try to get a dispatch object for our URL&lt;br /&gt;
                      xDispatch = xDispatchProvider.queryDispatch(aURL[0], &amp;quot;&amp;quot;, 0);&lt;br /&gt;
    &lt;br /&gt;
                      if (xDispatch != null) {&lt;br /&gt;
                          if (bDisabledCmds)&lt;br /&gt;
                              System.out.println(&amp;quot;Something is wrong, I got dispatch object for &amp;quot; &lt;br /&gt;
                                  + aURL[0].Complete);&lt;br /&gt;
                          else&lt;br /&gt;
                              System.out.println(&amp;quot;Ok, dispatch object for &amp;quot; + aURL[0].Complete);&lt;br /&gt;
                      }&lt;br /&gt;
                      else {&lt;br /&gt;
                          if (!bDisabledCmds)&lt;br /&gt;
                              System.out.println(&amp;quot;Something is wrong, I cannot get dispatch   object for &amp;quot; &lt;br /&gt;
                                  + aURL[0].Complete);&lt;br /&gt;
                          else&lt;br /&gt;
                              System.out.println(&amp;quot;Ok, no dispatch object for &amp;quot; + aURL[0].Complete);&lt;br /&gt;
                      }&lt;br /&gt;
                      resetURL(aURL[0]);&lt;br /&gt;
                  }&lt;br /&gt;
              }&lt;br /&gt;
              else&lt;br /&gt;
                  System.out.println(&amp;quot;Couldn&amp;#039;t get XDispatchProvider from Frame!&amp;quot;);&lt;br /&gt;
          }&lt;br /&gt;
          else&lt;br /&gt;
              System.out.println(&amp;quot;Couldn&amp;#039;t get current Frame from Desktop!&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
    &lt;br /&gt;
      /**&lt;br /&gt;
       *  Ensure that there are no disabled commands in the user layer. The&lt;br /&gt;
       *  implementation removes all commands from the disabled set!&lt;br /&gt;
       */&lt;br /&gt;
      private static void enableCommands() {&lt;br /&gt;
          // Set the root path for our configuration access&lt;br /&gt;
          com.sun.star.beans.PropertyValue[] lParams = new com.sun.star.beans.PropertyValue[1];&lt;br /&gt;
  &lt;br /&gt;
          lParams[0] = new com.sun.star.beans.PropertyValue();&lt;br /&gt;
          lParams[0].Name = &amp;quot;nodepath&amp;quot;;&lt;br /&gt;
          lParams[0].Value = &amp;quot;/org.openoffice.Office.Commands/Execute/Disabled&amp;quot;;&lt;br /&gt;
      &lt;br /&gt;
          try {&lt;br /&gt;
              // Create configuration update access to have write access to the configuration&lt;br /&gt;
              Object xAccess = xConfigProvider.createInstanceWithArguments( &lt;br /&gt;
&amp;quot;com.sun.star.configuration.ConfigurationUpdateAccess&amp;quot;, lParams);&lt;br /&gt;
  &lt;br /&gt;
              com.sun.star.container.XNameAccess xNameAccess = (com.sun.star.container.XNameAccess)&lt;br /&gt;
              UnoRuntime.queryInterface(com.sun.star.container.XNameAccess.class, xAccess);&lt;br /&gt;
              if (xNameAccess != null) {&lt;br /&gt;
                  // We need the XNameContainer interface to remove the nodes by name&lt;br /&gt;
                  com.sun.star.container.XNameContainer xNameContainer =&lt;br /&gt;
                      (com.sun.star.container.XNameContainer)&lt;br /&gt;
                  UnoRuntime.queryInterface(com.sun.star.container.XNameContainer.class, xAccess);&lt;br /&gt;
    &lt;br /&gt;
                  // Retrieves the names of all Disabled nodes&lt;br /&gt;
                  String[] aCommandsSeq = xNameAccess.getElementNames();&lt;br /&gt;
                  for (int n = 0; n &amp;lt; aCommandsSeq.length; n++) {&lt;br /&gt;
                      try {&lt;br /&gt;
                          // remove the node&lt;br /&gt;
                          xNameContainer.removeByName( aCommandsSeq[n]);&lt;br /&gt;
                      }&lt;br /&gt;
                      catch (com.sun.star.lang.WrappedTargetException e) {&lt;br /&gt;
                      }&lt;br /&gt;
                      catch (com.sun.star.container.NoSuchElementException e) {&lt;br /&gt;
                      }&lt;br /&gt;
                  }&lt;br /&gt;
              } &lt;br /&gt;
    &lt;br /&gt;
              // Commit our changes&lt;br /&gt;
              com.sun.star.util.XChangesBatch xFlush =&lt;br /&gt;
              (com.sun.star.util.XChangesBatch)UnoRuntime.queryInterface(&lt;br /&gt;
                  com.sun.star.util.XChangesBatch.class, xAccess);&lt;br /&gt;
              xFlush.commitChanges();&lt;br /&gt;
          }    &lt;br /&gt;
          catch (com.sun.star.uno.Exception e) {&lt;br /&gt;
              System.out.println(&amp;quot;Exception detected!&amp;quot;);&lt;br /&gt;
              System.out.println(e);&lt;br /&gt;
          }&lt;br /&gt;
      }&lt;br /&gt;
    &lt;br /&gt;
      /**&lt;br /&gt;
       *  Disable all commands defined in the aCommandURLTestSet array&lt;br /&gt;
       */&lt;br /&gt;
      private static void disableCommands() {&lt;br /&gt;
      // Set the root path for our configuration access&lt;br /&gt;
      com.sun.star.beans.PropertyValue[] lParams = new com.sun.star.beans.PropertyValue[1];&lt;br /&gt;
      lParams[0] = new com.sun.star.beans.PropertyValue();&lt;br /&gt;
      lParams[0].Name = &amp;quot;nodepath&amp;quot;;&lt;br /&gt;
      lParams[0].Value = &amp;quot;/org.openoffice.Office.Commands/Execute/Disabled&amp;quot;;&lt;br /&gt;
  &lt;br /&gt;
      try {&lt;br /&gt;
          // Create configuration update access to have write access to the configuration&lt;br /&gt;
          Object xAccess = xConfigProvider.createInstanceWithArguments( &lt;br /&gt;
          &amp;quot;com.sun.star.configuration.ConfigurationUpdateAccess&amp;quot;, lParams);&lt;br /&gt;
    &lt;br /&gt;
          com.sun.star.lang.XSingleServiceFactory xSetElementFactory = &lt;br /&gt;
          (com.sun.star.lang.XSingleServiceFactory)UnoRuntime.queryInterface(&lt;br /&gt;
              com.sun.star.lang.XSingleServiceFactory.class, xAccess);&lt;br /&gt;
          &lt;br /&gt;
          com.sun.star.container.XNameContainer xNameContainer =&lt;br /&gt;
          (com.sun.star.container.XNameContainer)UnoRuntime.queryInterface(&lt;br /&gt;
              com.sun.star.container.XNameContainer.class, xAccess );&lt;br /&gt;
  &lt;br /&gt;
          if (xSetElementFactory != null &amp;amp;&amp;amp; xNameContainer != null) {&lt;br /&gt;
              Object[] aArgs = { };&lt;br /&gt;
    &lt;br /&gt;
              for (int i = 0; i &amp;lt; aCommandURLTestSet.length; i++) {&lt;br /&gt;
                  // Create the nodes with the XSingleServiceFactory of the configuration&lt;br /&gt;
                      Object xNewElement = xSetElementFactory.createInstanceWithArguments( aArgs );&lt;br /&gt;
                      if (xNewElement != null) {&lt;br /&gt;
                          // We have a new node. To set the properties of the node we need&lt;br /&gt;
                          // the XPropertySet interface.&lt;br /&gt;
                          com.sun.star.beans.XPropertySet xPropertySet = &lt;br /&gt;
                          (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface( com.sun.star.beans.XPropertySet.class,&lt;br /&gt;
                              xNewElement );&lt;br /&gt;
  &lt;br /&gt;
                          if (xPropertySet != null) {&lt;br /&gt;
                              // Create a unique node name.&lt;br /&gt;
                              String aCmdNodeName = &amp;quot;Command-&amp;quot;;&lt;br /&gt;
                              aCmdNodeName += i;&lt;br /&gt;
    &lt;br /&gt;
                              // Insert the node into the Disabled set&lt;br /&gt;
                              xPropertySet.setPropertyValue(&amp;quot;Command&amp;quot;, aCommandURLTestSet[i]);&lt;br /&gt;
                              xNameContainer.insertByName(aCmdNodeName, xNewElement);&lt;br /&gt;
                          }&lt;br /&gt;
                      }&lt;br /&gt;
                  }&lt;br /&gt;
    &lt;br /&gt;
                  // Commit our changes&lt;br /&gt;
                  com.sun.star.util.XChangesBatch xFlush = (com.sun.star.util.XChangesBatch)&lt;br /&gt;
                  UnoRuntime.queryInterface(com.sun.star.util.XChangesBatch.class, xAccess);&lt;br /&gt;
                  xFlush.commitChanges();&lt;br /&gt;
              } &lt;br /&gt;
          }&lt;br /&gt;
          catch (com.sun.star.uno.Exception e) {&lt;br /&gt;
              System.out.println(&amp;quot;Exception detected!&amp;quot;);&lt;br /&gt;
              System.out.println(e);&lt;br /&gt;
          }&lt;br /&gt;
      } &lt;br /&gt;
      &lt;br /&gt;
      /**&lt;br /&gt;
       *  reset URL so it can be reused&lt;br /&gt;
       *&lt;br /&gt;
       *  @param aURL&lt;br /&gt;
       *  the URL that should be reseted&lt;br /&gt;
       */&lt;br /&gt;
      private static void resetURL(com.sun.star.util.URL aURL) {&lt;br /&gt;
          aURL.Protocol = &amp;quot;&amp;quot;;&lt;br /&gt;
          aURL.User = &amp;quot;&amp;quot;;&lt;br /&gt;
          aURL.Password = &amp;quot;&amp;quot;;&lt;br /&gt;
          aURL.Server = &amp;quot;&amp;quot;;&lt;br /&gt;
          aURL.Port = 0;&lt;br /&gt;
          aURL.Path = &amp;quot;&amp;quot;;&lt;br /&gt;
          aURL.Name = &amp;quot;&amp;quot;;&lt;br /&gt;
          aURL.Arguments = &amp;quot;&amp;quot;;&lt;br /&gt;
          aURL.Mark = &amp;quot;&amp;quot;;&lt;br /&gt;
          aURL.Main = &amp;quot;&amp;quot;;&lt;br /&gt;
          aURL.Complete = &amp;quot;&amp;quot;;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt; {{PDL1}} &lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s_Guide/Writing_UNO_Components]]&lt;/div&gt;</summary>
		<author><name>Java1cprog</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/AddOns/Configuration&amp;diff=181187</id>
		<title>Documentation/DevGuide/WritingUNO/AddOns/Configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/AddOns/Configuration&amp;diff=181187"/>
		<updated>2010-09-01T16:00:07Z</updated>

		<summary type="html">&lt;p&gt;Java1cprog: set more readable XML view&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/WritingUNOTOC&lt;br /&gt;
|WritingUNO2e=block&lt;br /&gt;
|WritingUNO2AddOns=block&lt;br /&gt;
|WritingUNO2Config=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/WritingUNO/AddOns/Guidelines&lt;br /&gt;
|NextPage=Documentation/DevGuide/WritingUNO/AddOns/Menus&lt;br /&gt;
}} {{Documentation/DevGuideLanguages|Documentation/DevGuide/WritingUNO/AddOns/{{SUBPAGENAME}}}} {{DISPLAYTITLE:Configuration}} &lt;br /&gt;
The user interface definitions of all add-ons are stored in the special configuration branch &amp;#039;&amp;#039;org.openoffice.Office.Addons&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
The schema of the configuration branch &amp;#039;&amp;#039;org.openoffice.Office.Addons&amp;#039;&amp;#039; specifies how to define a user interface extension. &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;
  &amp;lt;oor:component-schema oor:name=&amp;quot;Addons&amp;quot; &lt;br /&gt;
                        oor:package=&amp;quot;org.openoffice.Office&amp;quot; &lt;br /&gt;
                        xml:lang=&amp;quot;en-US&amp;quot; &lt;br /&gt;
                        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; &lt;br /&gt;
                        xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;templates&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;MenuItem&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;prop oor:name=&amp;quot;Title&amp;quot; oor:type=&amp;quot;xs:string&amp;quot; oor:localized=&amp;quot;true&amp;quot;/&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;prop oor:name=&amp;quot;Target&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;/&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;set oor:name=&amp;quot;Submenu&amp;quot; oor:node-type=&amp;quot;MenuItem&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/group&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;PopupMenu&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; oor:localized=&amp;quot;true&amp;quot;/&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;set oor:name=&amp;quot;Submenu&amp;quot; oor:node-type=&amp;quot;MenuItem&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/group&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;ToolBarItem&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;prop oor:name=&amp;quot;Title&amp;quot; oor:type=&amp;quot;xs:string&amp;quot; oor:localized=&amp;quot;true&amp;quot;/&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;prop oor:name=&amp;quot;Target&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;/&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;/group&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;UserDefinedImages&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;ImageSmall&amp;quot; oor:type=&amp;quot;xs:hexBinary&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;ImageBig&amp;quot; oor:type=&amp;quot;xs:hexBinary&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;ImageSmallHC&amp;quot; oor:type=&amp;quot;xs:hexBinary&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;ImageBigHC&amp;quot; oor:type=&amp;quot;xs:hexBinary&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;ImageSmallURL&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;ImageBigURL&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;ImageSmallHCURL&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;ImageBigHCURL&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/group&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;Images&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;node-ref oor:name=&amp;quot;UserDefinedImages&amp;quot; oor:node-type=&amp;quot;UserDefinedImages&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/group&amp;gt;&lt;br /&gt;
          &amp;lt;set oor:name=&amp;quot;ToolBarItems&amp;quot; oor:node-type=&amp;quot;ToolBarItem&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;/templates&amp;gt;&lt;br /&gt;
      &amp;lt;component&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;AddonUI&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;set oor:name=&amp;quot;AddonMenu&amp;quot; oor:node-type=&amp;quot;MenuItem&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;set oor:name=&amp;quot;Images&amp;quot; oor:node-type=&amp;quot;Images&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;set oor:name=&amp;quot;OfficeMenuBar&amp;quot; oor:node-type=&amp;quot;PopupMenu&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;set oor:name=&amp;quot;OfficeToolBar&amp;quot; oor:node-type=&amp;quot;ToolBarItems&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;set oor:name=&amp;quot;OfficeHelp&amp;quot; oor:node-type=&amp;quot;MenuItem&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/group&amp;gt;&lt;br /&gt;
      &amp;lt;/component&amp;gt;&lt;br /&gt;
  &amp;lt;/oor:component-schema&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt; {{PDL1}} &lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s_Guide/Writing_UNO_Components]]&lt;/div&gt;</summary>
		<author><name>Java1cprog</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Jobs/Using_the_vnd.sun.star.jobs:_URL_Schema&amp;diff=181186</id>
		<title>Documentation/DevGuide/WritingUNO/Jobs/Using the vnd.sun.star.jobs: URL Schema</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Jobs/Using_the_vnd.sun.star.jobs:_URL_Schema&amp;diff=181186"/>
		<updated>2010-09-01T15:56:46Z</updated>

		<summary type="html">&lt;p&gt;Java1cprog: set more readable text paragraph&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/WritingUNOTOC&lt;br /&gt;
|WritingUNO2e=block&lt;br /&gt;
|WritingUNO2Jobs=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/WritingUNO/Jobs/Installation&lt;br /&gt;
|NextPage=Documentation/DevGuide/WritingUNO/Jobs/List of Supported Events&lt;br /&gt;
}} {{Documentation/DevGuideLanguages|Documentation/DevGuide/WritingUNO/Jobs/{{SUBPAGENAME}}}} {{DISPLAYTITLE:Using the vnd.sun.star.jobs: URL Schema}} &lt;br /&gt;
This section describes the necessary steps to execute a job by issuing a command URL at the dispatch framework. Based upon the protocol handler mechanism, a specialized URL schema has been implemented in {{PRODUCTNAME}}. It is registered for the URL schema &amp;quot;&amp;lt;code&amp;gt;vnd.sun.star.job:*&amp;lt;/code&amp;gt;&amp;quot; which uses the following syntax: &lt;br /&gt;
&lt;br /&gt;
  vnd.sun.star.job:{[event=&amp;amp;lt;name&amp;amp;gt;]}{,[alias=&amp;amp;lt;name&amp;amp;gt;]}{,[service=&amp;amp;lt;name&amp;amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#EDEDED&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Elements of a vnd.sun.star.job: URL&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;event=&amp;amp;lt;name&amp;amp;gt;&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. Contains an event string, which can also be used as parameter of the interface method &amp;lt;idlml&amp;gt;com.sun.star.task.XJobExecutor:trigger&amp;lt;/idlml&amp;gt;(). It corresponds to the node name of the set &amp;lt;code&amp;gt;Events&amp;lt;/code&amp;gt; in the configuration package &amp;#039;&amp;#039;org.openoffice.Office.Jobs&amp;#039;&amp;#039;. Using the event parameter of a &amp;lt;code&amp;gt;vnd.sun.star.job: URL&amp;lt;/code&amp;gt; will start all jobs that are registered for this event in the configuration. &lt;br /&gt;
Note: Disabled jobs, that is jobs with a user time stamp that is newer than the administrator time stamp, are not triggered by event URLs. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;alias=&amp;amp;lt;name&amp;amp;gt;&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. Contains an alias name of a configured job. This name is not used by the job execution API. It is a node name of the set Jobs in the configuration package &amp;#039;&amp;#039;org.openoffice.Office.Jobs&amp;#039;&amp;#039;. Using the alias part of a &amp;lt;code&amp;gt;vnd.sun.star.job: URL&amp;lt;/code&amp;gt; only starts the requested job.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;service=&amp;amp;lt;name&amp;amp;gt;&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. Contains the UNO implementation name of a configured or unconfigured &amp;lt;idl&amp;gt;com.sun.star.task.Job&amp;lt;/idl&amp;gt; or &amp;lt;idl&amp;gt;com.sun.star.task.AsyncJob&amp;lt;/idl&amp;gt; service. It is not necessary that such jobs are registered in the configuration, provided that they work without configuration data or implements necessary configuration on their own.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is possible to combine elements so as to start several jobs at once with a single URL. For instance, you could dispatch a URL &amp;#039;&amp;#039;vnd.sun.star.job:event=e1,alias=a1,event=e2,...&amp;#039;&amp;#039;. However, URLs that start several jobs at once should be used carefully, since there is no check for double or concurrent requests. If a service is designed asynchronously, it will be run concurrently with another, synchronous job. If both services work at the same area, there might be race conditions and they must synchronize their work. The generic job execution mechanism does not provide this functionality. &lt;br /&gt;
&lt;br /&gt;
The following configuration file for the configuration package &amp;#039;&amp;#039;org.openoffice.Office.Jobs&amp;#039;&amp;#039; shows two jobs, which are registered for different events: &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&amp;lt;!DOCTYPE oor:component-data SYSTEM &amp;quot;../../../../component-update.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;oor:component-data oor:name=&amp;quot;Jobs&amp;quot; &lt;br /&gt;
                      oor:package=&amp;quot;org.openoffice.Office&amp;quot; &lt;br /&gt;
                      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; &lt;br /&gt;
                      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;Jobs&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;Job_1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;Service&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;value&amp;gt;vnd.sun.star.jobs.Job_1&amp;lt;/value&amp;gt;&lt;br /&gt;
              &amp;lt;/prop&amp;gt;&lt;br /&gt;
              &amp;lt;node oor:name=&amp;quot;Arguments&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;prop oor:name=&amp;quot;arg_1&amp;quot; oor:type=&amp;quot;xs:string&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;value&amp;gt;val_1&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 oor:name=&amp;quot;Job_2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;Service&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;value&amp;gt;vnd.sun.star.jobs.Job_2&amp;lt;/value&amp;gt;&lt;br /&gt;
              &amp;lt;/prop&amp;gt;&lt;br /&gt;
              &amp;lt;node oor:name=&amp;quot;Arguments&amp;quot;/&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;Events&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;onFirstVisibleTask&amp;quot; oor:op=&amp;quot;fuse&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;node oor:name=&amp;quot;JobList&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;node oor:name=&amp;quot;Job_1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
                      &amp;lt;prop oor:name=&amp;quot;AdminTime&amp;quot;&amp;gt;&lt;br /&gt;
                          &amp;lt;value&amp;gt;01.01.2003/00:00:00&amp;lt;/value&amp;gt;&lt;br /&gt;
                      &amp;lt;/prop&amp;gt;&lt;br /&gt;
                      &amp;lt;prop oor:name=&amp;quot;UserTime&amp;quot;&amp;gt;&lt;br /&gt;
                          &amp;lt;value&amp;gt;01.01.2003/00:00:01&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 oor:name=&amp;quot;Job_2&amp;quot; oor:op=&amp;quot;replace&amp;quot;/&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;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first job can be described by the following properties: &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#EDEDED&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Properties of &amp;quot;Job_1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; &lt;br /&gt;
| &amp;lt;code&amp;gt;Job_1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;UNO implementation name&amp;lt;/code&amp;gt; &lt;br /&gt;
| &amp;lt;code&amp;gt;vnd.sun.star.jobs.Job_1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;activation state&amp;lt;/code&amp;gt; &lt;br /&gt;
| Disabled for job execution (because its AdminTime is older than its UserTime)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;own configuration&amp;lt;/code&amp;gt; &lt;br /&gt;
| contains one &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; item &amp;lt;code&amp;gt;arg1&amp;lt;/code&amp;gt; with the value &amp;quot;&amp;lt;code&amp;gt;val1&amp;lt;/code&amp;gt;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;event registration&amp;lt;/code&amp;gt; &lt;br /&gt;
| job is registered for the event string &amp;quot;&amp;lt;code&amp;gt;onFirstVisibleTask&amp;lt;/code&amp;gt;&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The second job can be described by these properties: &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#EDEDED&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Properties of &amp;quot;Job_2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; &lt;br /&gt;
| &amp;lt;code&amp;gt;Job_2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;UNO implementation name&amp;lt;/code&amp;gt; &lt;br /&gt;
| &amp;lt;code&amp;gt;vnd.sun.star.jobs.Job_2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;activation state&amp;lt;/code&amp;gt; &lt;br /&gt;
| Enabled for job execution (because it uses default values for AdminTime and UserTime)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;own configuration&amp;lt;/code&amp;gt; &lt;br /&gt;
| no own configuration items registered&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;event registration&amp;lt;/code&amp;gt; &lt;br /&gt;
| job is registered for the event string &amp;quot;&amp;lt;code&amp;gt;onFirstVisibleTask&amp;lt;/code&amp;gt;&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following demonstrates use cases for all possible &amp;#039;&amp;#039;vnd.sun.star.job:&amp;#039;&amp;#039; URLs. Not all possible scenarios are shown here. The job dispatch can be used in different ways and the combination of jobs can produce different results: &lt;br /&gt;
&lt;br /&gt;
  vnd.sun.star.job:event=onFirstVisibleTask &lt;br /&gt;
&lt;br /&gt;
This URL starts &amp;lt;code&amp;gt;Job_2&amp;lt;/code&amp;gt; only, &amp;lt;code&amp;gt;Job_1&amp;lt;/code&amp;gt; is marked &amp;lt;code&amp;gt;DISABLED&amp;lt;/code&amp;gt;, since its &amp;lt;code&amp;gt;AdminTime&amp;lt;/code&amp;gt; stamp is older than its &amp;lt;code&amp;gt;UserTime&amp;lt;/code&amp;gt; stamp. &lt;br /&gt;
&lt;br /&gt;
The job is initialized with environment information through the Environment sub list, as shown in section [[Documentation/DevGuide/WritingUNO/Jobs/Initialization|Initialization]]. Optional dispatch arguments are passed in &amp;lt;code&amp;gt;DynamicData&amp;lt;/code&amp;gt;, and generic configuration data, including the event string, is received in &amp;lt;code&amp;gt;Config&amp;lt;/code&amp;gt;. However, it is not initialized with configuration data of its own in &amp;lt;code&amp;gt;JobConfig&amp;lt;/code&amp;gt; because &amp;lt;code&amp;gt;Job_2&amp;lt;/code&amp;gt; is not configured with such information. On the other hand, &amp;lt;code&amp;gt;Job_2&amp;lt;/code&amp;gt; may return data after finishing its work, which will be written back to the configuration. &lt;br /&gt;
&lt;br /&gt;
Furthermore, the job instance can expect that the &amp;lt;code&amp;gt;Frame&amp;lt;/code&amp;gt; property from the &amp;lt;code&amp;gt;Environment&amp;lt;/code&amp;gt; sub list points to the frame in which the dispatch request is to be executed. &lt;br /&gt;
&lt;br /&gt;
  vnd.sun.star.job:alias=Job_1 &lt;br /&gt;
&lt;br /&gt;
This starts &amp;lt;code&amp;gt;Job_1&amp;lt;/code&amp;gt; only. It is initialized with an environment, and optionally initialized with dispatch arguments, generic configuration data, and configuration data of its own. However, the event name is not set here because this job was triggered directly, not using an event name. &lt;br /&gt;
&lt;br /&gt;
  vnd.sun.star.job:service=vnd.sun.star.jobs.Job_3 &lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;vnd.sun.star.jobs.Job_3&amp;lt;/code&amp;gt; is not registered in the job configuration package. However, if this implementation was registered with the global service manager, and if it provided the &amp;lt;idl&amp;gt;com.sun.star.task.XJob&amp;lt;/idl&amp;gt; or &amp;lt;idl&amp;gt;com.sun.star.task.XAsyncJob&amp;lt;/idl&amp;gt; interfaces, it would be executed by this URL. If both interfaces are present, the synchronous version is preferred. &lt;br /&gt;
&lt;br /&gt;
The given UNO implementation name &amp;lt;code&amp;gt;vnd.sun.star.jobs.Job_3&amp;lt;/code&amp;gt; is used directly for creation at the UNO service manager. In addition, this job instance is only initialized with an environment and possibly with optional dispatch arguments - there is no configuration data for the job to use. &lt;br /&gt;
&lt;br /&gt;
{{PDL1}} &lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s_Guide/Writing_UNO_Components]]&lt;/div&gt;</summary>
		<author><name>Java1cprog</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Jobs/Using_the_vnd.sun.star.jobs:_URL_Schema&amp;diff=181185</id>
		<title>Documentation/DevGuide/WritingUNO/Jobs/Using the vnd.sun.star.jobs: URL Schema</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Jobs/Using_the_vnd.sun.star.jobs:_URL_Schema&amp;diff=181185"/>
		<updated>2010-09-01T15:42:46Z</updated>

		<summary type="html">&lt;p&gt;Java1cprog: set more readable XML view&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/WritingUNOTOC&lt;br /&gt;
|WritingUNO2e=block&lt;br /&gt;
|WritingUNO2Jobs=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/WritingUNO/Jobs/Installation&lt;br /&gt;
|NextPage=Documentation/DevGuide/WritingUNO/Jobs/List of Supported Events&lt;br /&gt;
}} {{Documentation/DevGuideLanguages|Documentation/DevGuide/WritingUNO/Jobs/{{SUBPAGENAME}}}} {{DISPLAYTITLE:Using the vnd.sun.star.jobs: URL Schema}} This section describes the necessary steps to execute a job by issuing a command URL at the dispatch framework. Based upon the protocol handler mechanism, a specialized URL schema has been implemented in {{PRODUCTNAME}}. It is registered for the URL schema &amp;quot;&amp;lt;code&amp;gt;vnd.sun.star.job:*&amp;lt;/code&amp;gt;&amp;quot; which uses the following syntax: &lt;br /&gt;
&lt;br /&gt;
  vnd.sun.star.job:{[event=&amp;amp;lt;name&amp;amp;gt;]}{,[alias=&amp;amp;lt;name&amp;amp;gt;]}{,[service=&amp;amp;lt;name&amp;amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#EDEDED&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Elements of a vnd.sun.star.job: URL&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;event=&amp;amp;lt;name&amp;amp;gt;&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. Contains an event string, which can also be used as parameter of the interface method &amp;lt;idlml&amp;gt;com.sun.star.task.XJobExecutor:trigger&amp;lt;/idlml&amp;gt;(). It corresponds to the node name of the set &amp;lt;code&amp;gt;Events&amp;lt;/code&amp;gt; in the configuration package &amp;#039;&amp;#039;org.openoffice.Office.Jobs&amp;#039;&amp;#039;. Using the event parameter of a &amp;lt;code&amp;gt;vnd.sun.star.job: URL&amp;lt;/code&amp;gt; will start all jobs that are registered for this event in the configuration. &lt;br /&gt;
Note: Disabled jobs, that is jobs with a user time stamp that is newer than the administrator time stamp, are not triggered by event URLs. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;alias=&amp;amp;lt;name&amp;amp;gt;&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. Contains an alias name of a configured job. This name is not used by the job execution API. It is a node name of the set Jobs in the configuration package &amp;#039;&amp;#039;org.openoffice.Office.Jobs&amp;#039;&amp;#039;. Using the alias part of a &amp;lt;code&amp;gt;vnd.sun.star.job: URL&amp;lt;/code&amp;gt; only starts the requested job.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;service=&amp;amp;lt;name&amp;amp;gt;&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. Contains the UNO implementation name of a configured or unconfigured &amp;lt;idl&amp;gt;com.sun.star.task.Job&amp;lt;/idl&amp;gt; or &amp;lt;idl&amp;gt;com.sun.star.task.AsyncJob&amp;lt;/idl&amp;gt; service. It is not necessary that such jobs are registered in the configuration, provided that they work without configuration data or implements necessary configuration on their own.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is possible to combine elements so as to start several jobs at once with a single URL. For instance, you could dispatch a URL &amp;#039;&amp;#039;vnd.sun.star.job:event=e1,alias=a1,event=e2,...&amp;#039;&amp;#039;. However, URLs that start several jobs at once should be used carefully, since there is no check for double or concurrent requests. If a service is designed asynchronously, it will be run concurrently with another, synchronous job. If both services work at the same area, there might be race conditions and they must synchronize their work. The generic job execution mechanism does not provide this functionality. &lt;br /&gt;
&lt;br /&gt;
The following configuration file for the configuration package &amp;#039;&amp;#039;org.openoffice.Office.Jobs&amp;#039;&amp;#039; shows two jobs, which are registered for different events: &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&amp;lt;!DOCTYPE oor:component-data SYSTEM &amp;quot;../../../../component-update.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;oor:component-data oor:name=&amp;quot;Jobs&amp;quot; &lt;br /&gt;
                      oor:package=&amp;quot;org.openoffice.Office&amp;quot; &lt;br /&gt;
                      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; &lt;br /&gt;
                      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;Jobs&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;Job_1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;Service&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;value&amp;gt;vnd.sun.star.jobs.Job_1&amp;lt;/value&amp;gt;&lt;br /&gt;
              &amp;lt;/prop&amp;gt;&lt;br /&gt;
              &amp;lt;node oor:name=&amp;quot;Arguments&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;prop oor:name=&amp;quot;arg_1&amp;quot; oor:type=&amp;quot;xs:string&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;value&amp;gt;val_1&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 oor:name=&amp;quot;Job_2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;Service&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;value&amp;gt;vnd.sun.star.jobs.Job_2&amp;lt;/value&amp;gt;&lt;br /&gt;
              &amp;lt;/prop&amp;gt;&lt;br /&gt;
              &amp;lt;node oor:name=&amp;quot;Arguments&amp;quot;/&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;Events&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;onFirstVisibleTask&amp;quot; oor:op=&amp;quot;fuse&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;node oor:name=&amp;quot;JobList&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;node oor:name=&amp;quot;Job_1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
                      &amp;lt;prop oor:name=&amp;quot;AdminTime&amp;quot;&amp;gt;&lt;br /&gt;
                          &amp;lt;value&amp;gt;01.01.2003/00:00:00&amp;lt;/value&amp;gt;&lt;br /&gt;
                      &amp;lt;/prop&amp;gt;&lt;br /&gt;
                      &amp;lt;prop oor:name=&amp;quot;UserTime&amp;quot;&amp;gt;&lt;br /&gt;
                          &amp;lt;value&amp;gt;01.01.2003/00:00:01&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 oor:name=&amp;quot;Job_2&amp;quot; oor:op=&amp;quot;replace&amp;quot;/&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;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first job can be described by the following properties: &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#EDEDED&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Properties of &amp;quot;Job_1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; &lt;br /&gt;
| &amp;lt;code&amp;gt;Job_1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;UNO implementation name&amp;lt;/code&amp;gt; &lt;br /&gt;
| &amp;lt;code&amp;gt;vnd.sun.star.jobs.Job_1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;activation state&amp;lt;/code&amp;gt; &lt;br /&gt;
| Disabled for job execution (because its AdminTime is older than its UserTime)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;own configuration&amp;lt;/code&amp;gt; &lt;br /&gt;
| contains one &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; item &amp;lt;code&amp;gt;arg1&amp;lt;/code&amp;gt; with the value &amp;quot;&amp;lt;code&amp;gt;val1&amp;lt;/code&amp;gt;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;event registration&amp;lt;/code&amp;gt; &lt;br /&gt;
| job is registered for the event string &amp;quot;&amp;lt;code&amp;gt;onFirstVisibleTask&amp;lt;/code&amp;gt;&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The second job can be described by these properties: &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#EDEDED&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Properties of &amp;quot;Job_2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; &lt;br /&gt;
| &amp;lt;code&amp;gt;Job_2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;UNO implementation name&amp;lt;/code&amp;gt; &lt;br /&gt;
| &amp;lt;code&amp;gt;vnd.sun.star.jobs.Job_2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;activation state&amp;lt;/code&amp;gt; &lt;br /&gt;
| Enabled for job execution (because it uses default values for AdminTime and UserTime)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;own configuration&amp;lt;/code&amp;gt; &lt;br /&gt;
| no own configuration items registered&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;event registration&amp;lt;/code&amp;gt; &lt;br /&gt;
| job is registered for the event string &amp;quot;&amp;lt;code&amp;gt;onFirstVisibleTask&amp;lt;/code&amp;gt;&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following demonstrates use cases for all possible &amp;#039;&amp;#039;vnd.sun.star.job:&amp;#039;&amp;#039; URLs. Not all possible scenarios are shown here. The job dispatch can be used in different ways and the combination of jobs can produce different results: &lt;br /&gt;
&lt;br /&gt;
  vnd.sun.star.job:event=onFirstVisibleTask &lt;br /&gt;
&lt;br /&gt;
This URL starts &amp;lt;code&amp;gt;Job_2&amp;lt;/code&amp;gt; only, &amp;lt;code&amp;gt;Job_1&amp;lt;/code&amp;gt; is marked &amp;lt;code&amp;gt;DISABLED&amp;lt;/code&amp;gt;, since its &amp;lt;code&amp;gt;AdminTime&amp;lt;/code&amp;gt; stamp is older than its &amp;lt;code&amp;gt;UserTime&amp;lt;/code&amp;gt; stamp. &lt;br /&gt;
&lt;br /&gt;
The job is initialized with environment information through the Environment sub list, as shown in section [[Documentation/DevGuide/WritingUNO/Jobs/Initialization|Initialization]]. Optional dispatch arguments are passed in &amp;lt;code&amp;gt;DynamicData&amp;lt;/code&amp;gt;, and generic configuration data, including the event string, is received in &amp;lt;code&amp;gt;Config&amp;lt;/code&amp;gt;. However, it is not initialized with configuration data of its own in &amp;lt;code&amp;gt;JobConfig&amp;lt;/code&amp;gt; because &amp;lt;code&amp;gt;Job_2&amp;lt;/code&amp;gt; is not configured with such information. On the other hand, &amp;lt;code&amp;gt;Job_2&amp;lt;/code&amp;gt; may return data after finishing its work, which will be written back to the configuration. &lt;br /&gt;
&lt;br /&gt;
Furthermore, the job instance can expect that the &amp;lt;code&amp;gt;Frame&amp;lt;/code&amp;gt; property from the &amp;lt;code&amp;gt;Environment&amp;lt;/code&amp;gt; sub list points to the frame in which the dispatch request is to be executed. &lt;br /&gt;
&lt;br /&gt;
  vnd.sun.star.job:alias=Job_1 &lt;br /&gt;
&lt;br /&gt;
This starts &amp;lt;code&amp;gt;Job_1&amp;lt;/code&amp;gt; only. It is initialized with an environment, and optionally initialized with dispatch arguments, generic configuration data, and configuration data of its own. However, the event name is not set here because this job was triggered directly, not using an event name. &lt;br /&gt;
&lt;br /&gt;
  vnd.sun.star.job:service=vnd.sun.star.jobs.Job_3 &lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;vnd.sun.star.jobs.Job_3&amp;lt;/code&amp;gt; is not registered in the job configuration package. However, if this implementation was registered with the global service manager, and if it provided the &amp;lt;idl&amp;gt;com.sun.star.task.XJob&amp;lt;/idl&amp;gt; or &amp;lt;idl&amp;gt;com.sun.star.task.XAsyncJob&amp;lt;/idl&amp;gt; interfaces, it would be executed by this URL. If both interfaces are present, the synchronous version is preferred. &lt;br /&gt;
&lt;br /&gt;
The given UNO implementation name &amp;lt;code&amp;gt;vnd.sun.star.jobs.Job_3&amp;lt;/code&amp;gt; is used directly for creation at the UNO service manager. In addition, this job instance is only initialized with an environment and possibly with optional dispatch arguments - there is no configuration data for the job to use. &lt;br /&gt;
&lt;br /&gt;
{{PDL1}} &lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s_Guide/Writing_UNO_Components]]&lt;/div&gt;</summary>
		<author><name>Java1cprog</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Jobs/Configuration&amp;diff=181181</id>
		<title>Documentation/DevGuide/WritingUNO/Jobs/Configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Jobs/Configuration&amp;diff=181181"/>
		<updated>2010-09-01T15:20:24Z</updated>

		<summary type="html">&lt;p&gt;Java1cprog: set more readable XML view&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/WritingUNOTOC&lt;br /&gt;
|WritingUNO2e=block&lt;br /&gt;
|WritingUNO2Jobs=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/WritingUNO/Jobs/Returning Results&lt;br /&gt;
|NextPage=Documentation/DevGuide/WritingUNO/Jobs/Installation&lt;br /&gt;
}} {{Documentation/DevGuideLanguages|Documentation/DevGuide/WritingUNO/Jobs/{{SUBPAGENAME}}}} {{DISPLAYTITLE:Configuration}} &lt;br /&gt;
&lt;br /&gt;
Although jobs that are called through a &amp;#039;&amp;#039;vnd.sun.star.jobs:&amp;#039;&amp;#039; URL by their implementation name do not require it, a job usually has configuration data. The configuration package &amp;#039;&amp;#039;org.openoffice.Office.Jobs&amp;#039;&amp;#039; contains all necessary information: &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;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;!DOCTYPE oor:component-schema SYSTEM &amp;quot;../../../../component-schema.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;oor:component-schema 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; &lt;br /&gt;
                        xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; &lt;br /&gt;
                        oor:name=&amp;quot;Jobs&amp;quot; &lt;br /&gt;
                        oor:package=&amp;quot;org.openoffice.Office&amp;quot; &lt;br /&gt;
                        xml:lang=&amp;quot;en-US&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;templates&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;Job&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;Service&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;group oor:name=&amp;quot;Arguments&amp;quot; oor:extensible=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/group&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;TimeStamp&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;AdminTime&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;UserTime&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/group&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;Event&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;set oor:name=&amp;quot;JobList&amp;quot; oor:node-type=&amp;quot;TimeStamp&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/group&amp;gt;&lt;br /&gt;
      &amp;lt;/templates&amp;gt;&lt;br /&gt;
      &amp;lt;component&amp;gt;&lt;br /&gt;
          &amp;lt;set oor:name=&amp;quot;Jobs&amp;quot; oor:node-type=&amp;quot;Job&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;set oor:name=&amp;quot;Events&amp;quot; oor:node-type=&amp;quot;Event&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;/component&amp;gt;&lt;br /&gt;
  &amp;lt;/oor:component-schema&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Job template contains all properties that describe a job component. Instances of this template are located inside the configuration set Jobs. &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#EDEDED&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Properties of the Job template&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. This property is declared as the name of the corresponding set node inside the configuration set &amp;lt;code&amp;gt;Jobs&amp;lt;/code&amp;gt;. It must be a unique name, which represents the structured information of a job. In the example &amp;#039;&amp;#039;.xcu&amp;#039;&amp;#039; file below its value is &amp;quot;&amp;lt;code&amp;gt;SyncJob&amp;lt;/code&amp;gt;&amp;quot;. In the job execution arguments this property is passed as &amp;lt;code&amp;gt;Config - Alias&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Service&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. Represents the UNO implementation name of the job component. In the job execution arguments this property is passed as &amp;lt;code&amp;gt;Config - Service&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Arguments&amp;lt;/code&amp;gt; &lt;br /&gt;
| set of any entries. This list can be filled with any values and represents the private set of configuration data for this job. In the job execution arguments this property is passed as &amp;lt;code&amp;gt;JobConfig&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The job property &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt; was created to provide you with more flexibility for a developing components. You can use the same UNO implementation, but register it with different Aliases. At runtime the job instance will be initialized with its own configuration data and can detect which representation is used. &lt;br /&gt;
&lt;br /&gt;
{{Documentation/Caution|You cannot use the generic UNO service names &amp;lt;idl&amp;gt;com.sun.star.task.Job&amp;lt;/idl&amp;gt; or &amp;lt;idl&amp;gt;com.sun.star.task.AsyncJob&amp;lt;/idl&amp;gt; for the &amp;lt;tt&amp;gt;Service&amp;lt;/tt&amp;gt; job property, because the job executor cannot identify the correct job implementation. To avoid ambiguities, it is necessary to use the UNO implementation name of the component.}} &lt;br /&gt;
&lt;br /&gt;
Every job instance can be bound to multiple events. An event indicates a special office state, which can be detected at runtime (for example, &amp;lt;code&amp;gt;OnFirstVisibleTask&amp;lt;/code&amp;gt; ), and which can be triggered by a call to the job executor when the first document window is displayed. &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#EDEDED&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Properties of the Event template&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;EventName&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. This property is declared as the name of the corresponding set node inside the configuration set &amp;lt;code&amp;gt;Events&amp;lt;/code&amp;gt;. It must be a unique name, which describes a functional state. In the example &amp;#039;&amp;#039;.xcu&amp;#039;&amp;#039; file below its value is &amp;quot;&amp;lt;code&amp;gt;onFirstVisibleTask&amp;lt;/code&amp;gt;&amp;quot;. &lt;br /&gt;
Section [[Documentation/DevGuide/WritingUNO/Jobs/List of Supported Events|List of Supported Events]] summarizes the events currently triggered by the office. In addition, developers can use arbitrary event strings with the &amp;#039;&amp;#039;vnd.sun.star.jobs:&amp;#039;&amp;#039; URL or in calls to &amp;lt;code&amp;gt;trigger()&amp;lt;/code&amp;gt; at the &amp;lt;idl&amp;gt;com.sun.star.task.JobExecutor&amp;lt;/idl&amp;gt; service. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JobList&amp;lt;/code&amp;gt; &lt;br /&gt;
| set of &amp;lt;code&amp;gt;TimeStamp&amp;lt;/code&amp;gt; entries. This set contains a list of all &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt; names of jobs that are bound to this event. Every job registration can be combined with time stamp values. Please refer to the description of the template &amp;lt;code&amp;gt;TimeStamp&amp;lt;/code&amp;gt; below for details&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As an optional feature, every job registration that is bound to an event can be enabled or disabled by two time stamp values. In a shared installation of {{PRODUCTNAME}}, an administrator can use the &amp;lt;code&amp;gt;AdminTime&amp;lt;/code&amp;gt; value to reactivate jobs for every newly started user office instance; regardless of earlier executions of these jobs. That can be useful, for example, for updating user installations if new functions have been added to the shared installation. &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#EDEDED&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Properties of the TimeStamp template&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;AdminTime&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. This value must be formatted according to the ISO 8601. It contains the time stamp, which can only be adjusted by an administrator, to reactivate this job.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;UserTime&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. This value must be formatted according to the ISO 8601. It contains the time, when this job was finished successfully last time upon the configured event.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Using this time stamp feature can sometimes be complicated. For example, assume that there is a job that was installed using the Extension Manager. The job is enabled for a registered event by default, but after the first execution it is disabled. By default, both values (&amp;lt;code&amp;gt;AdminTime&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;UserTime&amp;lt;/code&amp;gt;) do not exist for a configured event. A &amp;#039;&amp;#039;Jobs.xcu&amp;#039;&amp;#039; fragment, as part of the extension, must also not contain the &amp;lt;code&amp;gt;AdminTime&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;UserTime&amp;lt;/code&amp;gt; entries. Because both values are not there, no check can be made and the job is enabled. A job can be deactivated by the global job executor once it has finished its work successfully (depending on the &amp;lt;code&amp;gt;Deactivate&amp;lt;/code&amp;gt; return value). In that case, the &amp;lt;code&amp;gt;UserTime&amp;lt;/code&amp;gt; entry is generated and set to the current time. An administrator can set a newer and valid &amp;lt;code&amp;gt;AdminTime&amp;lt;/code&amp;gt; value in order to reactivate the job again, or the user can remove his &amp;lt;code&amp;gt;UserTime&amp;lt;/code&amp;gt; entry manually from the configuration file of the user installation. &lt;br /&gt;
&lt;br /&gt;
The following &amp;#039;&amp;#039;Jobs.xcu&amp;#039;&amp;#039; file shows an example job configuration: &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;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;!DOCTYPE oor:component-data SYSTEM &amp;quot;../../../../component-update.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;oor:component-data oor:name=&amp;quot;Jobs&amp;quot; &lt;br /&gt;
                      oor:package=&amp;quot;org.openoffice.Office&amp;quot; &lt;br /&gt;
                      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; &lt;br /&gt;
                      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;Jobs&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;SyncJob&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;Service&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;value&amp;gt;com.sun.star.comp.framework.java.services.SyncJob&amp;lt;/value&amp;gt;&lt;br /&gt;
              &amp;lt;/prop&amp;gt;&lt;br /&gt;
              &amp;lt;node oor:name=&amp;quot;Arguments&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;prop oor:name=&amp;quot;arg_1&amp;quot; oor:type=&amp;quot;xs:string&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;val_1&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;Events&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;onFirstVisibleTask&amp;quot; oor:op=&amp;quot;fuse&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;node oor:name=&amp;quot;JobList&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;node oor:name=&amp;quot;SyncJob&amp;quot; oor:op=&amp;quot;replace&amp;quot;/&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;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example job has the following characteristics: &lt;br /&gt;
&lt;br /&gt;
*Its alias name is &amp;quot;&amp;lt;code&amp;gt;SyncJob&amp;lt;/code&amp;gt;&amp;quot; &lt;br /&gt;
*The UNO implementation name of the component is &amp;lt;code&amp;gt;com.sun.star.comp.framework.java.services.SyncJob&amp;lt;/code&amp;gt;. &lt;br /&gt;
*The job has its own set of configuration data with one item. It is a string, its name is &amp;lt;code&amp;gt;arg_1&amp;lt;/code&amp;gt; and its value is &amp;quot;&amp;lt;code&amp;gt;val_1&amp;lt;/code&amp;gt;&amp;quot;. &lt;br /&gt;
*The job is bound to the global event &amp;lt;code&amp;gt;onFirstVisibleTask&amp;lt;/code&amp;gt;, which is triggered when the first document window of a new {{PRODUCTNAME}} instance is displayed. The next execution of this job is guaranteed, because there are no time stamp values present.&lt;br /&gt;
&lt;br /&gt;
When specifying the event to which the job is bound (&amp;lt;code&amp;gt;onFirstVisibleTask&amp;lt;/code&amp;gt; in the above example), it is important to use &amp;lt;code&amp;gt;oor:op=&amp;quot;fuse&amp;quot;&amp;lt;/code&amp;gt;, so that multiple &amp;#039;&amp;#039;Jobs.xcu&amp;#039;&amp;#039; particles merge losslessly. but note that &amp;lt;code&amp;gt;oor:op=&amp;quot;fuse&amp;quot;&amp;lt;/code&amp;gt; is only available since OpenOffice.org 2.0.3, and that a &amp;#039;&amp;#039;Jobs.xcu&amp;#039;&amp;#039; file that uses it cannot be used with older versions of OpenOffice.org. With older versions of OpenOffice.org, it was common to use &amp;lt;code&amp;gt;oor:op=&amp;quot;replace&amp;quot;&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;oor:op=&amp;quot;fuse&amp;quot;&amp;lt;/code&amp;gt;, which potentially caused event bindings to get lost when multiple &amp;#039;&amp;#039;Jobs.xcu&amp;#039;&amp;#039; particles were merged. &lt;br /&gt;
&lt;br /&gt;
{{Documentation/Caution|A job is not executed when it has deactivated itself and is called afterwards by a &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;vnd.sun.star.jobs:event=...&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; command URL. This can be confusing to users, especially with add-ons, since it would seem that the customized UI items do not function.}} &lt;br /&gt;
&lt;br /&gt;
{{PDL1}} &lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s_Guide/Writing_UNO_Components]]&lt;/div&gt;</summary>
		<author><name>Java1cprog</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Jobs/Configuration&amp;diff=181180</id>
		<title>Documentation/DevGuide/WritingUNO/Jobs/Configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Jobs/Configuration&amp;diff=181180"/>
		<updated>2010-09-01T15:00:46Z</updated>

		<summary type="html">&lt;p&gt;Java1cprog: Change first paragraph view&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/WritingUNOTOC&lt;br /&gt;
|WritingUNO2e=block&lt;br /&gt;
|WritingUNO2Jobs=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/WritingUNO/Jobs/Returning Results&lt;br /&gt;
|NextPage=Documentation/DevGuide/WritingUNO/Jobs/Installation&lt;br /&gt;
}} {{Documentation/DevGuideLanguages|Documentation/DevGuide/WritingUNO/Jobs/{{SUBPAGENAME}}}} {{DISPLAYTITLE:Configuration}} &lt;br /&gt;
&lt;br /&gt;
Although jobs that are called through a &amp;#039;&amp;#039;vnd.sun.star.jobs:&amp;#039;&amp;#039; URL by their implementation name do not require it, a job usually has configuration data. The configuration package &amp;#039;&amp;#039;org.openoffice.Office.Jobs&amp;#039;&amp;#039; contains all necessary information: &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;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;!DOCTYPE oor:component-schema SYSTEM &amp;quot;../../../../component-schema.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;oor:component-schema 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; &lt;br /&gt;
                        xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; &lt;br /&gt;
                        oor:name=&amp;quot;Jobs&amp;quot; &lt;br /&gt;
                        oor:package=&amp;quot;org.openoffice.Office&amp;quot; &lt;br /&gt;
                        xml:lang=&amp;quot;en-US&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;templates&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;Job&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;Service&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;group oor:name=&amp;quot;Arguments&amp;quot; oor:extensible=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/group&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;TimeStamp&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;AdminTime&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;UserTime&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/group&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;Event&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;set oor:name=&amp;quot;JobList&amp;quot; oor:node-type=&amp;quot;TimeStamp&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/group&amp;gt;&lt;br /&gt;
      &amp;lt;/templates&amp;gt;&lt;br /&gt;
      &amp;lt;component&amp;gt;&lt;br /&gt;
          &amp;lt;set oor:name=&amp;quot;Jobs&amp;quot; oor:node-type=&amp;quot;Job&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;set oor:name=&amp;quot;Events&amp;quot; oor:node-type=&amp;quot;Event&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;/component&amp;gt;&lt;br /&gt;
  &amp;lt;/oor:component-schema&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Job template contains all properties that describe a job component. Instances of this template are located inside the configuration set Jobs. &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#EDEDED&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Properties of the Job template&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. This property is declared as the name of the corresponding set node inside the configuration set &amp;lt;code&amp;gt;Jobs&amp;lt;/code&amp;gt;. It must be a unique name, which represents the structured information of a job. In the example &amp;#039;&amp;#039;.xcu&amp;#039;&amp;#039; file below its value is &amp;quot;&amp;lt;code&amp;gt;SyncJob&amp;lt;/code&amp;gt;&amp;quot;. In the job execution arguments this property is passed as &amp;lt;code&amp;gt;Config - Alias&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Service&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. Represents the UNO implementation name of the job component. In the job execution arguments this property is passed as &amp;lt;code&amp;gt;Config - Service&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Arguments&amp;lt;/code&amp;gt; &lt;br /&gt;
| set of any entries. This list can be filled with any values and represents the private set of configuration data for this job. In the job execution arguments this property is passed as &amp;lt;code&amp;gt;JobConfig&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The job property &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt; was created to provide you with more flexibility for a developing components. You can use the same UNO implementation, but register it with different Aliases. At runtime the job instance will be initialized with its own configuration data and can detect which representation is used. &lt;br /&gt;
&lt;br /&gt;
{{Documentation/Caution|You cannot use the generic UNO service names &amp;lt;idl&amp;gt;com.sun.star.task.Job&amp;lt;/idl&amp;gt; or &amp;lt;idl&amp;gt;com.sun.star.task.AsyncJob&amp;lt;/idl&amp;gt; for the &amp;lt;tt&amp;gt;Service&amp;lt;/tt&amp;gt; job property, because the job executor cannot identify the correct job implementation. To avoid ambiguities, it is necessary to use the UNO implementation name of the component.}} &lt;br /&gt;
&lt;br /&gt;
Every job instance can be bound to multiple events. An event indicates a special office state, which can be detected at runtime (for example, &amp;lt;code&amp;gt;OnFirstVisibleTask&amp;lt;/code&amp;gt; ), and which can be triggered by a call to the job executor when the first document window is displayed. &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#EDEDED&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Properties of the Event template&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;EventName&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. This property is declared as the name of the corresponding set node inside the configuration set &amp;lt;code&amp;gt;Events&amp;lt;/code&amp;gt;. It must be a unique name, which describes a functional state. In the example &amp;#039;&amp;#039;.xcu&amp;#039;&amp;#039; file below its value is &amp;quot;&amp;lt;code&amp;gt;onFirstVisibleTask&amp;lt;/code&amp;gt;&amp;quot;. &lt;br /&gt;
Section [[Documentation/DevGuide/WritingUNO/Jobs/List of Supported Events|List of Supported Events]] summarizes the events currently triggered by the office. In addition, developers can use arbitrary event strings with the &amp;#039;&amp;#039;vnd.sun.star.jobs:&amp;#039;&amp;#039; URL or in calls to &amp;lt;code&amp;gt;trigger()&amp;lt;/code&amp;gt; at the &amp;lt;idl&amp;gt;com.sun.star.task.JobExecutor&amp;lt;/idl&amp;gt; service. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JobList&amp;lt;/code&amp;gt; &lt;br /&gt;
| set of &amp;lt;code&amp;gt;TimeStamp&amp;lt;/code&amp;gt; entries. This set contains a list of all &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt; names of jobs that are bound to this event. Every job registration can be combined with time stamp values. Please refer to the description of the template &amp;lt;code&amp;gt;TimeStamp&amp;lt;/code&amp;gt; below for details&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As an optional feature, every job registration that is bound to an event can be enabled or disabled by two time stamp values. In a shared installation of {{PRODUCTNAME}}, an administrator can use the &amp;lt;code&amp;gt;AdminTime&amp;lt;/code&amp;gt; value to reactivate jobs for every newly started user office instance; regardless of earlier executions of these jobs. That can be useful, for example, for updating user installations if new functions have been added to the shared installation. &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#EDEDED&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Properties of the TimeStamp template&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;AdminTime&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. This value must be formatted according to the ISO 8601. It contains the time stamp, which can only be adjusted by an administrator, to reactivate this job.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;UserTime&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. This value must be formatted according to the ISO 8601. It contains the time, when this job was finished successfully last time upon the configured event.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Using this time stamp feature can sometimes be complicated. For example, assume that there is a job that was installed using the Extension Manager. The job is enabled for a registered event by default, but after the first execution it is disabled. By default, both values (&amp;lt;code&amp;gt;AdminTime&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;UserTime&amp;lt;/code&amp;gt;) do not exist for a configured event. A &amp;#039;&amp;#039;Jobs.xcu&amp;#039;&amp;#039; fragment, as part of the extension, must also not contain the &amp;lt;code&amp;gt;AdminTime&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;UserTime&amp;lt;/code&amp;gt; entries. Because both values are not there, no check can be made and the job is enabled. A job can be deactivated by the global job executor once it has finished its work successfully (depending on the &amp;lt;code&amp;gt;Deactivate&amp;lt;/code&amp;gt; return value). In that case, the &amp;lt;code&amp;gt;UserTime&amp;lt;/code&amp;gt; entry is generated and set to the current time. An administrator can set a newer and valid &amp;lt;code&amp;gt;AdminTime&amp;lt;/code&amp;gt; value in order to reactivate the job again, or the user can remove his &amp;lt;code&amp;gt;UserTime&amp;lt;/code&amp;gt; entry manually from the configuration file of the user installation. &lt;br /&gt;
&lt;br /&gt;
The following &amp;#039;&amp;#039;Jobs.xcu&amp;#039;&amp;#039; file shows an example job configuration: &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;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;!DOCTYPE oor:component-data SYSTEM &amp;quot;../../../../component-update.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;oor:component-data oor:name=&amp;quot;Jobs&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;Jobs&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;SyncJob&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;Service&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;value&amp;gt;com.sun.star.comp.framework.java.services.SyncJob&amp;lt;/value&amp;gt;&lt;br /&gt;
              &amp;lt;/prop&amp;gt;&lt;br /&gt;
              &amp;lt;node oor:name=&amp;quot;Arguments&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;prop oor:name=&amp;quot;arg_1&amp;quot; oor:type=&amp;quot;xs:string&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;val_1&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;Events&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;onFirstVisibleTask&amp;quot; oor:op=&amp;quot;fuse&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;node oor:name=&amp;quot;JobList&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;node oor:name=&amp;quot;SyncJob&amp;quot; oor:op=&amp;quot;replace&amp;quot;/&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;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example job has the following characteristics: &lt;br /&gt;
&lt;br /&gt;
*Its alias name is &amp;quot;&amp;lt;code&amp;gt;SyncJob&amp;lt;/code&amp;gt;&amp;quot; &lt;br /&gt;
*The UNO implementation name of the component is &amp;lt;code&amp;gt;com.sun.star.comp.framework.java.services.SyncJob&amp;lt;/code&amp;gt;. &lt;br /&gt;
*The job has its own set of configuration data with one item. It is a string, its name is &amp;lt;code&amp;gt;arg_1&amp;lt;/code&amp;gt; and its value is &amp;quot;&amp;lt;code&amp;gt;val_1&amp;lt;/code&amp;gt;&amp;quot;. &lt;br /&gt;
*The job is bound to the global event &amp;lt;code&amp;gt;onFirstVisibleTask&amp;lt;/code&amp;gt;, which is triggered when the first document window of a new {{PRODUCTNAME}} instance is displayed. The next execution of this job is guaranteed, because there are no time stamp values present.&lt;br /&gt;
&lt;br /&gt;
When specifying the event to which the job is bound (&amp;lt;code&amp;gt;onFirstVisibleTask&amp;lt;/code&amp;gt; in the above example), it is important to use &amp;lt;code&amp;gt;oor:op=&amp;quot;fuse&amp;quot;&amp;lt;/code&amp;gt;, so that multiple &amp;#039;&amp;#039;Jobs.xcu&amp;#039;&amp;#039; particles merge losslessly. but note that &amp;lt;code&amp;gt;oor:op=&amp;quot;fuse&amp;quot;&amp;lt;/code&amp;gt; is only available since OpenOffice.org 2.0.3, and that a &amp;#039;&amp;#039;Jobs.xcu&amp;#039;&amp;#039; file that uses it cannot be used with older versions of OpenOffice.org. With older versions of OpenOffice.org, it was common to use &amp;lt;code&amp;gt;oor:op=&amp;quot;replace&amp;quot;&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;oor:op=&amp;quot;fuse&amp;quot;&amp;lt;/code&amp;gt;, which potentially caused event bindings to get lost when multiple &amp;#039;&amp;#039;Jobs.xcu&amp;#039;&amp;#039; particles were merged. &lt;br /&gt;
&lt;br /&gt;
{{Documentation/Caution|A job is not executed when it has deactivated itself and is called afterwards by a &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;vnd.sun.star.jobs:event=...&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; command URL. This can be confusing to users, especially with add-ons, since it would seem that the customized UI items do not function.}} &lt;br /&gt;
&lt;br /&gt;
{{PDL1}} &lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s_Guide/Writing_UNO_Components]]&lt;/div&gt;</summary>
		<author><name>Java1cprog</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Jobs/Configuration&amp;diff=181179</id>
		<title>Documentation/DevGuide/WritingUNO/Jobs/Configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Jobs/Configuration&amp;diff=181179"/>
		<updated>2010-09-01T14:55:30Z</updated>

		<summary type="html">&lt;p&gt;Java1cprog: I improved XML view for better reading.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/WritingUNOTOC&lt;br /&gt;
|WritingUNO2e=block&lt;br /&gt;
|WritingUNO2Jobs=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/WritingUNO/Jobs/Returning Results&lt;br /&gt;
|NextPage=Documentation/DevGuide/WritingUNO/Jobs/Installation&lt;br /&gt;
}} {{Documentation/DevGuideLanguages|Documentation/DevGuide/WritingUNO/Jobs/{{SUBPAGENAME}}}} {{DISPLAYTITLE:Configuration}} Although jobs that are called through a &amp;#039;&amp;#039;vnd.sun.star.jobs:&amp;#039;&amp;#039; URL by their implementation name do not require it, a job usually has configuration data. The configuration package &amp;#039;&amp;#039;org.openoffice.Office.Jobs&amp;#039;&amp;#039; contains all necessary information: &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;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;!DOCTYPE oor:component-schema SYSTEM &amp;quot;../../../../component-schema.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;oor:component-schema 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; &lt;br /&gt;
                        xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; &lt;br /&gt;
                        oor:name=&amp;quot;Jobs&amp;quot; &lt;br /&gt;
                        oor:package=&amp;quot;org.openoffice.Office&amp;quot; &lt;br /&gt;
                        xml:lang=&amp;quot;en-US&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;templates&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;Job&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;Service&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;group oor:name=&amp;quot;Arguments&amp;quot; oor:extensible=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/group&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;TimeStamp&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;AdminTime&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;UserTime&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/group&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;Event&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;set oor:name=&amp;quot;JobList&amp;quot; oor:node-type=&amp;quot;TimeStamp&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/group&amp;gt;&lt;br /&gt;
      &amp;lt;/templates&amp;gt;&lt;br /&gt;
      &amp;lt;component&amp;gt;&lt;br /&gt;
          &amp;lt;set oor:name=&amp;quot;Jobs&amp;quot; oor:node-type=&amp;quot;Job&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;set oor:name=&amp;quot;Events&amp;quot; oor:node-type=&amp;quot;Event&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;/component&amp;gt;&lt;br /&gt;
  &amp;lt;/oor:component-schema&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Job template contains all properties that describe a job component. Instances of this template are located inside the configuration set Jobs. &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#EDEDED&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Properties of the Job template&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. This property is declared as the name of the corresponding set node inside the configuration set &amp;lt;code&amp;gt;Jobs&amp;lt;/code&amp;gt;. It must be a unique name, which represents the structured information of a job. In the example &amp;#039;&amp;#039;.xcu&amp;#039;&amp;#039; file below its value is &amp;quot;&amp;lt;code&amp;gt;SyncJob&amp;lt;/code&amp;gt;&amp;quot;. In the job execution arguments this property is passed as &amp;lt;code&amp;gt;Config - Alias&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Service&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. Represents the UNO implementation name of the job component. In the job execution arguments this property is passed as &amp;lt;code&amp;gt;Config - Service&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Arguments&amp;lt;/code&amp;gt; &lt;br /&gt;
| set of any entries. This list can be filled with any values and represents the private set of configuration data for this job. In the job execution arguments this property is passed as &amp;lt;code&amp;gt;JobConfig&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The job property &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt; was created to provide you with more flexibility for a developing components. You can use the same UNO implementation, but register it with different Aliases. At runtime the job instance will be initialized with its own configuration data and can detect which representation is used. &lt;br /&gt;
&lt;br /&gt;
{{Documentation/Caution|You cannot use the generic UNO service names &amp;lt;idl&amp;gt;com.sun.star.task.Job&amp;lt;/idl&amp;gt; or &amp;lt;idl&amp;gt;com.sun.star.task.AsyncJob&amp;lt;/idl&amp;gt; for the &amp;lt;tt&amp;gt;Service&amp;lt;/tt&amp;gt; job property, because the job executor cannot identify the correct job implementation. To avoid ambiguities, it is necessary to use the UNO implementation name of the component.}} &lt;br /&gt;
&lt;br /&gt;
Every job instance can be bound to multiple events. An event indicates a special office state, which can be detected at runtime (for example, &amp;lt;code&amp;gt;OnFirstVisibleTask&amp;lt;/code&amp;gt; ), and which can be triggered by a call to the job executor when the first document window is displayed. &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#EDEDED&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Properties of the Event template&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;EventName&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. This property is declared as the name of the corresponding set node inside the configuration set &amp;lt;code&amp;gt;Events&amp;lt;/code&amp;gt;. It must be a unique name, which describes a functional state. In the example &amp;#039;&amp;#039;.xcu&amp;#039;&amp;#039; file below its value is &amp;quot;&amp;lt;code&amp;gt;onFirstVisibleTask&amp;lt;/code&amp;gt;&amp;quot;. &lt;br /&gt;
Section [[Documentation/DevGuide/WritingUNO/Jobs/List of Supported Events|List of Supported Events]] summarizes the events currently triggered by the office. In addition, developers can use arbitrary event strings with the &amp;#039;&amp;#039;vnd.sun.star.jobs:&amp;#039;&amp;#039; URL or in calls to &amp;lt;code&amp;gt;trigger()&amp;lt;/code&amp;gt; at the &amp;lt;idl&amp;gt;com.sun.star.task.JobExecutor&amp;lt;/idl&amp;gt; service. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;JobList&amp;lt;/code&amp;gt; &lt;br /&gt;
| set of &amp;lt;code&amp;gt;TimeStamp&amp;lt;/code&amp;gt; entries. This set contains a list of all &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt; names of jobs that are bound to this event. Every job registration can be combined with time stamp values. Please refer to the description of the template &amp;lt;code&amp;gt;TimeStamp&amp;lt;/code&amp;gt; below for details&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As an optional feature, every job registration that is bound to an event can be enabled or disabled by two time stamp values. In a shared installation of {{PRODUCTNAME}}, an administrator can use the &amp;lt;code&amp;gt;AdminTime&amp;lt;/code&amp;gt; value to reactivate jobs for every newly started user office instance; regardless of earlier executions of these jobs. That can be useful, for example, for updating user installations if new functions have been added to the shared installation. &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#EDEDED&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Properties of the TimeStamp template&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;AdminTime&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. This value must be formatted according to the ISO 8601. It contains the time stamp, which can only be adjusted by an administrator, to reactivate this job.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;UserTime&amp;lt;/code&amp;gt; &lt;br /&gt;
| string. This value must be formatted according to the ISO 8601. It contains the time, when this job was finished successfully last time upon the configured event.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Using this time stamp feature can sometimes be complicated. For example, assume that there is a job that was installed using the Extension Manager. The job is enabled for a registered event by default, but after the first execution it is disabled. By default, both values (&amp;lt;code&amp;gt;AdminTime&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;UserTime&amp;lt;/code&amp;gt;) do not exist for a configured event. A &amp;#039;&amp;#039;Jobs.xcu&amp;#039;&amp;#039; fragment, as part of the extension, must also not contain the &amp;lt;code&amp;gt;AdminTime&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;UserTime&amp;lt;/code&amp;gt; entries. Because both values are not there, no check can be made and the job is enabled. A job can be deactivated by the global job executor once it has finished its work successfully (depending on the &amp;lt;code&amp;gt;Deactivate&amp;lt;/code&amp;gt; return value). In that case, the &amp;lt;code&amp;gt;UserTime&amp;lt;/code&amp;gt; entry is generated and set to the current time. An administrator can set a newer and valid &amp;lt;code&amp;gt;AdminTime&amp;lt;/code&amp;gt; value in order to reactivate the job again, or the user can remove his &amp;lt;code&amp;gt;UserTime&amp;lt;/code&amp;gt; entry manually from the configuration file of the user installation. &lt;br /&gt;
&lt;br /&gt;
The following &amp;#039;&amp;#039;Jobs.xcu&amp;#039;&amp;#039; file shows an example job configuration: &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;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;!DOCTYPE oor:component-data SYSTEM &amp;quot;../../../../component-update.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;oor:component-data oor:name=&amp;quot;Jobs&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;Jobs&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;SyncJob&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;Service&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;value&amp;gt;com.sun.star.comp.framework.java.services.SyncJob&amp;lt;/value&amp;gt;&lt;br /&gt;
              &amp;lt;/prop&amp;gt;&lt;br /&gt;
              &amp;lt;node oor:name=&amp;quot;Arguments&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;prop oor:name=&amp;quot;arg_1&amp;quot; oor:type=&amp;quot;xs:string&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;val_1&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;Events&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;onFirstVisibleTask&amp;quot; oor:op=&amp;quot;fuse&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;node oor:name=&amp;quot;JobList&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;node oor:name=&amp;quot;SyncJob&amp;quot; oor:op=&amp;quot;replace&amp;quot;/&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;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example job has the following characteristics: &lt;br /&gt;
&lt;br /&gt;
*Its alias name is &amp;quot;&amp;lt;code&amp;gt;SyncJob&amp;lt;/code&amp;gt;&amp;quot; &lt;br /&gt;
*The UNO implementation name of the component is &amp;lt;code&amp;gt;com.sun.star.comp.framework.java.services.SyncJob&amp;lt;/code&amp;gt;. &lt;br /&gt;
*The job has its own set of configuration data with one item. It is a string, its name is &amp;lt;code&amp;gt;arg_1&amp;lt;/code&amp;gt; and its value is &amp;quot;&amp;lt;code&amp;gt;val_1&amp;lt;/code&amp;gt;&amp;quot;. &lt;br /&gt;
*The job is bound to the global event &amp;lt;code&amp;gt;onFirstVisibleTask&amp;lt;/code&amp;gt;, which is triggered when the first document window of a new {{PRODUCTNAME}} instance is displayed. The next execution of this job is guaranteed, because there are no time stamp values present.&lt;br /&gt;
&lt;br /&gt;
When specifying the event to which the job is bound (&amp;lt;code&amp;gt;onFirstVisibleTask&amp;lt;/code&amp;gt; in the above example), it is important to use &amp;lt;code&amp;gt;oor:op=&amp;quot;fuse&amp;quot;&amp;lt;/code&amp;gt;, so that multiple &amp;#039;&amp;#039;Jobs.xcu&amp;#039;&amp;#039; particles merge losslessly. but note that &amp;lt;code&amp;gt;oor:op=&amp;quot;fuse&amp;quot;&amp;lt;/code&amp;gt; is only available since OpenOffice.org 2.0.3, and that a &amp;#039;&amp;#039;Jobs.xcu&amp;#039;&amp;#039; file that uses it cannot be used with older versions of OpenOffice.org. With older versions of OpenOffice.org, it was common to use &amp;lt;code&amp;gt;oor:op=&amp;quot;replace&amp;quot;&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;oor:op=&amp;quot;fuse&amp;quot;&amp;lt;/code&amp;gt;, which potentially caused event bindings to get lost when multiple &amp;#039;&amp;#039;Jobs.xcu&amp;#039;&amp;#039; particles were merged. &lt;br /&gt;
&lt;br /&gt;
{{Documentation/Caution|A job is not executed when it has deactivated itself and is called afterwards by a &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;vnd.sun.star.jobs:event=...&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; command URL. This can be confusing to users, especially with add-ons, since it would seem that the customized UI items do not function.}} &lt;br /&gt;
&lt;br /&gt;
{{PDL1}} &lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s_Guide/Writing_UNO_Components]]&lt;/div&gt;</summary>
		<author><name>Java1cprog</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Configuration&amp;diff=181159</id>
		<title>Documentation/DevGuide/WritingUNO/Configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Configuration&amp;diff=181159"/>
		<updated>2010-09-01T10:08:04Z</updated>

		<summary type="html">&lt;p&gt;Java1cprog: Fix XML view in an example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/WritingUNOTOC&lt;br /&gt;
|WritingUNO2e=block&lt;br /&gt;
|WritingUNO2Protocol=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/WritingUNO/Implementation&lt;br /&gt;
|NextPage=Documentation/DevGuide/WritingUNO/Installation&lt;br /&gt;
}} {{Documentation/DevGuideLanguages|Documentation/DevGuide/WritingUNO/{{SUBPAGENAME}}}} {{DISPLAYTITLE:Configuration}} A protocol handler needs configuration entries, which provide the framework with the necessary information to find the handler. The schema of the configuration branch &amp;#039;&amp;#039;org.openoffice.Office.ProtocolHandler&amp;#039;&amp;#039; defines how to bind handler instances to their URL schemas: &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;!DOCTYPE oor:component-schema SYSTEM &amp;quot;../../../../component-schema.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;oor:component-schema 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; &lt;br /&gt;
                        xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; &lt;br /&gt;
                        oor:name=&amp;quot;ProtocolHandler&amp;quot; &lt;br /&gt;
                        oor:package=&amp;quot;org.openoffice.Office&amp;quot; &lt;br /&gt;
                        xml:lang=&amp;quot;en-US&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;templates&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;Handler&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;/group&amp;gt;&lt;br /&gt;
      &amp;lt;/templates&amp;gt;&lt;br /&gt;
          &amp;lt;component&amp;gt;&lt;br /&gt;
              &amp;lt;set oor:name=&amp;quot;HandlerSet&amp;quot; oor:node-type=&amp;quot;Handler&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/component&amp;gt;&lt;br /&gt;
  &amp;lt;/oor:component-schema&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt; Each set node entry specifies one protocol handler, using its UNO implementation name. The only property it has is the Protocols item. Its type must be &amp;lt;code&amp;gt;[string-list]&amp;lt;/code&amp;gt; and it contains a list of URL schemas bound to the handler. Wildcards are allowed, otherwise the entire string must match the dispatched URL. &lt;br /&gt;
&lt;br /&gt;
=== Configuration for vnd.sun.star.framework.ExampleHandler  ===&lt;br /&gt;
&lt;br /&gt;
The following example ProtocolHandler.xcu contains the protocol handler configuration for the example&amp;#039;s Java protocol handler: &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;
  &amp;lt;oor:component-data oor:name=&amp;quot;ProtocolHandler&amp;quot; &lt;br /&gt;
                      oor:package=&amp;quot;org.openoffice.Office&amp;quot; &lt;br /&gt;
                      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; &lt;br /&gt;
                      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;vnd.sun.star.framework.ExampleHandler&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;Protocols&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;value&amp;gt;myProtocol_1://* myProtocol_2://*&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;/source&amp;gt; The example adds two new URL protocols using wildcards: &lt;br /&gt;
&lt;br /&gt;
  myProtocol_1://*&lt;br /&gt;
 myProtocol_2://*&lt;br /&gt;
&lt;br /&gt;
Both protocols are bound to the handler implementation &amp;lt;code&amp;gt;vnd.sun.star.framework.ExampleHandler&amp;lt;/code&amp;gt;. Note that this must be the implementation name of the handler, not the name of the service &amp;lt;idl&amp;gt;com.sun.star.frame.ProtocolHandler&amp;lt;/idl&amp;gt; it implements. Because all implementations of the service &amp;lt;idl&amp;gt;com.sun.star.frame.ProtocolHandler&amp;lt;/idl&amp;gt; share the same UNO service name, you cannot use this name in the configuration files. &lt;br /&gt;
&lt;br /&gt;
To prevent ambiguous implementation names, the following naming schema for implementation names is frequently used: &lt;br /&gt;
&lt;br /&gt;
  vnd.&amp;amp;lt;namespace_of_company&amp;amp;gt;.&amp;amp;lt;namespace_of_implementation&amp;amp;gt;.&amp;amp;lt;class_name&amp;amp;gt; &lt;br /&gt;
&lt;br /&gt;
e.g. &amp;lt;code&amp;gt;vnd.sun.star.framework.ExampleHandler&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;namespace_of_company&amp;amp;gt;= sun.star&lt;br /&gt;
 &amp;amp;lt;namespace_of_implementation&amp;amp;gt;= framework&lt;br /&gt;
 &amp;amp;lt;class_name&amp;amp;gt;= ExampleHandler &lt;br /&gt;
&lt;br /&gt;
An alternative would be the naming convention proposed in [[Documentation/DevGuide/WritingUNO/XServiceInfo|XServiceInfo]]: &lt;br /&gt;
&lt;br /&gt;
  &amp;amp;lt;namespace_of_creator&amp;amp;gt;.comp.&amp;amp;lt;namespace_of_implementation&amp;amp;gt;.&amp;amp;lt;class_name&amp;amp;gt; &lt;br /&gt;
&lt;br /&gt;
e.g. &amp;lt;code&amp;gt;org.openoffice.comp.framework.OProtocolHandler&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
All of these conventions are proposals; what matters is: &lt;br /&gt;
&lt;br /&gt;
*use the implementation name in the configuration file, not the general service name &amp;quot;com.sun.star.frame.ProtocolHandler&amp;quot; &lt;br /&gt;
*be careful to choose an implementation name that is likely to be unique, and be aware that your handler ceases to function when another developer adds a handler with the same name.&lt;br /&gt;
&lt;br /&gt;
=== Configuration for org.openoffice.Office.addon.example  ===&lt;br /&gt;
&lt;br /&gt;
The following &amp;#039;&amp;#039;ProtocolHandler.xcu&amp;#039;&amp;#039; file configures the example&amp;#039;s C++ protocol handler with the implementation name &amp;#039;&amp;#039;org.openoffice.Office.addon.example&amp;#039;&amp;#039; in the configuration branch &amp;#039;&amp;#039;org.openoffice.Office.ProtocolHandler&amp;#039;&amp;#039; following the same schema. &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;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;ProtocolHandler&amp;quot; oor:package=&amp;quot;org.openoffice.Office&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.Office.addon.example&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.Office.addon.example:*&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;/source&amp;gt; The configuration adds one new URL protocol using wildcards: &lt;br /&gt;
&lt;br /&gt;
  org.openoffice.Office.addon.example:*&lt;br /&gt;
&lt;br /&gt;
Based on this URL protocol, the C++ protocol handler can route, for example, a dispatched URL &lt;br /&gt;
&lt;br /&gt;
  org.openoffice.Office.addon.example:Function1 &lt;br /&gt;
&lt;br /&gt;
to the corresponding target routine. See the implementation of the &amp;lt;code&amp;gt;dispatch()&amp;lt;/code&amp;gt; method in the &amp;lt;code&amp;gt;XDispatch&amp;lt;/code&amp;gt; interface of the C++ source fragment above. &lt;br /&gt;
&lt;br /&gt;
{{PDL1}} &lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s_Guide/Writing_UNO_Components]]&lt;/div&gt;</summary>
		<author><name>Java1cprog</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Implementation&amp;diff=181147</id>
		<title>Documentation/DevGuide/WritingUNO/Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Implementation&amp;diff=181147"/>
		<updated>2010-09-01T03:55:36Z</updated>

		<summary type="html">&lt;p&gt;Java1cprog: Fixe error of using AnyConverter.toObject method&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/WritingUNOTOC&lt;br /&gt;
|WritingUNO2e=block&lt;br /&gt;
|WritingUNO2Protocol=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/WritingUNO/Protocol Handler&lt;br /&gt;
|NextPage=Documentation/DevGuide/WritingUNO/Configuration&lt;br /&gt;
}}&lt;br /&gt;
{{Documentation/DevGuideLanguages|Documentation/DevGuide/WritingUNO/{{SUBPAGENAME}}}}&lt;br /&gt;
{{DISPLAYTITLE:Implementation}}&lt;br /&gt;
&amp;lt;!--&amp;lt;idltopic&amp;gt;com.sun.star.frame.ProtocolHandler;com.sun.star.frame.XDispatchProvider&amp;lt;/idltopic&amp;gt;--&amp;gt;&lt;br /&gt;
A protocol handler implementation must follow the service definition &amp;lt;idl&amp;gt;com.sun.star.frame.ProtocolHandler&amp;lt;/idl&amp;gt;. At least the interface &amp;lt;idl&amp;gt;com.sun.star.frame.XDispatchProvider&amp;lt;/idl&amp;gt; must be supported. &lt;br /&gt;
&lt;br /&gt;
[[Image:ProtocolHandler.png|none|thumb|350px|Protocol handler]]&lt;br /&gt;
&lt;br /&gt;
The interface &amp;lt;code&amp;gt;XDispatchProvider&amp;lt;/code&amp;gt; supports two methods:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  XDispatch queryDispatch( [in] ::com::sun::star::util::URL URL, &lt;br /&gt;
                           [in] string TargetFrameName,&lt;br /&gt;
                           [in] long SearchFlags )&lt;br /&gt;
  sequence&amp;lt; XDispatch &amp;gt; queryDispatches( [in] sequence&amp;lt; DispatchDescriptor &amp;gt; Requests )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The protocol handler is asked for its agreement to execute a given URL by a call to the interface method [http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XDispatchProvider.html#queryDispatch com.sun.star.frame.XDispatchProvider:queryDispatch()]. The incoming URL should be parsed and validated. If the URL is valid and the protocol handler is able to handle it, it should return a dispatch object, thus indicating that it accepts the request.&lt;br /&gt;
&lt;br /&gt;
The dispatch object must support the interface &amp;lt;idl&amp;gt;com.sun.star.frame.XDispatch&amp;lt;/idl&amp;gt; with the methods&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  [oneway] void dispatch( [in] ::com::sun::star::util::URL URL,&lt;br /&gt;
                          [in] sequence&amp;lt; ::com::sun::star::beans::PropertyValue &amp;gt; Arguments )&lt;br /&gt;
  addStatusListener [oneway] void addStatusListener( [in] XStatusListener Control,&lt;br /&gt;
                                                     [in] ::com::sun::star::util::URL URL )&lt;br /&gt;
  removeStatusListener [oneway] void removeStatusListener( [in] XStatusListener Control,&lt;br /&gt;
                                                           [in] ::com::sun::star::util::URL URL )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Optionally, the dispatch object can support the interface &amp;lt;idl&amp;gt;com.sun.star.frame.XNotifyingDispatch&amp;lt;/idl&amp;gt;, which derives from &amp;lt;code&amp;gt;XDispatch&amp;lt;/code&amp;gt; and introduces a new method &amp;lt;code&amp;gt;dispatchWithNotification()&amp;lt;/code&amp;gt;. This interface is preferred if it is present.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  [oneway] void dispatchWithNotification(&lt;br /&gt;
          [in] com::sun::star::util::URL URL,&lt;br /&gt;
          [in] sequence&amp;lt;com::sun::star::beans::PropertyValue&amp;gt; Arguments,&lt;br /&gt;
          [in] com::sun::star::frame::XDispatchResultListener Listener);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
A basic protocol handler is free to implement XDispatch itself, so it can simply return itself in the &amp;lt;code&amp;gt;queryDispatch()&amp;lt;/code&amp;gt; implementation. But it is advisable to return specialized helper dispatch objects instead of the protocol handler instance. This helps to decrease the complexity of status updates. It is easier to notify status listeners for a single-use dispatch object instead of multi-use dispatch objects, which have to distinguish the URLs given in &amp;lt;code&amp;gt;addStatusListener()&amp;lt;/code&amp;gt; all the time.&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Tip|To supply the UI with status information for a command, it is required to call back a &amp;lt;idl&amp;gt;com.sun.star.frame.XStatusListener&amp;lt;/idl&amp;gt; during its registration immediately, for example:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;public void addStatusListener(XStatusListener xControl, URL aURL) { &lt;br /&gt;
      FeatureStateEvent aState = new FeatureStateEvent(); &lt;br /&gt;
      aState.FeatureURL = aURL; &lt;br /&gt;
      aState.IsEnabled = true; &lt;br /&gt;
      aState.State = Boolean.TRUE; &lt;br /&gt;
      xControl.statusChanged(aState); &lt;br /&gt;
      m_lListenerContainer.add(xControl);&lt;br /&gt;
  }&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A protocol handler can support the interface &amp;lt;idl&amp;gt;com.sun.star.lang.XInitialization&amp;lt;/idl&amp;gt; if it wants to be initialized with a &amp;lt;idl&amp;gt;com.sun.star.frame.Frame&amp;lt;/idl&amp;gt; environment to work with. &amp;lt;code&amp;gt;XInitialization&amp;lt;/code&amp;gt; contains one method:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  void initialize( [in] sequence&amp;lt; any &amp;gt; aArguments )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
A protocol handler is generally used in a well known &amp;lt;idl&amp;gt;com.sun.star.frame.Frame&amp;lt;/idl&amp;gt; context, therefore the dispatch framework always passes this frame context through &amp;lt;code&amp;gt;initialize()&amp;lt;/code&amp;gt; as the first argument, if &amp;lt;code&amp;gt;XInitialization&amp;lt;/code&amp;gt; is present. Its &amp;lt;idl&amp;gt;com.sun.star.frame.XFrame&amp;lt;/idl&amp;gt; interface provides access to the controller, from which you can get the document model and have a good starting point to work with the document.&lt;br /&gt;
&lt;br /&gt;
The illustration below shows how to get to the controller and the document model from an XFrame interface. The chapter [[Documentation/DevGuide/OfficeDev/Using the Component Framework|Using the Component Framework]] describes the usage of frames, controllers and models in more detail.&lt;br /&gt;
&lt;br /&gt;
[[Image:FCMNavigation.png|none|thumb|500px|Frame-controller-model organization]]&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Note|A protocol handler can be implemented as a singleton, but this poses multithreading difficulties. In a multithreaded environment it is most unlikely that the initial frame context matches every following dispatch request. So you have to be prepared for calls to &amp;lt;tt&amp;gt;initialize()&amp;lt;/tt&amp;gt; by multiple threads for multiple frames. A dispatch object can also be used more then once, but must be bound to the target frame that was specified in the original &amp;lt;tt&amp;gt;queryDispatch()&amp;lt;/tt&amp;gt; call. A change of the frame context can cause trouble if the protocol handler returns itself as a dispatch object. A protocol handler singleton must return new dispatch objects for every request, which has to be initialized with the current context of the protocol handler, and you have to synchronize between &amp;lt;tt&amp;gt;initialize()&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;queryDispatch()&amp;lt;/tt&amp;gt;. The protocol handler would have to serve as a kind of factory for specialized dispatch objects. You can avoid these problems, if you write your protocol handler as a multi-instance service.}}&lt;br /&gt;
&lt;br /&gt;
The opportunity to deny a &amp;lt;code&amp;gt;queryDispatch()&amp;lt;/code&amp;gt; call allows you to register a protocol handler for a URL schema using wildcards, and to accept only a subset of all possible URLs. That way the handler object can validate incoming URLs and reject them if they appear to be invalid. However, this feature should not be used to register different protocol handlers for the same URL schema and accept different subsets by different handler objects, because it would be very difficult to avoid ambiguities.&lt;br /&gt;
&lt;br /&gt;
Since a protocol handler is a UNO component, it must contain the component operations needed by a UNO service manager. These operations are certain static methods in Java or export functions in C++. It also has to implement the core interfaces used to enable communication with UNO and the application environment. For more information on the component operations and core interfaces, please see [[Documentation/DevGuide/WritingUNO/Component Architecture|Component Architecture]] and [[Documentation/DevGuide/WritingUNO/Core Interfaces to Implement|Core Interfaces to Implement]].&lt;br /&gt;
&lt;br /&gt;
=== Java Protocol Handler - vnd.sun.star.framework.ExampleHandler  ===&lt;br /&gt;
&lt;br /&gt;
The following example shows a simple protocol handler implementation in Java. For simplicity, the component operations are omitted. &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  // imports&lt;br /&gt;
  import com.sun.star.beans.*;&lt;br /&gt;
  import com.sun.star.frame.*;&lt;br /&gt;
  import com.sun.star.uno.*;&lt;br /&gt;
  import com.sun.star.util.*;&lt;br /&gt;
  &lt;br /&gt;
  // definition&lt;br /&gt;
  public class ExampleHandler implements com.sun.star.frame.XDispatchProvider,&lt;br /&gt;
      com.sun.star.lang.XInitialization {&lt;br /&gt;
      // member&lt;br /&gt;
      /** points to the frame context in which this handler runs, is set in initialize()*/&lt;br /&gt;
      private com.sun.star.frame.XFrame m_xContext;&lt;br /&gt;
  &lt;br /&gt;
      // Dispatch object as inner class&lt;br /&gt;
      class OwnDispatch implements com.sun.star.frame.XDispatch {&lt;br /&gt;
          /** the target frame, in which context this dispatch must work */&lt;br /&gt;
          private com.sun.star.frame.XFrame m_xContext;&lt;br /&gt;
  &lt;br /&gt;
          /** describe the function of this dispatch.&lt;br /&gt;
           *  Because a URL can contain e.g. optional arguments&lt;br /&gt;
           *  this URL means the main part of such URL sets only. */&lt;br /&gt;
          private com.sun.star.util.URL m_aMainURL;&lt;br /&gt;
  &lt;br /&gt;
          /** contains all interested status listener for this dispatch */&lt;br /&gt;
          private java.lang.HashMap m_lListener;&lt;br /&gt;
  &lt;br /&gt;
          /** take over all neccessary parameters from outside. */&lt;br /&gt;
          public OwnDispatch(com.sun.star.frame.XFrame xContext, com.sun.star.util.URL aMainURL) {&lt;br /&gt;
              m_xContext = xContext;&lt;br /&gt;
              m_aMainURL = aMainURL;&lt;br /&gt;
          }&lt;br /&gt;
  &lt;br /&gt;
          /** execute the functionality, which is described by this URL.&lt;br /&gt;
           *&lt;br /&gt;
           *  @param aURL&lt;br /&gt;
           *  this URL can describe the main function, we already know;&lt;br /&gt;
           *  but it can specify a sub function too! But queryDispatch()&lt;br /&gt;
           *  and dispatch() are used in a generic way ...&lt;br /&gt;
           *  m_aMainURL and aURL will be the same.&lt;br /&gt;
           *&lt;br /&gt;
           *  @param lArgs&lt;br /&gt;
           *  optional arguments for this request&lt;br /&gt;
           */&lt;br /&gt;
          public void dispatch(com.sun.star.util.URL aURL, com.sun.star.beans.PropertyValue lArgs)&lt;br /&gt;
              throws com.sun.star.uno.RuntimeException {&lt;br /&gt;
              // ... do function&lt;br /&gt;
              // ... inform listener if necessary&lt;br /&gt;
          }&lt;br /&gt;
  &lt;br /&gt;
          /** register a new listener and bind it toe given URL.&lt;br /&gt;
           *&lt;br /&gt;
           *  Note: Because the listener does not know the current state&lt;br /&gt;
           *  and may nobody change it next time, it is neccessary to inform it&lt;br /&gt;
           *  immediately about this current state. So the listener is up to date.&lt;br /&gt;
           */&lt;br /&gt;
          public void addStatusListener(com.sun.star.frame.XStatusListener xListener,&lt;br /&gt;
                  com.sun.star.util.URL aURL) throws com.sun.star.uno.RuntimeException {&lt;br /&gt;
              // ... register listener for given URL&lt;br /&gt;
              // ... inform it immediatly about current state!&lt;br /&gt;
              xListener.statusChanged(...);&lt;br /&gt;
          }&lt;br /&gt;
          &lt;br /&gt;
          /** deregister a listener for this URL. */&lt;br /&gt;
          public void removeStatusListener(com.sun.star.frame.XStatusListener xListener,&lt;br /&gt;
                  com.sun.star.util.URLaURL) throws com.sun.star.uno.RuntimeException {&lt;br /&gt;
              // ... deregister listener for given URL&lt;br /&gt;
          }&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      /** set the target frame reference as context for all following dispatches. */&lt;br /&gt;
      public void initialize(com.sun.star.uno.Any[] lContext) {&lt;br /&gt;
        m_xContext = (com.sun.star.frame.XFrame)AnyConverter.toObject(com.sun.star.frame.XFrame.class, lContext[0]);&lt;br /&gt;
      }&lt;br /&gt;
      &lt;br /&gt;
      /** should return a valid dispatch object for the given URL.&lt;br /&gt;
       *&lt;br /&gt;
       *  In case the URL is not valid an empty reference can be returned.&lt;br /&gt;
       *  The parameter sTarget and nFlags can be ignored. The will be &amp;quot;_self&amp;quot; and 0&lt;br /&gt;
       *  everytime.&lt;br /&gt;
       */&lt;br /&gt;
      public com.sun.star.frame.XDispatch queryDispatch(com.sun.star.util.URL aURL,&lt;br /&gt;
              java.lang.String sTarget, int nFlags ) throws com.sun.star.uno.RuntimeException {&lt;br /&gt;
          // check if given URL is valid for this protocol handler&lt;br /&gt;
          if (!aURL.Main.startsWith(&amp;quot;myProtocol_1://&amp;quot;) &amp;amp;&amp;amp; !aURL.Main.startsWith(&amp;quot;myProtocol_2://&amp;quot;))&lt;br /&gt;
              return null;&lt;br /&gt;
          // and return a specialized dispatch object&lt;br /&gt;
          // Of course &amp;quot;return this&amp;quot; would be possible too ...&lt;br /&gt;
          return (com.sun.star.frame.XDispatch)(new OwnDispatch(m_xContext, aURL));&lt;br /&gt;
      }&lt;br /&gt;
    &lt;br /&gt;
      /** optimized API call for remote.&lt;br /&gt;
       *&lt;br /&gt;
       *  It should be forwarded to queryDispatch() for every request item of the&lt;br /&gt;
       *  given DispatchDescriptor list.&lt;br /&gt;
       *&lt;br /&gt;
       *  But note: it is not allowed to pack the return list of dispatch objects.&lt;br /&gt;
       *  Every request in source list must match to a reference (null or valid) in&lt;br /&gt;
       *  the destination list!&lt;br /&gt;
       */&lt;br /&gt;
      public com.sun.star.frame.XDispatch[] queryDispatches( &lt;br /&gt;
              com.sun.star.frame.DispatchDescriptor[] lRequests) throws com.sun.star.uno.RuntimeException {&lt;br /&gt;
          int c = lRequests.length;&lt;br /&gt;
          com.sun.star.frame.XDispatch[] lDispatches = new com.sun.star.frame.XDispatch[c];&lt;br /&gt;
          for (int i=0; i&amp;lt;c; ++i)&lt;br /&gt;
              lDispatches[i] = queryDispatch(lRequests[i].FeatureURL,&lt;br /&gt;
                  lRequests[i].FrameName, lRequests[i].SearchFlags);&lt;br /&gt;
          return lDispatches;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C++ Protocol Handler - org.openoffice.Office.addon.example ===&lt;br /&gt;
&lt;br /&gt;
The next example shows a protocol handler in C++. The section [[Documentation/DevGuide/WritingUNO/AddOns/Add-Ons|Add-Ons]] below will integrate this example handler into the graphical user interface of {{PRODUCTNAME}}.&lt;br /&gt;
&lt;br /&gt;
The following code shows the UNO component operations that must be implemented in a C++ protocol handler example. The three C functions return vital information to the UNO environment:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;component_getImplementationEnvironment()&amp;lt;/code&amp;gt; tells the shared library component loader which compiler was used to build the library.&lt;br /&gt;
* &amp;lt;code&amp;gt;component_writeInfo()&amp;lt;/code&amp;gt; is called during the registration process by the registration tool &amp;#039;&amp;#039;regcomp&amp;#039;&amp;#039;, or indirectly when you use the Extension Manager.&lt;br /&gt;
* &amp;lt;code&amp;gt;component_getFactory()&amp;lt;/code&amp;gt; provides a single service factory for the requested implementation. This factory can be asked to create an arbitrary number of instances for only one service specification, therefore it is called a single service factory, as opposed to a multi-service factory, where you can order instances for many different service specifications. (A single service factory has nothing to do with a singleton).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
  #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  #ifndef _RTL_USTRING_HXX_&lt;br /&gt;
  #include &amp;lt;rtl/ustring.hxx&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  &lt;br /&gt;
  #ifndef _CPPUHELPER_QUERYINTERFACE_HXX_&lt;br /&gt;
  #include &amp;lt;cppuhelper/queryinterface.hxx&amp;gt; // helper for queryInterface() impl&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _CPPUHELPER_FACTORY_HXX_&lt;br /&gt;
  #include &amp;lt;cppuhelper/factory.hxx&amp;gt; // helper for component factory&lt;br /&gt;
  #endif&lt;br /&gt;
  // generated c++ interfaces&lt;br /&gt;
  &lt;br /&gt;
  #ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/lang/XSingleServiceFactory.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/lang/XMultiServiceFactory.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/lang/XServiceInfo.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_REGISTRY_XREGISTRYKEY_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/registry/XRegistryKey.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  &lt;br /&gt;
  // include our specific addon header to get access to functions and definitions&lt;br /&gt;
  #include &amp;lt;addon.hxx&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  using namespace ::rtl;&lt;br /&gt;
  using namespace ::osl;&lt;br /&gt;
  using namespace ::cppu;&lt;br /&gt;
  using namespace ::com::sun::star::uno;&lt;br /&gt;
  using namespace ::com::sun::star::lang;&lt;br /&gt;
  using namespace ::com::sun::star::registry; &lt;br /&gt;
  &lt;br /&gt;
  //##################################################################################################&lt;br /&gt;
  //#### EXPORTED ####################################################################################&lt;br /&gt;
  //##################################################################################################&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  /**&lt;br /&gt;
   *  Gives the environment this component belongs to.&lt;br /&gt;
   */&lt;br /&gt;
  extern &amp;quot;C&amp;quot; void SAL_CALL component_getImplementationEnvironment(const sal_Char **   ppEnvTypeName, uno_Environment ** ppEnv)&lt;br /&gt;
  {&lt;br /&gt;
      *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  /**&lt;br /&gt;
   *  This function creates an implementation section in the registry and another subkey&lt;br /&gt;
   *&lt;br /&gt;
   *  for each supported service.&lt;br /&gt;
   *  @param pServiceManager the service manager&lt;br /&gt;
   *  @param pRegistryKey the registry key&lt;br /&gt;
   */&lt;br /&gt;
  extern &amp;quot;C&amp;quot; sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void * pRegistryKey) {&lt;br /&gt;
      sal_Bool result = sal_False;&lt;br /&gt;
  &lt;br /&gt;
      if (pRegistryKey) {&lt;br /&gt;
          try {&lt;br /&gt;
              Reference&amp;lt; XRegistryKey &amp;gt; xNewKey(&lt;br /&gt;
                  reinterpret_cast&amp;lt; XRegistryKey * &amp;gt;( pRegistryKey )-&amp;gt;createKey(&lt;br /&gt;
                      OUString( RTL_CONSTASCII_USTRINGPARAM(&amp;quot;/&amp;quot; IMPLEMENTATION_NAME &amp;quot;/UNO/SERVICES&amp;quot;)) ) );&lt;br /&gt;
    &lt;br /&gt;
  &lt;br /&gt;
              const Sequence&amp;lt; OUString &amp;gt; &amp;amp; rSNL = Addon_getSupportedServiceNames();&lt;br /&gt;
              const OUString * pArray = rSNL.getConstArray();&lt;br /&gt;
              for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )&lt;br /&gt;
                 xNewKey-&amp;gt;createKey( pArray[nPos] );&lt;br /&gt;
  &lt;br /&gt;
              return sal_True;&lt;br /&gt;
          }&lt;br /&gt;
          catch (InvalidRegistryException &amp;amp;) {&lt;br /&gt;
             // we should not ignore exceptions&lt;br /&gt;
          }&lt;br /&gt;
      }&lt;br /&gt;
      return result;&lt;br /&gt;
  }&lt;br /&gt;
    &lt;br /&gt;
  /**&lt;br /&gt;
   *  This function is called to get service factories for an implementation.&lt;br /&gt;
   *&lt;br /&gt;
   *  @param pImplName name of implementation&lt;br /&gt;
   *  @param pServiceManager a service manager, need for component creation&lt;br /&gt;
   *  @param pRegistryKey the registry key for this component, need for persistent data&lt;br /&gt;
   *  @return a component factory &lt;br /&gt;
   */&lt;br /&gt;
  &lt;br /&gt;
  extern &amp;quot;C&amp;quot; void * SAL_CALL component_getFactory(const sal_Char * pImplName,&lt;br /&gt;
          void * pServiceManager, void * pRegistryKey) {&lt;br /&gt;
      void * pRet = 0;&lt;br /&gt;
  &lt;br /&gt;
      if (rtl_str_compare( pImplName, IMPLEMENTATION_NAME ) == 0) {&lt;br /&gt;
          Reference&amp;lt; XSingleServiceFactory &amp;gt; xFactory(createSingleFactory(&lt;br /&gt;
              reinterpret_cast&amp;lt; XMultiServiceFactory * &amp;gt;(pServiceManager),&lt;br /&gt;
              OUString(RTL_CONSTASCII_USTRINGPARAM(IMPLEMENTATION_NAME)),&lt;br /&gt;
              Addon_createInstance,&lt;br /&gt;
              Addon_getSupportedServiceNames()));&lt;br /&gt;
  &lt;br /&gt;
          if (xFactory.is()) {&lt;br /&gt;
              xFactory-&amp;gt;acquire();&lt;br /&gt;
              pRet = xFactory.get();&lt;br /&gt;
          }&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      return pRet;&lt;br /&gt;
  } &lt;br /&gt;
  &lt;br /&gt;
  //##################################################################################################&lt;br /&gt;
  //#### Helper functions for the implementation of UNO component interfaces #########################&lt;br /&gt;
  //################################################################################################## &lt;br /&gt;
  ::rtl::OUString Addon_getImplementationName()&lt;br /&gt;
  throw (RuntimeException) {&lt;br /&gt;
      return ::rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) );&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  sal_Bool SAL_CALL Addon_supportsService( const ::rtl::OUString&amp;amp; ServiceName )&lt;br /&gt;
  throw (RuntimeException)&lt;br /&gt;
  {&lt;br /&gt;
      return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ) );&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  Sequence&amp;lt; ::rtl::OUString &amp;gt; SAL_CALL Addon_getSupportedServiceNames()&lt;br /&gt;
  throw (RuntimeException)&lt;br /&gt;
  {&lt;br /&gt;
          Sequence &amp;lt; ::rtl::OUString &amp;gt; aRet(1);&lt;br /&gt;
      ::rtl::OUString* pArray = aRet.getArray();&lt;br /&gt;
      pArray[0] = ::rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) );&lt;br /&gt;
      return aRet;&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  Reference&amp;lt; XInterface &amp;gt; SAL_CALL Addon_createInstance( const Reference&amp;lt; XMultiServiceFactory &amp;gt; &amp;amp; rSMgr)&lt;br /&gt;
      throw( Exception )&lt;br /&gt;
  {&lt;br /&gt;
      return (cppu::OWeakObject*) new Addon( rSMgr );&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The C++ protocol handler in the example has the implementation name &amp;lt;code&amp;gt;org.openoffice.Office.addon.example&amp;lt;/code&amp;gt;. It supports the URL protocol schema &amp;#039;&amp;#039;org.openoffice.Office.addon.example:&amp;#039;&amp;#039; and provides three different URL commands: &amp;lt;code&amp;gt;Function1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Function2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Help&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The protocol handler implements the &amp;lt;idl&amp;gt;com.sun.star.frame.XDispatch&amp;lt;/idl&amp;gt; interface, so it can return a reference to itself when it is queried for a dispatch object that matches the given URL.&lt;br /&gt;
&lt;br /&gt;
The implementation of the &amp;lt;code&amp;gt;dispatch()&amp;lt;/code&amp;gt; method below shows how the supported commands are routed inside the protocol handler. Based on the path part of the URL, a simple message box displays which function has been called. The message box is implemented using the UNO toolkit and uses the container windows of the given frame as parent window. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
  #ifndef _Addon_HXX&lt;br /&gt;
  #include &amp;lt;addon.hxx&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _OSL_DIAGNOSE_H_&lt;br /&gt;
  #include &amp;lt;osl/diagnose.h&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _RTL_USTRING_HXX_&lt;br /&gt;
  #include &amp;lt;rtl/ustring.hxx&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/lang/XMultiServiceFactory.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/beans/PropertyValue.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/frame/XFrame.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_FRAME_XCONTROLLER_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/frame/XController.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_AWT_XTOOLKIT_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/awt/XToolkit.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_AWT_XWINDOWPEER_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/awt/XWindowPeer.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_AWT_WINDOWATTRIBUTE_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/awt/WindowAttribute.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_AWT_XMESSAGEBOX_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/awt/XMessageBox.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  &lt;br /&gt;
  using rtl::OUString;&lt;br /&gt;
  using namespace com::sun::star::uno;&lt;br /&gt;
  using namespace com::sun::star::frame;&lt;br /&gt;
  using namespace com::sun::star::awt;&lt;br /&gt;
  using com::sun::star::lang::XMultiServiceFactory;&lt;br /&gt;
  using com::sun::star::beans::PropertyValue;&lt;br /&gt;
  using com::sun::star::util::URL;&lt;br /&gt;
  &lt;br /&gt;
  // This is the service name an Add-On has to implement&lt;br /&gt;
  #define SERVICE_NAME &amp;quot;com.sun.star.frame.ProtocolHandler&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  /**&lt;br /&gt;
   *  Show a message box with the UNO based toolkit&lt;br /&gt;
   */&lt;br /&gt;
  static void ShowMessageBox(const Reference&amp;lt; XToolkit &amp;gt;&amp;amp; rToolkit, const Reference&amp;lt; XFrame &amp;gt;&amp;amp; rFrame, const OUString&amp;amp; aTitle, const OUString&amp;amp; aMsgText)&lt;br /&gt;
  {&lt;br /&gt;
      if ( rFrame.is() &amp;amp;&amp;amp; rToolkit.is() )&lt;br /&gt;
      {&lt;br /&gt;
          // describe window properties. &lt;br /&gt;
          WindowDescriptor                aDescriptor; &lt;br /&gt;
          aDescriptor.Type              = WindowClass_MODALTOP ; &lt;br /&gt;
          aDescriptor.WindowServiceName = OUString( RTL_CONSTASCII_USTRINGPARAM( &amp;quot;infobox&amp;quot; ));&lt;br /&gt;
          aDescriptor.ParentIndex       = -1 ; &lt;br /&gt;
          aDescriptor.Parent            = Reference&amp;lt; XWindowPeer &amp;gt;( rFrame-&amp;gt;getContainerWindow(), UNO_QUERY ) ; &lt;br /&gt;
          aDescriptor.Bounds            = Rectangle(0,0,300,200) ; &lt;br /&gt;
          aDescriptor.WindowAttributes  = WindowAttribute::BORDER   | &lt;br /&gt;
                                          WindowAttribute::MOVEABLE | &lt;br /&gt;
                                          WindowAttribute::CLOSEABLE; &lt;br /&gt;
          Reference&amp;lt; XWindowPeer &amp;gt; xPeer = rToolkit-&amp;gt;createWindow( aDescriptor ); if ( xPeer.is() ) &lt;br /&gt;
          { &lt;br /&gt;
              Reference&amp;lt; XMessageBox &amp;gt; xMsgBox( xPeer, UNO_QUERY );&lt;br /&gt;
              if ( xMsgBox.is() )&lt;br /&gt;
              { &lt;br /&gt;
                  xMsgBox-&amp;gt;setCaptionText( aTitle ); &lt;br /&gt;
                  xMsgBox-&amp;gt;setMessageText( aMsgText ); &lt;br /&gt;
                  xMsgBox-&amp;gt;execute(); &lt;br /&gt;
              } &lt;br /&gt;
          } &lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  //##################################################################################################&lt;br /&gt;
  //#### Implementation of the ProtocolHandler and Dispatch Interfaces ###################&lt;br /&gt;
  //################################################################################################## &lt;br /&gt;
  // XInitialization &lt;br /&gt;
  /**&lt;br /&gt;
   *  Called by the Office framework.&lt;br /&gt;
   *  We store the context information&lt;br /&gt;
   *  given, like the frame we are bound to, into our members. &lt;br /&gt;
   */&lt;br /&gt;
  void SAL_CALL Addon::initialize( const Sequence&amp;lt; Any &amp;gt;&amp;amp; aArguments ) throw ( Exception, RuntimeException)&lt;br /&gt;
  {&lt;br /&gt;
      Reference &amp;lt; XFrame &amp;gt; xFrame;&lt;br /&gt;
      if ( aArguments.getLength() )&lt;br /&gt;
      {&lt;br /&gt;
          aArguments[0] &amp;gt;&amp;gt;= xFrame;&lt;br /&gt;
          mxFrame = xFrame;&lt;br /&gt;
      }&lt;br /&gt;
    &lt;br /&gt;
      // Create the toolkit to have access to it later&lt;br /&gt;
      mxToolkit = Reference&amp;lt; XToolkit &amp;gt;( mxMSF-&amp;gt;createInstance( &lt;br /&gt;
                                          OUString( RTL_CONSTASCII_USTRINGPARAM( &lt;br /&gt;
                                              &amp;quot;com.sun.star.awt.Toolkit&amp;quot; ))), UNO_QUERY );&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  // XDispatchProvider &lt;br /&gt;
  /** &lt;br /&gt;
   *  Called by the Office framework.&lt;br /&gt;
   *  We are ask to query the given URL and return a dispatch object if the URL&lt;br /&gt;
   *  contains an Add-On command.&lt;br /&gt;
   */&lt;br /&gt;
  Reference&amp;lt; XDispatch &amp;gt; SAL_CALL Addon::queryDispatch( const URL&amp;amp; aURL, const ::rtl::OUString&amp;amp; sTargetFrameName, sal_Int32 nSearchFlags )&lt;br /&gt;
                                  throw( RuntimeException )&lt;br /&gt;
  {&lt;br /&gt;
      Reference &amp;lt; XDispatch &amp;gt; xRet;&lt;br /&gt;
      if ( aURL.Protocol.compareToAscii(&amp;quot;org.openoffice.Office.addon.example:&amp;quot;) == 0 )&lt;br /&gt;
      {&lt;br /&gt;
          if ( aURL.Path.compareToAscii( &amp;quot;Function1&amp;quot; ) == 0 )&lt;br /&gt;
              xRet = this;&lt;br /&gt;
          else if ( aURL.Path.compareToAscii( &amp;quot;Function2&amp;quot; ) == 0 )&lt;br /&gt;
              xRet = this;&lt;br /&gt;
          else if ( aURL.Path.compareToAscii( &amp;quot;Help&amp;quot; ) == 0 )&lt;br /&gt;
              xRet = this;&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      return xRet;&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  /** &lt;br /&gt;
   *  Called by the Office framework.&lt;br /&gt;
   *  We are ask to query the given sequence of URLs and return dispatch objects if the URLs&lt;br /&gt;
   *  contain Add-On commands.&lt;br /&gt;
   */&lt;br /&gt;
  Sequence &amp;lt; Reference&amp;lt; XDispatch &amp;gt; &amp;gt; SAL_CALL Addon::queryDispatches( &lt;br /&gt;
          const Sequence &amp;lt; DispatchDescriptor &amp;gt;&amp;amp; seqDescripts )&lt;br /&gt;
          throw( RuntimeException )&lt;br /&gt;
  {&lt;br /&gt;
      sal_Int32 nCount = seqDescripts.getLength();&lt;br /&gt;
      Sequence &amp;lt; Reference &amp;lt; XDispatch &amp;gt; &amp;gt; lDispatcher( nCount );&lt;br /&gt;
  &lt;br /&gt;
      for( sal_Int32 i=0; i&amp;lt;nCount; ++i )&lt;br /&gt;
          lDispatcher[i] = queryDispatch( seqDescripts[i].FeatureURL, seqDescripts[i].FrameName, seqDescripts[i].SearchFlags );&lt;br /&gt;
      &lt;br /&gt;
      return lDispatcher;&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  // XDispatch &lt;br /&gt;
  /** &lt;br /&gt;
   *  Called by the Office framework.&lt;br /&gt;
   *  We are ask to execute the given Add-On command URL.&lt;br /&gt;
   */&lt;br /&gt;
  void SAL_CALL Addon::dispatch( const URL&amp;amp; aURL, const Sequence &amp;lt; PropertyValue &amp;gt;&amp;amp; lArgs ) throw (RuntimeException)&lt;br /&gt;
  {&lt;br /&gt;
      if ( aURL.Protocol.compareToAscii(&amp;quot;org.openoffice.Office.addon.example:&amp;quot;) == 0 )&lt;br /&gt;
      {&lt;br /&gt;
          if ( aURL.Path.compareToAscii( &amp;quot;Function1&amp;quot; ) == 0 )&lt;br /&gt;
          {&lt;br /&gt;
              ShowMessageBox( mxToolkit, mxFrame, &lt;br /&gt;
                              OUString( RTL_CONSTASCII_USTRINGPARAM( &amp;quot;SDK Add-On example&amp;quot; )),&lt;br /&gt;
                              OUString( RTL_CONSTASCII_USTRINGPARAM( &amp;quot;Function 1 activated&amp;quot; )) );&lt;br /&gt;
          }&lt;br /&gt;
          else if ( aURL.Path.compareToAscii( &amp;quot;Function2&amp;quot; ) == 0 )&lt;br /&gt;
          {&lt;br /&gt;
              ShowMessageBox( mxToolkit, mxFrame, &lt;br /&gt;
                              OUString( RTL_CONSTASCII_USTRINGPARAM( &amp;quot;SDK Add-On example&amp;quot; )),&lt;br /&gt;
                              OUString( RTL_CONSTASCII_USTRINGPARAM( &amp;quot;Function 2 activated&amp;quot; )) );&lt;br /&gt;
          }&lt;br /&gt;
          else if ( aURL.Path.compareToAscii( &amp;quot;Help&amp;quot; ) == 0 )&lt;br /&gt;
          {&lt;br /&gt;
              // Show info box&lt;br /&gt;
              ShowMessageBox( mxToolkit, mxFrame, &lt;br /&gt;
                              OUString( RTL_CONSTASCII_USTRINGPARAM( &amp;quot;About SDK Add-On example&amp;quot; )),&lt;br /&gt;
                              OUString( RTL_CONSTASCII_USTRINGPARAM( &amp;quot;This is the SDK Add-On example&amp;quot;)));&lt;br /&gt;
          }&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
  /** &lt;br /&gt;
   *  Called by the Office framework.&lt;br /&gt;
   *  We are asked to store a status listener for the given URL.&lt;br /&gt;
   */&lt;br /&gt;
  void SAL_CALL Addon::addStatusListener( const Reference&amp;lt; XStatusListener &amp;gt;&amp;amp; xControl, const URL&amp;amp; aURL ) throw (RuntimeException)&lt;br /&gt;
  {&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  /** &lt;br /&gt;
   *  Called by the Office framework.&lt;br /&gt;
   *  We are asked to remove a status listener for the given URL.&lt;br /&gt;
   */&lt;br /&gt;
  void SAL_CALL Addon::removeStatusListener( const Reference&amp;lt; XStatusListener &amp;gt;&amp;amp; xControl, &lt;br /&gt;
          const URL&amp;amp; aURL ) &lt;br /&gt;
          throw (RuntimeException)&lt;br /&gt;
  {&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  //##################################################################################################&lt;br /&gt;
  //#### Implementation of the recommended/mandatory interfaces of a UNO component ###################&lt;br /&gt;
  //################################################################################################## &lt;br /&gt;
  // XServiceInfo &lt;br /&gt;
  ::rtl::OUString SAL_CALL Addon::getImplementationName( )&lt;br /&gt;
          throw (RuntimeException)&lt;br /&gt;
  {&lt;br /&gt;
          return Addon_getImplementationName();&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  sal_Bool SAL_CALL Addon::supportsService( const ::rtl::OUString&amp;amp; rServiceName )&lt;br /&gt;
          throw (RuntimeException)&lt;br /&gt;
  {&lt;br /&gt;
          return Addon_supportsService( rServiceName );&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  Sequence&amp;lt; ::rtl::OUString &amp;gt; SAL_CALL Addon::getSupportedServiceNames( )&lt;br /&gt;
          throw (RuntimeException)&lt;br /&gt;
  {&lt;br /&gt;
          return Addon_getSupportedServiceNames();&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Writing UNO Components]]&lt;/div&gt;</summary>
		<author><name>Java1cprog</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Configuration&amp;diff=180459</id>
		<title>Documentation/DevGuide/WritingUNO/Configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Configuration&amp;diff=180459"/>
		<updated>2010-08-29T13:25:52Z</updated>

		<summary type="html">&lt;p&gt;Java1cprog: I improve design view of a long group of parameters&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/WritingUNOTOC&lt;br /&gt;
|WritingUNO2e=block&lt;br /&gt;
|WritingUNO2Protocol=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/WritingUNO/Implementation&lt;br /&gt;
|NextPage=Documentation/DevGuide/WritingUNO/Installation&lt;br /&gt;
}} {{Documentation/DevGuideLanguages|Documentation/DevGuide/WritingUNO/{{SUBPAGENAME}}}} {{DISPLAYTITLE:Configuration}} A protocol handler needs configuration entries, which provide the framework with the necessary information to find the handler. The schema of the configuration branch &amp;#039;&amp;#039;org.openoffice.Office.ProtocolHandler&amp;#039;&amp;#039; defines how to bind handler instances to their URL schemas: &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;!DOCTYPE oor:component-schema SYSTEM &amp;quot;../../../../component-schema.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;oor:component-schema 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; &lt;br /&gt;
                        xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; &lt;br /&gt;
                        oor:name=&amp;quot;ProtocolHandler&amp;quot; &lt;br /&gt;
                        oor:package=&amp;quot;org.openoffice.Office&amp;quot; &lt;br /&gt;
                        xml:lang=&amp;quot;en-US&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;templates&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;Handler&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;/group&amp;gt;&lt;br /&gt;
      &amp;lt;/templates&amp;gt;&lt;br /&gt;
          &amp;lt;component&amp;gt;&lt;br /&gt;
              &amp;lt;set oor:name=&amp;quot;HandlerSet&amp;quot; oor:node-type=&amp;quot;Handler&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/component&amp;gt;&lt;br /&gt;
  &amp;lt;/oor:component-schema&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt; Each set node entry specifies one protocol handler, using its UNO implementation name. The only property it has is the Protocols item. Its type must be &amp;lt;code&amp;gt;[string-list]&amp;lt;/code&amp;gt; and it contains a list of URL schemas bound to the handler. Wildcards are allowed, otherwise the entire string must match the dispatched URL. &lt;br /&gt;
&lt;br /&gt;
=== Configuration for vnd.sun.star.framework.ExampleHandler  ===&lt;br /&gt;
&lt;br /&gt;
The following example ProtocolHandler.xcu contains the protocol handler configuration for the example&amp;#039;s Java protocol handler: &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;
  &amp;lt;oor:component-data oor:name=&amp;quot;ProtocolHandler&amp;quot; &lt;br /&gt;
                      oor:package=&amp;quot;org.openoffice.Office&amp;quot; &lt;br /&gt;
                      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; &lt;br /&gt;
                      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;vnd.sun.star.framework.ExampleHandler&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;Protocols&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;value&amp;gt;myProtocol_1://* myProtocol_2://*&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;/source&amp;gt; The example adds two new URL protocols using wildcards: &lt;br /&gt;
&lt;br /&gt;
  myProtocol_1://*&lt;br /&gt;
 myProtocol_2://*&lt;br /&gt;
&lt;br /&gt;
Both protocols are bound to the handler implementation &amp;lt;code&amp;gt;vnd.sun.star.framework.ExampleHandler&amp;lt;/code&amp;gt;. Note that this must be the implementation name of the handler, not the name of the service &amp;lt;idl&amp;gt;com.sun.star.frame.ProtocolHandler&amp;lt;/idl&amp;gt; it implements. Because all implementations of the service &amp;lt;idl&amp;gt;com.sun.star.frame.ProtocolHandler&amp;lt;/idl&amp;gt; share the same UNO service name, you cannot use this name in the configuration files. &lt;br /&gt;
&lt;br /&gt;
To prevent ambiguous implementation names, the following naming schema for implementation names is frequently used: &lt;br /&gt;
&lt;br /&gt;
  vnd.&amp;amp;lt;namespace_of_company&amp;amp;gt;.&amp;amp;lt;namespace_of_implementation&amp;amp;gt;.&amp;amp;lt;class_name&amp;amp;gt; &lt;br /&gt;
&lt;br /&gt;
e.g. &amp;lt;code&amp;gt;vnd.sun.star.framework.ExampleHandler&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  &amp;amp;lt;namespace_of_company&amp;amp;gt;= sun.star&amp;amp;lt;&lt;br /&gt;
 namespace_of_implementation&amp;amp;gt;= framework&lt;br /&gt;
 &amp;amp;lt;class_name&amp;amp;gt;= ExampleHandler &lt;br /&gt;
&lt;br /&gt;
An alternative would be the naming convention proposed in [[Documentation/DevGuide/WritingUNO/XServiceInfo|XServiceInfo]]: &lt;br /&gt;
&lt;br /&gt;
  &amp;amp;lt;namespace_of_creator&amp;amp;gt;.comp.&amp;amp;lt;namespace_of_implementation&amp;amp;gt;.&amp;amp;lt;class_name&amp;amp;gt; &lt;br /&gt;
&lt;br /&gt;
e.g. &amp;lt;code&amp;gt;org.openoffice.comp.framework.OProtocolHandler&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
All of these conventions are proposals; what matters is: &lt;br /&gt;
&lt;br /&gt;
*use the implementation name in the configuration file, not the general service name &amp;quot;com.sun.star.frame.ProtocolHandler&amp;quot; &lt;br /&gt;
*be careful to choose an implementation name that is likely to be unique, and be aware that your handler ceases to function when another developer adds a handler with the same name.&lt;br /&gt;
&lt;br /&gt;
=== Configuration for org.openoffice.Office.addon.example  ===&lt;br /&gt;
&lt;br /&gt;
The following &amp;#039;&amp;#039;ProtocolHandler.xcu&amp;#039;&amp;#039; file configures the example&amp;#039;s C++ protocol handler with the implementation name &amp;#039;&amp;#039;org.openoffice.Office.addon.example&amp;#039;&amp;#039; in the configuration branch &amp;#039;&amp;#039;org.openoffice.Office.ProtocolHandler&amp;#039;&amp;#039; following the same schema. &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;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;ProtocolHandler&amp;quot; oor:package=&amp;quot;org.openoffice.Office&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.Office.addon.example&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.Office.addon.example:*&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;/source&amp;gt; The configuration adds one new URL protocol using wildcards: &lt;br /&gt;
&lt;br /&gt;
  org.openoffice.Office.addon.example:*&lt;br /&gt;
&lt;br /&gt;
Based on this URL protocol, the C++ protocol handler can route, for example, a dispatched URL &lt;br /&gt;
&lt;br /&gt;
  org.openoffice.Office.addon.example:Function1 &lt;br /&gt;
&lt;br /&gt;
to the corresponding target routine. See the implementation of the &amp;lt;code&amp;gt;dispatch()&amp;lt;/code&amp;gt; method in the &amp;lt;code&amp;gt;XDispatch&amp;lt;/code&amp;gt; interface of the C++ source fragment above. &lt;br /&gt;
&lt;br /&gt;
{{PDL1}} &lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s_Guide/Writing_UNO_Components]]&lt;/div&gt;</summary>
		<author><name>Java1cprog</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Configuration&amp;diff=180458</id>
		<title>Documentation/DevGuide/WritingUNO/Configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Configuration&amp;diff=180458"/>
		<updated>2010-08-29T13:24:43Z</updated>

		<summary type="html">&lt;p&gt;Java1cprog: I improve design view of a long group of parameters&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/WritingUNOTOC&lt;br /&gt;
|WritingUNO2e=block&lt;br /&gt;
|WritingUNO2Protocol=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/WritingUNO/Implementation&lt;br /&gt;
|NextPage=Documentation/DevGuide/WritingUNO/Installation&lt;br /&gt;
}} {{Documentation/DevGuideLanguages|Documentation/DevGuide/WritingUNO/{{SUBPAGENAME}}}} {{DISPLAYTITLE:Configuration}} A protocol handler needs configuration entries, which provide the framework with the necessary information to find the handler. The schema of the configuration branch &amp;#039;&amp;#039;org.openoffice.Office.ProtocolHandler&amp;#039;&amp;#039; defines how to bind handler instances to their URL schemas: &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;!DOCTYPE oor:component-schema SYSTEM &amp;quot;../../../../component-schema.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;oor:component-schema 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; &lt;br /&gt;
                        xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; &lt;br /&gt;
                        oor:name=&amp;quot;ProtocolHandler&amp;quot; &lt;br /&gt;
                        oor:package=&amp;quot;org.openoffice.Office&amp;quot; &lt;br /&gt;
                        xml:lang=&amp;quot;en-US&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;templates&amp;gt;&lt;br /&gt;
          &amp;lt;group oor:name=&amp;quot;Handler&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;/group&amp;gt;&lt;br /&gt;
      &amp;lt;/templates&amp;gt;&lt;br /&gt;
          &amp;lt;component&amp;gt;&lt;br /&gt;
              &amp;lt;set oor:name=&amp;quot;HandlerSet&amp;quot; oor:node-type=&amp;quot;Handler&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/component&amp;gt;&lt;br /&gt;
  &amp;lt;/oor:component-schema&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt; Each set node entry specifies one protocol handler, using its UNO implementation name. The only property it has is the Protocols item. Its type must be &amp;lt;code&amp;gt;[string-list]&amp;lt;/code&amp;gt; and it contains a list of URL schemas bound to the handler. Wildcards are allowed, otherwise the entire string must match the dispatched URL. &lt;br /&gt;
&lt;br /&gt;
=== Configuration for vnd.sun.star.framework.ExampleHandler  ===&lt;br /&gt;
&lt;br /&gt;
The following example ProtocolHandler.xcu contains the protocol handler configuration for the example&amp;#039;s Java protocol handler: &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;
  &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;vnd.sun.star.framework.ExampleHandler&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;prop oor:name=&amp;quot;Protocols&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;value&amp;gt;myProtocol_1://* myProtocol_2://*&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;/source&amp;gt; The example adds two new URL protocols using wildcards: &lt;br /&gt;
&lt;br /&gt;
  myProtocol_1://*&lt;br /&gt;
 myProtocol_2://*&lt;br /&gt;
&lt;br /&gt;
Both protocols are bound to the handler implementation &amp;lt;code&amp;gt;vnd.sun.star.framework.ExampleHandler&amp;lt;/code&amp;gt;. Note that this must be the implementation name of the handler, not the name of the service &amp;lt;idl&amp;gt;com.sun.star.frame.ProtocolHandler&amp;lt;/idl&amp;gt; it implements. Because all implementations of the service &amp;lt;idl&amp;gt;com.sun.star.frame.ProtocolHandler&amp;lt;/idl&amp;gt; share the same UNO service name, you cannot use this name in the configuration files. &lt;br /&gt;
&lt;br /&gt;
To prevent ambiguous implementation names, the following naming schema for implementation names is frequently used: &lt;br /&gt;
&lt;br /&gt;
  vnd.&amp;amp;lt;namespace_of_company&amp;amp;gt;.&amp;amp;lt;namespace_of_implementation&amp;amp;gt;.&amp;amp;lt;class_name&amp;amp;gt; &lt;br /&gt;
&lt;br /&gt;
e.g. &amp;lt;code&amp;gt;vnd.sun.star.framework.ExampleHandler&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  &amp;amp;lt;namespace_of_company&amp;amp;gt;= sun.star&amp;amp;lt;&lt;br /&gt;
 namespace_of_implementation&amp;amp;gt;= framework&lt;br /&gt;
 &amp;amp;lt;class_name&amp;amp;gt;= ExampleHandler &lt;br /&gt;
&lt;br /&gt;
An alternative would be the naming convention proposed in [[Documentation/DevGuide/WritingUNO/XServiceInfo|XServiceInfo]]: &lt;br /&gt;
&lt;br /&gt;
  &amp;amp;lt;namespace_of_creator&amp;amp;gt;.comp.&amp;amp;lt;namespace_of_implementation&amp;amp;gt;.&amp;amp;lt;class_name&amp;amp;gt; &lt;br /&gt;
&lt;br /&gt;
e.g. &amp;lt;code&amp;gt;org.openoffice.comp.framework.OProtocolHandler&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
All of these conventions are proposals; what matters is: &lt;br /&gt;
&lt;br /&gt;
*use the implementation name in the configuration file, not the general service name &amp;quot;com.sun.star.frame.ProtocolHandler&amp;quot; &lt;br /&gt;
*be careful to choose an implementation name that is likely to be unique, and be aware that your handler ceases to function when another developer adds a handler with the same name.&lt;br /&gt;
&lt;br /&gt;
=== Configuration for org.openoffice.Office.addon.example  ===&lt;br /&gt;
&lt;br /&gt;
The following &amp;#039;&amp;#039;ProtocolHandler.xcu&amp;#039;&amp;#039; file configures the example&amp;#039;s C++ protocol handler with the implementation name &amp;#039;&amp;#039;org.openoffice.Office.addon.example&amp;#039;&amp;#039; in the configuration branch &amp;#039;&amp;#039;org.openoffice.Office.ProtocolHandler&amp;#039;&amp;#039; following the same schema. &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;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;ProtocolHandler&amp;quot; oor:package=&amp;quot;org.openoffice.Office&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.Office.addon.example&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.Office.addon.example:*&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;/source&amp;gt; The configuration adds one new URL protocol using wildcards: &lt;br /&gt;
&lt;br /&gt;
  org.openoffice.Office.addon.example:*&lt;br /&gt;
&lt;br /&gt;
Based on this URL protocol, the C++ protocol handler can route, for example, a dispatched URL &lt;br /&gt;
&lt;br /&gt;
  org.openoffice.Office.addon.example:Function1 &lt;br /&gt;
&lt;br /&gt;
to the corresponding target routine. See the implementation of the &amp;lt;code&amp;gt;dispatch()&amp;lt;/code&amp;gt; method in the &amp;lt;code&amp;gt;XDispatch&amp;lt;/code&amp;gt; interface of the C++ source fragment above. &lt;br /&gt;
&lt;br /&gt;
{{PDL1}} &lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s_Guide/Writing_UNO_Components]]&lt;/div&gt;</summary>
		<author><name>Java1cprog</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Implementation&amp;diff=180454</id>
		<title>Documentation/DevGuide/WritingUNO/Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Implementation&amp;diff=180454"/>
		<updated>2010-08-29T10:45:43Z</updated>

		<summary type="html">&lt;p&gt;Java1cprog: Fix Java source&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/WritingUNOTOC&lt;br /&gt;
|WritingUNO2e=block&lt;br /&gt;
|WritingUNO2Protocol=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/WritingUNO/Protocol Handler&lt;br /&gt;
|NextPage=Documentation/DevGuide/WritingUNO/Configuration&lt;br /&gt;
}}&lt;br /&gt;
{{Documentation/DevGuideLanguages|Documentation/DevGuide/WritingUNO/{{SUBPAGENAME}}}}&lt;br /&gt;
{{DISPLAYTITLE:Implementation}}&lt;br /&gt;
&amp;lt;!--&amp;lt;idltopic&amp;gt;com.sun.star.frame.ProtocolHandler;com.sun.star.frame.XDispatchProvider&amp;lt;/idltopic&amp;gt;--&amp;gt;&lt;br /&gt;
A protocol handler implementation must follow the service definition &amp;lt;idl&amp;gt;com.sun.star.frame.ProtocolHandler&amp;lt;/idl&amp;gt;. At least the interface &amp;lt;idl&amp;gt;com.sun.star.frame.XDispatchProvider&amp;lt;/idl&amp;gt; must be supported. &lt;br /&gt;
&lt;br /&gt;
[[Image:ProtocolHandler.png|none|thumb|350px|Protocol handler]]&lt;br /&gt;
&lt;br /&gt;
The interface &amp;lt;code&amp;gt;XDispatchProvider&amp;lt;/code&amp;gt; supports two methods:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  XDispatch queryDispatch( [in] ::com::sun::star::util::URL URL, &lt;br /&gt;
                           [in] string TargetFrameName,&lt;br /&gt;
                           [in] long SearchFlags )&lt;br /&gt;
  sequence&amp;lt; XDispatch &amp;gt; queryDispatches( [in] sequence&amp;lt; DispatchDescriptor &amp;gt; Requests )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The protocol handler is asked for its agreement to execute a given URL by a call to the interface method [http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XDispatchProvider.html#queryDispatch com.sun.star.frame.XDispatchProvider:queryDispatch()]. The incoming URL should be parsed and validated. If the URL is valid and the protocol handler is able to handle it, it should return a dispatch object, thus indicating that it accepts the request.&lt;br /&gt;
&lt;br /&gt;
The dispatch object must support the interface &amp;lt;idl&amp;gt;com.sun.star.frame.XDispatch&amp;lt;/idl&amp;gt; with the methods&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  [oneway] void dispatch( [in] ::com::sun::star::util::URL URL,&lt;br /&gt;
                          [in] sequence&amp;lt; ::com::sun::star::beans::PropertyValue &amp;gt; Arguments )&lt;br /&gt;
  addStatusListener [oneway] void addStatusListener( [in] XStatusListener Control,&lt;br /&gt;
                                                     [in] ::com::sun::star::util::URL URL )&lt;br /&gt;
  removeStatusListener [oneway] void removeStatusListener( [in] XStatusListener Control,&lt;br /&gt;
                                                           [in] ::com::sun::star::util::URL URL )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Optionally, the dispatch object can support the interface &amp;lt;idl&amp;gt;com.sun.star.frame.XNotifyingDispatch&amp;lt;/idl&amp;gt;, which derives from &amp;lt;code&amp;gt;XDispatch&amp;lt;/code&amp;gt; and introduces a new method &amp;lt;code&amp;gt;dispatchWithNotification()&amp;lt;/code&amp;gt;. This interface is preferred if it is present.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  [oneway] void dispatchWithNotification(&lt;br /&gt;
          [in] com::sun::star::util::URL URL,&lt;br /&gt;
          [in] sequence&amp;lt;com::sun::star::beans::PropertyValue&amp;gt; Arguments,&lt;br /&gt;
          [in] com::sun::star::frame::XDispatchResultListener Listener);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
A basic protocol handler is free to implement XDispatch itself, so it can simply return itself in the &amp;lt;code&amp;gt;queryDispatch()&amp;lt;/code&amp;gt; implementation. But it is advisable to return specialized helper dispatch objects instead of the protocol handler instance. This helps to decrease the complexity of status updates. It is easier to notify status listeners for a single-use dispatch object instead of multi-use dispatch objects, which have to distinguish the URLs given in &amp;lt;code&amp;gt;addStatusListener()&amp;lt;/code&amp;gt; all the time.&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Tip|To supply the UI with status information for a command, it is required to call back a &amp;lt;idl&amp;gt;com.sun.star.frame.XStatusListener&amp;lt;/idl&amp;gt; during its registration immediately, for example:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;public void addStatusListener(XStatusListener xControl, URL aURL) { &lt;br /&gt;
      FeatureStateEvent aState = new FeatureStateEvent(); &lt;br /&gt;
      aState.FeatureURL = aURL; &lt;br /&gt;
      aState.IsEnabled = true; &lt;br /&gt;
      aState.State = Boolean.TRUE; &lt;br /&gt;
      xControl.statusChanged(aState); &lt;br /&gt;
      m_lListenerContainer.add(xControl);&lt;br /&gt;
  }&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A protocol handler can support the interface &amp;lt;idl&amp;gt;com.sun.star.lang.XInitialization&amp;lt;/idl&amp;gt; if it wants to be initialized with a &amp;lt;idl&amp;gt;com.sun.star.frame.Frame&amp;lt;/idl&amp;gt; environment to work with. &amp;lt;code&amp;gt;XInitialization&amp;lt;/code&amp;gt; contains one method:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  void initialize( [in] sequence&amp;lt; any &amp;gt; aArguments )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
A protocol handler is generally used in a well known &amp;lt;idl&amp;gt;com.sun.star.frame.Frame&amp;lt;/idl&amp;gt; context, therefore the dispatch framework always passes this frame context through &amp;lt;code&amp;gt;initialize()&amp;lt;/code&amp;gt; as the first argument, if &amp;lt;code&amp;gt;XInitialization&amp;lt;/code&amp;gt; is present. Its &amp;lt;idl&amp;gt;com.sun.star.frame.XFrame&amp;lt;/idl&amp;gt; interface provides access to the controller, from which you can get the document model and have a good starting point to work with the document.&lt;br /&gt;
&lt;br /&gt;
The illustration below shows how to get to the controller and the document model from an XFrame interface. The chapter [[Documentation/DevGuide/OfficeDev/Using the Component Framework|Using the Component Framework]] describes the usage of frames, controllers and models in more detail.&lt;br /&gt;
&lt;br /&gt;
[[Image:FCMNavigation.png|none|thumb|500px|Frame-controller-model organization]]&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Note|A protocol handler can be implemented as a singleton, but this poses multithreading difficulties. In a multithreaded environment it is most unlikely that the initial frame context matches every following dispatch request. So you have to be prepared for calls to &amp;lt;tt&amp;gt;initialize()&amp;lt;/tt&amp;gt; by multiple threads for multiple frames. A dispatch object can also be used more then once, but must be bound to the target frame that was specified in the original &amp;lt;tt&amp;gt;queryDispatch()&amp;lt;/tt&amp;gt; call. A change of the frame context can cause trouble if the protocol handler returns itself as a dispatch object. A protocol handler singleton must return new dispatch objects for every request, which has to be initialized with the current context of the protocol handler, and you have to synchronize between &amp;lt;tt&amp;gt;initialize()&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;queryDispatch()&amp;lt;/tt&amp;gt;. The protocol handler would have to serve as a kind of factory for specialized dispatch objects. You can avoid these problems, if you write your protocol handler as a multi-instance service.}}&lt;br /&gt;
&lt;br /&gt;
The opportunity to deny a &amp;lt;code&amp;gt;queryDispatch()&amp;lt;/code&amp;gt; call allows you to register a protocol handler for a URL schema using wildcards, and to accept only a subset of all possible URLs. That way the handler object can validate incoming URLs and reject them if they appear to be invalid. However, this feature should not be used to register different protocol handlers for the same URL schema and accept different subsets by different handler objects, because it would be very difficult to avoid ambiguities.&lt;br /&gt;
&lt;br /&gt;
Since a protocol handler is a UNO component, it must contain the component operations needed by a UNO service manager. These operations are certain static methods in Java or export functions in C++. It also has to implement the core interfaces used to enable communication with UNO and the application environment. For more information on the component operations and core interfaces, please see [[Documentation/DevGuide/WritingUNO/Component Architecture|Component Architecture]] and [[Documentation/DevGuide/WritingUNO/Core Interfaces to Implement|Core Interfaces to Implement]].&lt;br /&gt;
&lt;br /&gt;
=== Java Protocol Handler - vnd.sun.star.framework.ExampleHandler  ===&lt;br /&gt;
&lt;br /&gt;
The following example shows a simple protocol handler implementation in Java. For simplicity, the component operations are omitted. &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  // imports&lt;br /&gt;
  import com.sun.star.beans.*;&lt;br /&gt;
  import com.sun.star.frame.*;&lt;br /&gt;
  import com.sun.star.uno.*;&lt;br /&gt;
  import com.sun.star.util.*;&lt;br /&gt;
  &lt;br /&gt;
  // definition&lt;br /&gt;
  public class ExampleHandler implements com.sun.star.frame.XDispatchProvider,&lt;br /&gt;
      com.sun.star.lang.XInitialization {&lt;br /&gt;
      // member&lt;br /&gt;
      /** points to the frame context in which this handler runs, is set in initialize()*/&lt;br /&gt;
      private com.sun.star.frame.XFrame m_xContext;&lt;br /&gt;
  &lt;br /&gt;
      // Dispatch object as inner class&lt;br /&gt;
      class OwnDispatch implements com.sun.star.frame.XDispatch {&lt;br /&gt;
          /** the target frame, in which context this dispatch must work */&lt;br /&gt;
          private com.sun.star.frame.XFrame m_xContext;&lt;br /&gt;
  &lt;br /&gt;
          /** describe the function of this dispatch.&lt;br /&gt;
           *  Because a URL can contain e.g. optional arguments&lt;br /&gt;
           *  this URL means the main part of such URL sets only. */&lt;br /&gt;
          private com.sun.star.util.URL m_aMainURL;&lt;br /&gt;
  &lt;br /&gt;
          /** contains all interested status listener for this dispatch */&lt;br /&gt;
          private java.lang.HashMap m_lListener;&lt;br /&gt;
  &lt;br /&gt;
          /** take over all neccessary parameters from outside. */&lt;br /&gt;
          public OwnDispatch(com.sun.star.frame.XFrame xContext, com.sun.star.util.URL aMainURL) {&lt;br /&gt;
              m_xContext = xContext;&lt;br /&gt;
              m_aMainURL = aMainURL;&lt;br /&gt;
          }&lt;br /&gt;
  &lt;br /&gt;
          /** execute the functionality, which is described by this URL.&lt;br /&gt;
           *&lt;br /&gt;
           *  @param aURL&lt;br /&gt;
           *  this URL can describe the main function, we already know;&lt;br /&gt;
           *  but it can specify a sub function too! But queryDispatch()&lt;br /&gt;
           *  and dispatch() are used in a generic way ...&lt;br /&gt;
           *  m_aMainURL and aURL will be the same.&lt;br /&gt;
           *&lt;br /&gt;
           *  @param lArgs&lt;br /&gt;
           *  optional arguments for this request&lt;br /&gt;
           */&lt;br /&gt;
          public void dispatch(com.sun.star.util.URL aURL, com.sun.star.beans.PropertyValue lArgs)&lt;br /&gt;
              throws com.sun.star.uno.RuntimeException {&lt;br /&gt;
              // ... do function&lt;br /&gt;
              // ... inform listener if necessary&lt;br /&gt;
          }&lt;br /&gt;
  &lt;br /&gt;
          /** register a new listener and bind it toe given URL.&lt;br /&gt;
           *&lt;br /&gt;
           *  Note: Because the listener does not know the current state&lt;br /&gt;
           *  and may nobody change it next time, it is neccessary to inform it&lt;br /&gt;
           *  immediately about this current state. So the listener is up to date.&lt;br /&gt;
           */&lt;br /&gt;
          public void addStatusListener(com.sun.star.frame.XStatusListener xListener,&lt;br /&gt;
                  com.sun.star.util.URL aURL) throws com.sun.star.uno.RuntimeException {&lt;br /&gt;
              // ... register listener for given URL&lt;br /&gt;
              // ... inform it immediatly about current state!&lt;br /&gt;
              xListener.statusChanged(...);&lt;br /&gt;
          }&lt;br /&gt;
          &lt;br /&gt;
          /** deregister a listener for this URL. */&lt;br /&gt;
          public void removeStatusListener(com.sun.star.frame.XStatusListener xListener,&lt;br /&gt;
                  com.sun.star.util.URLaURL) throws com.sun.star.uno.RuntimeException {&lt;br /&gt;
              // ... deregister listener for given URL&lt;br /&gt;
          }&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      /** set the target frame reference as context for all following dispatches. */&lt;br /&gt;
      public void initialize(com.sun.star.uno.Any[] lContext) {&lt;br /&gt;
m_xContext = (com.sun.star.frame.XFrame)com.sun.star.uno.AnyConverter.toObject(lContext[0]);&lt;br /&gt;
      }&lt;br /&gt;
      &lt;br /&gt;
      /** should return a valid dispatch object for the given URL.&lt;br /&gt;
       *&lt;br /&gt;
       *  In case the URL is not valid an empty reference can be returned.&lt;br /&gt;
       *  The parameter sTarget and nFlags can be ignored. The will be &amp;quot;_self&amp;quot; and 0&lt;br /&gt;
       *  everytime.&lt;br /&gt;
       */&lt;br /&gt;
      public com.sun.star.frame.XDispatch queryDispatch(com.sun.star.util.URL aURL,&lt;br /&gt;
              java.lang.String sTarget, int nFlags ) throws com.sun.star.uno.RuntimeException {&lt;br /&gt;
          // check if given URL is valid for this protocol handler&lt;br /&gt;
          if (!aURL.Main.startsWith(&amp;quot;myProtocol_1://&amp;quot;) &amp;amp;&amp;amp; !aURL.Main.startsWith(&amp;quot;myProtocol_2://&amp;quot;))&lt;br /&gt;
              return null;&lt;br /&gt;
          // and return a specialized dispatch object&lt;br /&gt;
          // Of course &amp;quot;return this&amp;quot; would be possible too ...&lt;br /&gt;
          return (com.sun.star.frame.XDispatch)(new OwnDispatch(m_xContext, aURL));&lt;br /&gt;
      }&lt;br /&gt;
    &lt;br /&gt;
      /** optimized API call for remote.&lt;br /&gt;
       *&lt;br /&gt;
       *  It should be forwarded to queryDispatch() for every request item of the&lt;br /&gt;
       *  given DispatchDescriptor list.&lt;br /&gt;
       *&lt;br /&gt;
       *  But note: it is not allowed to pack the return list of dispatch objects.&lt;br /&gt;
       *  Every request in source list must match to a reference (null or valid) in&lt;br /&gt;
       *  the destination list!&lt;br /&gt;
       */&lt;br /&gt;
      public com.sun.star.frame.XDispatch[] queryDispatches( &lt;br /&gt;
              com.sun.star.frame.DispatchDescriptor[] lRequests) throws com.sun.star.uno.RuntimeException {&lt;br /&gt;
          int c = lRequests.length;&lt;br /&gt;
          com.sun.star.frame.XDispatch[] lDispatches = new com.sun.star.frame.XDispatch[c];&lt;br /&gt;
          for (int i=0; i&amp;lt;c; ++i)&lt;br /&gt;
              lDispatches[i] = queryDispatch(lRequests[i].FeatureURL,&lt;br /&gt;
                  lRequests[i].FrameName, lRequests[i].SearchFlags);&lt;br /&gt;
          return lDispatches;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C++ Protocol Handler - org.openoffice.Office.addon.example ===&lt;br /&gt;
&lt;br /&gt;
The next example shows a protocol handler in C++. The section [[Documentation/DevGuide/WritingUNO/AddOns/Add-Ons|Add-Ons]] below will integrate this example handler into the graphical user interface of {{PRODUCTNAME}}.&lt;br /&gt;
&lt;br /&gt;
The following code shows the UNO component operations that must be implemented in a C++ protocol handler example. The three C functions return vital information to the UNO environment:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;component_getImplementationEnvironment()&amp;lt;/code&amp;gt; tells the shared library component loader which compiler was used to build the library.&lt;br /&gt;
* &amp;lt;code&amp;gt;component_writeInfo()&amp;lt;/code&amp;gt; is called during the registration process by the registration tool &amp;#039;&amp;#039;regcomp&amp;#039;&amp;#039;, or indirectly when you use the Extension Manager.&lt;br /&gt;
* &amp;lt;code&amp;gt;component_getFactory()&amp;lt;/code&amp;gt; provides a single service factory for the requested implementation. This factory can be asked to create an arbitrary number of instances for only one service specification, therefore it is called a single service factory, as opposed to a multi-service factory, where you can order instances for many different service specifications. (A single service factory has nothing to do with a singleton).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
  #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  #ifndef _RTL_USTRING_HXX_&lt;br /&gt;
  #include &amp;lt;rtl/ustring.hxx&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  &lt;br /&gt;
  #ifndef _CPPUHELPER_QUERYINTERFACE_HXX_&lt;br /&gt;
  #include &amp;lt;cppuhelper/queryinterface.hxx&amp;gt; // helper for queryInterface() impl&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _CPPUHELPER_FACTORY_HXX_&lt;br /&gt;
  #include &amp;lt;cppuhelper/factory.hxx&amp;gt; // helper for component factory&lt;br /&gt;
  #endif&lt;br /&gt;
  // generated c++ interfaces&lt;br /&gt;
  &lt;br /&gt;
  #ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/lang/XSingleServiceFactory.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/lang/XMultiServiceFactory.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/lang/XServiceInfo.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_REGISTRY_XREGISTRYKEY_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/registry/XRegistryKey.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  &lt;br /&gt;
  // include our specific addon header to get access to functions and definitions&lt;br /&gt;
  #include &amp;lt;addon.hxx&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  using namespace ::rtl;&lt;br /&gt;
  using namespace ::osl;&lt;br /&gt;
  using namespace ::cppu;&lt;br /&gt;
  using namespace ::com::sun::star::uno;&lt;br /&gt;
  using namespace ::com::sun::star::lang;&lt;br /&gt;
  using namespace ::com::sun::star::registry; &lt;br /&gt;
  &lt;br /&gt;
  //##################################################################################################&lt;br /&gt;
  //#### EXPORTED ####################################################################################&lt;br /&gt;
  //##################################################################################################&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  /**&lt;br /&gt;
   *  Gives the environment this component belongs to.&lt;br /&gt;
   */&lt;br /&gt;
  extern &amp;quot;C&amp;quot; void SAL_CALL component_getImplementationEnvironment(const sal_Char **   ppEnvTypeName, uno_Environment ** ppEnv)&lt;br /&gt;
  {&lt;br /&gt;
      *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  /**&lt;br /&gt;
   *  This function creates an implementation section in the registry and another subkey&lt;br /&gt;
   *&lt;br /&gt;
   *  for each supported service.&lt;br /&gt;
   *  @param pServiceManager the service manager&lt;br /&gt;
   *  @param pRegistryKey the registry key&lt;br /&gt;
   */&lt;br /&gt;
  extern &amp;quot;C&amp;quot; sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void * pRegistryKey) {&lt;br /&gt;
      sal_Bool result = sal_False;&lt;br /&gt;
  &lt;br /&gt;
      if (pRegistryKey) {&lt;br /&gt;
          try {&lt;br /&gt;
              Reference&amp;lt; XRegistryKey &amp;gt; xNewKey(&lt;br /&gt;
                  reinterpret_cast&amp;lt; XRegistryKey * &amp;gt;( pRegistryKey )-&amp;gt;createKey(&lt;br /&gt;
                      OUString( RTL_CONSTASCII_USTRINGPARAM(&amp;quot;/&amp;quot; IMPLEMENTATION_NAME &amp;quot;/UNO/SERVICES&amp;quot;)) ) );&lt;br /&gt;
    &lt;br /&gt;
  &lt;br /&gt;
              const Sequence&amp;lt; OUString &amp;gt; &amp;amp; rSNL = Addon_getSupportedServiceNames();&lt;br /&gt;
              const OUString * pArray = rSNL.getConstArray();&lt;br /&gt;
              for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )&lt;br /&gt;
                 xNewKey-&amp;gt;createKey( pArray[nPos] );&lt;br /&gt;
  &lt;br /&gt;
              return sal_True;&lt;br /&gt;
          }&lt;br /&gt;
          catch (InvalidRegistryException &amp;amp;) {&lt;br /&gt;
             // we should not ignore exceptions&lt;br /&gt;
          }&lt;br /&gt;
      }&lt;br /&gt;
      return result;&lt;br /&gt;
  }&lt;br /&gt;
    &lt;br /&gt;
  /**&lt;br /&gt;
   *  This function is called to get service factories for an implementation.&lt;br /&gt;
   *&lt;br /&gt;
   *  @param pImplName name of implementation&lt;br /&gt;
   *  @param pServiceManager a service manager, need for component creation&lt;br /&gt;
   *  @param pRegistryKey the registry key for this component, need for persistent data&lt;br /&gt;
   *  @return a component factory &lt;br /&gt;
   */&lt;br /&gt;
  &lt;br /&gt;
  extern &amp;quot;C&amp;quot; void * SAL_CALL component_getFactory(const sal_Char * pImplName,&lt;br /&gt;
          void * pServiceManager, void * pRegistryKey) {&lt;br /&gt;
      void * pRet = 0;&lt;br /&gt;
  &lt;br /&gt;
      if (rtl_str_compare( pImplName, IMPLEMENTATION_NAME ) == 0) {&lt;br /&gt;
          Reference&amp;lt; XSingleServiceFactory &amp;gt; xFactory(createSingleFactory(&lt;br /&gt;
              reinterpret_cast&amp;lt; XMultiServiceFactory * &amp;gt;(pServiceManager),&lt;br /&gt;
              OUString(RTL_CONSTASCII_USTRINGPARAM(IMPLEMENTATION_NAME)),&lt;br /&gt;
              Addon_createInstance,&lt;br /&gt;
              Addon_getSupportedServiceNames()));&lt;br /&gt;
  &lt;br /&gt;
          if (xFactory.is()) {&lt;br /&gt;
              xFactory-&amp;gt;acquire();&lt;br /&gt;
              pRet = xFactory.get();&lt;br /&gt;
          }&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      return pRet;&lt;br /&gt;
  } &lt;br /&gt;
  &lt;br /&gt;
  //##################################################################################################&lt;br /&gt;
  //#### Helper functions for the implementation of UNO component interfaces #########################&lt;br /&gt;
  //################################################################################################## &lt;br /&gt;
  ::rtl::OUString Addon_getImplementationName()&lt;br /&gt;
  throw (RuntimeException) {&lt;br /&gt;
      return ::rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) );&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  sal_Bool SAL_CALL Addon_supportsService( const ::rtl::OUString&amp;amp; ServiceName )&lt;br /&gt;
  throw (RuntimeException)&lt;br /&gt;
  {&lt;br /&gt;
      return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ) );&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  Sequence&amp;lt; ::rtl::OUString &amp;gt; SAL_CALL Addon_getSupportedServiceNames()&lt;br /&gt;
  throw (RuntimeException)&lt;br /&gt;
  {&lt;br /&gt;
          Sequence &amp;lt; ::rtl::OUString &amp;gt; aRet(1);&lt;br /&gt;
      ::rtl::OUString* pArray = aRet.getArray();&lt;br /&gt;
      pArray[0] = ::rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) );&lt;br /&gt;
      return aRet;&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  Reference&amp;lt; XInterface &amp;gt; SAL_CALL Addon_createInstance( const Reference&amp;lt; XMultiServiceFactory &amp;gt; &amp;amp; rSMgr)&lt;br /&gt;
      throw( Exception )&lt;br /&gt;
  {&lt;br /&gt;
      return (cppu::OWeakObject*) new Addon( rSMgr );&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The C++ protocol handler in the example has the implementation name &amp;lt;code&amp;gt;org.openoffice.Office.addon.example&amp;lt;/code&amp;gt;. It supports the URL protocol schema &amp;#039;&amp;#039;org.openoffice.Office.addon.example:&amp;#039;&amp;#039; and provides three different URL commands: &amp;lt;code&amp;gt;Function1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Function2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Help&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The protocol handler implements the &amp;lt;idl&amp;gt;com.sun.star.frame.XDispatch&amp;lt;/idl&amp;gt; interface, so it can return a reference to itself when it is queried for a dispatch object that matches the given URL.&lt;br /&gt;
&lt;br /&gt;
The implementation of the &amp;lt;code&amp;gt;dispatch()&amp;lt;/code&amp;gt; method below shows how the supported commands are routed inside the protocol handler. Based on the path part of the URL, a simple message box displays which function has been called. The message box is implemented using the UNO toolkit and uses the container windows of the given frame as parent window. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
  #ifndef _Addon_HXX&lt;br /&gt;
  #include &amp;lt;addon.hxx&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _OSL_DIAGNOSE_H_&lt;br /&gt;
  #include &amp;lt;osl/diagnose.h&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _RTL_USTRING_HXX_&lt;br /&gt;
  #include &amp;lt;rtl/ustring.hxx&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/lang/XMultiServiceFactory.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/beans/PropertyValue.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/frame/XFrame.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_FRAME_XCONTROLLER_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/frame/XController.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_AWT_XTOOLKIT_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/awt/XToolkit.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_AWT_XWINDOWPEER_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/awt/XWindowPeer.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_AWT_WINDOWATTRIBUTE_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/awt/WindowAttribute.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifndef _COM_SUN_STAR_AWT_XMESSAGEBOX_HPP_&lt;br /&gt;
  #include &amp;lt;com/sun/star/awt/XMessageBox.hpp&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
  &lt;br /&gt;
  using rtl::OUString;&lt;br /&gt;
  using namespace com::sun::star::uno;&lt;br /&gt;
  using namespace com::sun::star::frame;&lt;br /&gt;
  using namespace com::sun::star::awt;&lt;br /&gt;
  using com::sun::star::lang::XMultiServiceFactory;&lt;br /&gt;
  using com::sun::star::beans::PropertyValue;&lt;br /&gt;
  using com::sun::star::util::URL;&lt;br /&gt;
  &lt;br /&gt;
  // This is the service name an Add-On has to implement&lt;br /&gt;
  #define SERVICE_NAME &amp;quot;com.sun.star.frame.ProtocolHandler&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  /**&lt;br /&gt;
   *  Show a message box with the UNO based toolkit&lt;br /&gt;
   */&lt;br /&gt;
  static void ShowMessageBox(const Reference&amp;lt; XToolkit &amp;gt;&amp;amp; rToolkit, const Reference&amp;lt; XFrame &amp;gt;&amp;amp; rFrame, const OUString&amp;amp; aTitle, const OUString&amp;amp; aMsgText)&lt;br /&gt;
  {&lt;br /&gt;
      if ( rFrame.is() &amp;amp;&amp;amp; rToolkit.is() )&lt;br /&gt;
      {&lt;br /&gt;
          // describe window properties. &lt;br /&gt;
          WindowDescriptor                aDescriptor; &lt;br /&gt;
          aDescriptor.Type              = WindowClass_MODALTOP ; &lt;br /&gt;
          aDescriptor.WindowServiceName = OUString( RTL_CONSTASCII_USTRINGPARAM( &amp;quot;infobox&amp;quot; ));&lt;br /&gt;
          aDescriptor.ParentIndex       = -1 ; &lt;br /&gt;
          aDescriptor.Parent            = Reference&amp;lt; XWindowPeer &amp;gt;( rFrame-&amp;gt;getContainerWindow(), UNO_QUERY ) ; &lt;br /&gt;
          aDescriptor.Bounds            = Rectangle(0,0,300,200) ; &lt;br /&gt;
          aDescriptor.WindowAttributes  = WindowAttribute::BORDER   | &lt;br /&gt;
                                          WindowAttribute::MOVEABLE | &lt;br /&gt;
                                          WindowAttribute::CLOSEABLE; &lt;br /&gt;
          Reference&amp;lt; XWindowPeer &amp;gt; xPeer = rToolkit-&amp;gt;createWindow( aDescriptor ); if ( xPeer.is() ) &lt;br /&gt;
          { &lt;br /&gt;
              Reference&amp;lt; XMessageBox &amp;gt; xMsgBox( xPeer, UNO_QUERY );&lt;br /&gt;
              if ( xMsgBox.is() )&lt;br /&gt;
              { &lt;br /&gt;
                  xMsgBox-&amp;gt;setCaptionText( aTitle ); &lt;br /&gt;
                  xMsgBox-&amp;gt;setMessageText( aMsgText ); &lt;br /&gt;
                  xMsgBox-&amp;gt;execute(); &lt;br /&gt;
              } &lt;br /&gt;
          } &lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  //##################################################################################################&lt;br /&gt;
  //#### Implementation of the ProtocolHandler and Dispatch Interfaces ###################&lt;br /&gt;
  //################################################################################################## &lt;br /&gt;
  // XInitialization &lt;br /&gt;
  /**&lt;br /&gt;
   *  Called by the Office framework.&lt;br /&gt;
   *  We store the context information&lt;br /&gt;
   *  given, like the frame we are bound to, into our members. &lt;br /&gt;
   */&lt;br /&gt;
  void SAL_CALL Addon::initialize( const Sequence&amp;lt; Any &amp;gt;&amp;amp; aArguments ) throw ( Exception, RuntimeException)&lt;br /&gt;
  {&lt;br /&gt;
      Reference &amp;lt; XFrame &amp;gt; xFrame;&lt;br /&gt;
      if ( aArguments.getLength() )&lt;br /&gt;
      {&lt;br /&gt;
          aArguments[0] &amp;gt;&amp;gt;= xFrame;&lt;br /&gt;
          mxFrame = xFrame;&lt;br /&gt;
      }&lt;br /&gt;
    &lt;br /&gt;
      // Create the toolkit to have access to it later&lt;br /&gt;
      mxToolkit = Reference&amp;lt; XToolkit &amp;gt;( mxMSF-&amp;gt;createInstance( &lt;br /&gt;
                                          OUString( RTL_CONSTASCII_USTRINGPARAM( &lt;br /&gt;
                                              &amp;quot;com.sun.star.awt.Toolkit&amp;quot; ))), UNO_QUERY );&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  // XDispatchProvider &lt;br /&gt;
  /** &lt;br /&gt;
   *  Called by the Office framework.&lt;br /&gt;
   *  We are ask to query the given URL and return a dispatch object if the URL&lt;br /&gt;
   *  contains an Add-On command.&lt;br /&gt;
   */&lt;br /&gt;
  Reference&amp;lt; XDispatch &amp;gt; SAL_CALL Addon::queryDispatch( const URL&amp;amp; aURL, const ::rtl::OUString&amp;amp; sTargetFrameName, sal_Int32 nSearchFlags )&lt;br /&gt;
                                  throw( RuntimeException )&lt;br /&gt;
  {&lt;br /&gt;
      Reference &amp;lt; XDispatch &amp;gt; xRet;&lt;br /&gt;
      if ( aURL.Protocol.compareToAscii(&amp;quot;org.openoffice.Office.addon.example:&amp;quot;) == 0 )&lt;br /&gt;
      {&lt;br /&gt;
          if ( aURL.Path.compareToAscii( &amp;quot;Function1&amp;quot; ) == 0 )&lt;br /&gt;
              xRet = this;&lt;br /&gt;
          else if ( aURL.Path.compareToAscii( &amp;quot;Function2&amp;quot; ) == 0 )&lt;br /&gt;
              xRet = this;&lt;br /&gt;
          else if ( aURL.Path.compareToAscii( &amp;quot;Help&amp;quot; ) == 0 )&lt;br /&gt;
              xRet = this;&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      return xRet;&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  /** &lt;br /&gt;
   *  Called by the Office framework.&lt;br /&gt;
   *  We are ask to query the given sequence of URLs and return dispatch objects if the URLs&lt;br /&gt;
   *  contain Add-On commands.&lt;br /&gt;
   */&lt;br /&gt;
  Sequence &amp;lt; Reference&amp;lt; XDispatch &amp;gt; &amp;gt; SAL_CALL Addon::queryDispatches( &lt;br /&gt;
          const Sequence &amp;lt; DispatchDescriptor &amp;gt;&amp;amp; seqDescripts )&lt;br /&gt;
          throw( RuntimeException )&lt;br /&gt;
  {&lt;br /&gt;
      sal_Int32 nCount = seqDescripts.getLength();&lt;br /&gt;
      Sequence &amp;lt; Reference &amp;lt; XDispatch &amp;gt; &amp;gt; lDispatcher( nCount );&lt;br /&gt;
  &lt;br /&gt;
      for( sal_Int32 i=0; i&amp;lt;nCount; ++i )&lt;br /&gt;
          lDispatcher[i] = queryDispatch( seqDescripts[i].FeatureURL, seqDescripts[i].FrameName, seqDescripts[i].SearchFlags );&lt;br /&gt;
      &lt;br /&gt;
      return lDispatcher;&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  // XDispatch &lt;br /&gt;
  /** &lt;br /&gt;
   *  Called by the Office framework.&lt;br /&gt;
   *  We are ask to execute the given Add-On command URL.&lt;br /&gt;
   */&lt;br /&gt;
  void SAL_CALL Addon::dispatch( const URL&amp;amp; aURL, const Sequence &amp;lt; PropertyValue &amp;gt;&amp;amp; lArgs ) throw (RuntimeException)&lt;br /&gt;
  {&lt;br /&gt;
      if ( aURL.Protocol.compareToAscii(&amp;quot;org.openoffice.Office.addon.example:&amp;quot;) == 0 )&lt;br /&gt;
      {&lt;br /&gt;
          if ( aURL.Path.compareToAscii( &amp;quot;Function1&amp;quot; ) == 0 )&lt;br /&gt;
          {&lt;br /&gt;
              ShowMessageBox( mxToolkit, mxFrame, &lt;br /&gt;
                              OUString( RTL_CONSTASCII_USTRINGPARAM( &amp;quot;SDK Add-On example&amp;quot; )),&lt;br /&gt;
                              OUString( RTL_CONSTASCII_USTRINGPARAM( &amp;quot;Function 1 activated&amp;quot; )) );&lt;br /&gt;
          }&lt;br /&gt;
          else if ( aURL.Path.compareToAscii( &amp;quot;Function2&amp;quot; ) == 0 )&lt;br /&gt;
          {&lt;br /&gt;
              ShowMessageBox( mxToolkit, mxFrame, &lt;br /&gt;
                              OUString( RTL_CONSTASCII_USTRINGPARAM( &amp;quot;SDK Add-On example&amp;quot; )),&lt;br /&gt;
                              OUString( RTL_CONSTASCII_USTRINGPARAM( &amp;quot;Function 2 activated&amp;quot; )) );&lt;br /&gt;
          }&lt;br /&gt;
          else if ( aURL.Path.compareToAscii( &amp;quot;Help&amp;quot; ) == 0 )&lt;br /&gt;
          {&lt;br /&gt;
              // Show info box&lt;br /&gt;
              ShowMessageBox( mxToolkit, mxFrame, &lt;br /&gt;
                              OUString( RTL_CONSTASCII_USTRINGPARAM( &amp;quot;About SDK Add-On example&amp;quot; )),&lt;br /&gt;
                              OUString( RTL_CONSTASCII_USTRINGPARAM( &amp;quot;This is the SDK Add-On example&amp;quot;)));&lt;br /&gt;
          }&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
  /** &lt;br /&gt;
   *  Called by the Office framework.&lt;br /&gt;
   *  We are asked to store a status listener for the given URL.&lt;br /&gt;
   */&lt;br /&gt;
  void SAL_CALL Addon::addStatusListener( const Reference&amp;lt; XStatusListener &amp;gt;&amp;amp; xControl, const URL&amp;amp; aURL ) throw (RuntimeException)&lt;br /&gt;
  {&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  /** &lt;br /&gt;
   *  Called by the Office framework.&lt;br /&gt;
   *  We are asked to remove a status listener for the given URL.&lt;br /&gt;
   */&lt;br /&gt;
  void SAL_CALL Addon::removeStatusListener( const Reference&amp;lt; XStatusListener &amp;gt;&amp;amp; xControl, &lt;br /&gt;
          const URL&amp;amp; aURL ) &lt;br /&gt;
          throw (RuntimeException)&lt;br /&gt;
  {&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  //##################################################################################################&lt;br /&gt;
  //#### Implementation of the recommended/mandatory interfaces of a UNO component ###################&lt;br /&gt;
  //################################################################################################## &lt;br /&gt;
  // XServiceInfo &lt;br /&gt;
  ::rtl::OUString SAL_CALL Addon::getImplementationName( )&lt;br /&gt;
          throw (RuntimeException)&lt;br /&gt;
  {&lt;br /&gt;
          return Addon_getImplementationName();&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  sal_Bool SAL_CALL Addon::supportsService( const ::rtl::OUString&amp;amp; rServiceName )&lt;br /&gt;
          throw (RuntimeException)&lt;br /&gt;
  {&lt;br /&gt;
          return Addon_supportsService( rServiceName );&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  Sequence&amp;lt; ::rtl::OUString &amp;gt; SAL_CALL Addon::getSupportedServiceNames( )&lt;br /&gt;
          throw (RuntimeException)&lt;br /&gt;
  {&lt;br /&gt;
          return Addon_getSupportedServiceNames();&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Writing UNO Components]]&lt;/div&gt;</summary>
		<author><name>Java1cprog</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Required_Files&amp;diff=180424</id>
		<title>Documentation/DevGuide/WritingUNO/Required Files</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Required_Files&amp;diff=180424"/>
		<updated>2010-08-29T04:25:20Z</updated>

		<summary type="html">&lt;p&gt;Java1cprog: Fix incorect path to sdk/bin folder of in Windows&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/WritingUNOTOC&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/WritingUNO/Writing UNO Components&lt;br /&gt;
|NextPage=Documentation/DevGuide/WritingUNO/Using UNOIDL to Specify New Components&lt;br /&gt;
}}&lt;br /&gt;
{{Documentation/DevGuideLanguages|Documentation/DevGuide/WritingUNO/{{SUBPAGENAME}}}}&lt;br /&gt;
{{DISPLAYTITLE:Required Files}}&lt;br /&gt;
=== {{PRODUCTNAME}} Software Development Kit (SDK)  ===&lt;br /&gt;
&lt;br /&gt;
The SDK provides a build environment for your projects, separate from the OpenOffice.org build environment. It contains the necessary tools for UNO development, C and C++ libraries, JARs , UNO type definitions and example code. But most of the necessary libraries and files are shared with an existing {{PRODUCTNAME}} installation which is a prerequisite for a SDK. &lt;br /&gt;
&lt;br /&gt;
The SDK development tools (executables) contained in the SDK are used in the following chapter. Become familiar with the following table that lists the executables from the SDK. These executables are found in the platform specific bin folder of the SDK installation. In Windows, they are in the folder &amp;#039;&amp;#039;&amp;amp;lt;SDK&amp;amp;gt;\bin&amp;#039;&amp;#039;, on Linux they are stored in &amp;#039;&amp;#039;&amp;amp;lt;SDK&amp;amp;gt;/linux/bin&amp;#039;&amp;#039; and on Solaris in &amp;#039;&amp;#039;&amp;amp;lt;SDK&amp;amp;gt;/solaris/bin&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#EDEDED&amp;quot;&lt;br /&gt;
! Executable &lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;idlc&amp;#039;&amp;#039; &lt;br /&gt;
| The UNOIDL compiler that creates binary type description files with the extension .urd for registry database files.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;idlcpp&amp;#039;&amp;#039; &lt;br /&gt;
| The idlc preprocessor used by idlc.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;cppumaker&amp;#039;&amp;#039; &lt;br /&gt;
| The C++ UNO maker that generates headers with UNO types mapped from binary type descriptions to C++ from binary type descriptions.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;javamaker&amp;#039;&amp;#039; &lt;br /&gt;
| Java maker that generates interface and class definitions for UNO types mapped from binary type descriptions to Java from binary type descriptions.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;xml2cmp&amp;#039;&amp;#039; &lt;br /&gt;
| XML to Component that can extract type names from XML object descriptions for use with cppumaker and javamaker, creates functions.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;regmerge&amp;#039;&amp;#039; &lt;br /&gt;
| The registry merge that merges binary type descriptions into registry files.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;regcomp&amp;#039;&amp;#039; &lt;br /&gt;
| The register component that tells a registry database file that there is a new component and where it can be found.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;unopkg&amp;#039;&amp;#039; &lt;br /&gt;
| The command line tool of the extension manager.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;regview&amp;#039;&amp;#039; &lt;br /&gt;
| The registry view that outputs the content of a registry database file in readable format.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;autodoc&amp;#039;&amp;#039; &lt;br /&gt;
| The automatic documentation tool that evaluates Javadoc style comments in idl files and generates documentation from them.&lt;br /&gt;
|-&lt;br /&gt;
| rdbmaker &lt;br /&gt;
| The registry database maker that creates registry files with selected types and their dependencies.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;uno&amp;#039;&amp;#039; &lt;br /&gt;
| The UNO executable. It is a standalone UNO environment which is able to run UNO components supporting the &amp;lt;idl&amp;gt;com.sun.star.lang.XMain&amp;lt;/idl&amp;gt; interface, one possible use is: &amp;lt;code&amp;gt;$ uno -s ServiceName -r MyRegistry.rdb -- MyMainClass arg1&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GNU Make ===&lt;br /&gt;
&lt;br /&gt;
The makefiles in the SDK assume that the GNU &amp;#039;&amp;#039;make&amp;#039;&amp;#039; is used. Documentation for GNU make command line options and syntax are available at [http://www.gnu.org www.gnu.org]. In Windows, not every GNU make seems stable, notably some versions of Cygwin &amp;#039;&amp;#039;make&amp;#039;&amp;#039; were reported to have problems with the SDK makefiles. Other GNU &amp;#039;&amp;#039;make&amp;#039;&amp;#039; binaries, such as the one from [http://unxutils.sourceforge.net unxutils.sourceforge.net] work well even on the Windows command line. The package UnxUtils comes with a &amp;#039;&amp;#039;zsh&amp;#039;&amp;#039; shell and numerous utilities, such as &amp;#039;&amp;#039;find&amp;#039;&amp;#039;, &amp;#039;&amp;#039;sed&amp;#039;&amp;#039;. To install UnxUtils, download and unpack the archive (if the links on [http://unxutils.sourceforge.net unxutils.sourceforge.net] are still broken, try with [http://sourceforge.net/projects/unxutils sourceforge.net/projects/unxutils]), and add &amp;#039;&amp;#039;&amp;lt;UnxUtils&amp;gt;\usr\local\wbin&amp;#039;&amp;#039; to the PATH environment variable. Now launch &amp;#039;&amp;#039;sh.exe&amp;#039;&amp;#039; from &amp;#039;&amp;#039;&amp;lt;UnxUtils&amp;gt;\bin&amp;#039;&amp;#039; and issue the command &amp;#039;&amp;#039;make&amp;#039;&amp;#039; from within &amp;#039;&amp;#039;zsh&amp;#039;&amp;#039; or use the Windows command line to run &amp;#039;&amp;#039;make&amp;#039;&amp;#039;. For further information about &amp;#039;&amp;#039;zsh&amp;#039;&amp;#039;, go to [http://zsh.sunsite.dk zsh.sunsite.dk].&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Writing UNO Components]]&lt;/div&gt;</summary>
		<author><name>Java1cprog</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/FirstSteps/First_Contact&amp;diff=179174</id>
		<title>Documentation/DevGuide/FirstSteps/First Contact</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/FirstSteps/First_Contact&amp;diff=179174"/>
		<updated>2010-08-25T10:23:39Z</updated>

		<summary type="html">&lt;p&gt;Java1cprog: I think it is necessary to add a link to a path variable before running the first code all the time by IDE Eclipse. That is whay the last paragraph need not.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/FirstStepsTOC&lt;br /&gt;
|FirstSteps2a=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/FirstSteps/Configuration&lt;br /&gt;
|NextPage=Documentation/DevGuide/FirstSteps/How to get Objects in OpenOffice.org&lt;br /&gt;
}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Documentation/DevGuideLanguages|Documentation/DevGuide/FirstSteps/{{SUBPAGENAME}}}}&lt;br /&gt;
{{DISPLAYTITLE:First Contact}}&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&amp;lt;idltopic&amp;gt;com.sun.star.uno.XComponentContext;com.sun.star.lang.XMultiComponentFactory;com.sun.star.lang.ServiceManager&amp;lt;/idltopic&amp;gt;--&amp;gt;&lt;br /&gt;
Since {{PRODUCTNAME}} {{OOo2.x}} it is very simple to get a working environment that offers a transparent use of UNO functionality and of office functionality. The following demonstrates how to write and build a small program that initializes UNO, which means that it internally connects to an office or starts a new office process if necessary and tells you if it was able to get the office component context that provides the office service manager object. &lt;br /&gt;
&lt;br /&gt;
Start a Java IDE or source editor, and enter the source code for the [[#FirstUnoContactClass|&amp;lt;tt&amp;gt;FirstUnoContact&amp;lt;/tt&amp;gt;]] class. In order to automate the build process one may use an [[#AntBuildScript|Ant build script]] as shown below. &lt;br /&gt;
&lt;br /&gt;
==== Using the NetBeans IDE ====&lt;br /&gt;
&lt;br /&gt;
To create and run the example in the NetBeans IDE, use the following steps:&lt;br /&gt;
&lt;br /&gt;
# From the &amp;#039;&amp;#039;&amp;#039;File&amp;#039;&amp;#039;&amp;#039; menu, select &amp;#039;&amp;#039;&amp;#039;New Project&amp;#039;&amp;#039;&amp;#039;. Select &amp;#039;&amp;#039;&amp;#039;OpenOffice.org&amp;#039;&amp;#039;&amp;#039; category and select the &amp;#039;&amp;#039;&amp;#039;OpenOffice.org Client Application&amp;#039;&amp;#039;&amp;#039;. On the next wizard panel insert &amp;#039;&amp;#039;&amp;#039;FirstUnoContact&amp;#039;&amp;#039;&amp;#039; as project name and maybe change the package and/or the location path. Press &amp;#039;&amp;#039;&amp;#039;Finish&amp;#039;&amp;#039;&amp;#039; to create the project.&lt;br /&gt;
# Navigate over the project node &amp;#039;&amp;#039;&amp;#039;FirstUnoContact&amp;#039;&amp;#039;&amp;#039; &amp;gt; &amp;#039;&amp;#039;&amp;#039;Source Packages&amp;#039;&amp;#039;&amp;#039; &amp;gt; ... to the generated &amp;#039;&amp;#039;&amp;#039;FirstUnoContact.java&amp;#039;&amp;#039;&amp;#039; skeleton.&lt;br /&gt;
# Complete the generated source code as [[#FirstUnoContractClass|shown below]] &amp;lt;!--[SOURCE:FirstSteps/FirstUnoContact.java].--&amp;gt;&lt;br /&gt;
# Build the project by pressing &amp;#039;&amp;#039;&amp;#039;F11&amp;#039;&amp;#039;&amp;#039; and run it by pressing &amp;#039;&amp;#039;&amp;#039;F6&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
Whereas in NetBeans the &amp;#039;&amp;#039;&amp;#039;OpenOffice.org Client Application&amp;#039;&amp;#039;&amp;#039; wizard prepares a working project environment for you, it should be easily possible to integrate the necessary steps in other IDEs as well or run an Ant script directly.&lt;br /&gt;
&lt;br /&gt;
==== Using the Eclipse IDE  ====&lt;br /&gt;
&lt;br /&gt;
To create and run the example in the Eclipse IDE, use the following steps: &lt;br /&gt;
&lt;br /&gt;
#From the &amp;#039;&amp;#039;&amp;#039;File&amp;#039;&amp;#039;&amp;#039; menu, select &amp;#039;&amp;#039;&amp;#039;New &amp;amp;gt; Java Project&amp;#039;&amp;#039;&amp;#039;. On the first wizard panel insert &amp;#039;&amp;#039;&amp;#039;FirstUnoContact&amp;#039;&amp;#039;&amp;#039; as project name. Press &amp;#039;&amp;#039;&amp;#039;Next&amp;#039;&amp;#039;&amp;#039;. On the next wizard panel check that the default output folder is set to &amp;#039;&amp;#039;&amp;#039;FirstUnoContact/bin&amp;#039;&amp;#039;&amp;#039;. Select the &amp;#039;&amp;#039;&amp;#039;Libraries&amp;#039;&amp;#039;&amp;#039; tab, where you may add the necessary libraries and a variable&amp;amp;nbsp;as described in section [[Documentation/DevGuide/FirstSteps/Configuration#Prepare_the_Eclipse_IDE|Prepare the Eclipse IDE]]. Press &amp;#039;&amp;#039;&amp;#039;Finish&amp;#039;&amp;#039;&amp;#039; to create the project. &lt;br /&gt;
#Right click on the project node &amp;#039;&amp;#039;&amp;#039;FirstUnoContact&amp;#039;&amp;#039;&amp;#039;, select &amp;#039;&amp;#039;&amp;#039;New &amp;amp;gt; Class&amp;#039;&amp;#039;&amp;#039; to generate the &amp;#039;&amp;#039;&amp;#039;FirstUnoContact.java&amp;#039;&amp;#039;&amp;#039; skeleton. &lt;br /&gt;
#Complete the generated source code as [[#FirstUnoContractClass|shown below]]. &lt;br /&gt;
#Right click on the project node &amp;#039;&amp;#039;&amp;#039;FirstUnoContact&amp;#039;&amp;#039;&amp;#039;, select &amp;#039;&amp;#039;&amp;#039;New &amp;amp;gt; File&amp;#039;&amp;#039;&amp;#039; to create the &amp;#039;&amp;#039;&amp;#039;build.xml&amp;#039;&amp;#039;&amp;#039; file. &lt;br /&gt;
#Enter the code for the Ant build script as [[#AntBuildScript|shown below]]. &lt;br /&gt;
#From the &amp;#039;&amp;#039;&amp;#039;Run&amp;#039;&amp;#039;&amp;#039; menu, select &amp;#039;&amp;#039;&amp;#039;External Tools &amp;amp;gt; Open External Tools Dialog&amp;#039;&amp;#039;&amp;#039;. On the dialog select &amp;#039;&amp;#039;&amp;#039;FirstUnoContract build.xml&amp;#039;&amp;#039;&amp;#039;. On the JRE tab, select the option &amp;#039;&amp;#039;&amp;#039;Run in the same JRE as the workspace&amp;#039;&amp;#039;&amp;#039;. Press &amp;#039;&amp;#039;&amp;#039;Apply&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Close&amp;#039;&amp;#039;&amp;#039;. This option is necessary for the Ant property &amp;#039;&amp;#039;&amp;#039;eclipse.running&amp;#039;&amp;#039;&amp;#039; to be set when the Ant build script is run. &lt;br /&gt;
#Build an run the project by using the build script.&lt;br /&gt;
&lt;br /&gt;
==== An Ant build script&amp;lt;span id=&amp;quot;AntBuildScript&amp;quot; /&amp;gt;  ====&lt;br /&gt;
&lt;br /&gt;
An example Ant build script could be as follows: &amp;lt;!--[SOURCE:FirstSteps/build_FirstUnoContact.xml]--&amp;gt; &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;project basedir=&amp;quot;.&amp;quot; default=&amp;quot;all&amp;quot; name=&amp;quot;FirstUnoContact&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- The following build script works with a standard installation of OpenOffice 3.0.1&lt;br /&gt;
	     and OpenOffice SDK 3.0.1 as described in section &amp;gt;Linux RPM-based Installation&amp;lt; &lt;br /&gt;
	     of the document found at http://download.openoffice.org/common/instructions.html. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- This script is tested with the Eclipse IDE and stand-alone, without any IDE support. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Paths based on the standard installation of OOo 3.0.1 and OOo SDK 3.0.1 on unix --&amp;gt;&lt;br /&gt;
	&amp;lt;property name=&amp;quot;OFFICE_ROOT&amp;quot; value=&amp;quot;/opt/openoffice.org&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;property name=&amp;quot;OFFICE_HOME&amp;quot; value=&amp;quot;${OFFICE_ROOT}/basis3.0&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;property name=&amp;quot;OO_SDK_HOME&amp;quot; value=&amp;quot;${OFFICE_HOME}/sdk&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;property name=&amp;quot;OO_URE_HOME&amp;quot; value=&amp;quot;${OFFICE_ROOT}/ure&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;target name=&amp;quot;init&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;property name=&amp;quot;OUT_DIR&amp;quot; value=&amp;quot;${basedir}/build/example1/&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;!-- For eclipse we need to set the output folder to this path --&amp;gt;&lt;br /&gt;
		&amp;lt;property name=&amp;quot;BIN_DIR&amp;quot; value=&amp;quot;${basedir}/bin/&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;path id=&amp;quot;office.class.path&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filelist dir=&amp;quot;${OFFICE_HOME}/program/classes&amp;quot; files=&amp;quot;unoil.jar&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;filelist dir=&amp;quot;${OO_URE_HOME}/share/java&amp;quot; files=&amp;quot;jurt.jar,ridl.jar,juh.jar&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;fileset id=&amp;quot;bootstrap.glue.code&amp;quot; dir=&amp;quot;${OO_SDK_HOME}/classes&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;patternset&amp;gt;&lt;br /&gt;
			&amp;lt;include name=&amp;quot;com/sun/star/lib/loader/*.class&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;/patternset&amp;gt;&lt;br /&gt;
	&amp;lt;/fileset&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Since the Eclipse IDE has an incremental compiler build in we do not need&lt;br /&gt;
	     to run the &amp;gt;compile&amp;lt; target in this case --&amp;gt;&lt;br /&gt;
	&amp;lt;target name=&amp;quot;compile&amp;quot; depends=&amp;quot;init&amp;quot; unless=&amp;quot;eclipse.running&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;mkdir dir=&amp;quot;${BIN_DIR}&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;javac debug=&amp;quot;true&amp;quot; deprecation=&amp;quot;true&amp;quot; destdir=&amp;quot;${BIN_DIR}&amp;quot; srcdir=&amp;quot;.&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;classpath refid=&amp;quot;office.class.path&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;/javac&amp;gt;&lt;br /&gt;
	&amp;lt;/target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;target name=&amp;quot;jar&amp;quot; depends=&amp;quot;init,compile&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;mkdir dir=&amp;quot;${OUT_DIR}&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;jar basedir=&amp;quot;${BIN_DIR}&amp;quot; compress=&amp;quot;true&amp;quot; jarfile=&amp;quot;${OUT_DIR}/FirstUnoContact.jar&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;exclude name=&amp;quot;**/*.java&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;exclude name=&amp;quot;*.jar&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;fileset refid=&amp;quot;bootstrap.glue.code&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;manifest&amp;gt;&lt;br /&gt;
				&amp;lt;attribute name=&amp;quot;Main-Class&amp;quot; value=&amp;quot;com.sun.star.lib.loader.Loader&amp;quot; /&amp;gt;&lt;br /&gt;
				&amp;lt;section name=&amp;quot;com/sun/star/lib/loader/Loader.class&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;attribute name=&amp;quot;Application-Class&amp;quot; value=&amp;quot;de.ooo.devguide.example1.FirstUnoContact&amp;quot; /&amp;gt;&lt;br /&gt;
				&amp;lt;/section&amp;gt;&lt;br /&gt;
			&amp;lt;/manifest&amp;gt;&lt;br /&gt;
		&amp;lt;/jar&amp;gt;&lt;br /&gt;
	&amp;lt;/target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;target name=&amp;quot;all&amp;quot; description=&amp;quot;Build everything.&amp;quot; depends=&amp;quot;init,compile,jar&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;echo message=&amp;quot;Application built. FirstUnoContact!&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;target name=&amp;quot;run&amp;quot; description=&amp;quot;Try running it.&amp;quot; depends=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;java jar=&amp;quot;${OUT_DIR}/FirstUnoContact.jar&amp;quot; failonerror=&amp;quot;true&amp;quot; fork=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;/java&amp;gt;&lt;br /&gt;
	&amp;lt;/target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;target name=&amp;quot;cleanbin&amp;quot; description=&amp;quot;Clean all binaries.&amp;quot; unless=&amp;quot;eclipse.running&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;delete&amp;gt;&lt;br /&gt;
			&amp;lt;fileset dir=&amp;quot;${BIN_DIR}&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;include name=&amp;quot;**/*.class&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;/fileset&amp;gt;&lt;br /&gt;
		&amp;lt;/delete&amp;gt;&lt;br /&gt;
	&amp;lt;/target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;target name=&amp;quot;cleanall&amp;quot; description=&amp;quot;Clean all build products.&amp;quot; depends=&amp;quot;init,cleanbin&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;delete file=&amp;quot;${OUT_DIR}/FirstUnoContact.jar&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/project&amp;gt;&lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This build script has been tested stand-alone and with the Eclipse IDE. For use with other IDEs it may have to be adapted. The comments and all targets that have an &amp;lt;tt&amp;gt;unless&amp;lt;/tt&amp;gt; attribute with the value &amp;lt;tt&amp;gt;eclipse.running&amp;lt;/tt&amp;gt; should give an idea about what might be necessary. &lt;br /&gt;
&lt;br /&gt;
The script works with a standard installation on unix, which is rooted at &amp;lt;tt&amp;gt;/opt&amp;lt;/tt&amp;gt;. For other installations the property &amp;lt;tt&amp;gt;OFFICE_ROOT&amp;lt;/tt&amp;gt; has to be set accordingly.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The FirstUnoContact class&amp;lt;span id=&amp;quot;FirstUnoContactClass&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; === &lt;br /&gt;
&lt;br /&gt;
The FirstUnoContact example that connects to the office with java: &amp;lt;!--[SOURCE:FirstSteps/FirstUnoContact.java]--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package de.ooo.devguide.example1;&lt;br /&gt;
&lt;br /&gt;
public class FirstUnoContact {&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;
	    com.sun.star.uno.XComponentContext xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();&lt;br /&gt;
&lt;br /&gt;
	    System.out.println(&amp;quot;Connected to a running office ...&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	    com.sun.star.lang.XMultiComponentFactory xMCF = xContext.getServiceManager();&lt;br /&gt;
&lt;br /&gt;
            String available = (xMCF != null ? &amp;quot;available&amp;quot; : &amp;quot;not available&amp;quot;);&lt;br /&gt;
	    System.out.println(&amp;quot;remote ServiceManager is &amp;quot; + available);&lt;br /&gt;
	} catch (java.lang.Exception e) {&lt;br /&gt;
	    e.printStackTrace();&lt;br /&gt;
	} finally {&lt;br /&gt;
	    System.exit(0);&lt;br /&gt;
	}&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For an example that connects to the office with C++, see chapter [[Documentation/DevGuide/ProUNO/C++/C++ Language Binding|C++ Language Binding]]. Accessing the office with {{PRODUCTNAME}} Basic is described in [[Documentation/DevGuide/Basic/First Steps with OpenOffice.org Basic|First Steps with OpenOffice.org Basic]].&lt;br /&gt;
The next section describes what happens during the connection between a Java program and {{PRODUCTNAME}}.&lt;br /&gt;
&lt;br /&gt;
====Service Managers====&lt;br /&gt;
&lt;br /&gt;
UNO introduces the concept of service managers, which can be considered as “factories” that  create &amp;#039;&amp;#039;services&amp;#039;&amp;#039;. For now, it is sufficient to see services as UNO objects that can be used to perform specific tasks. Later on we will give a more precise definition for the term service.&lt;br /&gt;
For example, the following services are available:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;lt;idl&amp;gt;com.sun.star.frame.Desktop&amp;lt;/idl&amp;gt;&amp;#039;&amp;#039;&lt;br /&gt;
: maintains loaded documents: is used to load documents, to get the current document, and access all loaded documents&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;lt;idl&amp;gt;com.sun.star.configuration.ConfigurationProvider&amp;lt;/idl&amp;gt;&amp;#039;&amp;#039;&lt;br /&gt;
: yields access to the {{PRODUCTNAME}} configuration, for instance the settings in the &amp;#039;&amp;#039;&amp;#039;Tools&amp;#039;&amp;#039;&amp;#039; &amp;gt; &amp;#039;&amp;#039;&amp;#039;Options&amp;#039;&amp;#039;&amp;#039; dialog&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;lt;idl&amp;gt;com.sun.star.sdb.DatabaseContext&amp;lt;/idl&amp;gt;&amp;#039;&amp;#039;&lt;br /&gt;
: holds databases registered with {{PRODUCTNAME}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;lt;idl&amp;gt;com.sun.star.system.SystemShellExecute&amp;lt;/idl&amp;gt;&amp;#039;&amp;#039;&lt;br /&gt;
: executes system commands or documents registered for an application on the current platform&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;lt;idl&amp;gt;com.sun.star.text.GlobalSettings&amp;lt;/idl&amp;gt;&amp;#039;&amp;#039;&lt;br /&gt;
: manages global view and print settings for text documents&lt;br /&gt;
&lt;br /&gt;
[[Image:Service.png|none|thumb|300px|Service manager]]&lt;br /&gt;
&lt;br /&gt;
A service always has a &amp;#039;&amp;#039;component context&amp;#039;&amp;#039;, which consists of the service manager that created the service and other data to be used by the service.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;FirstUnoContact&amp;lt;/tt&amp;gt; class above is considered a client of the {{PRODUCTNAME}} process, {{PRODUCTNAME}} is the server in this respect. The server has its own component context and its own service manager, which can be accessed from client programs to use the office functionality. The client program initializes UNO and gets the component context from the {{PRODUCTNAME}} process. Internally, this initialization process creates a local service manager, establishes a pipe connection to a running {{PRODUCTNAME}} process (if necessary a new process is started) and returns the remote component context. In the first step this is the only thing you have to know. The [http://api.openoffice.org/docs/java/ref/com/sun/star/comp/helper/Bootstrap.html &amp;lt;tt&amp;gt;com.sun.star.comp.helper.Bootstrap.bootstrap()&amp;lt;/tt&amp;gt;] method initializes UNO and returns the remote component context of a running {{PRODUCTNAME}} process. You can find more details about bootstrapping UNO, the opportunities of different connection types and how to establish a connection to a UNO server process in the [[Documentation/DevGuide/ProUNO/UNO Concepts|UNO Concepts]]. &lt;br /&gt;
&lt;br /&gt;
After this first initialization step, you can use the method   &amp;lt;idlm&amp;gt;com.sun.star.uno.XComponentContext:getServiceManager&amp;lt;/idlm&amp;gt;() from the component context to get the remote service manager from the {{PRODUCTNAME}} process, which offers you access to the complete office functionality available through the API.&lt;br /&gt;
&lt;br /&gt;
====Failed Connections====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&amp;lt;idltopic&amp;gt;com.sun.star.lang.DisposedException&amp;lt;/idltopic&amp;gt;--&amp;gt;&lt;br /&gt;
A remote connection can fail under certain conditions: &lt;br /&gt;
&lt;br /&gt;
* Client programs should be able to detect errors. For instance, sometimes the bridge might become unavailable. Simple clients that connect to the office, perform a certain task and exit afterwards should stop their work and inform the user if an error occurred.&lt;br /&gt;
* Clients that are supposed to run over a long period of time should not assume that a reference to an initial object will be valid over the whole runtime of the client. The client should resume even if the connection goes down for some reason and comes back later on. When the connection fails, a robust, long running client should stop the current work, inform the user that the connection is not available and release the references to the remote process. When the user tries to repeat the last action, the client should try to rebuild the connection. Do not force the user to restart your program just because the connection was temporarily unavailable. &lt;br /&gt;
&lt;br /&gt;
When the bridge has become unavailable and access is tried, it throws a &amp;lt;idls&amp;gt;com.sun.star.lang.DisposedException&amp;lt;/idls&amp;gt;. Whenever you access remote references in your program, catch this Exception in such a way that you set your remote references to null and inform the user accordingly. If your client is designed to run for a longer period of time, be prepared to get new remote references when you find that they are currently null. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to handle lost connections is to register a listener at the underlying bridge object. The chapter [[Documentation/DevGuide/ProUNO/UNO Interprocess Connections|UNO Interprocess Connections]] shows how to write a connection-aware client.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/First Steps]]&lt;/div&gt;</summary>
		<author><name>Java1cprog</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/FirstSteps/First_Contact&amp;diff=179172</id>
		<title>Documentation/DevGuide/FirstSteps/First Contact</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/FirstSteps/First_Contact&amp;diff=179172"/>
		<updated>2010-08-25T10:09:07Z</updated>

		<summary type="html">&lt;p&gt;Java1cprog: I draw attation to adding a variable to libraries&amp;#039; links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/FirstStepsTOC&lt;br /&gt;
|FirstSteps2a=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/FirstSteps/Configuration&lt;br /&gt;
|NextPage=Documentation/DevGuide/FirstSteps/How to get Objects in OpenOffice.org&lt;br /&gt;
}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Documentation/DevGuideLanguages|Documentation/DevGuide/FirstSteps/{{SUBPAGENAME}}}}&lt;br /&gt;
{{DISPLAYTITLE:First Contact}}&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&amp;lt;idltopic&amp;gt;com.sun.star.uno.XComponentContext;com.sun.star.lang.XMultiComponentFactory;com.sun.star.lang.ServiceManager&amp;lt;/idltopic&amp;gt;--&amp;gt;&lt;br /&gt;
Since {{PRODUCTNAME}} {{OOo2.x}} it is very simple to get a working environment that offers a transparent use of UNO functionality and of office functionality. The following demonstrates how to write and build a small program that initializes UNO, which means that it internally connects to an office or starts a new office process if necessary and tells you if it was able to get the office component context that provides the office service manager object. &lt;br /&gt;
&lt;br /&gt;
Start a Java IDE or source editor, and enter the source code for the [[#FirstUnoContactClass|&amp;lt;tt&amp;gt;FirstUnoContact&amp;lt;/tt&amp;gt;]] class. In order to automate the build process one may use an [[#AntBuildScript|Ant build script]] as shown below. &lt;br /&gt;
&lt;br /&gt;
==== Using the NetBeans IDE ====&lt;br /&gt;
&lt;br /&gt;
To create and run the example in the NetBeans IDE, use the following steps:&lt;br /&gt;
&lt;br /&gt;
# From the &amp;#039;&amp;#039;&amp;#039;File&amp;#039;&amp;#039;&amp;#039; menu, select &amp;#039;&amp;#039;&amp;#039;New Project&amp;#039;&amp;#039;&amp;#039;. Select &amp;#039;&amp;#039;&amp;#039;OpenOffice.org&amp;#039;&amp;#039;&amp;#039; category and select the &amp;#039;&amp;#039;&amp;#039;OpenOffice.org Client Application&amp;#039;&amp;#039;&amp;#039;. On the next wizard panel insert &amp;#039;&amp;#039;&amp;#039;FirstUnoContact&amp;#039;&amp;#039;&amp;#039; as project name and maybe change the package and/or the location path. Press &amp;#039;&amp;#039;&amp;#039;Finish&amp;#039;&amp;#039;&amp;#039; to create the project.&lt;br /&gt;
# Navigate over the project node &amp;#039;&amp;#039;&amp;#039;FirstUnoContact&amp;#039;&amp;#039;&amp;#039; &amp;gt; &amp;#039;&amp;#039;&amp;#039;Source Packages&amp;#039;&amp;#039;&amp;#039; &amp;gt; ... to the generated &amp;#039;&amp;#039;&amp;#039;FirstUnoContact.java&amp;#039;&amp;#039;&amp;#039; skeleton.&lt;br /&gt;
# Complete the generated source code as [[#FirstUnoContractClass|shown below]] &amp;lt;!--[SOURCE:FirstSteps/FirstUnoContact.java].--&amp;gt;&lt;br /&gt;
# Build the project by pressing &amp;#039;&amp;#039;&amp;#039;F11&amp;#039;&amp;#039;&amp;#039; and run it by pressing &amp;#039;&amp;#039;&amp;#039;F6&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
Whereas in NetBeans the &amp;#039;&amp;#039;&amp;#039;OpenOffice.org Client Application&amp;#039;&amp;#039;&amp;#039; wizard prepares a working project environment for you, it should be easily possible to integrate the necessary steps in other IDEs as well or run an Ant script directly.&lt;br /&gt;
&lt;br /&gt;
==== Using the Eclipse IDE  ====&lt;br /&gt;
&lt;br /&gt;
To create and run the example in the Eclipse IDE, use the following steps: &lt;br /&gt;
&lt;br /&gt;
#From the &amp;#039;&amp;#039;&amp;#039;File&amp;#039;&amp;#039;&amp;#039; menu, select &amp;#039;&amp;#039;&amp;#039;New &amp;amp;gt; Java Project&amp;#039;&amp;#039;&amp;#039;. On the first wizard panel insert &amp;#039;&amp;#039;&amp;#039;FirstUnoContact&amp;#039;&amp;#039;&amp;#039; as project name. Press &amp;#039;&amp;#039;&amp;#039;Next&amp;#039;&amp;#039;&amp;#039;. On the next wizard panel check that the default output folder is set to &amp;#039;&amp;#039;&amp;#039;FirstUnoContact/bin&amp;#039;&amp;#039;&amp;#039;. Select the &amp;#039;&amp;#039;&amp;#039;Libraries&amp;#039;&amp;#039;&amp;#039; tab, where you may add the necessary libraries and a variable&amp;amp;nbsp;as described in section [[Documentation/DevGuide/FirstSteps/Configuration#Prepare_the_Eclipse_IDE|Prepare the Eclipse IDE]]. Press &amp;#039;&amp;#039;&amp;#039;Finish&amp;#039;&amp;#039;&amp;#039; to create the project. &lt;br /&gt;
#Right click on the project node &amp;#039;&amp;#039;&amp;#039;FirstUnoContact&amp;#039;&amp;#039;&amp;#039;, select &amp;#039;&amp;#039;&amp;#039;New &amp;amp;gt; Class&amp;#039;&amp;#039;&amp;#039; to generate the &amp;#039;&amp;#039;&amp;#039;FirstUnoContact.java&amp;#039;&amp;#039;&amp;#039; skeleton. &lt;br /&gt;
#Complete the generated source code as [[#FirstUnoContractClass|shown below]]. &lt;br /&gt;
#Right click on the project node &amp;#039;&amp;#039;&amp;#039;FirstUnoContact&amp;#039;&amp;#039;&amp;#039;, select &amp;#039;&amp;#039;&amp;#039;New &amp;amp;gt; File&amp;#039;&amp;#039;&amp;#039; to create the &amp;#039;&amp;#039;&amp;#039;build.xml&amp;#039;&amp;#039;&amp;#039; file. &lt;br /&gt;
#Enter the code for the Ant build script as [[#AntBuildScript|shown below]]. &lt;br /&gt;
#From the &amp;#039;&amp;#039;&amp;#039;Run&amp;#039;&amp;#039;&amp;#039; menu, select &amp;#039;&amp;#039;&amp;#039;External Tools &amp;amp;gt; Open External Tools Dialog&amp;#039;&amp;#039;&amp;#039;. On the dialog select &amp;#039;&amp;#039;&amp;#039;FirstUnoContract build.xml&amp;#039;&amp;#039;&amp;#039;. On the JRE tab, select the option &amp;#039;&amp;#039;&amp;#039;Run in the same JRE as the workspace&amp;#039;&amp;#039;&amp;#039;. Press &amp;#039;&amp;#039;&amp;#039;Apply&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Close&amp;#039;&amp;#039;&amp;#039;. This option is necessary for the Ant property &amp;#039;&amp;#039;&amp;#039;eclipse.running&amp;#039;&amp;#039;&amp;#039; to be set when the Ant build script is run. &lt;br /&gt;
#Build an run the project by using the build script.&lt;br /&gt;
&lt;br /&gt;
==== An Ant build script&amp;lt;span id=&amp;quot;AntBuildScript&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
An example Ant build script could be as follows: &amp;lt;!--[SOURCE:FirstSteps/build_FirstUnoContact.xml]--&amp;gt;&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;project basedir=&amp;quot;.&amp;quot; default=&amp;quot;all&amp;quot; name=&amp;quot;FirstUnoContact&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- The following build script works with a standard installation of OpenOffice 3.0.1&lt;br /&gt;
	     and OpenOffice SDK 3.0.1 as described in section &amp;gt;Linux RPM-based Installation&amp;lt; &lt;br /&gt;
	     of the document found at http://download.openoffice.org/common/instructions.html. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- This script is tested with the Eclipse IDE and stand-alone, without any IDE support. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Paths based on the standard installation of OOo 3.0.1 and OOo SDK 3.0.1 on unix --&amp;gt;&lt;br /&gt;
	&amp;lt;property name=&amp;quot;OFFICE_ROOT&amp;quot; value=&amp;quot;/opt/openoffice.org&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;property name=&amp;quot;OFFICE_HOME&amp;quot; value=&amp;quot;${OFFICE_ROOT}/basis3.0&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;property name=&amp;quot;OO_SDK_HOME&amp;quot; value=&amp;quot;${OFFICE_HOME}/sdk&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;property name=&amp;quot;OO_URE_HOME&amp;quot; value=&amp;quot;${OFFICE_ROOT}/ure&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;target name=&amp;quot;init&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;property name=&amp;quot;OUT_DIR&amp;quot; value=&amp;quot;${basedir}/build/example1/&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;!-- For eclipse we need to set the output folder to this path --&amp;gt;&lt;br /&gt;
		&amp;lt;property name=&amp;quot;BIN_DIR&amp;quot; value=&amp;quot;${basedir}/bin/&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;path id=&amp;quot;office.class.path&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filelist dir=&amp;quot;${OFFICE_HOME}/program/classes&amp;quot; files=&amp;quot;unoil.jar&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;filelist dir=&amp;quot;${OO_URE_HOME}/share/java&amp;quot; files=&amp;quot;jurt.jar,ridl.jar,juh.jar&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;fileset id=&amp;quot;bootstrap.glue.code&amp;quot; dir=&amp;quot;${OO_SDK_HOME}/classes&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;patternset&amp;gt;&lt;br /&gt;
			&amp;lt;include name=&amp;quot;com/sun/star/lib/loader/*.class&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;/patternset&amp;gt;&lt;br /&gt;
	&amp;lt;/fileset&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Since the Eclipse IDE has an incremental compiler build in we do not need&lt;br /&gt;
	     to run the &amp;gt;compile&amp;lt; target in this case --&amp;gt;&lt;br /&gt;
	&amp;lt;target name=&amp;quot;compile&amp;quot; depends=&amp;quot;init&amp;quot; unless=&amp;quot;eclipse.running&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;mkdir dir=&amp;quot;${BIN_DIR}&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;javac debug=&amp;quot;true&amp;quot; deprecation=&amp;quot;true&amp;quot; destdir=&amp;quot;${BIN_DIR}&amp;quot; srcdir=&amp;quot;.&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;classpath refid=&amp;quot;office.class.path&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;/javac&amp;gt;&lt;br /&gt;
	&amp;lt;/target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;target name=&amp;quot;jar&amp;quot; depends=&amp;quot;init,compile&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;mkdir dir=&amp;quot;${OUT_DIR}&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;jar basedir=&amp;quot;${BIN_DIR}&amp;quot; compress=&amp;quot;true&amp;quot; jarfile=&amp;quot;${OUT_DIR}/FirstUnoContact.jar&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;exclude name=&amp;quot;**/*.java&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;exclude name=&amp;quot;*.jar&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;fileset refid=&amp;quot;bootstrap.glue.code&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;manifest&amp;gt;&lt;br /&gt;
				&amp;lt;attribute name=&amp;quot;Main-Class&amp;quot; value=&amp;quot;com.sun.star.lib.loader.Loader&amp;quot; /&amp;gt;&lt;br /&gt;
				&amp;lt;section name=&amp;quot;com/sun/star/lib/loader/Loader.class&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;attribute name=&amp;quot;Application-Class&amp;quot; value=&amp;quot;de.ooo.devguide.example1.FirstUnoContact&amp;quot; /&amp;gt;&lt;br /&gt;
				&amp;lt;/section&amp;gt;&lt;br /&gt;
			&amp;lt;/manifest&amp;gt;&lt;br /&gt;
		&amp;lt;/jar&amp;gt;&lt;br /&gt;
	&amp;lt;/target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;target name=&amp;quot;all&amp;quot; description=&amp;quot;Build everything.&amp;quot; depends=&amp;quot;init,compile,jar&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;echo message=&amp;quot;Application built. FirstUnoContact!&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;target name=&amp;quot;run&amp;quot; description=&amp;quot;Try running it.&amp;quot; depends=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;java jar=&amp;quot;${OUT_DIR}/FirstUnoContact.jar&amp;quot; failonerror=&amp;quot;true&amp;quot; fork=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;/java&amp;gt;&lt;br /&gt;
	&amp;lt;/target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;target name=&amp;quot;cleanbin&amp;quot; description=&amp;quot;Clean all binaries.&amp;quot; unless=&amp;quot;eclipse.running&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;delete&amp;gt;&lt;br /&gt;
			&amp;lt;fileset dir=&amp;quot;${BIN_DIR}&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;include name=&amp;quot;**/*.class&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;/fileset&amp;gt;&lt;br /&gt;
		&amp;lt;/delete&amp;gt;&lt;br /&gt;
	&amp;lt;/target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;target name=&amp;quot;cleanall&amp;quot; description=&amp;quot;Clean all build products.&amp;quot; depends=&amp;quot;init,cleanbin&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;delete file=&amp;quot;${OUT_DIR}/FirstUnoContact.jar&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/project&amp;gt;&lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This build script has been tested stand-alone and with the Eclipse IDE. For use with other IDEs it may have to be adapted. The comments and all targets that have an &amp;lt;tt&amp;gt;unless&amp;lt;/tt&amp;gt; attribute with the value &amp;lt;tt&amp;gt;eclipse.running&amp;lt;/tt&amp;gt; should give an idea about what might be necessary.&lt;br /&gt;
&lt;br /&gt;
The script works with a standard installation on unix, which is rooted at &amp;lt;tt&amp;gt;/opt&amp;lt;/tt&amp;gt;. For other installations the property &amp;lt;tt&amp;gt;OFFICE_ROOT&amp;lt;/tt&amp;gt; has to be set accordingly.&lt;br /&gt;
&lt;br /&gt;
If you encounter a &amp;#039;&amp;#039;&amp;#039;com.sun.star.comp.helper.BootstrapException&amp;#039;&amp;#039;&amp;#039; claiming &amp;quot;no office executable found!&amp;quot; you should add the path to the OpenOffice.org program folder to the classpath (e.g. .../OpenOffice.org 3/program).&lt;br /&gt;
&lt;br /&gt;
=== The FirstUnoContact class&amp;lt;span id=&amp;quot;FirstUnoContactClass&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; === &lt;br /&gt;
&lt;br /&gt;
The FirstUnoContact example that connects to the office with java: &amp;lt;!--[SOURCE:FirstSteps/FirstUnoContact.java]--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package de.ooo.devguide.example1;&lt;br /&gt;
&lt;br /&gt;
public class FirstUnoContact {&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;
	    com.sun.star.uno.XComponentContext xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();&lt;br /&gt;
&lt;br /&gt;
	    System.out.println(&amp;quot;Connected to a running office ...&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	    com.sun.star.lang.XMultiComponentFactory xMCF = xContext.getServiceManager();&lt;br /&gt;
&lt;br /&gt;
            String available = (xMCF != null ? &amp;quot;available&amp;quot; : &amp;quot;not available&amp;quot;);&lt;br /&gt;
	    System.out.println(&amp;quot;remote ServiceManager is &amp;quot; + available);&lt;br /&gt;
	} catch (java.lang.Exception e) {&lt;br /&gt;
	    e.printStackTrace();&lt;br /&gt;
	} finally {&lt;br /&gt;
	    System.exit(0);&lt;br /&gt;
	}&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For an example that connects to the office with C++, see chapter [[Documentation/DevGuide/ProUNO/C++/C++ Language Binding|C++ Language Binding]]. Accessing the office with {{PRODUCTNAME}} Basic is described in [[Documentation/DevGuide/Basic/First Steps with OpenOffice.org Basic|First Steps with OpenOffice.org Basic]].&lt;br /&gt;
The next section describes what happens during the connection between a Java program and {{PRODUCTNAME}}.&lt;br /&gt;
&lt;br /&gt;
====Service Managers====&lt;br /&gt;
&lt;br /&gt;
UNO introduces the concept of service managers, which can be considered as “factories” that  create &amp;#039;&amp;#039;services&amp;#039;&amp;#039;. For now, it is sufficient to see services as UNO objects that can be used to perform specific tasks. Later on we will give a more precise definition for the term service.&lt;br /&gt;
For example, the following services are available:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;lt;idl&amp;gt;com.sun.star.frame.Desktop&amp;lt;/idl&amp;gt;&amp;#039;&amp;#039;&lt;br /&gt;
: maintains loaded documents: is used to load documents, to get the current document, and access all loaded documents&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;lt;idl&amp;gt;com.sun.star.configuration.ConfigurationProvider&amp;lt;/idl&amp;gt;&amp;#039;&amp;#039;&lt;br /&gt;
: yields access to the {{PRODUCTNAME}} configuration, for instance the settings in the &amp;#039;&amp;#039;&amp;#039;Tools&amp;#039;&amp;#039;&amp;#039; &amp;gt; &amp;#039;&amp;#039;&amp;#039;Options&amp;#039;&amp;#039;&amp;#039; dialog&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;lt;idl&amp;gt;com.sun.star.sdb.DatabaseContext&amp;lt;/idl&amp;gt;&amp;#039;&amp;#039;&lt;br /&gt;
: holds databases registered with {{PRODUCTNAME}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;lt;idl&amp;gt;com.sun.star.system.SystemShellExecute&amp;lt;/idl&amp;gt;&amp;#039;&amp;#039;&lt;br /&gt;
: executes system commands or documents registered for an application on the current platform&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;lt;idl&amp;gt;com.sun.star.text.GlobalSettings&amp;lt;/idl&amp;gt;&amp;#039;&amp;#039;&lt;br /&gt;
: manages global view and print settings for text documents&lt;br /&gt;
&lt;br /&gt;
[[Image:Service.png|none|thumb|300px|Service manager]]&lt;br /&gt;
&lt;br /&gt;
A service always has a &amp;#039;&amp;#039;component context&amp;#039;&amp;#039;, which consists of the service manager that created the service and other data to be used by the service.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;FirstUnoContact&amp;lt;/tt&amp;gt; class above is considered a client of the {{PRODUCTNAME}} process, {{PRODUCTNAME}} is the server in this respect. The server has its own component context and its own service manager, which can be accessed from client programs to use the office functionality. The client program initializes UNO and gets the component context from the {{PRODUCTNAME}} process. Internally, this initialization process creates a local service manager, establishes a pipe connection to a running {{PRODUCTNAME}} process (if necessary a new process is started) and returns the remote component context. In the first step this is the only thing you have to know. The [http://api.openoffice.org/docs/java/ref/com/sun/star/comp/helper/Bootstrap.html &amp;lt;tt&amp;gt;com.sun.star.comp.helper.Bootstrap.bootstrap()&amp;lt;/tt&amp;gt;] method initializes UNO and returns the remote component context of a running {{PRODUCTNAME}} process. You can find more details about bootstrapping UNO, the opportunities of different connection types and how to establish a connection to a UNO server process in the [[Documentation/DevGuide/ProUNO/UNO Concepts|UNO Concepts]]. &lt;br /&gt;
&lt;br /&gt;
After this first initialization step, you can use the method   &amp;lt;idlm&amp;gt;com.sun.star.uno.XComponentContext:getServiceManager&amp;lt;/idlm&amp;gt;() from the component context to get the remote service manager from the {{PRODUCTNAME}} process, which offers you access to the complete office functionality available through the API.&lt;br /&gt;
&lt;br /&gt;
====Failed Connections====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&amp;lt;idltopic&amp;gt;com.sun.star.lang.DisposedException&amp;lt;/idltopic&amp;gt;--&amp;gt;&lt;br /&gt;
A remote connection can fail under certain conditions: &lt;br /&gt;
&lt;br /&gt;
* Client programs should be able to detect errors. For instance, sometimes the bridge might become unavailable. Simple clients that connect to the office, perform a certain task and exit afterwards should stop their work and inform the user if an error occurred.&lt;br /&gt;
* Clients that are supposed to run over a long period of time should not assume that a reference to an initial object will be valid over the whole runtime of the client. The client should resume even if the connection goes down for some reason and comes back later on. When the connection fails, a robust, long running client should stop the current work, inform the user that the connection is not available and release the references to the remote process. When the user tries to repeat the last action, the client should try to rebuild the connection. Do not force the user to restart your program just because the connection was temporarily unavailable. &lt;br /&gt;
&lt;br /&gt;
When the bridge has become unavailable and access is tried, it throws a &amp;lt;idls&amp;gt;com.sun.star.lang.DisposedException&amp;lt;/idls&amp;gt;. Whenever you access remote references in your program, catch this Exception in such a way that you set your remote references to null and inform the user accordingly. If your client is designed to run for a longer period of time, be prepared to get new remote references when you find that they are currently null. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to handle lost connections is to register a listener at the underlying bridge object. The chapter [[Documentation/DevGuide/ProUNO/UNO Interprocess Connections|UNO Interprocess Connections]] shows how to write a connection-aware client.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/First Steps]]&lt;/div&gt;</summary>
		<author><name>Java1cprog</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/FirstSteps/Configuration&amp;diff=179170</id>
		<title>Documentation/DevGuide/FirstSteps/Configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/FirstSteps/Configuration&amp;diff=179170"/>
		<updated>2010-08-25T10:04:00Z</updated>

		<summary type="html">&lt;p&gt;Java1cprog: I add information about a necessary classpath variable which must be set for connecting to a running office in Eclipse IDE.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/FirstStepsTOC&lt;br /&gt;
|FirstSteps2a=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/FirstSteps/Installation Sets&lt;br /&gt;
|NextPage=Documentation/DevGuide/FirstSteps/First Contact&lt;br /&gt;
}}&lt;br /&gt;
{{Documentation/DevGuideLanguages|Documentation/DevGuide/FirstSteps/{{SUBPAGENAME}}}}&lt;br /&gt;
{{DISPLAYTITLE:Configuration}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Enable Java in {{PRODUCTNAME}}===&lt;br /&gt;
&lt;br /&gt;
{{PRODUCTNAME}} uses a Java Virtual Machine to instantiate components written in Java. From {{PRODUCTNAME}} {{OOo2.x}} on, Java is found automatically during startup, or latest when Java functionality is required. If you prefer to preselect a JRE or JDK, or if no Java is found, you can configure Java using the &amp;#039;&amp;#039;&amp;#039;Tools – Options&amp;#039;&amp;#039;&amp;#039; dialog in {{PRODUCTNAME}} and select the section &amp;#039;&amp;#039;&amp;#039;{{PRODUCTNAME}} – Java&amp;#039;&amp;#039;&amp;#039; section. In older versions of {{PRODUCTNAME}} you can also easily tell the office which JVM to use: launch the jvmsetup executable from the programs folder under the {{PRODUCTNAME}}, select an installed JRE or JDK and click &amp;#039;&amp;#039;&amp;#039;OK&amp;#039;&amp;#039;&amp;#039;. Close the {{PRODUCTNAME}} including the Quickstarter in the taskbar and restart {{PRODUCTNAME}}. Furthermore, open the &amp;#039;&amp;#039;&amp;#039;Tools - Options&amp;#039;&amp;#039;&amp;#039; dialog in {{PRODUCTNAME}}, select the section &amp;#039;&amp;#039;&amp;#039;{{PRODUCTNAME}} - Security&amp;#039;&amp;#039;&amp;#039; and make sure that the Java enable option is checked.&lt;br /&gt;
&lt;br /&gt;
===Using the Java UNO runtime and API in your IDE===&lt;br /&gt;
&lt;br /&gt;
Next, the {{PRODUCTNAME}} API and Java UNO runtime class files must be made known to the Java IDE. &lt;br /&gt;
&lt;br /&gt;
==== Prepare the NetBeans IDE ====&lt;br /&gt;
&lt;br /&gt;
For NetBeans the necessary jar files are made available by simply installing the [[OpenOffice_NetBeans_Integration| OpenOffice.org API Plugin for NetBeans]]. After the configuration the plugin installs a new library in NetBeans that can be used in projects directly. The library will be automatically added to new projects created with the project wizards coming with the plugin. The following steps show how to install the plugin in NetBeans 5.5 or higher and how to create a new UNO client application project.&lt;br /&gt;
&lt;br /&gt;
# Install and start NetBeans.&lt;br /&gt;
# From the &amp;#039;&amp;#039;&amp;#039;Tools&amp;#039;&amp;#039;&amp;#039; menu, select &amp;#039;&amp;#039;&amp;#039;Update center&amp;#039;&amp;#039;&amp;#039;. check mark at least the &amp;#039;&amp;#039;&amp;#039;NetBeans Update Center&amp;#039;&amp;#039;&amp;#039; and press &amp;#039;&amp;#039;&amp;#039;Next&amp;#039;&amp;#039;&amp;#039;. Under &amp;#039;&amp;#039;&amp;#039;Features&amp;#039;&amp;#039;&amp;#039; search for the entry &amp;#039;&amp;#039;&amp;#039;OpenOffice.org API Plugin&amp;#039;&amp;#039;&amp;#039;, select the entry, &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; it, press &amp;#039;&amp;#039;&amp;#039;Next&amp;#039;&amp;#039;&amp;#039;, accept the license and follow the next steps to install it completely.&lt;br /&gt;
# A plugin specific configuration dialog comes up and required the input of a PATH to a valid office and SDK installation . After completion of this dialog the plugin is installed and configured correctly.&lt;br /&gt;
# From the &amp;#039;&amp;#039;&amp;#039;File&amp;#039;&amp;#039;&amp;#039; menu, select &amp;#039;&amp;#039;&amp;#039;New Project&amp;#039;&amp;#039;&amp;#039;. Select &amp;#039;&amp;#039;&amp;#039;OpenOffice.org&amp;#039;&amp;#039;&amp;#039; category and select the &amp;#039;&amp;#039;&amp;#039;OpenOffice.org Client Application&amp;#039;&amp;#039;&amp;#039;. Follow the next step and finish the project wizard.&lt;br /&gt;
# A new project with your specified name is created. The main function of a generated JAVA skeleton contains already the UNO bootstrap function that gives you access to an office context object as main entry point to get started with the {{PRODUCTNAME}} API. The context object is from a remote office instance that is connected over a named pipe connection and the default office is started automatically if no instance is running.&lt;br /&gt;
&lt;br /&gt;
==== Prepare the Eclipse IDE  ====&lt;br /&gt;
&lt;br /&gt;
For Eclipse the necessary jar files may be made available by defining a &amp;#039;&amp;#039;&amp;#039;User Library&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
#Install and start Eclipse. &lt;br /&gt;
#From the &amp;#039;&amp;#039;&amp;#039;Window&amp;#039;&amp;#039;&amp;#039; menu, select &amp;#039;&amp;#039;&amp;#039;Preferences&amp;#039;&amp;#039;&amp;#039;. On the dialog window, select &amp;#039;&amp;#039;&amp;#039;Java &amp;amp;gt; Build Path &amp;amp;gt; User Libraries&amp;#039;&amp;#039;&amp;#039;. Press &amp;#039;&amp;#039;&amp;#039;New&amp;#039;&amp;#039;&amp;#039; to create a new User Library. The library&amp;#039;s name might be &amp;#039;&amp;#039;&amp;#039;OpenOffice.org Libraries [SDK 3.0.1]&amp;#039;&amp;#039;&amp;#039;. Press &amp;#039;&amp;#039;&amp;#039;OK&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
#Select the library and press &amp;#039;&amp;#039;&amp;#039;Add JARs&amp;#039;&amp;#039;&amp;#039;. On the JAR-Selection dialog you should add the necessary libraries. For a standard installation of {{PRODUCTNAME}} 3.0.1 on unix, these are &lt;br /&gt;
##/opt/openoffice.org/ure/share/java/juh.jar &lt;br /&gt;
##/opt/openoffice.org/ure/share/java/jurt.jar &lt;br /&gt;
##/opt/openoffice.org/ure/share/java/ridl.jar &lt;br /&gt;
##/opt/openoffice.org/basis3.0/program/classes/unoil.jar&amp;lt;br&amp;gt; &lt;br /&gt;
#Press &amp;#039;&amp;#039;&amp;#039;OK&amp;#039;&amp;#039;&amp;#039; to save the User Library.&lt;br /&gt;
#Add a classpath variable.&amp;amp;nbsp;On the previous dialog window, select&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;Java &amp;amp;gt; Build Path &amp;amp;gt; Classpath Variables&amp;#039;&amp;#039;&amp;#039;. Press New to create a new Variable Entry. A name of the variable might be&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;OO_PROGRAM&amp;#039;&amp;#039;&amp;#039;. A path&amp;amp;nbsp;for a standard installation of 3.2.1 on unix is&amp;amp;nbsp;/opt/openoffice.org/program. &amp;amp;nbsp;&lt;br /&gt;
#From the &amp;#039;&amp;#039;&amp;#039;File&amp;#039;&amp;#039;&amp;#039; menu, select &amp;#039;&amp;#039;&amp;#039;New &amp;amp;gt; Java Project&amp;#039;&amp;#039;&amp;#039;. On the wizard&amp;#039;s page for &amp;#039;&amp;#039;&amp;#039;Java Settings&amp;#039;&amp;#039;&amp;#039; select the &amp;#039;&amp;#039;&amp;#039;Libraries&amp;#039;&amp;#039;&amp;#039; tab. Press &amp;#039;&amp;#039;&amp;#039;Add Library&amp;#039;&amp;#039;&amp;#039;, select &amp;#039;&amp;#039;&amp;#039;User Library&amp;#039;&amp;#039;&amp;#039; and press &amp;#039;&amp;#039;&amp;#039;Next&amp;#039;&amp;#039;&amp;#039;. Select the User Library you defined before and press &amp;#039;&amp;#039;&amp;#039;Finish&amp;#039;&amp;#039;&amp;#039;. Continue the dialog of the &amp;#039;&amp;#039;&amp;#039;New Project&amp;#039;&amp;#039;&amp;#039; wizard.&lt;br /&gt;
&lt;br /&gt;
A standard installation of {{PRODUCTNAME}} on unix is rooted as &amp;lt;code&amp;gt;/opt&amp;lt;/code&amp;gt;. For other installations the libraries should be found at corresponding locations.&lt;br /&gt;
&lt;br /&gt;
===Add the API Reference to your IDE===&lt;br /&gt;
&lt;br /&gt;
We recommend to add the API and the Java UNO reference to your Java IDE to get online help for the {{PRODUCTNAME}} API and the Java UNO runtime. The generated reference documentation provides Javadoc conform index files that can be integrated in most Java IDEs. In NetBeans the IDL reference is automatically integrated with the installation of the [http://wiki.services.openoffice.org/wiki/OpenOffice_NetBeans_Integration OpenOffice.org API Plugin].&lt;br /&gt;
&lt;br /&gt;
Using the reference in NetBeans is quite simple, type an IDL type in the editor and press &amp;#039;&amp;#039;&amp;#039;ALT ＋ F1&amp;#039;&amp;#039;&amp;#039;. A further useful feature is the code completion feature that you get also automatically when you install the plugin.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/First Steps]]&lt;/div&gt;</summary>
		<author><name>Java1cprog</name></author>
	</entry>
</feed>