<?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=OOoLerner</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=OOoLerner"/>
	<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/wiki/Special:Contributions/OOoLerner"/>
	<updated>2026-04-26T19:05:44Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/OfficeDev/Frames&amp;diff=131686</id>
		<title>Documentation/DevGuide/OfficeDev/Frames</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/OfficeDev/Frames&amp;diff=131686"/>
		<updated>2009-06-14T06:40:54Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/OfficeDevTOC&lt;br /&gt;
|OfficeDev2a=block&lt;br /&gt;
|OfficeDevFramework=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/OfficeDev/Frame-Controller-Model Paradigm in OpenOffice.org&lt;br /&gt;
|NextPage=Documentation/DevGuide/OfficeDev/Controllers&lt;br /&gt;
}}&lt;br /&gt;
{{Documentation/DevGuideLanguages|Documentation/DevGuide/OfficeDev/{{SUBPAGENAME}}}} &lt;br /&gt;
 {{DISPLAYTITLE:Frames}}&lt;br /&gt;
=== Linking Components and Windows ===&lt;br /&gt;
&amp;lt;!--&amp;lt;idltopic&amp;gt;com.sun.star.frame.Frame;com.sun.star.frame.XFrame;com.sun.star.frame.XFrames;com.sun.star.awt.XWindow;com.sun.star.awt.XTopWindow&amp;lt;/idltopic&amp;gt;--&amp;gt;&lt;br /&gt;
The main role of a frame in the Frame-Controller-Model paradigm is to act as a liaison between viewable components and the window system. &lt;br /&gt;
&lt;br /&gt;
Frames can hold one component, or a component and one or more subframes. The following two illustrations depict both possibilities. The first illustration shows a frame containing only a component. It is connected with two window instances: the container window and component window.&lt;br /&gt;
&lt;br /&gt;
[[Image:FCMFrame.png|none|thumb|400px|Frame containing a component]]&lt;br /&gt;
&lt;br /&gt;
When a frame is constructed, the frame must be initialized with a container window using &amp;lt;idlml&amp;gt;com.sun.star.frame.XFrame:initialize&amp;lt;/idlml&amp;gt;(). This method expects the &amp;lt;idl&amp;gt;com.sun.star.awt.XWindow&amp;lt;/idl&amp;gt; interface of a surrounding window instance, which becomes the container window of the frame. The window instance passed to &amp;lt;code&amp;gt;initialize()&amp;lt;/code&amp;gt; must also support &amp;lt;idl&amp;gt;com.sun.star.awt.XTopWindow&amp;lt;/idl&amp;gt; to become a container window. The container window must broadcast window events, such as &amp;lt;code&amp;gt;windowActivated()&amp;lt;/code&amp;gt;, and appear in front of other windows or be sent to the background. The fact that container windows support &amp;lt;idl&amp;gt;com.sun.star.awt.XTopWindow&amp;lt;/idl&amp;gt; does not mean the container window is an independent window of the underlying window system with a title bar and a system menu. An &amp;lt;code&amp;gt;XTopWindow&amp;lt;/code&amp;gt; acts as a window if necessary, but it can also be docked or depend on a surrounding application window.&lt;br /&gt;
&lt;br /&gt;
After initializing the frame, a component is set into the frame by a frame loader implementation that loads a component into the frame. It calls &amp;lt;idlml&amp;gt;com.sun.star.frame.XFrame:setComponent&amp;lt;/idlml&amp;gt;() that takes another &amp;lt;idl&amp;gt;com.sun.star.awt.XWindow&amp;lt;/idl&amp;gt; instance and the &amp;lt;idl&amp;gt;com.sun.star.frame.XController&amp;lt;/idl&amp;gt; interface of a controller.Usually the controller is holding a model, therefore the component gets a component window of its own, separate from the container window.&lt;br /&gt;
&lt;br /&gt;
A frame with a component is associated with &amp;#039;&amp;#039;two&amp;#039;&amp;#039; windows: the &amp;#039;&amp;#039;container&amp;#039;&amp;#039; window which is an &amp;lt;code&amp;gt;XTopWindow&amp;lt;/code&amp;gt; and the &amp;#039;&amp;#039;component&amp;#039;&amp;#039; window, which is the rectangular area that displays the component and receives GUI events for the component while it is active. When a frame is initialized with an instance of a window in a call to &amp;lt;code&amp;gt;initialize()&amp;lt;/code&amp;gt;, this window becomes its container window. When a component is set into a frame using &amp;lt;code&amp;gt;setComponent()&amp;lt;/code&amp;gt;, another &amp;lt;idl&amp;gt;com.sun.star.awt.XWindow&amp;lt;/idl&amp;gt; instance is passed and becomes the component window.&lt;br /&gt;
&lt;br /&gt;
When a frame is added to the desktop frame hierarchy, the desktop becomes the parent frame of our frame. For this purpose, the &amp;lt;idl&amp;gt;com.sun.star.frame.XFramesSupplier&amp;lt;/idl&amp;gt; interface of the desktop is passed to the method &amp;lt;code&amp;gt;setCreator()&amp;lt;/code&amp;gt; at the &amp;lt;code&amp;gt;XFrame&amp;lt;/code&amp;gt; interface. This happens internally when the method &amp;lt;code&amp;gt;append()&amp;lt;/code&amp;gt; is called at the &amp;lt;idl&amp;gt;com.sun.star.frame.XFrames&amp;lt;/idl&amp;gt; interface supplied by the desktop.&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Note|A component window can have sub-windows, and that is the case with all documents in {{PRODUCTNAME}}. For instance, a text document has sub-windows for the toolbars and the editable text. Form controls are sub-windows, as well, however, these sub-windows depend on the component window and do not appear in the Frame-Controller-Model paradigm, as discussed above.}}&lt;br /&gt;
&lt;br /&gt;
The second diagram shows a frame with a component and a sub-frame with another component. Each frame has a container window and component window.&lt;br /&gt;
&lt;br /&gt;
[[Image:FCMSubframe.png|none|thumb|400px|Frame containing a component and a sub-frame]]&lt;br /&gt;
&lt;br /&gt;
In the {{PRODUCTNAME}} GUI, sub-frames appear as dependent windows. The sub-frame in the illustration above could be a dockable window, such as the beamer showing the database browser or a floating frame in a document created with &amp;#039;&amp;#039;&amp;#039;Insert &amp;gt; Frame&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
Note that a frame with a component and sub-frame is associated with &amp;#039;&amp;#039;four&amp;#039;&amp;#039; windows. The frame and the sub-frame have a container window and a component window for the component.&lt;br /&gt;
&lt;br /&gt;
When a sub-frame is added to a surrounding frame, the frame becomes the parent of the sub-frame by a call to &amp;lt;code&amp;gt;setCreator()&amp;lt;/code&amp;gt; at the sub-frame. This happens internally when the method &amp;lt;code&amp;gt;append()&amp;lt;/code&amp;gt; is called at the &amp;lt;idl&amp;gt;com.sun.star.frame.XFrames&amp;lt;/idl&amp;gt; interface supplied by the surrounding frame.&lt;br /&gt;
&lt;br /&gt;
The section [[Documentation/DevGuide/OfficeDev/Creating Frames Manually|Creating Frames Manually]] shows examples for the usage of the &amp;lt;code&amp;gt;XFrame&amp;lt;/code&amp;gt; interface that creates frames in the desktop environment, constructs dockable and standalone windows, and inserts components into frames.&lt;br /&gt;
&lt;br /&gt;
=== Communication through Dispatch Framework ===&lt;br /&gt;
&lt;br /&gt;
Besides the main role of frames as expressed in the &amp;lt;idl&amp;gt;com.sun.star.frame.XFrame&amp;lt;/idl&amp;gt; interface, frames play another role by providing a communication context for the component they contain, that is, every communication from a controller to the desktop environment and the user interface, and conversely, is done through the frame. This aspect of a frame is published through the &amp;lt;idl&amp;gt;com.sun.star.frame.XDispatchProvider&amp;lt;/idl&amp;gt; interface, which uses special command requests to trigger actions.&lt;br /&gt;
&lt;br /&gt;
The section [[Documentation/DevGuide/OfficeDev/Using the Dispatch Framework|Using the Dispatch Framework]] discusses the usage of the dispatch API. &lt;br /&gt;
&lt;br /&gt;
=== Components in Frames ===&lt;br /&gt;
&lt;br /&gt;
The desktop environment section discussed the three kinds of viewable components that can be inserted into a frame. If the component has a controller &amp;#039;&amp;#039;and&amp;#039;&amp;#039; a model like a document, or if it has only a controller, such as the bibliography and database browser, it implements the &amp;lt;idl&amp;gt;com.sun.star.frame.Controller&amp;lt;/idl&amp;gt; service represented by the interface &amp;lt;idl&amp;gt;com.sun.star.frame.XController&amp;lt;/idl&amp;gt;. In the call to &amp;lt;idlml&amp;gt;com.sun.star.frame.XFrame:setComponent&amp;lt;/idlml&amp;gt;(), the controller is passed with the component window instance. If the component has no controller, it directly implements &amp;lt;idl&amp;gt;com.sun.star.lang.XComponent&amp;lt;/idl&amp;gt; and &amp;lt;idl&amp;gt;com.sun.star.awt.XWindow&amp;lt;/idl&amp;gt;. In this case, the component is passed as &amp;lt;code&amp;gt;XWindow&amp;lt;/code&amp;gt; parameter, and the &amp;lt;code&amp;gt;XController&amp;lt;/code&amp;gt; parameter must be an &amp;lt;code&amp;gt;XController&amp;lt;/code&amp;gt; reference set to null. &lt;br /&gt;
&lt;br /&gt;
If the viewable component is a &amp;#039;&amp;#039;trivial component&amp;#039;&amp;#039; (implementing &amp;lt;code&amp;gt;XWindow&amp;lt;/code&amp;gt; only), the frame holds a reference to the component window, controls the lifetime of the component and propagates certain events from the container window to the component window. If the viewable component is an &amp;#039;&amp;#039;office component&amp;#039;&amp;#039; (having a controller), the frame adds to these basic functions a set of features for integration of the component into the environment by supporting additional command URLs for the component at its &amp;lt;idl&amp;gt;com.sun.star.frame.XDispatchProvider&amp;lt;/idl&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Office Development]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/OfficeDev/Desktop_Environment&amp;diff=131639</id>
		<title>Documentation/DevGuide/OfficeDev/Desktop Environment</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/OfficeDev/Desktop_Environment&amp;diff=131639"/>
		<updated>2009-06-13T16:19:21Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/OfficeDevTOC&lt;br /&gt;
|OfficeDev2a=block&lt;br /&gt;
|OfficeDevUsing=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/OfficeDev/OpenOffice.org Application Environment&lt;br /&gt;
|NextPage=Documentation/DevGuide/OfficeDev/Framework API&lt;br /&gt;
}}&lt;br /&gt;
{{Documentation/DevGuideLanguages|Documentation/DevGuide/OfficeDev/{{SUBPAGENAME}}}} &lt;br /&gt;
 {{DISPLAYTITLE:Desktop Environment}}&lt;br /&gt;
&amp;lt;!--&amp;lt;idltopic&amp;gt;com.sun.star.frame.Desktop&amp;lt;/idltopic&amp;gt;--&amp;gt;&lt;br /&gt;
The &amp;lt;idl&amp;gt;com.sun.star.frame.Desktop&amp;lt;/idl&amp;gt; service is the central management instance for the {{PRODUCTNAME}} application framework. All {{PRODUCTNAME}} application windows are organized in a hierarchy of frames that contain viewable components. The desktop is the root frame for this hierarchy. From the desktop you can load viewable components, access frames and components, terminate the office, traverse the frame hierarchy and dispatch command requests.&lt;br /&gt;
&lt;br /&gt;
The name of this service originates at StarOffice 5.x, where all document windows were embedded into a common application window that was occupied by the StarOffice desktop, mirroring the Windows desktop. The root frame of this hierarchy was called the desktop frame. The name of this service and the interface name &amp;lt;idl&amp;gt;com.sun.star.frame.XDesktop&amp;lt;/idl&amp;gt; were kept for compatibility reasons.&lt;br /&gt;
&lt;br /&gt;
The desktop object and frame objects use auxiliary services, such as the &amp;lt;idl&amp;gt;com.sun.star.document.TypeDetection&amp;lt;/idl&amp;gt; service and other, opaque implementations that interact with the UNO-based office, but are not accessible through the {{PRODUCTNAME}} API. Examples for the latter are the global document event handling and its user interface (&amp;#039;&amp;#039;&amp;#039;Tools &amp;gt; Customize &amp;gt; Events&amp;#039;&amp;#039;&amp;#039;), and the menu bars that use the dispatch API without being UNO services themselves. The desktop service, together with these surrounding objects, is called the &amp;#039;&amp;#039;desktop environment&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
[[Image:DesktopOverview.png|none|thumb|400px|The Desktop terminates the office and manages components and frames]]&lt;br /&gt;
&lt;br /&gt;
The viewable components managed by the desktop can be three different kinds of objects: full-blown office documents with a document model and controllers, components with a controller but no model, such as the bibliography and database browser, or simple windows without API-enabled controllers, for example, preview windows. The commonality between these types of components is the &amp;lt;idl&amp;gt;com.sun.star.lang.XComponent&amp;lt;/idl&amp;gt; interface. Components with controllers are also called office components, whereas simple window components are called trivial components.&lt;br /&gt;
&lt;br /&gt;
Frames in the {{PRODUCTNAME}} API are the connecting link between windows, components and the desktop environment. The relationship between frames and components is discussed in the next section,  [[Documentation/DevGuide/OfficeDev/Framework API|Framework API]].&lt;br /&gt;
&lt;br /&gt;
Like all other services, the &amp;lt;idl&amp;gt;com.sun.star.frame.Desktop&amp;lt;/idl&amp;gt; service can be exchanged by another implementation that extends the functionality of {{PRODUCTNAME}}. By exchanging the desktop service it is possible to use different kinds of windows or to make {{PRODUCTNAME}} use MDI instead of SDI. This is not an easy thing to do, but it is possible without changing any code elsewhere in {{PRODUCTNAME}}.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Office Development]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/FirstSteps/Objects,_Interfaces,_and_Services&amp;diff=115971</id>
		<title>Documentation/DevGuide/FirstSteps/Objects, Interfaces, and Services</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/FirstSteps/Objects,_Interfaces,_and_Services&amp;diff=115971"/>
		<updated>2009-03-15T12:05:33Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: /* Interfaces */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/FirstStepsTOC&lt;br /&gt;
|FirstSteps2b=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/FirstSteps/Working with Objects&lt;br /&gt;
|NextPage=Documentation/DevGuide/FirstSteps/Using Services&lt;br /&gt;
}}&lt;br /&gt;
[[zh:Zh/Documentation/DevGuide/FirstSteps/Objects, Interfaces, and Services]]&lt;br /&gt;
{{DISPLAYTITLE:Objects, Interfaces, and Services}}&lt;br /&gt;
===Objects===&lt;br /&gt;
&lt;br /&gt;
In UNO, an &amp;#039;&amp;#039;object&amp;#039;&amp;#039; is a software artifact that has methods that you can call and attributes that you can get and set. Exactly which methods and attributes an object offers is specified by the set of interfaces it supports.&lt;br /&gt;
&lt;br /&gt;
===Interfaces===&lt;br /&gt;
&lt;br /&gt;
An &amp;#039;&amp;#039;interface&amp;#039;&amp;#039; specifies a set of attributes and methods that together define one single aspect of an object. For instance, the interface &amp;lt;idl&amp;gt;com.sun.star.resource.XResourceBundle&amp;lt;/idl&amp;gt; specifies the attribute &amp;lt;code&amp;gt;Parent&amp;lt;/code&amp;gt; and the methods &amp;lt;code&amp;gt;getLocale()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;getDirectElement()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  module com { module sun { module star { module resource { interface XResourceBundle: com::sun::star::container::XNameAccess {&lt;br /&gt;
      [attribute] XResourceBundle Parent;&lt;br /&gt;
      com::sun::star::lang::Locale getLocale();&lt;br /&gt;
      any getDirectElement([in] string key);&lt;br /&gt;
  };&lt;br /&gt;
  }; }; }; };&lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To allow for reuse of such interface specifications, an interface can inherit one or more other interfaces (as, for example, &amp;lt;idls&amp;gt;com.sun.star.resource.XResourceBundle&amp;lt;/idls&amp;gt; inherits all the attributes and methods of &amp;lt;idl&amp;gt;com.sun.star.container.XNameAccess&amp;lt;/idl&amp;gt;). Multiple inheritance, the ability to inherit more than one interface, was introduced in {{PRODUCTNAME}} {{OOo2.x}}.&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, interface attributes are not needed in UNO. Each attribute could also be expressed as a combination of one method to get the attribute&amp;#039;s value, and another method to set it (or just one method to get the value for a read-only attribute). However, there are at least two good reasons for the inclusion of interface attributes in UNO: First, the need for such combinations of getting and setting a value seems to be widespread enough to warrant extra support. Second, with attributes, a designer of an interface can better express nuances among the different features of an object. Attributes can be used for those features that are not considered integral or structural parts of an object, while explicit methods are reserved to access the core features.&lt;br /&gt;
Historically, a UNO object typically supported a set of many independent interfaces, corresponding to its many different aspects. With multiple-inheritance interfaces, there is less need for this, as an object may now support just one interface that inherits from all the other interfaces that make up the object’s various aspects.&lt;br /&gt;
&lt;br /&gt;
===Services===&lt;br /&gt;
&lt;br /&gt;
Historically, the term “service” has been used with an unclear meaning in UNO. Starting with {{PRODUCTNAME}} {{OOo2.x}}, the underlying concepts have been made cleaner. Unfortunately, this leaves two different meanings for the term “service” within UNO. In the following, we will use the term &amp;quot;new-style service&amp;quot; to denote an entity that conforms to the clarified, {{PRODUCTNAME}}-{{OOo2.x}} service concept, while we use &amp;quot;old-style service&amp;quot; to denote an entity that only conforms to the historical, more vague concept. To make matters even more complicated, the term “service” is often used with still different meanings in contexts outside UNO.&lt;br /&gt;
&lt;br /&gt;
Although technically there should no longer be any need for old-style services, the {{PRODUCTNAME}} API still uses them extensively to remain backwards compatible. Therefore, be prepared to encounter uses of both service concepts in parallel when working with the {{PRODUCTNAME}} API.&lt;br /&gt;
&lt;br /&gt;
A &amp;#039;&amp;#039;new-style service&amp;#039;&amp;#039; is of the form&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  module com { module sun { module star { module bridge {   &lt;br /&gt;
      serviceUnoUrlResolver: XUnoUrlResolver;&lt;br /&gt;
  }; }; }; };&lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and specifies that objects that support a certain interface (for example, &amp;lt;idl&amp;gt;com.sun.star.bridge.XUnoUrlResolver&amp;lt;/idl&amp;gt;) will be available under a certain service name (e.g., &amp;quot;com.sun.star.bridge.UnoUrlResolver&amp;quot;) at a component context’s service manager.  (Formally, new-style services are called “single-interface–based services.”)&lt;br /&gt;
&lt;br /&gt;
The various UNO language bindings offer special constructs to easily obtain instances of such new-style services, given a suitable component context; see [[Documentation/DevGuide/ProUNO/Java/Java Language Binding|Java Language Binding]] and [[Documentation/DevGuide/ProUNO/C++/C++ Language Binding|C++ Language Binding]].&lt;br /&gt;
&lt;br /&gt;
An &amp;#039;&amp;#039;old-style service&amp;#039;&amp;#039; (formally called an “accumulation-based service”) is of the form&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  module com { module sun { module star { module frame {serviceDesktop {&lt;br /&gt;
      service Frame;&lt;br /&gt;
      interface XDesktop;&lt;br /&gt;
      interface XComponentLoader;&lt;br /&gt;
      interface com::sun::star::document::XEventBroadcaster;&lt;br /&gt;
  };&lt;br /&gt;
  }; }; }; };&lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and is used to specify any of the following:&lt;br /&gt;
&lt;br /&gt;
* The general contract is that, if an object is documented to support a certain old-style service, then you can expect that object to support all interfaces exported by the service itself and any inherited services. For example, the method &amp;lt;idlml&amp;gt;com.sun.star.frame.XFrames:queryFrames&amp;lt;/idlml&amp;gt; returns a sequence of objects that should all support the old-style service &amp;lt;idl&amp;gt;com.sun.star.frame.Frame&amp;lt;/idl&amp;gt;, and thus all the interfaces exported by &amp;lt;idls&amp;gt;com.sun.star.frame.Frame&amp;lt;/idls&amp;gt;.&lt;br /&gt;
* Additionally, an old-style service may specify one or more properties, as in&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  module com { module sun { module star { module frame {service Frame {   &lt;br /&gt;
      interface com::sun::star::frame::XFrame;&lt;br /&gt;
      interface com::sun::star::frame::XDispatchProvider;&lt;br /&gt;
      // ...&lt;br /&gt;
      [property] string Title;&lt;br /&gt;
      [property, optional] XDispatchRecorderSupplier RecorderSupplier;&lt;br /&gt;
      // ...&lt;br /&gt;
  };&lt;br /&gt;
  }; }; }; };&lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: Properties, which are explained in detail in the following section, are similar to interface attributes, in that they describe additional features of an object. The main difference is that interface attributes can be accessed directly, while the properties of an old-style service are typically accessed via generic interfaces like &amp;lt;idl&amp;gt;com.sun.star.beans.XPropertySet&amp;lt;/idl&amp;gt;. Often, interface attributes are used to represent integral features of an object, while properties represent additional, more volatile features.&lt;br /&gt;
&lt;br /&gt;
* Some old-style services are intended to be available at a component context’s service manager. For example, the service &amp;lt;idl&amp;gt;com.sun.star.frame.Desktop&amp;lt;/idl&amp;gt; can be instantiated at a component context’s service manager under its service name &amp;quot;com.sun.star.frame.Desktop&amp;quot;. (The problem is that you cannot tell whether a given old-style service is intended to be available at a component context; using a new-style service instead makes that intent explicit.)&lt;br /&gt;
&lt;br /&gt;
* Other old-style services are designed as generic super-services that are inherited by other services. For example, the service &amp;lt;idl&amp;gt;com.sun.star.document.OfficeDocument&amp;lt;/idl&amp;gt; serves as a generic base for all different sorts of concrete document services, like &amp;lt;idl&amp;gt;com.sun.star.text.TextDocument&amp;lt;/idl&amp;gt; and &amp;lt;idl&amp;gt;com.sun.star.drawing.DrawingDocument&amp;lt;/idl&amp;gt;. (Multiple-inheritance interfaces are now the preferred mechanism to express such generic base services.)&lt;br /&gt;
&lt;br /&gt;
* Yet other old-style services only list properties, and do not export any interfaces at all. Instead of specifying the interfaces supported by certain objects, as the other kinds of old-style services do, such services are used to document a set of related properties. For example, the service &amp;lt;idl&amp;gt;com.sun.star.document.MediaDescriptor&amp;lt;/idl&amp;gt; lists all the properties that can be passed to &amp;lt;idlml&amp;gt;com.sun.star.frame.XComponentLoader:loadComponentFromURL&amp;lt;/idlml&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A &amp;#039;&amp;#039;property&amp;#039;&amp;#039; is a feature of an object which is typically not considered an integral or structural part of the object and therefore is handled through generic &amp;lt;code&amp;gt;getPropertyValue()&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;setPropertyValue()&amp;lt;/code&amp;gt; methods instead of specialized get methods, such as &amp;lt;code&amp;gt;getPrinter()&amp;lt;/code&amp;gt;. Old-style services offer a special syntax to list all the properties of an object. An object containing properties only has to support the &amp;lt;idl&amp;gt;com.sun.star.beans.XPropertySet&amp;lt;/idl&amp;gt; interface to be prepared to handle all kinds of properties. Typical examples are properties for character or paragraph formatting. With properties, you can set multiple features of an object through a single call to &amp;lt;code&amp;gt;setPropertyValues()&amp;lt;/code&amp;gt;, which greatly improves the remote performance. For instance, paragraphs support the &amp;lt;code&amp;gt;setPropertyValues()&amp;lt;/code&amp;gt; method through their &amp;lt;idl&amp;gt;com.sun.star.beans.XMultiPropertySet&amp;lt;/idl&amp;gt; interface.&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>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/FirstSteps/First_Contact&amp;diff=115968</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=115968"/>
		<updated>2009-03-15T11:21:25Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &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;
[[zh:Zh/Documentation/DevGuide/FirstSteps/First Contact]]&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;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 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;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;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;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;
=== 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&lt;br /&gt;
					.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&lt;br /&gt;
					.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>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Filter_Dialog_(new)&amp;diff=115795</id>
		<title>Filter Dialog (new)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Filter_Dialog_(new)&amp;diff=115795"/>
		<updated>2009-03-13T18:06:58Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The purpose of this project is to specify the new functionality for OpenOffice.org Base to filter records of a table or query. It is originating from the description of the &lt;br /&gt;
[http://dba.openoffice.org/development/projects.html#new_filter New Filter Dialog] developer project.&lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
One of the two main goals of the specification is to describe a filter dialog for use in all contexts in order harmonize the user interface. Currently (OpenOffice.org 3.0.1) OpenOffice.org Base uses two different filter dialogs in different circumstances.&lt;br /&gt;
&lt;br /&gt;
The other of the two main objectives is to enhance the current functionality so that more complex filter conditions can be specified. &lt;br /&gt;
&lt;br /&gt;
A third goal is to provide a dialog that is easier to use and more intuitive to the user. &lt;br /&gt;
&lt;br /&gt;
=== How to Help ===&lt;br /&gt;
&lt;br /&gt;
A [[#SpecDraft|first draft]] of the specification is provided below. Please feel encouraged to send feedback to the [mailto:users@dba.openoffice.org users@dba.openoffice.org] mailing list.&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
New project starting: 16 March 2009&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specification Draft: &amp;lt;span id=&amp;quot;SpecDraft&amp;quot;&amp;gt;[http://specs.openoffice.org/files/documents/138/4488/NewFilterDialog_1.odt Filter for Tables and Queries]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team and Contact==&lt;br /&gt;
&lt;br /&gt;
Please use the [mailto:dev@dba.openoffice.org dev@dba.openoffice.org] mailing list for&lt;br /&gt;
questions, comments, problem reports or if you want help develop the new Filter Dialog.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following people are working on the project:&lt;br /&gt;
* [mailto:karl.weber99@gmx.net?subject:OOoWiki Karl Weber] (iTeam Lead &amp;amp; Specification Owner)&lt;br /&gt;
* [http://wiki.services.openoffice.org/wiki/User:Frank_Sch%C3%B6nheit Frank Schönheit] ([http://dba.openoffice.org/ Development], [http://www.sun.com Sun Microsystems])&lt;br /&gt;
* [http://wiki.services.openoffice.org/wiki/User:Clu Christoph Lukasiak] ([http://ux.openoffice.org/ User Experience], [http://www.sun.com Sun Microsystems])&lt;br /&gt;
* [http://wiki.services.openoffice.org/wiki/User:DrewJensen/DBDoc Andrew Jenson] ([http://qa.openoffice.org/ Quality Assurance])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
----&lt;br /&gt;
&amp;#039;&amp;#039;Autors: [mailto:Christoph.Lukasiak@Sun.com?subject:OOoWiki Christoph Lukasiak] ([http://wiki.services.openoffice.org/wiki/User:Clu Clu]), [mailto:karl.weber99@gmx.net?subject:OOoWiki Karl Weber] 10 March 2009&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Please do not change the logical content of this site without&lt;br /&gt;
acknowledge of the authors, the [http://wiki.services.openoffice.org/wiki/Database_Docu_Coordinator Database Docu Coordinator] or the [http://wiki.services.openoffice.org/wiki/Project_Lead OOo QA Project Lead/Co-Leads].&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:Database]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Filter_Dialog_(new)&amp;diff=115794</id>
		<title>Filter Dialog (new)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Filter_Dialog_(new)&amp;diff=115794"/>
		<updated>2009-03-13T18:03:48Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The purpose of this project is to specify the new functionality OpenOffice.org Base is going to provide to filter records of a table or query. It is originating from the description of the &lt;br /&gt;
[http://dba.openoffice.org/development/projects.html#new_filter New Filter Dialog] developer project.&lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
One of the two main goals of the specification is to describe a filter dialog for use in all contexts in order harmonize the user interface. Currently (OpenOffice.org 3.0.1) OpenOffice.org Base uses two different filter dialogs in different circumstances.&lt;br /&gt;
&lt;br /&gt;
The other of the two main objectives is to enhance the current functionality so that more complex filter conditions can be specified. &lt;br /&gt;
&lt;br /&gt;
A third goal is to provide a dialog that is easier to use and more intuitive to the user. &lt;br /&gt;
&lt;br /&gt;
=== How to Help ===&lt;br /&gt;
&lt;br /&gt;
A [[#SpecDraft|first draft]] of the specification is provided below. Please feel encouraged to send feedback to the [mailto:users@dba.openoffice.org users@dba.openoffice.org] mailing list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
&lt;br /&gt;
New project starting: 16 March 2009&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specification Draft: &amp;lt;span id=&amp;quot;SpecDraft&amp;quot;&amp;gt;[http://specs.openoffice.org/files/documents/138/4488/NewFilterDialog_1.odt Filter for Tables and Queries]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team and Contact==&lt;br /&gt;
&lt;br /&gt;
Please use the [mailto:dev@dba.openoffice.org dev@dba.openoffice.org] mailing list for&lt;br /&gt;
questions, comments, problem reports or if you want help develop the new Filter Dialog.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following people are working on the project:&lt;br /&gt;
* [mailto:karl.weber99@gmx.net?subject:OOoWiki Karl Weber] (iTeam Lead &amp;amp; Specification Owner)&lt;br /&gt;
* [http://wiki.services.openoffice.org/wiki/User:Frank_Sch%C3%B6nheit Frank Schönheit] ([http://dba.openoffice.org/ Development], [http://www.sun.com Sun Microsystems])&lt;br /&gt;
* [http://wiki.services.openoffice.org/wiki/User:Clu Christoph Lukasiak] ([http://ux.openoffice.org/ User Experience], [http://www.sun.com Sun Microsystems])&lt;br /&gt;
* [http://wiki.services.openoffice.org/wiki/User:DrewJensen/DBDoc Andrew Jenson] ([http://qa.openoffice.org/ Quality Assurance])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
----&lt;br /&gt;
&amp;#039;&amp;#039;Autors: [mailto:Christoph.Lukasiak@Sun.com?subject:OOoWiki Christoph Lukasiak] ([http://wiki.services.openoffice.org/wiki/User:Clu Clu]), [mailto:karl.weber99@gmx.net?subject:OOoWiki Karl Weber] 10 March 2009&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Please do not change the logical content of this site without&lt;br /&gt;
acknowledge of the authors, the [http://wiki.services.openoffice.org/wiki/Database_Docu_Coordinator Database Docu Coordinator] or the [http://wiki.services.openoffice.org/wiki/Project_Lead OOo QA Project Lead/Co-Leads].&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:Database]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/ProUNO/Interfaces&amp;diff=112645</id>
		<title>Documentation/DevGuide/ProUNO/Interfaces</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/ProUNO/Interfaces&amp;diff=112645"/>
		<updated>2009-02-22T09:52:20Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/ProUNOTOC&lt;br /&gt;
|ProUNO2a=block&lt;br /&gt;
|ProUNO2aDTypes=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/ProUNO/The Any Type&lt;br /&gt;
|NextPage=Documentation/DevGuide/ProUNO/Services&lt;br /&gt;
}}&lt;br /&gt;
[[zh:Zh/Documentation/DevGuide/ProUNO/Interfaces]]&lt;br /&gt;
{{DISPLAYTITLE:Interfaces}}&lt;br /&gt;
&lt;br /&gt;
Communication between UNO objects is based on object interfaces. Interfaces can be seen from the outside or the inside of an object. &lt;br /&gt;
&lt;br /&gt;
From the &amp;#039;&amp;#039;outside&amp;#039;&amp;#039; of an object, an interface provides a functionality or special aspect of the object. Interfaces provide access to objects by publishing a set of operations that cover a certain aspect of an object &amp;#039;&amp;#039;without telling anything about its internals&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The concept of interfaces is quite natural and frequently used in everyday life. Interfaces allow the creation of things that fit in with each other without knowing internal details about them. A power plug that fits into a standard socket or a one-size-fits-all working glove are simple examples. They all work by standardizing the minimal conditions that must be met to make things work together. &lt;br /&gt;
&lt;br /&gt;
A more advanced example would be the &amp;quot;remote control aspect&amp;quot; of a simple TV system. One possible feature of a TV system is a remote control. The remote control functions can be described by an &amp;lt;tt&amp;gt;XPower&amp;lt;/tt&amp;gt; and an &amp;lt;tt&amp;gt;XChannel&amp;lt;/tt&amp;gt; interface. The illustration below shows a &amp;lt;tt&amp;gt;RemoteControl&amp;lt;/tt&amp;gt; object with these interfaces:&lt;br /&gt;
&lt;br /&gt;
[[Image:RemoteControlImpl.png|none|thumb|350px|RemoteControl service]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;XPower&amp;lt;/tt&amp;gt; interface has the functions &amp;lt;tt&amp;gt;turnOn()&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;turnOff()&amp;lt;/tt&amp;gt; to control the power and the &amp;lt;tt&amp;gt;XChannel&amp;lt;/tt&amp;gt; interface has the functions &amp;lt;tt&amp;gt;select()&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;next()&amp;lt;/tt&amp;gt;,  &amp;lt;tt&amp;gt;previous()&amp;lt;/tt&amp;gt; to control the current channel. The user of these interfaces does not care if he uses an original remote control that came with a TV set or a universal remote control as long as it carries out these functions. The user is only dissatisfied if some of the functions promised by the interface do not work with a remote control.&lt;br /&gt;
&lt;br /&gt;
From the &amp;#039;&amp;#039;inside&amp;#039;&amp;#039; of an object, or from the perspective of someone who implements a UNO object, interfaces are abstract specifications. The abstract specification of all the interfaces in the {{PRODUCTNAME}} API has the advantage that user and implementer can enter into a contract, agreeing to adhere to the interface specification. A program that strictly uses the {{PRODUCTNAME}} API according to the specification will always work, while an implementer can do whatever he wants with his objects, as long as he serves the contract.&lt;br /&gt;
&lt;br /&gt;
UNO uses the &amp;lt;tt&amp;gt;interface&amp;lt;/tt&amp;gt; type to describe such aspects of UNO objects. By convention, all interface names start with the letter X to distinguish them from other types. All interface types must inherit the &amp;lt;idl&amp;gt;com.sun.star.uno.XInterface&amp;lt;/idl&amp;gt; root interface, either directly or in the inheritance hierarchy. &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; is explained in [[Documentation/DevGuide/ProUNO/Using UNO Interfaces|Using UNO Interfaces]]. The &amp;lt;tt&amp;gt;interface&amp;lt;/tt&amp;gt; types define &amp;#039;&amp;#039;methods&amp;#039;&amp;#039; (sometimes also called &amp;#039;&amp;#039;operations&amp;#039;&amp;#039;) to provide access to the specified UNO objects.&lt;br /&gt;
&lt;br /&gt;
Interfaces allow access to the data inside an object through dedicated methods (member functions) which encapsulate the data of the object. The methods always have a parameter list and a return value, and they may define exceptions for smart error handling. &lt;br /&gt;
&lt;br /&gt;
The exception concept in the OpenOffice.org API is comparable with the exception concepts known from Java or C++. All operations can raise &amp;lt;idls&amp;gt;com.sun.star.uno.RuntimeException&amp;lt;/idls&amp;gt; without explicit specification, but all other exceptions must be specified. UNO exceptions are explained in the section [[Documentation/DevGuide/ProUNO/Exception Handling|Exception Handling]].&lt;br /&gt;
&lt;br /&gt;
Consider the following two examples for interface definitions in UNOIDL (UNO Interface Definition Language) notation. UNOIDL interfaces resemble Java interfaces, and methods look similar to Java method signatures. However, note the flags in square brackets in the following example:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;// base interface for all UNO interfaces &lt;br /&gt;
  interface XInterface &lt;br /&gt;
  { &lt;br /&gt;
          any queryInterface( [in] type aType ); &lt;br /&gt;
          [oneway] void acquire(); &lt;br /&gt;
          [oneway] void release(); &lt;br /&gt;
  &lt;br /&gt;
  };  &lt;br /&gt;
  &lt;br /&gt;
  // fragment of the Interface com.sun.star.io.XInputStream &lt;br /&gt;
  &lt;br /&gt;
  interface XInputStream: com::sun::star::uno::XInterface &lt;br /&gt;
  {  &lt;br /&gt;
      long readBytes( [out] sequence&amp;lt;byte&amp;gt; aData, &lt;br /&gt;
                      [in] long nBytesToRead ) &lt;br /&gt;
                  raises( com::sun::star::io::NotConnectedException, &lt;br /&gt;
                          com::sun::star::io::BufferSizeExceededException, &lt;br /&gt;
                          com::sun::star::io::IOException); &lt;br /&gt;
      ... &lt;br /&gt;
  };  &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;[oneway]&amp;lt;/tt&amp;gt; flag indicates that an operation can be executed asynchronously if the underlying method invocation system does support this feature. For example, a UNO Remote Protocol (URP) bridge is a system that supports oneway calls.&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Caution|Although there are no general problems with the specification and the implementation of the UNO &amp;lt;tt&amp;gt;oneway&amp;lt;/tt&amp;gt; feature, there are several API remote usage scenarios where &amp;lt;tt&amp;gt;oneway&amp;lt;/tt&amp;gt; calls cause deadlocks in {{PRODUCTNAME}}. Therefore, do not introduce new &amp;lt;tt&amp;gt;oneway&amp;lt;/tt&amp;gt; methods with new {{PRODUCTNAME}} UNO APIs.}}&lt;br /&gt;
&lt;br /&gt;
There are also parameter flags. Each parameter definition begins with one of the direction flags in, out, or inout to specify the use of the parameter:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt; specifies that the parameter will be used as an input parameter only&lt;br /&gt;
* &amp;lt;tt&amp;gt;out&amp;lt;/tt&amp;gt; specifies that the parameter will be used as an output parameter only&lt;br /&gt;
* &amp;lt;tt&amp;gt;inout&amp;lt;/tt&amp;gt; specifies that the parameter will be used as an input and output parameter&lt;br /&gt;
&lt;br /&gt;
These parameter flags do not appear in the API reference. The fact that a parameter is an &amp;lt;tt&amp;gt;[out]&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;[inout]&amp;lt;/tt&amp;gt; parameter is explained in the method details. &lt;br /&gt;
&lt;br /&gt;
Interfaces consisting of methods form the basis for service specifications.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Professional UNO]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/ProUNO/The_Any_Type&amp;diff=112641</id>
		<title>Documentation/DevGuide/ProUNO/The Any Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/ProUNO/The_Any_Type&amp;diff=112641"/>
		<updated>2009-02-22T09:14:29Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/ProUNOTOC&lt;br /&gt;
|ProUNO2a=block&lt;br /&gt;
|ProUNO2aDTypes=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/ProUNO/Simple Types&lt;br /&gt;
|NextPage=Documentation/DevGuide/ProUNO/Interfaces&lt;br /&gt;
}}&lt;br /&gt;
[[zh:Zh/Documentation/DevGuide/ProUNO/The Any Type]]&lt;br /&gt;
{{DISPLAYTITLE:The Any Type}}&lt;br /&gt;
The special type &amp;lt;code&amp;gt;any&amp;lt;/code&amp;gt; can represent values of all other UNO types. In the target languages, the &amp;lt;code&amp;gt;any&amp;lt;/code&amp;gt; type requires special treatment. There is an &amp;lt;tt&amp;gt;AnyConverter&amp;lt;/tt&amp;gt; in Java and special operators in C++. For details, see [[Documentation/DevGuide/ProUNO/UNO Language Bindings|UNO Language Bindings]].&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Professional UNO]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/ProUNO/Simple_Types&amp;diff=112638</id>
		<title>Documentation/DevGuide/ProUNO/Simple Types</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/ProUNO/Simple_Types&amp;diff=112638"/>
		<updated>2009-02-22T09:07:05Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/ProUNOTOC&lt;br /&gt;
|ProUNO2a=block&lt;br /&gt;
|ProUNO2aDTypes=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/ProUNO/Data Types&lt;br /&gt;
|NextPage=Documentation/DevGuide/ProUNO/The Any Type&lt;br /&gt;
}}&lt;br /&gt;
[[zh:Zh/Documentation/DevGuide/ProUNO/Simple Types]]&lt;br /&gt;
{{DISPLAYTITLE:Simple Types}}&lt;br /&gt;
UNO provides a set of predefined, simple types which are listed in the following table:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=4 style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|-bgcolor=#EDEDED&lt;br /&gt;
!UNO Type!!Description &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;tt&amp;gt;void&amp;lt;/tt&amp;gt;||Empty type, used only as method return type and in any.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;tt&amp;gt;boolean&amp;lt;/tt&amp;gt;||Can be true or false.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;tt&amp;gt;byte&amp;lt;/tt&amp;gt;||Signed 8-bit integer type (ranging from -128 to 127, inclusive). &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;tt&amp;gt;short&amp;lt;/tt&amp;gt;||Signed 16-bit integer type (ranging from −32768 to 32767, inclusive). &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;tt&amp;gt;unsigned short&amp;lt;/tt&amp;gt;||Unsigned 16-bit integer type (deprecated). &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;tt&amp;gt;long&amp;lt;/tt&amp;gt;||Signed 32-bit integer type (ranging from −2147483648 to 2147483647, inclusive). &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;tt&amp;gt;unsigned long&amp;lt;/tt&amp;gt;||Unsigned 32-bit integer type (deprecated). &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;tt&amp;gt;hyper&amp;lt;/tt&amp;gt;||Signed 64-bit integer type (ranging from −9223372036854775808 to 9223372036854775807, inclusive). &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;tt&amp;gt;unsigned hyper&amp;lt;/tt&amp;gt;||Unsigned 64-bit integer type (deprecated). &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;tt&amp;gt;float&amp;lt;/tt&amp;gt;||IEC 60559 single precision floating point type. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;tt&amp;gt;double&amp;lt;/tt&amp;gt;||IEC 60559 double precision floating point type. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;tt&amp;gt;char&amp;lt;/tt&amp;gt;||Represents individual Unicode characters (more precisely: individual UTF-16 code units). &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;tt&amp;gt;string&amp;lt;/tt&amp;gt;||Represents Unicode strings (more precisely: strings of Unicode scalar values). &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;tt&amp;gt;type&amp;lt;/tt&amp;gt;||Meta type that describes all UNO types. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;tt&amp;gt;any&amp;lt;/tt&amp;gt;||Special type that can represent values of all other types. &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The chapters about language bindings [[Documentation/DevGuide/ProUNO/Java/Java Language Binding|Java Language Binding]], [[Documentation/DevGuide/ProUNO/C++/C++ Language Binding|C++ Language Binding]], [[Documentation/DevGuide/ProUNO/Basic/OpenOffice.org Basic|OpenOffice.org Basic]] and [[Documentation/DevGuide/ProUNO/Bridge/Automation Bridge|Automation Bridge]] describe how these types are mapped to the types of your target language.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Professional UNO]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Forms/Model-View_Interaction&amp;diff=112616</id>
		<title>Documentation/DevGuide/Forms/Model-View Interaction</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Forms/Model-View_Interaction&amp;diff=112616"/>
		<updated>2009-02-21T18:41:42Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/FormsTOC&lt;br /&gt;
|Forms2a=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Forms/Models and Views for Form Controls&lt;br /&gt;
|NextPage=Documentation/DevGuide/Forms/Form Layer Views&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:Model-View Interaction}}&lt;br /&gt;
When model and view collaborate, data transfer is usually required in both directions, from model to view and backwards.&lt;br /&gt;
&lt;br /&gt;
Consider a simple text field. The model for a control implements a &amp;lt;idl&amp;gt;com.sun.star.form.component.TextField&amp;lt;/idl&amp;gt; service. This means it has a property Text, containing the current content of the field, and a property &amp;lt;tt&amp;gt;BackgroundColor&amp;lt;/tt&amp;gt; specifying the color that should be used as background when drawing the text of the control.&lt;br /&gt;
&lt;br /&gt;
First, if the value of the &amp;lt;tt&amp;gt;BackgroundColor&amp;lt;/tt&amp;gt; property is changed, the control is notified of the change. This is done by UNO listener mechanisms, such as the &amp;lt;idl&amp;gt;com.sun.star.beans.XPropertyChangeListener&amp;lt;/idl&amp;gt; allowing the control to listen for changes to model properties and react accordingly. Here the control would have to redraw itself using the new background color. &lt;br /&gt;
&lt;br /&gt;
In fact this is a common mechanism for the communication between model and view: The view adds itself as listener for any aspect of the model which could affect it, and when it is notified of changes, it adjusts itself to the new model state. This means that the model is always the passive part. The model does not know its views, or at least not as views, but only their role as listeners, while the views know their model.&lt;br /&gt;
&lt;br /&gt;
On the other hand, if the view is used for interaction with the user, the data needs to be propagated from the view to the model. The user enters data in a text field, and the change is reflected in the model. Remember that the user sees the control only, and everything affects the &amp;#039;&amp;#039;control&amp;#039;&amp;#039; in the first step. If the user interacts with the view with the intention of modifying the model, the view propagates changes to the model.&lt;br /&gt;
&lt;br /&gt;
In our example, the user enters text into the control, the control &amp;#039;&amp;#039;automatically&amp;#039;&amp;#039; updates the respective property at the model (Text), thus modifying the document containing the model.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Forms]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Forms/The_Model-View_Paradigm&amp;diff=112615</id>
		<title>Documentation/DevGuide/Forms/The Model-View Paradigm</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Forms/The_Model-View_Paradigm&amp;diff=112615"/>
		<updated>2009-02-21T18:28:46Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/FormsTOC&lt;br /&gt;
|Forms2a=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Forms/Models and Views&lt;br /&gt;
|NextPage=Documentation/DevGuide/Forms/Models and Views for Form Controls&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:The Model-View Paradigm}}&lt;br /&gt;
A basic concept to understand about forms and controls in {{PRODUCTNAME}} is the model-view paradigm. For a given element in your document,for example, a text field in your HTML form, it says that you have &amp;#039;&amp;#039;exactly one&amp;#039;&amp;#039; model and an arbitrary number of views.&lt;br /&gt;
&lt;br /&gt;
The model is what is part of your document in that it describes how this element looks, and how it behaves. The model even exists when you do not have an open instance of your document. If it is stored in a file, the file contains a description of the model of your element.&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Note|In UNO, the simplest conceivable model is a component implementing &amp;lt;idl&amp;gt;com.sun.star.beans.XPropertySet&amp;lt;/idl&amp;gt; only. Every aspect of the view could then be described by a single property. In fact, as you will see later, models for form controls are basically property sets.}}&lt;br /&gt;
&lt;br /&gt;
The view is a visual representation of your model. It is the component which looks and behaves according to the requirements of the model. You can have multiple views for one model, and they would all look alike as the model describes it. The view is visible to the user. It is for visualizing the model and handles interactions with the user. The model, however, is merely a &amp;quot;dumb&amp;quot; container of data.&lt;br /&gt;
&lt;br /&gt;
A good example to illustrate this is available in {{PRODUCTNAME}}. Open an arbitrary document and choose the menu item &amp;#039;&amp;#039;&amp;#039;Window &amp;gt; New Window&amp;#039;&amp;#039;&amp;#039;. A second window is opened showing the same document displayed in the first window. This does not mean that the document was opened twice, it means you opened a second view of the same document, which is a difference. In particular, if you type some text in one of the windows, this change is visible in &amp;#039;&amp;#039;both&amp;#039;&amp;#039; windows. That is what the model-view paradigm is about: Keep your document data once in the model, and when you need to visualize the data to the user, or need interaction from the user that modifies the document, create views to the model as needed.&lt;br /&gt;
&lt;br /&gt;
Between model and view a 1:n relationship exists:&lt;br /&gt;
&lt;br /&gt;
[[Image:Model_View_Paradigm.png|none|thumb|400px|The Model View Paradigm]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Note|Note that the relation is directed. Usually, a view knows its model, but the model itself does not know about the views which visualize it.}}&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Forms]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Forms/Models_and_Views&amp;diff=112614</id>
		<title>Documentation/DevGuide/Forms/Models and Views</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Forms/Models_and_Views&amp;diff=112614"/>
		<updated>2009-02-21T18:22:10Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/FormsTOC&lt;br /&gt;
|Forms2a=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Forms/Forms&lt;br /&gt;
|NextPage=Documentation/DevGuide/Forms/The Model-View Paradigm&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:Models and Views}}&lt;br /&gt;
The model describes appearance and behaviour of the element.  The view is the visual representation of the element. The relationship between models and views is important to understand and is described in detail in this section.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Forms]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Forms/Forms&amp;diff=112613</id>
		<title>Documentation/DevGuide/Forms/Forms</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Forms/Forms&amp;diff=112613"/>
		<updated>2009-02-21T18:17:41Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/FormsTOC&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Database/Handling Unsupported Functionality&lt;br /&gt;
|NextPage=Documentation/DevGuide/Forms/Models and Views&lt;br /&gt;
}}&lt;br /&gt;
[[zh:Zh/Documentation/DevGuide/Forms/Forms]]&lt;br /&gt;
{{DISPLAYTITLE:Forms}}&lt;br /&gt;
{{Download Collection|MediaWiki:Collections/Developer&amp;#039;s Guide - Forms}}&lt;br /&gt;
Forms offer a method of control-based data input. A form or &amp;#039;&amp;#039;form document&amp;#039;&amp;#039; consists of a set of controls, where each one enters a single piece of data. In a simple case, this could be a plain text field allowing you to insert some text without any word breaks. When we speak of forms, we mean forms and controls, because these cannot be divided.&lt;br /&gt;
&lt;br /&gt;
If an internet site asks you for information, for example, for a product registration you are presented with fields to enter your name, your address and other information. These are HTML forms.&lt;br /&gt;
&lt;br /&gt;
Basically, this is what {{PRODUCTNAME}} forms do. They enhance nearly every document with controls for data input. This additional functionality put into a document is called the &amp;#039;&amp;#039;form layer&amp;#039;&amp;#039; within the scope of this chapter.&lt;br /&gt;
&lt;br /&gt;
The most basic functionality provides the controls for HTML form documents mentioned above: If you open an HTML document with form elements in {{PRODUCTNAME}} Writer, these elements are represented by components from &amp;lt;idlmodule&amp;gt;com.sun.star.form&amp;lt;/idlmodule&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The more enhanced functionality provides support for data-aware forms. These are forms and controls that are bound to a data source registered in {{PRODUCTNAME}} to enter data into tables of a database. For more information about data sources and data access in general, refer to the [[Documentation/DevGuide/Database/Database Access|Database Access]].&lt;br /&gt;
&lt;br /&gt;
Since {{PRODUCTNAME}} {{OO2.0.0}}, form controls also feature a generalization of this concept. They can be bound to external components, which supply an own value. Both values - the one of the external component, and the current value of the control - are synchronized, so that a change in one of them is immediately propagated to the other. This allows new features, where the most notable is that you can bind form controls to spreadsheet cells.&lt;br /&gt;
&lt;br /&gt;
When discussing forms, &amp;#039;&amp;#039;form documents&amp;#039;&amp;#039; and &amp;#039;&amp;#039;logical forms&amp;#039;&amp;#039; have to be distinguished. The phrase &amp;#039;&amp;#039;form document&amp;#039;&amp;#039; refers to a document as a whole, while a &amp;#039;&amp;#039;logical form&amp;#039;&amp;#039; is basically a set of controls with additional properties. Within the scope of this chapter, when a &amp;quot;form&amp;quot; is referred to, the logical form is meant.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Forms]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Extensions/Location_of_Installed_Extensions&amp;diff=112595</id>
		<title>Documentation/DevGuide/Extensions/Location of Installed Extensions</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Extensions/Location_of_Installed_Extensions&amp;diff=112595"/>
		<updated>2009-02-21T15:12:29Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/ExtensionsTOC&lt;br /&gt;
|Extensions2a=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Extensions/unopkg&lt;br /&gt;
|NextPage=Documentation/DevGuide/Extensions/Extension Layers&lt;br /&gt;
}}&lt;br /&gt;
[[zh:Zh/Documentation/DevGuide/Extensions/Location of Installed Extensions]]&lt;br /&gt;
{{DISPLAYTITLE:Location of Installed Extensions}}&lt;br /&gt;
Sometimes an extension developer needs to know the path to the root of his installed extension e.g. to load some additional data. You can use the singleton &amp;lt;tt&amp;gt;PackageInformationProvider&amp;lt;/tt&amp;gt; to get an URL for an installed extension with a given Extension Identifier. For more information about Extension Identifiers see [[Documentation/DevGuide/Extensions/Extension Identifiers|Extension Identifiers]]. For more information see &amp;lt;idl&amp;gt;com.sun.star.deployment.PackageInformationProvider&amp;lt;/idl&amp;gt; and have a look at &amp;lt;idl&amp;gt;com.sun.star.deployment.XPackageInformationProvider&amp;lt;/idl&amp;gt;.&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  namespace css = com::sun::star;&lt;br /&gt;
  css::uno::Reference&amp;lt; css::uno::XComponentContext &amp;gt; mxContext;&lt;br /&gt;
  ...&lt;br /&gt;
  css::uno::Reference&amp;lt; css::deployment::XPackageInformationProvider &amp;gt;&lt;br /&gt;
  xInfoProvider( css::deployment::PackageInformationProvider::get( mxContext ) );&lt;br /&gt;
  &lt;br /&gt;
  // &amp;quot;MY_PACKAGE_ID&amp;quot; is the identifier of the package whose location we want&lt;br /&gt;
  rtl::OUString sLocation = xInfoProvider-&amp;gt;getPackageLocation( &lt;br /&gt;
  rtl::OUString::createFromAscii( &amp;quot;MY_PACKAGE_ID&amp;quot; ) );&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/Extensions]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Extensions/unopkg&amp;diff=112594</id>
		<title>Documentation/DevGuide/Extensions/unopkg</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Extensions/unopkg&amp;diff=112594"/>
		<updated>2009-02-21T15:10:23Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/ExtensionsTOC&lt;br /&gt;
|Extensions2a=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Extensions/Extension Manager in OpenOffice.org&lt;br /&gt;
|NextPage=Documentation/DevGuide/Extensions/Location of Installed Extensions&lt;br /&gt;
}}&lt;br /&gt;
[[zh:Zh/Documentation/DevGuide/Extensions/unopkg]]&lt;br /&gt;
{{DISPLAYTITLE:unopkg}}&lt;br /&gt;
The &amp;#039;&amp;#039;unopkg&amp;#039;&amp;#039; executable offers another way to start the Extension Manager. It supersedes the &amp;#039;&amp;#039;pkgchk&amp;#039;&amp;#039; executable which was used in {{PRODUCTNAME}} {{OO1.1.0}} and older versions and which no longer works.&lt;br /&gt;
&lt;br /&gt;
In contrast to the Extension Manager in {{PRODUCTNAME}} &amp;#039;&amp;#039;unopkg&amp;#039;&amp;#039; can also manage shared extensions. For example:&lt;br /&gt;
&lt;br /&gt;
  [&amp;lt;OfficePath&amp;gt;/program] $ unopkg add --shared my_extension.oxt&lt;br /&gt;
&lt;br /&gt;
installs &amp;#039;&amp;#039;my_extension.oxt&amp;#039;&amp;#039; for all users.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;unopkg&amp;#039;&amp;#039; offers a windowless mode in which all interactions occurs through the console. This is the default. If &amp;#039;&amp;#039;unopkg&amp;#039;&amp;#039; is started with the subcommand &amp;lt;tt&amp;gt;gui&amp;lt;/tt&amp;gt; then the Extension Manager dialog appears which is exactly the same as the one in {{PRODUCTNAME}}.&lt;br /&gt;
&lt;br /&gt;
  [&amp;lt;OfficePath&amp;gt;/program] $ unopkg gui&lt;br /&gt;
&lt;br /&gt;
The difference is that in the dialog all items deployed under &amp;#039;&amp;#039;&amp;#039;{{PRODUCTNAME}} Extensions&amp;#039;&amp;#039;&amp;#039; can be modified and new items can be added there as well. All actions, that is, adding, removing, etc. can be done in the dialog. Therefore &amp;lt;tt&amp;gt;unopkg gui&amp;lt;/tt&amp;gt; does not require any more parameters.&lt;br /&gt;
&lt;br /&gt;
It follows a short overview what can be done with &amp;#039;&amp;#039;unopkg&amp;#039;&amp;#039;. Since there are many more commands, have a look at the help text that can be obtained by calling &amp;lt;tt&amp;gt;unopkg -h&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
First of all open a console and change into the program directory of the office installation.&lt;br /&gt;
&lt;br /&gt;
Adding an extension for a single user:&lt;br /&gt;
&lt;br /&gt;
  [&amp;lt;OfficePath&amp;gt;/program] $ unopkg add my_extension.oxt&lt;br /&gt;
&lt;br /&gt;
Adding an extension for all users:&lt;br /&gt;
&lt;br /&gt;
  [&amp;lt;OfficePath&amp;gt;/program] $ unopkg add --shared my_extension.oxt&lt;br /&gt;
&lt;br /&gt;
Removing a user extension is done via the identifier of the extension (see [[Documentation/DevGuide/Extensions/Extension Identifiers|Extension Identifiers]]):&lt;br /&gt;
&lt;br /&gt;
  [&amp;lt;OfficePath&amp;gt;/program] $ unopkg remove my.domain.my_extension-id&lt;br /&gt;
&lt;br /&gt;
Remove a shared extension:&lt;br /&gt;
&lt;br /&gt;
  [&amp;lt;OfficePath&amp;gt;/program] $ unopkg remove --shared my.domain.my_extension-id&lt;br /&gt;
&lt;br /&gt;
Before you install an extension or other item for all users, make absolutely sure there are no running instances of {{PRODUCTNAME}}. &amp;#039;&amp;#039;unopkg&amp;#039;&amp;#039; cannot recognize if there are running instances of {{PRODUCTNAME}} from different users. Installing into a running office installation might cause inconsistencies and destroy your installation!&lt;br /&gt;
&lt;br /&gt;
When a user starts {{PRODUCTNAME}} and then starts &amp;#039;&amp;#039;unopkg&amp;#039;&amp;#039;, then the Extension Manager from the office is used and &amp;#039;&amp;#039;unopkg&amp;#039;&amp;#039; terminates. Then, however, no shared extensions and other shared items can be modified.&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Caution|Although it is now possible to deploy “live” into a running {{PRODUCTNAME}} process, there are some limitations you should be aware of: Removing a type library from a running process is not possible, because this may lead to crashes when the type is needed. Thus if you, for example, uninstall a package that comes with a UNO type library, these types will vanish upon next process startup, but not before.&lt;br /&gt;
&lt;br /&gt;
There may also be problems with cached configuration data, because parts of the running process do not listen for configuration updates (for example, menu bars). Most often, those parts read the configuration just once upon startup.}}&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Extensions]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Extensions/Extension_Manager_in_OpenOffice.org&amp;diff=112589</id>
		<title>Documentation/DevGuide/Extensions/Extension Manager in OpenOffice.org</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Extensions/Extension_Manager_in_OpenOffice.org&amp;diff=112589"/>
		<updated>2009-02-21T15:04:23Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/ExtensionsTOC&lt;br /&gt;
|Extensions2a=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Extensions/Installing Extensions for All or a Single User&lt;br /&gt;
|NextPage=Documentation/DevGuide/Extensions/unopkg&lt;br /&gt;
}}&lt;br /&gt;
[[zh:Zh/Documentation/DevGuide/Extensions/Extension Manager in OpenOffice.org]]&lt;br /&gt;
{{DISPLAYTITLE:Extension Manager in OpenOffice.org}}&lt;br /&gt;
Within a running office the Extension Manager is started through the menu item &amp;#039;&amp;#039;&amp;#039;Tools &amp;gt; Extension Manager...&amp;#039;&amp;#039;&amp;#039;. When started in this way, extensions can only be installed as user extensions. All items deployed under &amp;#039;&amp;#039;&amp;#039;{{PRODUCTNAME}} Extensions&amp;#039;&amp;#039;&amp;#039; cannot be modified. But it is possible to export them.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Extensions]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Extensions/Installing_Extensions_for_All_or_a_Single_User&amp;diff=112585</id>
		<title>Documentation/DevGuide/Extensions/Installing Extensions for All or a Single User</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Extensions/Installing_Extensions_for_All_or_a_Single_User&amp;diff=112585"/>
		<updated>2009-02-21T14:43:24Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/ExtensionsTOC&lt;br /&gt;
|Extensions2a=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Extensions/Deployment Items&lt;br /&gt;
|NextPage=Documentation/DevGuide/Extensions/Extension Manager in OpenOffice.org&lt;br /&gt;
}}&lt;br /&gt;
[[zh:Zh/Documentation/DevGuide/Extensions/Installing Extensions for All or a Single User]]&lt;br /&gt;
{{DISPLAYTITLE:Installing Extensions for All or a Single User}}&lt;br /&gt;
When installing an extension, one has to decide if all possible users can use it (shared extension) or only oneself (user extension).  In the first case, users cannot modify (enable, disable, remove) the extension unless they have write access to the share directory in the office installation. &lt;br /&gt;
&lt;br /&gt;
A shared extension may change the appearance of the GUI (toolbars, menu bar, etc.) for all users. They can, however, configure their office so that particular menu or toolbar items are not shown. There is currently no way to centrally install an extension for particular user groups.&lt;br /&gt;
&lt;br /&gt;
Whether an extension is to be installed for all users, or only for the single user, is determined during installation. The person performing the install must select, in the Extension Manager dialog, either &amp;#039;&amp;#039;&amp;#039;My Extensions&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;{{PRODUCTNAME}} Extensions&amp;#039;&amp;#039;&amp;#039; before pressing the &amp;#039;&amp;#039;&amp;#039;Add...&amp;#039;&amp;#039;&amp;#039; button. In the first case, the extension will only be installed for the current user, whereas in the latter case it will be installed for all users. &lt;br /&gt;
&lt;br /&gt;
When running &amp;#039;&amp;#039;unopkg&amp;#039;&amp;#039; in a windowless mode, the option &amp;lt;tt&amp;gt;--shared&amp;lt;/tt&amp;gt; determines if an extension can be used by all users. For example:&lt;br /&gt;
&lt;br /&gt;
  [&amp;lt;OfficePath&amp;gt;/program] $ unopkg add --shared my_extension.oxt&lt;br /&gt;
&lt;br /&gt;
would install &amp;lt;tt&amp;gt;my_extension&amp;lt;/tt&amp;gt; so that it can be used by all users.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Extensions]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Extensions/Extension_Manager&amp;diff=112579</id>
		<title>Documentation/DevGuide/Extensions/Extension Manager</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Extensions/Extension_Manager&amp;diff=112579"/>
		<updated>2009-02-21T11:27:18Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/ExtensionsTOC&lt;br /&gt;
|Extensions2a=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Extensions/Extensions&lt;br /&gt;
|NextPage=Documentation/DevGuide/Extensions/Deployment Items&lt;br /&gt;
}}&lt;br /&gt;
[[zh:Zh/Documentation/DevGuide/Extensions/Extension Manager]]&lt;br /&gt;
{{DISPLAYTITLE:Extension Manager}}&lt;br /&gt;
The Extension Manager is a tool for managing extensions and other deployable items, such as separate libraries, JARs, configuration data files. This includes adding, removing, enabling and disabling of these items.&lt;br /&gt;
&lt;br /&gt;
The Extension Manager can be started from within the office by pressing the menu item &amp;#039;&amp;#039;&amp;#039;Tools &amp;gt; Extension Manager&amp;#039;&amp;#039;&amp;#039; or by running the &amp;#039;&amp;#039;unopkg&amp;#039;&amp;#039; executable, which is contained in the program directory of the office installation.&lt;br /&gt;
&lt;br /&gt;
When an extension is installed, then a copy is created which is kept either in the user installation or the shared installation (&amp;#039;&amp;#039;&amp;lt;office-directory&amp;gt;/share&amp;#039;&amp;#039;). The original extension can therefore be (re) moved after installation.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Extensions]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Basic/Adding_Event_Handlers&amp;diff=112173</id>
		<title>Documentation/DevGuide/Basic/Adding Event Handlers</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Basic/Adding_Event_Handlers&amp;diff=112173"/>
		<updated>2009-02-16T21:04:30Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/BasicTOC&lt;br /&gt;
|BasicTutorial=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Basic/Creating Dialogs&lt;br /&gt;
|NextPage=Documentation/DevGuide/Basic/AutoPilot Dialogs&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:Adding Event Handlers}}&lt;br /&gt;
Now we will write code to open the dialog and add functionality to the buttons. To show a dialog, create a dialog object using &amp;lt;tt&amp;gt;createUnoDialog()&amp;lt;/tt&amp;gt; and call its &amp;lt;tt&amp;gt;execute()&amp;lt;/tt&amp;gt; method. A dialog can be closed while it is shown by calling &amp;lt;tt&amp;gt;endExecute()&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Tip|It is possible to configure the &amp;#039;&amp;#039;&amp;#039;Finish&amp;#039;&amp;#039;&amp;#039; button and the &amp;#039;&amp;#039;&amp;#039;Cancel&amp;#039;&amp;#039;&amp;#039; button to close the dialog by setting the button property PushButtonType to OK and Cancel respectively. The method &amp;lt;tt&amp;gt;execute()&amp;lt;/tt&amp;gt; returns 0 for Cancel and 1 for OK.}}&lt;br /&gt;
&lt;br /&gt;
To add functionality to GUI elements, develop Subs to handle GUI events, then hook them to the GUI elements. To add functionality to the buttons of our dialog, click the &amp;#039;&amp;#039;&amp;#039;Module1&amp;#039;&amp;#039;&amp;#039; tab in the lower part of the Basic IDE and enter the following Subs above the previous Sub Main to open, close and process the dialog. Note that a &amp;lt;tt&amp;gt;Private&amp;lt;/tt&amp;gt; variable &amp;lt;tt&amp;gt;oDialog&amp;lt;/tt&amp;gt; is defined outside of the Subs. After loading the dialog, this variable is visible from all Subs and Functions of Module1. &lt;br /&gt;
&amp;lt;!--[SOURCE:BasicAndDialogs/FirstStepsBasic.odt]--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  Private oDialog as Variant &amp;#039; private, module-wide variable&lt;br /&gt;
  &lt;br /&gt;
  Sub RunGraphicsWizard&lt;br /&gt;
      oDialog = createUnoDialog(DialogLibraries.Standard.Dialog1)&lt;br /&gt;
      oDialog.execute&lt;br /&gt;
  End Sub&lt;br /&gt;
  &lt;br /&gt;
  Sub CancelGraphicsDialog&lt;br /&gt;
      oDialog.endExecute()&lt;br /&gt;
  End Sub&lt;br /&gt;
  &lt;br /&gt;
  Sub FinishGraphicsDialog&lt;br /&gt;
      Dim sFile as String, sGraphicURL as String&lt;br /&gt;
  &lt;br /&gt;
      oDialog.endExecute()&lt;br /&gt;
  &lt;br /&gt;
      sFile = oDialog.Model.FileControl1.Text &lt;br /&gt;
    &lt;br /&gt;
      &amp;#039; the FileControl contains a system path, we have to transform it to a file URL&lt;br /&gt;
      &amp;#039; We use the built-in Basic runtime function ConvertToURL for this purpose&lt;br /&gt;
      sGraphicURL = ConvertToURL(sFile)&lt;br /&gt;
    &lt;br /&gt;
      &amp;#039; insert the graphics&lt;br /&gt;
      &amp;#039; access the document model&lt;br /&gt;
      oDoc = ThisComponent&lt;br /&gt;
      &amp;#039; get the Text service of the document&lt;br /&gt;
      oText = oDoc.getText()&lt;br /&gt;
      &amp;#039; create an instance of a graphic object using the document service factory&lt;br /&gt;
      oGraphicObject = oDoc.createInstance(&amp;quot;com.sun.star.text.GraphicObject&amp;quot;)&lt;br /&gt;
      &amp;#039; set the URL of the graphic&lt;br /&gt;
      oGraphicObject.GraphicURL = sGraphicURL&lt;br /&gt;
      &amp;#039; get the current cursor position in the GUI and create a text cursor from it&lt;br /&gt;
      oViewCursor = oDoc.getCurrentController().getViewCursor()&lt;br /&gt;
      oCursor = oText.createTextCursorByRange(oViewCursor.getStart())&lt;br /&gt;
      &amp;#039; insert the graphical object at the cursor position&lt;br /&gt;
      oText.insertTextContent(oCursor.getStart(), oGraphicObject, false)&lt;br /&gt;
  End Sub&lt;br /&gt;
  &lt;br /&gt;
  Sub Main&lt;br /&gt;
      ...&lt;br /&gt;
  End Sub&lt;br /&gt;
&lt;br /&gt;
Select the &amp;#039;&amp;#039;&amp;#039;Cancel&amp;#039;&amp;#039;&amp;#039; button in our dialog in the dialog editor, and click the &amp;#039;&amp;#039;&amp;#039;Events&amp;#039;&amp;#039;&amp;#039; tab of the &amp;#039;&amp;#039;&amp;#039;Properties Dialog&amp;#039;&amp;#039;&amp;#039;, then click the ellipsis button on the right-hand side of the Event &amp;#039;&amp;#039;&amp;#039;When Initiating&amp;#039;&amp;#039;&amp;#039;. As shown in the next illustration the &amp;#039;&amp;#039;&amp;#039;Assign Action&amp;#039;&amp;#039;&amp;#039; dialog appears.&lt;br /&gt;
&lt;br /&gt;
[[Image:CancelButtonEvent.png|none|thumb|400px|Assign Action dialog]]&lt;br /&gt;
&lt;br /&gt;
In the &amp;#039;&amp;#039;&amp;#039;Assign Action&amp;#039;&amp;#039;&amp;#039; dialog press the &amp;#039;&amp;#039;&amp;#039;Macro ...&amp;#039;&amp;#039;&amp;#039; button to open the &amp;#039;&amp;#039;&amp;#039;Macro Selector&amp;#039;&amp;#039;&amp;#039; dialog shown in the illustration below. Navigate to &amp;lt;tt&amp;gt;FirstStepsBasic.Standard.Module1&amp;lt;/tt&amp;gt;, select the Sub CancelGraphicsDialog and press the &amp;#039;&amp;#039;&amp;#039;OK&amp;#039;&amp;#039;&amp;#039; button to link this sub to the wizard dialog&amp;#039;s &amp;#039;&amp;#039;&amp;#039;Cancel&amp;#039;&amp;#039;&amp;#039; button.&lt;br /&gt;
&lt;br /&gt;
[[Image:MacroSelector.png|none|thumb|400px|The Macro Selector dialog]]&lt;br /&gt;
&lt;br /&gt;
The next illustration shows how the new assignment is shown in the &amp;#039;&amp;#039;&amp;#039;Assign Action&amp;#039;&amp;#039;&amp;#039; dialog.&lt;br /&gt;
&lt;br /&gt;
[[Image:AssignedAction.png|none|thumb|400px|The Assign Action dialog]]&lt;br /&gt;
&lt;br /&gt;
Pressing the &amp;#039;&amp;#039;&amp;#039;OK&amp;#039;&amp;#039;&amp;#039; button in the Assign Action dialog finishes the assignment process.&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Note|In the &amp;#039;&amp;#039;&amp;#039;Assign Action&amp;#039;&amp;#039;&amp;#039; dialog there&amp;#039;s also a &amp;#039;&amp;#039;&amp;#039;Component ...&amp;#039;&amp;#039;&amp;#039; button. This button is only needed in the context of dialogs used by UNO components, see [[Documentation/DevGuide/WritingUNO/Accessing Dialogs|Accessing Dialogs]]. In the Basic context this button is not relevant.}}&lt;br /&gt;
&lt;br /&gt;
Using the same method, hook the Finish button to &amp;lt;tt&amp;gt;FinishGraphicsDialog&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:MacroRun.png]]&lt;br /&gt;
|If the &amp;#039;&amp;#039;&amp;#039;Run&amp;#039;&amp;#039;&amp;#039; icon is selected now, the dialog is displayed, and the &amp;#039;&amp;#039;&amp;#039;Finish&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Cancel&amp;#039;&amp;#039;&amp;#039; buttons are functional. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Basic and Dialogs]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Basic/Creating_Dialogs&amp;diff=112149</id>
		<title>Documentation/DevGuide/Basic/Creating Dialogs</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Basic/Creating_Dialogs&amp;diff=112149"/>
		<updated>2009-02-16T19:02:45Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/BasicTOC&lt;br /&gt;
|BasicTutorial=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Basic/Calling a Sub from the User Interface&lt;br /&gt;
|NextPage=Documentation/DevGuide/Basic/Adding Event Handlers&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:Creating Dialogs}}&lt;br /&gt;
To create a dialog in the Basic IDE, right-click the Module1 tab at the bottom of the Basic source editor and select &amp;#039;&amp;#039;&amp;#039;Insert &amp;gt; Basic Dialog&amp;#039;&amp;#039;&amp;#039;. The IDE creates a new page named Dialog1:&lt;br /&gt;
&lt;br /&gt;
[[Image:DialogIDE.png|none|thumb|400px|The Basic GUI Editor]]&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=4&lt;br /&gt;
|[[Image:Controls.png]]&lt;br /&gt;
|To add controls to the dialog, we require the dialog design tools. Click the &amp;#039;&amp;#039;&amp;#039;Controls&amp;#039;&amp;#039;&amp;#039; icon to pop up the design tools window. The title bar of the tools window can be used to drag the window away from the toolbar to keep it open permanently. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our dialog shall offer a more convenient way to select a file than the simple input box of our first example. Furthermore, the user shall be able to control how the picture is anchored in the text after inserting it. For this, we will create a wizard dialog with two steps.&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=4&lt;br /&gt;
|[[Image:FileSelection.png]]&lt;br /&gt;
|In the design tools window, select &amp;#039;&amp;#039;&amp;#039;File Selection&amp;#039;&amp;#039;&amp;#039; and define the size of the &amp;#039;&amp;#039;&amp;#039;Browse&amp;#039;&amp;#039;&amp;#039; control by dragging a rectangle in the dialog using the left-mouse button. &lt;br /&gt;
|-&lt;br /&gt;
|[[Image:ControlProperties.png]]&lt;br /&gt;
|The &amp;#039;&amp;#039;&amp;#039;Properties&amp;#039;&amp;#039;&amp;#039; icon displays the &amp;#039;&amp;#039;&amp;#039;Properties Dialog&amp;#039;&amp;#039;&amp;#039; that is used to edit controls and hook up event handling code to events occurring at dialog controls. &lt;br /&gt;
|-&lt;br /&gt;
|[[Image:ButtonControl.png]]&lt;br /&gt;
|Next, add &amp;#039;&amp;#039;&amp;#039;&amp;lt;&amp;lt; Back&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Next &amp;gt;&amp;gt;&amp;#039;&amp;#039;&amp;#039; Buttons to move between the dialog steps, and a &amp;#039;&amp;#039;&amp;#039;Finish&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Cancel&amp;#039;&amp;#039;&amp;#039; button. Select the &amp;#039;&amp;#039;&amp;#039;Button&amp;#039;&amp;#039;&amp;#039; icon and define the button size using the left-mouse button. Buttons are labeled with a default text, such as &amp;lt;tt&amp;gt;CommandButton1&amp;lt;/tt&amp;gt;. If the &amp;#039;&amp;#039;&amp;#039;Properties Dialog&amp;#039;&amp;#039;&amp;#039; is not open, double click the newly inserted button controls to display it. Enter new labels in the Label field as suggested, and name the dialog step buttons Back and Next. Set the property &amp;#039;&amp;#039;&amp;#039;Enabled&amp;#039;&amp;#039;&amp;#039; for the &amp;#039;&amp;#039;&amp;#039;&amp;lt;&amp;lt; Back&amp;#039;&amp;#039;&amp;#039; button to &amp;lt;tt&amp;gt;false&amp;lt;/tt&amp;gt;. &lt;br /&gt;
|-&lt;br /&gt;
|[[Image:LabelControl.png]]&lt;br /&gt;
|Use the Label tool to create a label &amp;quot;Select Graphics File:&amp;quot; in the same manner. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Now the dialog looks similar to the illustration below:&lt;br /&gt;
&lt;br /&gt;
[[Image:DialogStep1.png|none|thumb|500px|The custom dialog]]&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=4&lt;br /&gt;
|[[Image:ActivateTestMode.png]]&lt;br /&gt;
|Test the dialog using the &amp;#039;&amp;#039;&amp;#039;Activate Test Mode&amp;#039;&amp;#039;&amp;#039; icon from the design tool window. After you have finished the test, click the &amp;#039;&amp;#039;&amp;#039;Close&amp;#039;&amp;#039;&amp;#039; button of the test dialog window. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To edit the dialog, such as setting the title and changing the size, select it by clicking the outer border of the dialog. Green handles appear around the dialog. The green handles can be used to alter the dialog size. The &amp;#039;&amp;#039;&amp;#039;Properties Dialog&amp;#039;&amp;#039;&amp;#039; is used to define a dialog title and other dialog properties.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Basic and Dialogs]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Basic/Calling_a_Sub_from_the_User_Interface&amp;diff=111998</id>
		<title>Documentation/DevGuide/Basic/Calling a Sub from the User Interface</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Basic/Calling_a_Sub_from_the_User_Interface&amp;diff=111998"/>
		<updated>2009-02-15T23:38:58Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/BasicTOC&lt;br /&gt;
|BasicTutorial=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Basic/Writing and Debugging a Basic UNO program&lt;br /&gt;
|NextPage=Documentation/DevGuide/Basic/Creating Dialogs&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:Calling a Sub from the User Interface}}&lt;br /&gt;
A Sub can be called from customized icons, menu entries, upon keyboard shortcuts and on certain application or document events. The entry point for all these settings is the &amp;#039;&amp;#039;&amp;#039;Customize&amp;#039;&amp;#039;&amp;#039; dialog accessible through the &amp;#039;&amp;#039;&amp;#039;Assign&amp;#039;&amp;#039;&amp;#039; button in the Macro dialog or the &amp;#039;&amp;#039;&amp;#039;Tools &amp;gt; Customize&amp;#039;&amp;#039;&amp;#039; command.&lt;br /&gt;
&lt;br /&gt;
To assign the Sub Main to a toolbar icon, select &amp;#039;&amp;#039;&amp;#039;Tools &amp;gt; Customize&amp;#039;&amp;#039;&amp;#039; and click the &amp;#039;&amp;#039;&amp;#039;Toolbars&amp;#039;&amp;#039;&amp;#039; tab The &amp;#039;&amp;#039;&amp;#039;Toolbars&amp;#039;&amp;#039;&amp;#039; tab looks like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:CustomizeToolbars.png|none|thumb|400px|Customize Toolbars]]&lt;br /&gt;
&lt;br /&gt;
Click the &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; button in the &amp;#039;&amp;#039;&amp;#039;Toolbars&amp;#039;&amp;#039;&amp;#039; tab. In the Add Commands dialog that pops up, scroll down the &amp;#039;&amp;#039;&amp;#039;Category&amp;#039;&amp;#039;&amp;#039; list until you see the {{PRODUCTNAME}} Macros node. Expand it and the &amp;#039;&amp;#039;&amp;#039;FirstStepsBasic.odt&amp;#039;&amp;#039;&amp;#039; node. Navigate to the Module &amp;lt;tt&amp;gt;FirstStepsBasic.Standard.Module1&amp;lt;/tt&amp;gt; and select it. When &amp;lt;tt&amp;gt;Module1&amp;lt;/tt&amp;gt; is selected, the Commands list shows an entry &amp;quot;Main&amp;quot; for the Sub Main in &amp;lt;tt&amp;gt;Module1&amp;lt;/tt&amp;gt;. Clicking &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; will add it to a toolbar.&lt;br /&gt;
&lt;br /&gt;
You can now click the new toolbar item to launch the example macros.&lt;br /&gt;
&lt;br /&gt;
The section [[Documentation/DevGuide/Basic/Assigning Macros to GUI Events|Assigning Macros to GUI Events]] describes other options to make your Sub accessible from the user interface.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Basic and Dialogs]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Basic/Writing_and_Debugging_a_Basic_UNO_program&amp;diff=111997</id>
		<title>Documentation/DevGuide/Basic/Writing and Debugging a Basic UNO program</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Basic/Writing_and_Debugging_a_Basic_UNO_program&amp;diff=111997"/>
		<updated>2009-02-15T23:29:45Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/BasicTOC&lt;br /&gt;
|BasicTutorial=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Basic/Creating a Module in a Standard Library&lt;br /&gt;
|NextPage=Documentation/DevGuide/Basic/Calling a Sub from the User Interface&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:Writing and Debugging a Basic UNO program}}&lt;br /&gt;
Enter the following source code in the Basic editor window. The example asks the user for the location of a graphics file and inserts it at the current cursor position of our document. Later, the example will be extended by a small insert graphics autopilot. &lt;br /&gt;
&amp;lt;!--[SOURCE:BasicAndDialogs/FirstStepsBasic.odt]--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  Sub Main&lt;br /&gt;
      &amp;#039; ask the user for a graphics file&lt;br /&gt;
      sGraphicUrl = InputBox(&amp;quot;Please enter the URL of a graphic file&amp;quot;, _&lt;br /&gt;
          &amp;quot;Import Graphics&amp;quot;, _&lt;br /&gt;
          &amp;quot;file:///&amp;quot;)&lt;br /&gt;
      if sGraphicURL = &amp;quot;&amp;quot; then &amp;#039; User clicked Cancel&lt;br /&gt;
          exit sub&lt;br /&gt;
      endif&lt;br /&gt;
      &lt;br /&gt;
      &amp;#039; access the document model&lt;br /&gt;
      oDoc = ThisComponent&lt;br /&gt;
      &lt;br /&gt;
      &amp;#039; get the Text service of the document&lt;br /&gt;
      oText = oDoc.getText()&lt;br /&gt;
      &lt;br /&gt;
      &amp;#039; create an instance of a graphic object using the document service factory&lt;br /&gt;
      oGraphicObject = oDoc.createInstance(&amp;quot;com.sun.star.text.GraphicObject&amp;quot;)&lt;br /&gt;
      &lt;br /&gt;
      &amp;#039; set the URL of the graphic&lt;br /&gt;
      oGraphicObject.GraphicURL = sGraphicURL&lt;br /&gt;
      &lt;br /&gt;
      &amp;#039; get the current cursor position in the GUI and create a text cursor from it&lt;br /&gt;
      oViewCursor = oDoc.getCurrentController().getViewCursor()&lt;br /&gt;
      oCursor = oText.createTextCursorByRange(oViewCursor.getStart())&lt;br /&gt;
      &lt;br /&gt;
      &amp;#039; insert the graphical object at the cursor position&lt;br /&gt;
      oText.insertTextContent(oCursor.getStart(), oGraphicObject, false)&lt;br /&gt;
  End Sub&lt;br /&gt;
&lt;br /&gt;
If help is required on Basic keywords, press F1 while the text cursor is on a keyword. The {{PRODUCTNAME}} online help contains descriptions of the Basic language as supported by {{PRODUCTNAME}}.&lt;br /&gt;
&lt;br /&gt;
Starting with the line &amp;lt;tt&amp;gt;oDoc = ThisComponent&amp;lt;/tt&amp;gt;, where the document model is accessed, we use the UNO integration of {{PRODUCTNAME}} Basic. &amp;lt;tt&amp;gt;ThisComponent&amp;lt;/tt&amp;gt; is a shortcut to access a document model from the Basic code contained in it. Earlier, you created &amp;lt;tt&amp;gt;Module1&amp;lt;/tt&amp;gt; in &amp;#039;&amp;#039;FirstStepsBasic.odt&amp;#039;&amp;#039;, that is, your Basic code is embedded in the document &amp;#039;&amp;#039;FirstStepsBasic.odt&amp;#039;&amp;#039;, not in a global library below the &amp;#039;&amp;#039;&amp;#039;My Macros&amp;#039;&amp;#039;&amp;#039; container. The property &amp;lt;tt&amp;gt;ThisComponent&amp;lt;/tt&amp;gt; therefore contains the document model of &amp;#039;&amp;#039;FirstStepsBasic.odt&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Tip|Outside document libraries use &amp;lt;tt&amp;gt;ThisComponent&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;StarDesktop.CurrentComponent&amp;lt;/tt&amp;gt; to retrieve the current document. If access to an open document is required, even if it is not the current document, you have to iterate over the components in &amp;lt;tt&amp;gt;StarDesktop.Components&amp;lt;/tt&amp;gt;, checking their URL property with code similar to the following:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;oComps = StarDesktop.Components&lt;br /&gt;
  oCompsEnum = oComps.createEnumeration()&lt;br /&gt;
  &lt;br /&gt;
  while oCompsEnum.hasMoreElements()&lt;br /&gt;
      oComp = oCompsEnum.nextElement()&lt;br /&gt;
      &amp;#039; not all desktop components are necessarily models with a URL&lt;br /&gt;
      if HasUnoInterfaces(oComp, &amp;quot;com.sun.star.frame.XModel&amp;quot;) then&lt;br /&gt;
        print oComp.getURL()&lt;br /&gt;
      endif&lt;br /&gt;
  wend&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=4&lt;br /&gt;
|[[Image:Breakpoint.png]]&lt;br /&gt;
|To debug the program, put the cursor into the line &amp;lt;tt&amp;gt;oDoc = ThisComponent&amp;lt;/tt&amp;gt; and click the &amp;#039;&amp;#039;&amp;#039;Breakpoint&amp;#039;&amp;#039;&amp;#039; icon in the macro bar. &lt;br /&gt;
|-&lt;br /&gt;
|[[Image:MacroRun.png]]&lt;br /&gt;
|The &amp;#039;&amp;#039;&amp;#039;Run&amp;#039;&amp;#039;&amp;#039; icon launches the first Sub in the current module. Execution stops with the first breakpoint. &lt;br /&gt;
|-&lt;br /&gt;
|[[Image:SingleStep.png]]&lt;br /&gt;
|Now step through the program by clicking the &amp;#039;&amp;#039;&amp;#039;Single Step&amp;#039;&amp;#039;&amp;#039; icon. &lt;br /&gt;
|-&lt;br /&gt;
|[[Image:Macros.png]]&lt;br /&gt;
|Click the &amp;#039;&amp;#039;&amp;#039;Macros&amp;#039;&amp;#039;&amp;#039; icon if you need to run a Sub other than the first Sub in the module.. In the &amp;#039;&amp;#039;&amp;#039;{{PRODUCTNAME}} Basic Macros&amp;#039;&amp;#039;&amp;#039; dialog, navigate to the appropriate module, select the Sub to run and press the &amp;#039;&amp;#039;&amp;#039;Run&amp;#039;&amp;#039;&amp;#039; button. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To observe the values of Basic variables during debugging, enter a variable name in the &amp;#039;&amp;#039;&amp;#039;Watch&amp;#039;&amp;#039;&amp;#039; field of the Basic editor and press the &amp;#039;&amp;#039;&amp;#039;Enter&amp;#039;&amp;#039;&amp;#039; key to add the watch, or point at a variable name with the mouse cursor without clicking it. In the example below, we can observe the variables &amp;lt;tt&amp;gt;sGraphicUrl&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;oGraphicObject&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[Image:Watch.png|none|thumb|500px|A macro in the source editor window]]&lt;br /&gt;
&lt;br /&gt;
Since {{PRODUCTNAME}} {{OO2.0.0}} it is also possible to inspect the values of UNO objects in the Basic debugger during runtime.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Basic and Dialogs]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Talk:Documentation/DevGuide/Basic/Creating_a_Module_in_a_Standard_Library&amp;diff=111996</id>
		<title>Talk:Documentation/DevGuide/Basic/Creating a Module in a Standard Library</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Talk:Documentation/DevGuide/Basic/Creating_a_Module_in_a_Standard_Library&amp;diff=111996"/>
		<updated>2009-02-15T23:02:32Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The page states: &amp;#039;&amp;#039;&amp;#039;Additionally each loaded document can contain Basic libraries.&amp;#039;&amp;#039;&amp;#039; This does not apply to base documents. (Ooo 3.0.1)&lt;br /&gt;
[[User:OOoLerner|OOoLerner]] 23:02, 15 February 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Basic/Creating_a_Module_in_a_Standard_Library&amp;diff=111995</id>
		<title>Documentation/DevGuide/Basic/Creating a Module in a Standard Library</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Basic/Creating_a_Module_in_a_Standard_Library&amp;diff=111995"/>
		<updated>2009-02-15T23:00:24Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/BasicTOC&lt;br /&gt;
|BasicTutorial=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Basic/First Steps with OpenOffice.org Basic&lt;br /&gt;
|NextPage=Documentation/DevGuide/Basic/Writing and Debugging a Basic UNO program&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:Creating a Module in a Standard Library}}&lt;br /&gt;
# Create a new Writer document and save the document, for example, &amp;#039;&amp;#039;FirstStepsBasic.odt&amp;#039;&amp;#039;. &lt;br /&gt;
# Click &amp;#039;&amp;#039;&amp;#039;Tools &amp;gt; Macros &amp;gt; Organize Macros &amp;gt; {{PRODUCTNAME}} Basic&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;{{PRODUCTNAME}} Basic Macros&amp;#039;&amp;#039;&amp;#039; dialog appears. The &amp;#039;&amp;#039;&amp;#039;Macro from&amp;#039;&amp;#039;&amp;#039; list shows macro containers where Basic source code (macros) can come from. There is always a &amp;#039;&amp;#039;&amp;#039;My Macros&amp;#039;&amp;#039;&amp;#039; and a &amp;#039;&amp;#039;&amp;#039;{{PRODUCTNAME}} Macros&amp;#039;&amp;#039;&amp;#039; container for Basic libraries. Additionally each loaded document can contain Basic libraries.&lt;br /&gt;
&lt;br /&gt;
[[Image:MacroNew.png|none|thumb|400px|Macro dialog]]&lt;br /&gt;
&lt;br /&gt;
The illustration above shows that the document &amp;#039;&amp;#039;FirstStepsBasic.odt&amp;#039;&amp;#039; is the only document loaded. Therefore, the &amp;#039;&amp;#039;&amp;#039;My Macros&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;{{PRODUCTNAME}} Macros&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;FirstStepsBasic.odt&amp;#039;&amp;#039;&amp;#039; containers are displayed in the illustration above. Both containers, &amp;#039;&amp;#039;&amp;#039;My Macros&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;FirstStepsBasic.odt&amp;#039;&amp;#039;&amp;#039;, contain a library named &amp;#039;&amp;#039;&amp;#039;Standard&amp;#039;&amp;#039;&amp;#039;. The {{PRODUCTNAME}} Macros container contains the libraries that come with a default {{PRODUCTNAME}} installation – most of them are AutoPilots. The &amp;#039;&amp;#039;&amp;#039;Standard&amp;#039;&amp;#039;&amp;#039; libraries of the application and for all open documents are always loaded. They appear enabled in the dialog. Other libraries have to be loaded before they can be used.&lt;br /&gt;
&lt;br /&gt;
The libraries contain modules with the actual Basic source code. Our next step will create a new module for source code in the &amp;#039;&amp;#039;&amp;#039;Standard&amp;#039;&amp;#039;&amp;#039; library of our &amp;#039;&amp;#039;FirstStepsBasic.odt&amp;#039;&amp;#039; document.&lt;br /&gt;
&lt;br /&gt;
# Scroll to the document node &amp;#039;&amp;#039;&amp;#039;FirstStepsBasic.odt&amp;#039;&amp;#039;&amp;#039; in the &amp;#039;&amp;#039;&amp;#039;Macro from&amp;#039;&amp;#039;&amp;#039; list. &lt;br /&gt;
# Select the &amp;#039;&amp;#039;&amp;#039;Standard&amp;#039;&amp;#039;&amp;#039; entry below the document node and click &amp;#039;&amp;#039;&amp;#039;New&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
{{PRODUCTNAME}} shows a small dialog that suggests to create a new module named &amp;lt;tt&amp;gt;Module1&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# Click &amp;#039;&amp;#039;&amp;#039;OK&amp;#039;&amp;#039;&amp;#039; to confirm. &lt;br /&gt;
&lt;br /&gt;
The Basic source editor window appears containing a Sub (subroutine) Main.&lt;br /&gt;
&lt;br /&gt;
[[Image:MainNew.png|none|thumb|500px|Basic source editor window]]&lt;br /&gt;
&lt;br /&gt;
The status bar of the Basic editor window shows that the Sub Main is part of &amp;lt;tt&amp;gt;FirstStepsBasic.Standard.Module1&amp;lt;/tt&amp;gt;. If you click &amp;#039;&amp;#039;&amp;#039;Tools &amp;gt; Macros &amp;gt; {{PRODUCTNAME}} Basic&amp;#039;&amp;#039;&amp;#039; in the Basic editor, you will see that {{PRODUCTNAME}} created a module &amp;lt;tt&amp;gt;Module1&amp;lt;/tt&amp;gt; below the Standard library in &amp;#039;&amp;#039;FirstStepsBasic.odt&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
[[Image:ModuleNew.png|none|thumb|400px|The New Module window]]&lt;br /&gt;
&lt;br /&gt;
When a module is selected, the &amp;#039;&amp;#039;&amp;#039;Macro name&amp;#039;&amp;#039;&amp;#039; list box on the left shows the Subs and Functions in that module. In this case, Sub Main. If you click &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039; while a Sub or Function is selected, the Basic editor opens and scrolls to the selected Sub or Function.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Basic and Dialogs]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Talk:Documentation/DevGuide/Basic/Creating_a_Module_in_a_Standard_Library&amp;diff=111994</id>
		<title>Talk:Documentation/DevGuide/Basic/Creating a Module in a Standard Library</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Talk:Documentation/DevGuide/Basic/Creating_a_Module_in_a_Standard_Library&amp;diff=111994"/>
		<updated>2009-02-15T22:48:38Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: New page: The page states: &amp;#039;&amp;#039;&amp;#039;Additionally each loaded document can contain Basic libraries.&amp;#039;&amp;#039;&amp;#039; This does not apply to base documents. (Ooo 3.0.1)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The page states: &amp;#039;&amp;#039;&amp;#039;Additionally each loaded document can contain Basic libraries.&amp;#039;&amp;#039;&amp;#039; This does not apply to base documents. (Ooo 3.0.1)&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Basic/Creating_a_Module_in_a_Standard_Library&amp;diff=111993</id>
		<title>Documentation/DevGuide/Basic/Creating a Module in a Standard Library</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Basic/Creating_a_Module_in_a_Standard_Library&amp;diff=111993"/>
		<updated>2009-02-15T22:32:23Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/BasicTOC&lt;br /&gt;
|BasicTutorial=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Basic/First Steps with OpenOffice.org Basic&lt;br /&gt;
|NextPage=Documentation/DevGuide/Basic/Writing and Debugging a Basic UNO program&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:Creating a Module in a Standard Library}}&lt;br /&gt;
# Create a new Writer document and save the document, for example, &amp;#039;&amp;#039;FirstStepsBasic.odt&amp;#039;&amp;#039;. &lt;br /&gt;
# Click &amp;#039;&amp;#039;&amp;#039;Tools &amp;gt; Macros &amp;gt; Organize Macros &amp;gt; {{PRODUCTNAME}} Basic&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;{{PRODUCTNAME}} Basic Macros&amp;#039;&amp;#039;&amp;#039; dialog appears. The &amp;#039;&amp;#039;&amp;#039;Macro from&amp;#039;&amp;#039;&amp;#039; list shows macro containers where Basic source code (macros) can come from. There is always a &amp;#039;&amp;#039;&amp;#039;My Macros&amp;#039;&amp;#039;&amp;#039; and a &amp;#039;&amp;#039;&amp;#039;{{PRODUCTNAME}} Macros&amp;#039;&amp;#039;&amp;#039; container for Basic libraries. Additionally each loaded document can contain Basic libraries.&lt;br /&gt;
&lt;br /&gt;
[[Image:MacroNew.png|none|thumb|400px|Macro dialog]]&lt;br /&gt;
&lt;br /&gt;
The illustration above shows that the document &amp;#039;&amp;#039;FirstStepsBasic.odt&amp;#039;&amp;#039; is the only document loaded. Therefore, the &amp;#039;&amp;#039;&amp;#039;My Macros&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;{{PRODUCTNAME}} Macros&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;FirstStepsBasic.odt&amp;#039;&amp;#039;&amp;#039; containers are displayed in the illustration above. Both containers, &amp;#039;&amp;#039;&amp;#039;My Macros&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;FirstStepsBasic.odt&amp;#039;&amp;#039;&amp;#039;, contain a library named &amp;#039;&amp;#039;&amp;#039;Standard&amp;#039;&amp;#039;&amp;#039;. The {{PRODUCTNAME}} Macros container contains the libraries that come with a default {{PRODUCTNAME}} installation – most of them are AutoPilots. The &amp;#039;&amp;#039;&amp;#039;Standard&amp;#039;&amp;#039;&amp;#039; libraries of the application and for all open documents are always loaded. They appear enabled in the dialog. Other libraries have to be loaded before they can be used.&lt;br /&gt;
&lt;br /&gt;
The libraries contain modules with the actual Basic source code. Our next step will create a new module for source code in the &amp;#039;&amp;#039;&amp;#039;Standard&amp;#039;&amp;#039;&amp;#039; library of our &amp;#039;&amp;#039;FirstStepsBasic.odt&amp;#039;&amp;#039; document.&lt;br /&gt;
&lt;br /&gt;
# Scroll to the document node &amp;#039;&amp;#039;&amp;#039;FirstStepsBasic.odt&amp;#039;&amp;#039;&amp;#039; in the &amp;#039;&amp;#039;&amp;#039;Macro from&amp;#039;&amp;#039;&amp;#039; list. &lt;br /&gt;
# Select the &amp;#039;&amp;#039;&amp;#039;Standard&amp;#039;&amp;#039;&amp;#039; entry below the document node and click &amp;#039;&amp;#039;&amp;#039;New&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
{{PRODUCTNAME}} shows a small dialog that suggests to create a new module named &amp;lt;tt&amp;gt;Module1&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# Click OK to confirm. &lt;br /&gt;
&lt;br /&gt;
The Basic source editor window appears containing a Sub (subroutine) Main.&lt;br /&gt;
&lt;br /&gt;
[[Image:MainNew.png|none|thumb|500px|Basic source editor window]]&lt;br /&gt;
&lt;br /&gt;
The status bar of the Basic editor window shows that the Sub Main is part of &amp;lt;tt&amp;gt;FirstStepsBasic.Standard.Module1&amp;lt;/tt&amp;gt;. If you click &amp;#039;&amp;#039;&amp;#039;Tools &amp;gt; Macros &amp;gt; {{PRODUCTNAME}} Basic&amp;#039;&amp;#039;&amp;#039; in the Basic editor, you will see that {{PRODUCTNAME}} created a module &amp;lt;tt&amp;gt;Module1&amp;lt;/tt&amp;gt; below the Standard library in &amp;#039;&amp;#039;FirstStepsBasic.odt&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
[[Image:ModuleNew.png|none|thumb|400px|The New Module window]]&lt;br /&gt;
&lt;br /&gt;
When a module is selected, the &amp;#039;&amp;#039;&amp;#039;Macro name&amp;#039;&amp;#039;&amp;#039; list box on the left shows the Subs and Functions in that module. In this case, Sub Main. If you click &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039; while a Sub or Function is selected, the Basic editor opens and scrolls to the selected Sub or Function.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Basic and Dialogs]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Using_Dialogs_in_Components&amp;diff=111961</id>
		<title>Documentation/DevGuide/WritingUNO/Using Dialogs in Components</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Using_Dialogs_in_Components&amp;diff=111961"/>
		<updated>2009-02-15T14:59:46Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: /* Instantiate and display a dialog */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/WritingUNOTOC&lt;br /&gt;
|WritingUNO2Accessing=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/WritingUNO/Assigning Component Methods to Control Events&lt;br /&gt;
|NextPage=Documentation/DevGuide/Extensions/Extensions&lt;br /&gt;
}}&lt;br /&gt;
[[zh:Zh/Documentation/DevGuide/WritingUNO/Using Dialogs in Components]]&lt;br /&gt;
{{DISPLAYTITLE:Using Dialogs in Components}}&lt;br /&gt;
In general components using dialogs are like any other component. But they need some additional code to instantiate and display the dialog(s) to be used and to accept the events created by the dialog controls.&lt;br /&gt;
&lt;br /&gt;
=== Instantiate and display a dialog ===&lt;br /&gt;
&lt;br /&gt;
To do this an extended version of the &amp;lt;idl&amp;gt;com.sun.star.awt.DialogProvider&amp;lt;/idl&amp;gt; service - described in chapter [[Documentation/DevGuide/Scripting/Scripting Framework|Scripting Framework]] - has to be used. The extended service version &amp;lt;idl&amp;gt;com.sun.star.awt.DialogProvider2&amp;lt;/idl&amp;gt; supports &amp;lt;idl&amp;gt;com.sun.star.awt.XDialogProvider2&amp;lt;/idl&amp;gt; providing an additional method &amp;lt;idl&amp;gt;com.sun.star.awt.XDialog&amp;lt;/idl&amp;gt; &amp;lt;tt&amp;gt;createDialogWithHandler(...)&amp;lt;/tt&amp;gt; that allows to pass an interface when creating the dialog. This interface will be used as event handler and called if events are bound to the component.&lt;br /&gt;
&lt;br /&gt;
The following code is taken from the DialogComponent SDK example that can be found in &amp;#039;&amp;#039;SDK/examples/DevelopersGuide/Components&amp;#039;&amp;#039; and shows how a dialog is created and displayed using the &amp;lt;tt&amp;gt;DialogProvider2&amp;lt;/tt&amp;gt; service: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  // XTestDialogHandler&lt;br /&gt;
  public String createDialog( String DialogURL, XModel xModel, XFrame xFrame ) {&lt;br /&gt;
      m_xFrame = xFrame;  &lt;br /&gt;
  &lt;br /&gt;
      try { &lt;br /&gt;
          XMultiComponentFactory xMCF = m_xCmpCtx.getServiceManager();&lt;br /&gt;
          Object obj;&lt;br /&gt;
  &lt;br /&gt;
          // If valid we must pass the XModel when creating a DialogProvider object&lt;br /&gt;
          if( xModel != null ) {&lt;br /&gt;
              Object[] args = new Object[1];&lt;br /&gt;
              args[0] = xModel;&lt;br /&gt;
  &lt;br /&gt;
              obj = xMCF.createInstanceWithArgumentsAndContext(&lt;br /&gt;
                  &amp;quot;com.sun.star.awt.DialogProvider2&amp;quot;, args, m_xCmpCtx );&lt;br /&gt;
          }&lt;br /&gt;
          else {&lt;br /&gt;
              obj = xMCF.createInstanceWithContext(&lt;br /&gt;
                  &amp;quot;com.sun.star.awt.DialogProvider2&amp;quot;, m_xCmpCtx );&lt;br /&gt;
          }&lt;br /&gt;
  &lt;br /&gt;
          XDialogProvider2 xDialogProvider = (XDialogProvider2)&lt;br /&gt;
              UnoRuntime.queryInterface( XDialogProvider2.class, obj );&lt;br /&gt;
      &lt;br /&gt;
          XDialog xDialog = xDialogProvider.createDialogWithHandler( DialogURL, this );&lt;br /&gt;
          if( xDialog != null )&lt;br /&gt;
              xDialog.execute();&lt;br /&gt;
      }&lt;br /&gt;
      catch (Exception e) { &lt;br /&gt;
          e.printStackTrace(); &lt;br /&gt;
      }&lt;br /&gt;
      return &amp;quot;Created dialog \&amp;quot;&amp;quot; + DialogURL + &amp;quot;\&amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The variable &amp;lt;code&amp;gt;m_xCmpCtx&amp;lt;/code&amp;gt; is the &amp;lt;idl&amp;gt;com.sun.star.uno.XComponentContext&amp;lt;/idl&amp;gt; interface passed to the component while initialisation. If the dialog that should be created is placed inside a document a &amp;lt;idl&amp;gt;com.sun.star.frame.XModel&amp;lt;/idl&amp;gt; interface &amp;lt;code&amp;gt;xModel&amp;lt;/code&amp;gt; representing this document has to be passed. It&amp;#039;s used as argument to initialise the DialogProvider service enabling the access to the document&amp;#039;s Dialog Libraries. If &amp;lt;code&amp;gt;xModel&amp;lt;/code&amp;gt; is null the dialog has to be placed in the application library container. This also has to be reflected in the DialogURL passed to the method.&lt;br /&gt;
&lt;br /&gt;
Example code for a Basic/Dialog library &amp;lt;code&amp;gt;Library1&amp;lt;/code&amp;gt; placed in a document:&lt;br /&gt;
&lt;br /&gt;
  Sub TestDialogComponent()&lt;br /&gt;
      oComp = CreateUnoService( &amp;quot;com.sun.star.test.TestDialogHandler&amp;quot; )&lt;br /&gt;
      oComp.createDialog( &amp;quot;vnd.sun.star.script:Library1.Dialog1?location=document&amp;quot;, _&lt;br /&gt;
          ThisComponent, StarDesktop.getActiveFrame() )&lt;br /&gt;
  End Sub&lt;br /&gt;
&lt;br /&gt;
Example code for a Basic/Dialog library &amp;lt;code&amp;gt;Library1&amp;lt;/code&amp;gt; placed in &amp;quot;My Macros&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  Sub TestDialogComponent()&lt;br /&gt;
      oComp = CreateUnoService( &amp;quot;com.sun.star.test.TestDialogHandler&amp;quot; )&lt;br /&gt;
      oComp.createDialog( &amp;quot;vnd.sun.star.script:Library1.Dialog1?location=application&amp;quot;, _&lt;br /&gt;
          null, StarDesktop.getActiveFrame() )&lt;br /&gt;
  End Sub&lt;br /&gt;
&lt;br /&gt;
The dialog contained in the &amp;#039;&amp;#039;DialogComponent.odt&amp;#039;&amp;#039; sample document in &amp;#039;&amp;#039;SDK/examples/DevelopersGuide/Components/DialogComponent&amp;#039;&amp;#039; looks like this. &lt;br /&gt;
&lt;br /&gt;
[[Image:TestDialog.png|none|thumb|398px|Sample dialog with controls]]&lt;br /&gt;
&lt;br /&gt;
The button labels show which component method is called in each case. The next chapter explains how these methods can be implemented inside the component. Method &amp;quot;doit3&amp;quot; isn&amp;#039;t implemented at all. It&amp;#039;s called in the sample dialog to show the resulting error message:&lt;br /&gt;
&lt;br /&gt;
[[Image:ErrorMessage.png|none|thumb|264px|Error message for Component method not found]]&lt;br /&gt;
&lt;br /&gt;
=== Accept events created by dialog controls ===&lt;br /&gt;
&lt;br /&gt;
The event handling functionality can be implemented in two different ways. The test component described here uses both ways.&lt;br /&gt;
&lt;br /&gt;
The first way is to implement the generic handler interface &amp;lt;idl&amp;gt;com.sun.star.awt.XDialogEventHandler&amp;lt;/idl&amp;gt; containing two methods:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  interface XDialogEventHandler: com::sun::star::uno::XInterface&lt;br /&gt;
  {&lt;br /&gt;
      bool callHandlerMethod&lt;br /&gt;
      (&lt;br /&gt;
          [in] com::sun::star::awt::XDialog xDialog, &lt;br /&gt;
          [in] any Event,  &lt;br /&gt;
          [in] string MethodName &lt;br /&gt;
      )&lt;br /&gt;
  &lt;br /&gt;
      sequence&amp;lt;string&amp;gt; getSupportedMethodNames();&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If an event occurs that is bound to a component method and the component implements this interface, the method &amp;lt;code&amp;gt;callHandlerMethod&amp;lt;/code&amp;gt; will be called first, with the method name used in the event binding passed as &amp;lt;code&amp;gt;MethodName&amp;lt;/code&amp;gt; parameter. In this example this would be: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  xHandler.callHandlerMethod( xDialog, aEvent, &amp;quot;handleEvent&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;xDialog&amp;lt;/code&amp;gt; points to the same dialog instance that has been returned by the &amp;lt;code&amp;gt;createDialogWithHandler()&amp;lt;/code&amp;gt; method. Event represents the event object originally passed to the awt listener method. E.g. in case of the &amp;quot;When initiating&amp;quot; event used in this example the corresponding awt listener interface is &amp;lt;idl&amp;gt;com.sun.star.awt.XActionListener&amp;lt;/idl&amp;gt; and an &amp;lt;idl&amp;gt;com.sun.star.awt.ActionEvent&amp;lt;/idl&amp;gt; is passed to its &amp;lt;code&amp;gt;actionPerformed&amp;lt;/code&amp;gt; method when the event occurs. This &amp;lt;code&amp;gt;ActionEvent&amp;lt;/code&amp;gt; object will also be passed to &amp;lt;code&amp;gt;callHandlerMethod&amp;lt;/code&amp;gt;. The Event object has to be passed as any, because other events use different listener interfaces with other event object types. &amp;lt;code&amp;gt;callHandlerMethod&amp;lt;/code&amp;gt; returns a bool value. Returning true means that the event has been handled. &lt;br /&gt;
&lt;br /&gt;
The method &amp;lt;code&amp;gt;getSupportedMethodNames()&amp;lt;/code&amp;gt; should return the names of all methods handled by &amp;lt;code&amp;gt;callHandlerMethod()&amp;lt;/code&amp;gt;. It&amp;#039;s intended for later use, especially to expand the user interface to allow browsing a component&amp;#039;s methods. &lt;br /&gt;
&lt;br /&gt;
If the event has not been handled, because &amp;lt;code&amp;gt;callHandlerMethod&amp;lt;/code&amp;gt; returns false or &amp;lt;idl&amp;gt;com.sun.star.awt.XDialogEventHandler&amp;lt;/idl&amp;gt; isn&amp;#039;t supported at all by the component, the DialogProvider uses the &amp;lt;idl&amp;gt;com.sun.star.beans.Introspection&amp;lt;/idl&amp;gt; service to detect if one of the following methods is provided by one of the interfaces supported by the component:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  void [MethodName] &lt;br /&gt;
  ( &lt;br /&gt;
      [in] com::sun::star::awt::XDialog xDialog, &lt;br /&gt;
      [in] any aEvent &lt;br /&gt;
  );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  void [MethodName]( void );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The second method is only used if the first one is not available. In this example the component would have to support an interface containing a method &amp;lt;code&amp;gt;handleEvent&amp;lt;/code&amp;gt; with one of these signatures. It also has to support &amp;lt;idl&amp;gt;com.sun.star.lang.XTypeProvider&amp;lt;/idl&amp;gt; because otherwise the introspection mechanism does not work. &lt;br /&gt;
&lt;br /&gt;
As already mentioned the sample component supports both ways to implement handler methods. &amp;lt;idl&amp;gt;com.sun.star.awt.XDialogEventHandler&amp;lt;/idl&amp;gt; is implemented like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  private String aHandlerMethod1 = &amp;quot;doit1&amp;quot;;&lt;br /&gt;
  private String aHandlerMethod2 = &amp;quot;doit2&amp;quot;;&lt;br /&gt;
  &lt;br /&gt;
  //XDialogEventHandler&lt;br /&gt;
  public boolean callHandlerMethod( /*IN*/XDialog xDialog, /*IN*/Object EventObject, &lt;br /&gt;
                                    /*IN*/String MethodName ) {&lt;br /&gt;
      if ( MethodName.equals( aHandlerMethod1 ) ) {&lt;br /&gt;
          showMessageBox( &amp;quot;DialogComponent&amp;quot;, &amp;quot;callHandlerMethod() handled \&amp;quot;&amp;quot; + aHandlerMethod1 + &amp;quot;\&amp;quot;&amp;quot; );&lt;br /&gt;
          return true;&lt;br /&gt;
      }&lt;br /&gt;
      else if ( MethodName.equals( aHandlerMethod2 ) ) {&lt;br /&gt;
          showMessageBox( &amp;quot;DialogComponent&amp;quot;, &amp;quot;callHandlerMethod() handled \&amp;quot;&amp;quot; + aHandlerMethod2 + &amp;quot;\&amp;quot;&amp;quot; );&lt;br /&gt;
          return true;&lt;br /&gt;
      }&lt;br /&gt;
      return false;&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  public String[] getSupportedMethodNames() {&lt;br /&gt;
      String[] retValue= new String[1];&lt;br /&gt;
      retValue[0]= aHandlerMethod1;&lt;br /&gt;
      retValue[1]= aHandlerMethod2;&lt;br /&gt;
      return retValue;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The implementation is very simple to show only the logic. For the two handled method names the method displays a MessageBox and return true. Otherwise false is returned.&lt;br /&gt;
&lt;br /&gt;
The other methods bound to the sample dialog control events are implemented using the other way. The interface &amp;lt;idl&amp;gt;com.sun.star.test.XTestDialogHandler&amp;lt;/idl&amp;gt; looks like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  module com { module sun { module star { module test { &lt;br /&gt;
      interface XTestDialogHandler {  &lt;br /&gt;
          string createDialog( [in] string DialogURL, [in] ::com::sun::star::frame::XModel xModel, &lt;br /&gt;
                                                      [in] ::com::sun::star::frame::XFrame xFrame ); &lt;br /&gt;
      void copyText( [in] ::com::sun::star::awt::XDialog xDialog, [in] any aEventObject ); &lt;br /&gt;
      void handleEvent();  &lt;br /&gt;
      void handleEventWithArguments( [in] ::com::sun::star::awt::XDialog xDialog, &lt;br /&gt;
                                     [in] any aEventObject );  &lt;br /&gt;
      };&lt;br /&gt;
  }; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Besides the already described &amp;lt;code&amp;gt;createDialog&amp;lt;/code&amp;gt; method three methods are defined to handle events. &amp;lt;code&amp;gt;handleEvent&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;handleEventWithArguments&amp;lt;/code&amp;gt; are implemented very simple and only display a message box:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  public void handleEvent() { &lt;br /&gt;
      showMessageBox( &amp;quot;DialogComponent&amp;quot;, &amp;quot;handleEvent() called&amp;quot; );&lt;br /&gt;
  } &lt;br /&gt;
  &lt;br /&gt;
  public void handleEventWithArguments( XDialog xDialog, Object aEventObject ) { &lt;br /&gt;
      showMessageBox( &amp;quot;DialogComponent&amp;quot;, &amp;quot;handleEventWithArguments() called\n\n&amp;quot; +&lt;br /&gt;
          &amp;quot;Event Object = &amp;quot; + aEventObject );&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The method copy text shows, how the passed XDialog interface can be used to access controls on the dialog itself. The details are not described here. For more information see [[Documentation/DevGuide/Basic/Creating Dialogs at Runtime|Creating Dialogs at Runtime]].&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  public void copyText( XDialog xDialog, Object aEventObject ) {&lt;br /&gt;
      XControlContainer xControlContainer = (XControlContainer)UnoRuntime.queryInterface(&lt;br /&gt;
          XControlContainer.class, xDialog );&lt;br /&gt;
  &lt;br /&gt;
      String aTextPropertyStr = &amp;quot;Text&amp;quot;;&lt;br /&gt;
      String aText = &amp;quot;&amp;quot;;&lt;br /&gt;
      XControl xTextField1Control = xControlContainer.getControl( &amp;quot;TextField1&amp;quot; ); &lt;br /&gt;
      XControlModel xControlModel1 = xTextField1Control.getModel();&lt;br /&gt;
      XPropertySet xPropertySet1 = (XPropertySet)UnoRuntime.queryInterface(&lt;br /&gt;
      XPropertySet.class, xControlModel1 );&lt;br /&gt;
      try {&lt;br /&gt;
          aText = (String)xPropertySet1.getPropertyValue( aTextPropertyStr );&lt;br /&gt;
      }&lt;br /&gt;
      catch (Exception e) {&lt;br /&gt;
          e.printStackTrace();&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      XControl xTextField2Control = xControlContainer.getControl( &amp;quot;TextField2&amp;quot; ); &lt;br /&gt;
      XControlModel xControlModel2 = xTextField2Control.getModel();&lt;br /&gt;
      XPropertySet xPropertySet2 = (XPropertySet)UnoRuntime.queryInterface(&lt;br /&gt;
          XPropertySet.class, xControlModel2 );&lt;br /&gt;
      try {&lt;br /&gt;
          xPropertySet2.setPropertyValue( aTextPropertyStr, aText );&lt;br /&gt;
      }&lt;br /&gt;
      catch (Exception e) {&lt;br /&gt;
          e.printStackTrace();&lt;br /&gt;
      }&lt;br /&gt;
    &lt;br /&gt;
      showMessageBox( &amp;quot;DialogComponent&amp;quot;, &amp;quot;copyText() called&amp;quot; );&lt;br /&gt;
  } &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Simple components using dialogs can be realized very easily by supporting &amp;lt;code&amp;gt;XDialogEventHandler&amp;lt;/code&amp;gt; as then no own interfaces have to be created. For complex components it could make more sense to define handler interfaces to avoid a huge switch/case blocks in &amp;lt;code&amp;gt;XDialogEventHandler:: callHandlerMethod&amp;lt;/code&amp;gt;.&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>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Using_Dialogs_in_Components&amp;diff=111960</id>
		<title>Documentation/DevGuide/WritingUNO/Using Dialogs in Components</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Using_Dialogs_in_Components&amp;diff=111960"/>
		<updated>2009-02-15T14:55:00Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: /* Instantiate and display a dialog */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/WritingUNOTOC&lt;br /&gt;
|WritingUNO2Accessing=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/WritingUNO/Assigning Component Methods to Control Events&lt;br /&gt;
|NextPage=Documentation/DevGuide/Extensions/Extensions&lt;br /&gt;
}}&lt;br /&gt;
[[zh:Zh/Documentation/DevGuide/WritingUNO/Using Dialogs in Components]]&lt;br /&gt;
{{DISPLAYTITLE:Using Dialogs in Components}}&lt;br /&gt;
In general components using dialogs are like any other component. But they need some additional code to instantiate and display the dialog(s) to be used and to accept the events created by the dialog controls.&lt;br /&gt;
&lt;br /&gt;
=== Instantiate and display a dialog ===&lt;br /&gt;
&lt;br /&gt;
To do this an extended version of the &amp;lt;idl&amp;gt;com.sun.star.awt.DialogProvider&amp;lt;/idl&amp;gt; service - described in chapter [[Documentation/DevGuide/Scripting/Scripting Framework|Scripting Framework]] - has to be used. The extended service version &amp;lt;idl&amp;gt;com.sun.star.awt.DialogProvider2&amp;lt;/idl&amp;gt; supports &amp;lt;idl&amp;gt;com.sun.star.awt.XDialogProvider2&amp;lt;/idl&amp;gt; providing an additional method &amp;lt;idl&amp;gt;com.sun.star.awt.XDialog&amp;lt;/idl&amp;gt; &amp;lt;tt&amp;gt;createDialogWithHandler(...)&amp;lt;/tt&amp;gt; that allows to pass an interface when creating the dialog. This interface will be used as event handler and called if events are bound to the component.&lt;br /&gt;
&lt;br /&gt;
The following code is taken from the DialogComponent SDK example that can be found in &amp;#039;&amp;#039;SDK/examples/DevelopersGuide/Components&amp;#039;&amp;#039; and shows how a dialog is created and displayed using the &amp;lt;code&amp;gt;DialogProvider2&amp;lt;/code&amp;gt; service: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  // XTestDialogHandler&lt;br /&gt;
  public String createDialog( String DialogURL, XModel xModel, XFrame xFrame ) {&lt;br /&gt;
      m_xFrame = xFrame;  &lt;br /&gt;
  &lt;br /&gt;
      try { &lt;br /&gt;
          XMultiComponentFactory xMCF = m_xCmpCtx.getServiceManager();&lt;br /&gt;
          Object obj;&lt;br /&gt;
  &lt;br /&gt;
          // If valid we must pass the XModel when creating a DialogProvider object&lt;br /&gt;
          if( xModel != null ) {&lt;br /&gt;
              Object[] args = new Object[1];&lt;br /&gt;
              args[0] = xModel;&lt;br /&gt;
  &lt;br /&gt;
              obj = xMCF.createInstanceWithArgumentsAndContext(&lt;br /&gt;
                  &amp;quot;com.sun.star.awt.DialogProvider2&amp;quot;, args, m_xCmpCtx );&lt;br /&gt;
          }&lt;br /&gt;
          else {&lt;br /&gt;
              obj = xMCF.createInstanceWithContext(&lt;br /&gt;
                  &amp;quot;com.sun.star.awt.DialogProvider2&amp;quot;, m_xCmpCtx );&lt;br /&gt;
          }&lt;br /&gt;
  &lt;br /&gt;
          XDialogProvider2 xDialogProvider = (XDialogProvider2)&lt;br /&gt;
              UnoRuntime.queryInterface( XDialogProvider2.class, obj );&lt;br /&gt;
      &lt;br /&gt;
          XDialog xDialog = xDialogProvider.createDialogWithHandler( DialogURL, this );&lt;br /&gt;
          if( xDialog != null )&lt;br /&gt;
              xDialog.execute();&lt;br /&gt;
      }&lt;br /&gt;
      catch (Exception e) { &lt;br /&gt;
          e.printStackTrace(); &lt;br /&gt;
      }&lt;br /&gt;
      return &amp;quot;Created dialog \&amp;quot;&amp;quot; + DialogURL + &amp;quot;\&amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The variable &amp;lt;code&amp;gt;m_xCmpCtx&amp;lt;/code&amp;gt; is the &amp;lt;idl&amp;gt;com.sun.star.uno.XComponentContext&amp;lt;/idl&amp;gt; interface passed to the component while initialisation. If the dialog that should be created is placed inside a document a &amp;lt;idl&amp;gt;com.sun.star.frame.XModel&amp;lt;/idl&amp;gt; interface &amp;lt;code&amp;gt;xModel&amp;lt;/code&amp;gt; representing this document has to be passed. It&amp;#039;s used as argument to initialise the DialogProvider service enabling the access to the document&amp;#039;s Dialog Libraries. If &amp;lt;code&amp;gt;xModel&amp;lt;/code&amp;gt; is null the dialog has to be placed in the application library container. This also has to be reflected in the DialogURL passed to the method.&lt;br /&gt;
&lt;br /&gt;
Example code for a Basic/Dialog library &amp;lt;code&amp;gt;Library1&amp;lt;/code&amp;gt; placed in a document:&lt;br /&gt;
&lt;br /&gt;
  Sub TestDialogComponent()&lt;br /&gt;
      oComp = CreateUnoService( &amp;quot;com.sun.star.test.TestDialogHandler&amp;quot; )&lt;br /&gt;
      oComp.createDialog( &amp;quot;vnd.sun.star.script:Library1.Dialog1?location=document&amp;quot;, _&lt;br /&gt;
          ThisComponent, StarDesktop.getActiveFrame() )&lt;br /&gt;
  End Sub&lt;br /&gt;
&lt;br /&gt;
Example code for a Basic/Dialog library &amp;lt;code&amp;gt;Library1&amp;lt;/code&amp;gt; placed in &amp;quot;My Macros&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  Sub TestDialogComponent()&lt;br /&gt;
      oComp = CreateUnoService( &amp;quot;com.sun.star.test.TestDialogHandler&amp;quot; )&lt;br /&gt;
      oComp.createDialog( &amp;quot;vnd.sun.star.script:Library1.Dialog1?location=application&amp;quot;, _&lt;br /&gt;
          null, StarDesktop.getActiveFrame() )&lt;br /&gt;
  End Sub&lt;br /&gt;
&lt;br /&gt;
The dialog contained in the &amp;#039;&amp;#039;DialogComponent.odt&amp;#039;&amp;#039; sample document in &amp;#039;&amp;#039;SDK/examples/DevelopersGuide/Components/DialogComponent&amp;#039;&amp;#039; looks like this. &lt;br /&gt;
&lt;br /&gt;
[[Image:TestDialog.png|none|thumb|398px|Sample dialog with controls]]&lt;br /&gt;
&lt;br /&gt;
The button labels show which component method is called in each case. The next chapter explains how these methods can be implemented inside the component. Method &amp;quot;doit3&amp;quot; isn&amp;#039;t implemented at all. It&amp;#039;s called in the sample dialog to show the resulting error message:&lt;br /&gt;
&lt;br /&gt;
[[Image:ErrorMessage.png|none|thumb|264px|Error message for Component method not found]]&lt;br /&gt;
&lt;br /&gt;
=== Accept events created by dialog controls ===&lt;br /&gt;
&lt;br /&gt;
The event handling functionality can be implemented in two different ways. The test component described here uses both ways.&lt;br /&gt;
&lt;br /&gt;
The first way is to implement the generic handler interface &amp;lt;idl&amp;gt;com.sun.star.awt.XDialogEventHandler&amp;lt;/idl&amp;gt; containing two methods:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  interface XDialogEventHandler: com::sun::star::uno::XInterface&lt;br /&gt;
  {&lt;br /&gt;
      bool callHandlerMethod&lt;br /&gt;
      (&lt;br /&gt;
          [in] com::sun::star::awt::XDialog xDialog, &lt;br /&gt;
          [in] any Event,  &lt;br /&gt;
          [in] string MethodName &lt;br /&gt;
      )&lt;br /&gt;
  &lt;br /&gt;
      sequence&amp;lt;string&amp;gt; getSupportedMethodNames();&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If an event occurs that is bound to a component method and the component implements this interface, the method &amp;lt;code&amp;gt;callHandlerMethod&amp;lt;/code&amp;gt; will be called first, with the method name used in the event binding passed as &amp;lt;code&amp;gt;MethodName&amp;lt;/code&amp;gt; parameter. In this example this would be: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  xHandler.callHandlerMethod( xDialog, aEvent, &amp;quot;handleEvent&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;xDialog&amp;lt;/code&amp;gt; points to the same dialog instance that has been returned by the &amp;lt;code&amp;gt;createDialogWithHandler()&amp;lt;/code&amp;gt; method. Event represents the event object originally passed to the awt listener method. E.g. in case of the &amp;quot;When initiating&amp;quot; event used in this example the corresponding awt listener interface is &amp;lt;idl&amp;gt;com.sun.star.awt.XActionListener&amp;lt;/idl&amp;gt; and an &amp;lt;idl&amp;gt;com.sun.star.awt.ActionEvent&amp;lt;/idl&amp;gt; is passed to its &amp;lt;code&amp;gt;actionPerformed&amp;lt;/code&amp;gt; method when the event occurs. This &amp;lt;code&amp;gt;ActionEvent&amp;lt;/code&amp;gt; object will also be passed to &amp;lt;code&amp;gt;callHandlerMethod&amp;lt;/code&amp;gt;. The Event object has to be passed as any, because other events use different listener interfaces with other event object types. &amp;lt;code&amp;gt;callHandlerMethod&amp;lt;/code&amp;gt; returns a bool value. Returning true means that the event has been handled. &lt;br /&gt;
&lt;br /&gt;
The method &amp;lt;code&amp;gt;getSupportedMethodNames()&amp;lt;/code&amp;gt; should return the names of all methods handled by &amp;lt;code&amp;gt;callHandlerMethod()&amp;lt;/code&amp;gt;. It&amp;#039;s intended for later use, especially to expand the user interface to allow browsing a component&amp;#039;s methods. &lt;br /&gt;
&lt;br /&gt;
If the event has not been handled, because &amp;lt;code&amp;gt;callHandlerMethod&amp;lt;/code&amp;gt; returns false or &amp;lt;idl&amp;gt;com.sun.star.awt.XDialogEventHandler&amp;lt;/idl&amp;gt; isn&amp;#039;t supported at all by the component, the DialogProvider uses the &amp;lt;idl&amp;gt;com.sun.star.beans.Introspection&amp;lt;/idl&amp;gt; service to detect if one of the following methods is provided by one of the interfaces supported by the component:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  void [MethodName] &lt;br /&gt;
  ( &lt;br /&gt;
      [in] com::sun::star::awt::XDialog xDialog, &lt;br /&gt;
      [in] any aEvent &lt;br /&gt;
  );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  void [MethodName]( void );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The second method is only used if the first one is not available. In this example the component would have to support an interface containing a method &amp;lt;code&amp;gt;handleEvent&amp;lt;/code&amp;gt; with one of these signatures. It also has to support &amp;lt;idl&amp;gt;com.sun.star.lang.XTypeProvider&amp;lt;/idl&amp;gt; because otherwise the introspection mechanism does not work. &lt;br /&gt;
&lt;br /&gt;
As already mentioned the sample component supports both ways to implement handler methods. &amp;lt;idl&amp;gt;com.sun.star.awt.XDialogEventHandler&amp;lt;/idl&amp;gt; is implemented like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  private String aHandlerMethod1 = &amp;quot;doit1&amp;quot;;&lt;br /&gt;
  private String aHandlerMethod2 = &amp;quot;doit2&amp;quot;;&lt;br /&gt;
  &lt;br /&gt;
  //XDialogEventHandler&lt;br /&gt;
  public boolean callHandlerMethod( /*IN*/XDialog xDialog, /*IN*/Object EventObject, &lt;br /&gt;
                                    /*IN*/String MethodName ) {&lt;br /&gt;
      if ( MethodName.equals( aHandlerMethod1 ) ) {&lt;br /&gt;
          showMessageBox( &amp;quot;DialogComponent&amp;quot;, &amp;quot;callHandlerMethod() handled \&amp;quot;&amp;quot; + aHandlerMethod1 + &amp;quot;\&amp;quot;&amp;quot; );&lt;br /&gt;
          return true;&lt;br /&gt;
      }&lt;br /&gt;
      else if ( MethodName.equals( aHandlerMethod2 ) ) {&lt;br /&gt;
          showMessageBox( &amp;quot;DialogComponent&amp;quot;, &amp;quot;callHandlerMethod() handled \&amp;quot;&amp;quot; + aHandlerMethod2 + &amp;quot;\&amp;quot;&amp;quot; );&lt;br /&gt;
          return true;&lt;br /&gt;
      }&lt;br /&gt;
      return false;&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  public String[] getSupportedMethodNames() {&lt;br /&gt;
      String[] retValue= new String[1];&lt;br /&gt;
      retValue[0]= aHandlerMethod1;&lt;br /&gt;
      retValue[1]= aHandlerMethod2;&lt;br /&gt;
      return retValue;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The implementation is very simple to show only the logic. For the two handled method names the method displays a MessageBox and return true. Otherwise false is returned.&lt;br /&gt;
&lt;br /&gt;
The other methods bound to the sample dialog control events are implemented using the other way. The interface &amp;lt;idl&amp;gt;com.sun.star.test.XTestDialogHandler&amp;lt;/idl&amp;gt; looks like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  module com { module sun { module star { module test { &lt;br /&gt;
      interface XTestDialogHandler {  &lt;br /&gt;
          string createDialog( [in] string DialogURL, [in] ::com::sun::star::frame::XModel xModel, &lt;br /&gt;
                                                      [in] ::com::sun::star::frame::XFrame xFrame ); &lt;br /&gt;
      void copyText( [in] ::com::sun::star::awt::XDialog xDialog, [in] any aEventObject ); &lt;br /&gt;
      void handleEvent();  &lt;br /&gt;
      void handleEventWithArguments( [in] ::com::sun::star::awt::XDialog xDialog, &lt;br /&gt;
                                     [in] any aEventObject );  &lt;br /&gt;
      };&lt;br /&gt;
  }; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Besides the already described &amp;lt;code&amp;gt;createDialog&amp;lt;/code&amp;gt; method three methods are defined to handle events. &amp;lt;code&amp;gt;handleEvent&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;handleEventWithArguments&amp;lt;/code&amp;gt; are implemented very simple and only display a message box:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  public void handleEvent() { &lt;br /&gt;
      showMessageBox( &amp;quot;DialogComponent&amp;quot;, &amp;quot;handleEvent() called&amp;quot; );&lt;br /&gt;
  } &lt;br /&gt;
  &lt;br /&gt;
  public void handleEventWithArguments( XDialog xDialog, Object aEventObject ) { &lt;br /&gt;
      showMessageBox( &amp;quot;DialogComponent&amp;quot;, &amp;quot;handleEventWithArguments() called\n\n&amp;quot; +&lt;br /&gt;
          &amp;quot;Event Object = &amp;quot; + aEventObject );&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The method copy text shows, how the passed XDialog interface can be used to access controls on the dialog itself. The details are not described here. For more information see [[Documentation/DevGuide/Basic/Creating Dialogs at Runtime|Creating Dialogs at Runtime]].&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  public void copyText( XDialog xDialog, Object aEventObject ) {&lt;br /&gt;
      XControlContainer xControlContainer = (XControlContainer)UnoRuntime.queryInterface(&lt;br /&gt;
          XControlContainer.class, xDialog );&lt;br /&gt;
  &lt;br /&gt;
      String aTextPropertyStr = &amp;quot;Text&amp;quot;;&lt;br /&gt;
      String aText = &amp;quot;&amp;quot;;&lt;br /&gt;
      XControl xTextField1Control = xControlContainer.getControl( &amp;quot;TextField1&amp;quot; ); &lt;br /&gt;
      XControlModel xControlModel1 = xTextField1Control.getModel();&lt;br /&gt;
      XPropertySet xPropertySet1 = (XPropertySet)UnoRuntime.queryInterface(&lt;br /&gt;
      XPropertySet.class, xControlModel1 );&lt;br /&gt;
      try {&lt;br /&gt;
          aText = (String)xPropertySet1.getPropertyValue( aTextPropertyStr );&lt;br /&gt;
      }&lt;br /&gt;
      catch (Exception e) {&lt;br /&gt;
          e.printStackTrace();&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      XControl xTextField2Control = xControlContainer.getControl( &amp;quot;TextField2&amp;quot; ); &lt;br /&gt;
      XControlModel xControlModel2 = xTextField2Control.getModel();&lt;br /&gt;
      XPropertySet xPropertySet2 = (XPropertySet)UnoRuntime.queryInterface(&lt;br /&gt;
          XPropertySet.class, xControlModel2 );&lt;br /&gt;
      try {&lt;br /&gt;
          xPropertySet2.setPropertyValue( aTextPropertyStr, aText );&lt;br /&gt;
      }&lt;br /&gt;
      catch (Exception e) {&lt;br /&gt;
          e.printStackTrace();&lt;br /&gt;
      }&lt;br /&gt;
    &lt;br /&gt;
      showMessageBox( &amp;quot;DialogComponent&amp;quot;, &amp;quot;copyText() called&amp;quot; );&lt;br /&gt;
  } &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Simple components using dialogs can be realized very easily by supporting &amp;lt;code&amp;gt;XDialogEventHandler&amp;lt;/code&amp;gt; as then no own interfaces have to be created. For complex components it could make more sense to define handler interfaces to avoid a huge switch/case blocks in &amp;lt;code&amp;gt;XDialogEventHandler:: callHandlerMethod&amp;lt;/code&amp;gt;.&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>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Using_Dialogs_in_Components&amp;diff=111959</id>
		<title>Documentation/DevGuide/WritingUNO/Using Dialogs in Components</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/WritingUNO/Using_Dialogs_in_Components&amp;diff=111959"/>
		<updated>2009-02-15T14:54:23Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: /* Instantiate and display a dialog */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/WritingUNOTOC&lt;br /&gt;
|WritingUNO2Accessing=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/WritingUNO/Assigning Component Methods to Control Events&lt;br /&gt;
|NextPage=Documentation/DevGuide/Extensions/Extensions&lt;br /&gt;
}}&lt;br /&gt;
[[zh:Zh/Documentation/DevGuide/WritingUNO/Using Dialogs in Components]]&lt;br /&gt;
{{DISPLAYTITLE:Using Dialogs in Components}}&lt;br /&gt;
In general components using dialogs are like any other component. But they need some additional code to instantiate and display the dialog(s) to be used and to accept the events created by the dialog controls.&lt;br /&gt;
&lt;br /&gt;
=== Instantiate and display a dialog ===&lt;br /&gt;
&lt;br /&gt;
To do this an extended version of the &amp;lt;idl&amp;gt;com.sun.star.awt.DialogProvider&amp;lt;/idl&amp;gt; service - described in chapter [[Documentation/DevGuide/Scripting/Scripting Framework|Scripting Framework]] - has to be used. The extended service version &amp;lt;idl&amp;gt;com.sun.star.awt.DialogProvider2&amp;lt;/idl&amp;gt; supports &amp;lt;idl&amp;gt;com.sun.star.awt.XDialogProvider2&amp;lt;/idl&amp;gt; providing an additional method &amp;lt;idl&amp;gt;com.sun.star.awt.XDialog&amp;lt;/idl&amp;gt; &amp;lt;tt&amp;gt;createDialogWithHandler(...)&amp;lt;/tt&amp;gt; that allows to pass an interface when creating the dialog. This interface will be used as event handler and called if events are bound to the component.&lt;br /&gt;
&lt;br /&gt;
The following code is take from the DialogComponent SDK example that can be found in &amp;#039;&amp;#039;SDK/examples/DevelopersGuide/Components&amp;#039;&amp;#039; and shows how a dialog is created and displayed using the &amp;lt;code&amp;gt;DialogProvider2&amp;lt;/code&amp;gt; service: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  // XTestDialogHandler&lt;br /&gt;
  public String createDialog( String DialogURL, XModel xModel, XFrame xFrame ) {&lt;br /&gt;
      m_xFrame = xFrame;  &lt;br /&gt;
  &lt;br /&gt;
      try { &lt;br /&gt;
          XMultiComponentFactory xMCF = m_xCmpCtx.getServiceManager();&lt;br /&gt;
          Object obj;&lt;br /&gt;
  &lt;br /&gt;
          // If valid we must pass the XModel when creating a DialogProvider object&lt;br /&gt;
          if( xModel != null ) {&lt;br /&gt;
              Object[] args = new Object[1];&lt;br /&gt;
              args[0] = xModel;&lt;br /&gt;
  &lt;br /&gt;
              obj = xMCF.createInstanceWithArgumentsAndContext(&lt;br /&gt;
                  &amp;quot;com.sun.star.awt.DialogProvider2&amp;quot;, args, m_xCmpCtx );&lt;br /&gt;
          }&lt;br /&gt;
          else {&lt;br /&gt;
              obj = xMCF.createInstanceWithContext(&lt;br /&gt;
                  &amp;quot;com.sun.star.awt.DialogProvider2&amp;quot;, m_xCmpCtx );&lt;br /&gt;
          }&lt;br /&gt;
  &lt;br /&gt;
          XDialogProvider2 xDialogProvider = (XDialogProvider2)&lt;br /&gt;
              UnoRuntime.queryInterface( XDialogProvider2.class, obj );&lt;br /&gt;
      &lt;br /&gt;
          XDialog xDialog = xDialogProvider.createDialogWithHandler( DialogURL, this );&lt;br /&gt;
          if( xDialog != null )&lt;br /&gt;
              xDialog.execute();&lt;br /&gt;
      }&lt;br /&gt;
      catch (Exception e) { &lt;br /&gt;
          e.printStackTrace(); &lt;br /&gt;
      }&lt;br /&gt;
      return &amp;quot;Created dialog \&amp;quot;&amp;quot; + DialogURL + &amp;quot;\&amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The variable &amp;lt;code&amp;gt;m_xCmpCtx&amp;lt;/code&amp;gt; is the &amp;lt;idl&amp;gt;com.sun.star.uno.XComponentContext&amp;lt;/idl&amp;gt; interface passed to the component while initialisation. If the dialog that should be created is placed inside a document a &amp;lt;idl&amp;gt;com.sun.star.frame.XModel&amp;lt;/idl&amp;gt; interface &amp;lt;code&amp;gt;xModel&amp;lt;/code&amp;gt; representing this document has to be passed. It&amp;#039;s used as argument to initialise the DialogProvider service enabling the access to the document&amp;#039;s Dialog Libraries. If &amp;lt;code&amp;gt;xModel&amp;lt;/code&amp;gt; is null the dialog has to be placed in the application library container. This also has to be reflected in the DialogURL passed to the method.&lt;br /&gt;
&lt;br /&gt;
Example code for a Basic/Dialog library &amp;lt;code&amp;gt;Library1&amp;lt;/code&amp;gt; placed in a document:&lt;br /&gt;
&lt;br /&gt;
  Sub TestDialogComponent()&lt;br /&gt;
      oComp = CreateUnoService( &amp;quot;com.sun.star.test.TestDialogHandler&amp;quot; )&lt;br /&gt;
      oComp.createDialog( &amp;quot;vnd.sun.star.script:Library1.Dialog1?location=document&amp;quot;, _&lt;br /&gt;
          ThisComponent, StarDesktop.getActiveFrame() )&lt;br /&gt;
  End Sub&lt;br /&gt;
&lt;br /&gt;
Example code for a Basic/Dialog library &amp;lt;code&amp;gt;Library1&amp;lt;/code&amp;gt; placed in &amp;quot;My Macros&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  Sub TestDialogComponent()&lt;br /&gt;
      oComp = CreateUnoService( &amp;quot;com.sun.star.test.TestDialogHandler&amp;quot; )&lt;br /&gt;
      oComp.createDialog( &amp;quot;vnd.sun.star.script:Library1.Dialog1?location=application&amp;quot;, _&lt;br /&gt;
          null, StarDesktop.getActiveFrame() )&lt;br /&gt;
  End Sub&lt;br /&gt;
&lt;br /&gt;
The dialog contained in the &amp;#039;&amp;#039;DialogComponent.odt&amp;#039;&amp;#039; sample document in &amp;#039;&amp;#039;SDK/examples/DevelopersGuide/Components/DialogComponent&amp;#039;&amp;#039; looks like this. &lt;br /&gt;
&lt;br /&gt;
[[Image:TestDialog.png|none|thumb|398px|Sample dialog with controls]]&lt;br /&gt;
&lt;br /&gt;
The button labels show which component method is called in each case. The next chapter explains how these methods can be implemented inside the component. Method &amp;quot;doit3&amp;quot; isn&amp;#039;t implemented at all. It&amp;#039;s called in the sample dialog to show the resulting error message:&lt;br /&gt;
&lt;br /&gt;
[[Image:ErrorMessage.png|none|thumb|264px|Error message for Component method not found]]&lt;br /&gt;
&lt;br /&gt;
=== Accept events created by dialog controls ===&lt;br /&gt;
&lt;br /&gt;
The event handling functionality can be implemented in two different ways. The test component described here uses both ways.&lt;br /&gt;
&lt;br /&gt;
The first way is to implement the generic handler interface &amp;lt;idl&amp;gt;com.sun.star.awt.XDialogEventHandler&amp;lt;/idl&amp;gt; containing two methods:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  interface XDialogEventHandler: com::sun::star::uno::XInterface&lt;br /&gt;
  {&lt;br /&gt;
      bool callHandlerMethod&lt;br /&gt;
      (&lt;br /&gt;
          [in] com::sun::star::awt::XDialog xDialog, &lt;br /&gt;
          [in] any Event,  &lt;br /&gt;
          [in] string MethodName &lt;br /&gt;
      )&lt;br /&gt;
  &lt;br /&gt;
      sequence&amp;lt;string&amp;gt; getSupportedMethodNames();&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If an event occurs that is bound to a component method and the component implements this interface, the method &amp;lt;code&amp;gt;callHandlerMethod&amp;lt;/code&amp;gt; will be called first, with the method name used in the event binding passed as &amp;lt;code&amp;gt;MethodName&amp;lt;/code&amp;gt; parameter. In this example this would be: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  xHandler.callHandlerMethod( xDialog, aEvent, &amp;quot;handleEvent&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;xDialog&amp;lt;/code&amp;gt; points to the same dialog instance that has been returned by the &amp;lt;code&amp;gt;createDialogWithHandler()&amp;lt;/code&amp;gt; method. Event represents the event object originally passed to the awt listener method. E.g. in case of the &amp;quot;When initiating&amp;quot; event used in this example the corresponding awt listener interface is &amp;lt;idl&amp;gt;com.sun.star.awt.XActionListener&amp;lt;/idl&amp;gt; and an &amp;lt;idl&amp;gt;com.sun.star.awt.ActionEvent&amp;lt;/idl&amp;gt; is passed to its &amp;lt;code&amp;gt;actionPerformed&amp;lt;/code&amp;gt; method when the event occurs. This &amp;lt;code&amp;gt;ActionEvent&amp;lt;/code&amp;gt; object will also be passed to &amp;lt;code&amp;gt;callHandlerMethod&amp;lt;/code&amp;gt;. The Event object has to be passed as any, because other events use different listener interfaces with other event object types. &amp;lt;code&amp;gt;callHandlerMethod&amp;lt;/code&amp;gt; returns a bool value. Returning true means that the event has been handled. &lt;br /&gt;
&lt;br /&gt;
The method &amp;lt;code&amp;gt;getSupportedMethodNames()&amp;lt;/code&amp;gt; should return the names of all methods handled by &amp;lt;code&amp;gt;callHandlerMethod()&amp;lt;/code&amp;gt;. It&amp;#039;s intended for later use, especially to expand the user interface to allow browsing a component&amp;#039;s methods. &lt;br /&gt;
&lt;br /&gt;
If the event has not been handled, because &amp;lt;code&amp;gt;callHandlerMethod&amp;lt;/code&amp;gt; returns false or &amp;lt;idl&amp;gt;com.sun.star.awt.XDialogEventHandler&amp;lt;/idl&amp;gt; isn&amp;#039;t supported at all by the component, the DialogProvider uses the &amp;lt;idl&amp;gt;com.sun.star.beans.Introspection&amp;lt;/idl&amp;gt; service to detect if one of the following methods is provided by one of the interfaces supported by the component:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  void [MethodName] &lt;br /&gt;
  ( &lt;br /&gt;
      [in] com::sun::star::awt::XDialog xDialog, &lt;br /&gt;
      [in] any aEvent &lt;br /&gt;
  );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  void [MethodName]( void );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The second method is only used if the first one is not available. In this example the component would have to support an interface containing a method &amp;lt;code&amp;gt;handleEvent&amp;lt;/code&amp;gt; with one of these signatures. It also has to support &amp;lt;idl&amp;gt;com.sun.star.lang.XTypeProvider&amp;lt;/idl&amp;gt; because otherwise the introspection mechanism does not work. &lt;br /&gt;
&lt;br /&gt;
As already mentioned the sample component supports both ways to implement handler methods. &amp;lt;idl&amp;gt;com.sun.star.awt.XDialogEventHandler&amp;lt;/idl&amp;gt; is implemented like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  private String aHandlerMethod1 = &amp;quot;doit1&amp;quot;;&lt;br /&gt;
  private String aHandlerMethod2 = &amp;quot;doit2&amp;quot;;&lt;br /&gt;
  &lt;br /&gt;
  //XDialogEventHandler&lt;br /&gt;
  public boolean callHandlerMethod( /*IN*/XDialog xDialog, /*IN*/Object EventObject, &lt;br /&gt;
                                    /*IN*/String MethodName ) {&lt;br /&gt;
      if ( MethodName.equals( aHandlerMethod1 ) ) {&lt;br /&gt;
          showMessageBox( &amp;quot;DialogComponent&amp;quot;, &amp;quot;callHandlerMethod() handled \&amp;quot;&amp;quot; + aHandlerMethod1 + &amp;quot;\&amp;quot;&amp;quot; );&lt;br /&gt;
          return true;&lt;br /&gt;
      }&lt;br /&gt;
      else if ( MethodName.equals( aHandlerMethod2 ) ) {&lt;br /&gt;
          showMessageBox( &amp;quot;DialogComponent&amp;quot;, &amp;quot;callHandlerMethod() handled \&amp;quot;&amp;quot; + aHandlerMethod2 + &amp;quot;\&amp;quot;&amp;quot; );&lt;br /&gt;
          return true;&lt;br /&gt;
      }&lt;br /&gt;
      return false;&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  public String[] getSupportedMethodNames() {&lt;br /&gt;
      String[] retValue= new String[1];&lt;br /&gt;
      retValue[0]= aHandlerMethod1;&lt;br /&gt;
      retValue[1]= aHandlerMethod2;&lt;br /&gt;
      return retValue;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The implementation is very simple to show only the logic. For the two handled method names the method displays a MessageBox and return true. Otherwise false is returned.&lt;br /&gt;
&lt;br /&gt;
The other methods bound to the sample dialog control events are implemented using the other way. The interface &amp;lt;idl&amp;gt;com.sun.star.test.XTestDialogHandler&amp;lt;/idl&amp;gt; looks like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
  module com { module sun { module star { module test { &lt;br /&gt;
      interface XTestDialogHandler {  &lt;br /&gt;
          string createDialog( [in] string DialogURL, [in] ::com::sun::star::frame::XModel xModel, &lt;br /&gt;
                                                      [in] ::com::sun::star::frame::XFrame xFrame ); &lt;br /&gt;
      void copyText( [in] ::com::sun::star::awt::XDialog xDialog, [in] any aEventObject ); &lt;br /&gt;
      void handleEvent();  &lt;br /&gt;
      void handleEventWithArguments( [in] ::com::sun::star::awt::XDialog xDialog, &lt;br /&gt;
                                     [in] any aEventObject );  &lt;br /&gt;
      };&lt;br /&gt;
  }; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Besides the already described &amp;lt;code&amp;gt;createDialog&amp;lt;/code&amp;gt; method three methods are defined to handle events. &amp;lt;code&amp;gt;handleEvent&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;handleEventWithArguments&amp;lt;/code&amp;gt; are implemented very simple and only display a message box:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  public void handleEvent() { &lt;br /&gt;
      showMessageBox( &amp;quot;DialogComponent&amp;quot;, &amp;quot;handleEvent() called&amp;quot; );&lt;br /&gt;
  } &lt;br /&gt;
  &lt;br /&gt;
  public void handleEventWithArguments( XDialog xDialog, Object aEventObject ) { &lt;br /&gt;
      showMessageBox( &amp;quot;DialogComponent&amp;quot;, &amp;quot;handleEventWithArguments() called\n\n&amp;quot; +&lt;br /&gt;
          &amp;quot;Event Object = &amp;quot; + aEventObject );&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The method copy text shows, how the passed XDialog interface can be used to access controls on the dialog itself. The details are not described here. For more information see [[Documentation/DevGuide/Basic/Creating Dialogs at Runtime|Creating Dialogs at Runtime]].&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  public void copyText( XDialog xDialog, Object aEventObject ) {&lt;br /&gt;
      XControlContainer xControlContainer = (XControlContainer)UnoRuntime.queryInterface(&lt;br /&gt;
          XControlContainer.class, xDialog );&lt;br /&gt;
  &lt;br /&gt;
      String aTextPropertyStr = &amp;quot;Text&amp;quot;;&lt;br /&gt;
      String aText = &amp;quot;&amp;quot;;&lt;br /&gt;
      XControl xTextField1Control = xControlContainer.getControl( &amp;quot;TextField1&amp;quot; ); &lt;br /&gt;
      XControlModel xControlModel1 = xTextField1Control.getModel();&lt;br /&gt;
      XPropertySet xPropertySet1 = (XPropertySet)UnoRuntime.queryInterface(&lt;br /&gt;
      XPropertySet.class, xControlModel1 );&lt;br /&gt;
      try {&lt;br /&gt;
          aText = (String)xPropertySet1.getPropertyValue( aTextPropertyStr );&lt;br /&gt;
      }&lt;br /&gt;
      catch (Exception e) {&lt;br /&gt;
          e.printStackTrace();&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      XControl xTextField2Control = xControlContainer.getControl( &amp;quot;TextField2&amp;quot; ); &lt;br /&gt;
      XControlModel xControlModel2 = xTextField2Control.getModel();&lt;br /&gt;
      XPropertySet xPropertySet2 = (XPropertySet)UnoRuntime.queryInterface(&lt;br /&gt;
          XPropertySet.class, xControlModel2 );&lt;br /&gt;
      try {&lt;br /&gt;
          xPropertySet2.setPropertyValue( aTextPropertyStr, aText );&lt;br /&gt;
      }&lt;br /&gt;
      catch (Exception e) {&lt;br /&gt;
          e.printStackTrace();&lt;br /&gt;
      }&lt;br /&gt;
    &lt;br /&gt;
      showMessageBox( &amp;quot;DialogComponent&amp;quot;, &amp;quot;copyText() called&amp;quot; );&lt;br /&gt;
  } &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Simple components using dialogs can be realized very easily by supporting &amp;lt;code&amp;gt;XDialogEventHandler&amp;lt;/code&amp;gt; as then no own interfaces have to be created. For complex components it could make more sense to define handler interfaces to avoid a huge switch/case blocks in &amp;lt;code&amp;gt;XDialogEventHandler:: callHandlerMethod&amp;lt;/code&amp;gt;.&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>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/OpenOffice.org_Developers_Guide&amp;diff=111956</id>
		<title>Documentation/DevGuide/OpenOffice.org Developers Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/OpenOffice.org_Developers_Guide&amp;diff=111956"/>
		<updated>2009-02-15T14:10:33Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: /* How This Book is Organized */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/DevGuideTOC&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|ShowPrevPage=none&lt;br /&gt;
|NextPage=Documentation/DevGuide/FirstSteps/First Steps&lt;br /&gt;
}}&lt;br /&gt;
[[zh:Zh/Documentation/DevGuide/OpenOffice.org Developers Guide]]&lt;br /&gt;
{{DISPLAYTITLE:OpenOffice.org Developer&amp;#039;s Guide}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
[[Documentation/DevGuide/Contributing_to_the_Developers_Guide|Contributing to the Developer&amp;#039;s Guide]]&lt;br /&gt;
=== What This Manual Covers === &lt;br /&gt;
&lt;br /&gt;
This manual describes how to write programs using the component technology UNO (Universal Network Objects) with {{PRODUCTNAME}}.&lt;br /&gt;
&lt;br /&gt;
Most examples provided are written in Java. As well as Java, the language binding for C++, the UNO access for {{PRODUCTNAME}} Basic and the OLE Automation bridge that uses {{PRODUCTNAME}} through Microsoft&amp;#039;s component technology COM/DCOM is described.&lt;br /&gt;
&lt;br /&gt;
=== How This Book is Organized ===&lt;br /&gt;
&lt;br /&gt;
Every page of this book has a Table of Contents at the right side of the page. This TOC shows the content of the current part and navigation links to browse parts and pages of this book.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/FirstSteps/First_Steps|&amp;#039;&amp;#039;&amp;#039;First Steps&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
:The First Steps chapter describes the setting up of a Java UNO development environment to achieve the solutions you need. At the end of this chapter, you will be equipped with the essentials required for the following chapters about the {{PRODUCTNAME}} applications.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/ProUNO/Professional_UNO|&amp;#039;&amp;#039;&amp;#039; Professional UNO&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
:This chapter introduces API and UNO concepts and explains the specifics of the programming languages and technologies that can be used with UNO. It will help you to write industrial strength UNO programs, use one of the languages besides Java or improve your understanding of the API reference.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/WritingUNO/Writing_UNO_Components|&amp;#039;&amp;#039;&amp;#039; Writing UNO Components &amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
: This chapter describes how to write UNO components. It also provides an insight into the UNOIDL (UNO Interface Definition Language) language and the inner workings of the service manager. Before beginning this chapter, you should be familiar with the First Steps and Professional UNO chapters.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/Extensions/Extensions|&amp;#039;&amp;#039;&amp;#039; Extensions &amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
: This chapter describes the various aspects of OpenOffice.org Extensions.  It explains the specifics of how Extensions can be developed, and provides an overview of the various things that you must do to develop your own Extension.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/AdvUNO/Advanced_UNO|&amp;#039;&amp;#039;&amp;#039; Advanced UNO &amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
:This chapter describes the technical basis of UNO, how the language bindings and bridges work, how the service manager goes about its tasks and what the core reflection actually does.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/OfficeDev/Office_Development|&amp;#039;&amp;#039;&amp;#039; Office Development &amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
:This chapter describes the application framework of the {{PRODUCTNAME}} application that includes how the {{PRODUCTNAME}} API deals with the {{PRODUCTNAME}} application and the features available across all parts of {{PRODUCTNAME}}.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/Text/Text_Documents|&amp;#039;&amp;#039;&amp;#039;Text Documents&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/Spreadsheets/Spreadsheet_Documents|&amp;#039;&amp;#039;&amp;#039;Spreadsheet Documents&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/Drawings/Drawing_Documents_and_Presentation_Documents|&amp;#039;&amp;#039;&amp;#039;Drawings and Presentations&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/Charts/Charts|&amp;#039;&amp;#039;&amp;#039;Charts&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
:These chapters describe how {{PRODUCTNAME}} revolves around documents. These chapters teach you what to do with these documents programmatically.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/Basic/OpenOffice.org_Basic|&amp;#039;&amp;#039;&amp;#039; OpenOffice.org Basic &amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
:This chapter provides the functionality to create and manage Basic macros and dialogs.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/Database/Database_Access|&amp;#039;&amp;#039;&amp;#039; Database Access &amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
:This chapter describes how you can take advantage of this capability in your own projects. {{PRODUCTNAME}} can connect to databases in a universal manner.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/Forms/Forms|&amp;#039;&amp;#039;&amp;#039; Forms &amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
:This chapter describes how {{PRODUCTNAME}} documents contain form controls that are programmed using an event-driven programming model. The Forms chapter shows you how to enhance your documents with controls for data input.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/UCB/Universal_Content_Broker|&amp;#039;&amp;#039;&amp;#039; Universal Content Broker &amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
:This chapter describes how the Universal Content Broker is the generic resource access service used by the entire office application. It handles not only files and directories, but hierarchic and non-hierarchic contents, in general. &lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/Config/Configuration_Management|&amp;#039;&amp;#039;&amp;#039; Configuration Management &amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
:This chapter describes how the {{PRODUCTNAME}} API offers access to the office configuration options that are found in the &amp;#039;&amp;#039;&amp;#039;Tools &amp;gt; Options&amp;#039;&amp;#039;&amp;#039; dialog.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/JavaBean/JavaBean_for_Office_Components|&amp;#039;&amp;#039;&amp;#039; JavaBean for Office Components &amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
:This chapter describes how the OfficeBean JavaBean component allows the developer to integrate office functionality in Java applications.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/Accessibility/Accessibility|&amp;#039;&amp;#039;&amp;#039;Accessibility&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
: This chapter explains the Accessibility API, and how you can work to bring your applications in line with accessibility requirements.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/Scripting/Scripting_Framework|&amp;#039;&amp;#039;&amp;#039;Scripting Framework&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
: This chapter describes the user interface features of the Scripting Framework, and provides a guide on how to get started with writing Scripting Framework macros.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/GUI/Graphical_User_Interfaces|&amp;#039;&amp;#039;&amp;#039;Graphical User Interfaces&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
: This chapter is for extension developers who want to add functionality to their {{PRODUCTNAME}} application and want to create a consistent user interface.  It explains how you can add your own GUI to your {{PRODUCTNAME}} applications.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/AppendixA/{{PRODUCTNAME}}_API-Design-Guidelines|&amp;#039;&amp;#039;&amp;#039;Guidelines and Specifications&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
:The guidelines and specifications provide extra information about the {{PRODUCTNAME}} API.&lt;br /&gt;
&lt;br /&gt;
=== Appendices ===&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/AppendixB/IDL_Documentation_Guidelines|&amp;#039;&amp;#039;&amp;#039;IDL Documentation Guidelines&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
:How IDL files are used to create correct online documentation for the OpenOffice.org API.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/AppendixC/Universal_Content_Providers|&amp;#039;&amp;#039;&amp;#039;Universal Content Providers&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
:A listing of universal content providers.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/AppendixD/UNOIDL_Syntax_Specification|&amp;#039;&amp;#039;&amp;#039;UNOIDL Syntax Specification&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
:A listing of the language specification for UNOIDL in pseudo BNF notation (the IDL grammar).&lt;br /&gt;
&lt;br /&gt;
[[Documentation/DevGuide/Glossary/Glossary|&amp;#039;&amp;#039;&amp;#039;Glossary&amp;#039;&amp;#039;&amp;#039;]]&lt;br /&gt;
:Definition and explanation of {{PRODUCTNAME}} terms, concepts and abbreviations.&lt;br /&gt;
&lt;br /&gt;
=== OpenOffice.org Version History ===&lt;br /&gt;
OpenOffice.org exists in two versions:&lt;br /&gt;
&lt;br /&gt;
* OpenOffice.org - an open source edition [http://www.openoffice.org www.openoffice.org]&lt;br /&gt;
* StarOffice and StarSuite - &amp;quot;branded&amp;quot; editions derived from OpenOffice.org&lt;br /&gt;
&lt;br /&gt;
In 2000, Sun Microsystems released the source code of their current developer version of StarOffice on [http://www.openoffice.org www.openoffice.org], and made the ongoing development process public. Sun&amp;#039;s development team, which developed StarOffice, continued its work on [http://www.openoffice.org www.openoffice.org], and developers from all over the world joined them to port, translate, repair bugs and discuss future plans. StarOffice 6.0 and OpenOffice.org 1.0, which were released in spring 2002, share the same code basis.&lt;br /&gt;
&lt;br /&gt;
=== Related documentation ===&lt;br /&gt;
&lt;br /&gt;
The api and udk projects on [http://www.openoffice.org www.openoffice.org] have related documentation, examples and FAQs (frequently asked questions) on the {{PRODUCTNAME}} API. Most important are probably the references, you can find them at [http://api.openoffice.org api.openoffice.org] or [http://udk.openoffice.org udk.openoffice.org].&lt;br /&gt;
* The API Reference covers the programmable features of {{PRODUCTNAME}}.&lt;br /&gt;
* The Java Reference describes the features of the Java UNO runtime environment.&lt;br /&gt;
* The C++ Reference is about the C++ language binding.&lt;br /&gt;
&lt;br /&gt;
=== Conventions ===&lt;br /&gt;
This book uses the following formatting conventions:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Bold&amp;#039;&amp;#039;&amp;#039; refers to the keys on the keyboard or elements of a user interface, such as the OK button or File menu.&lt;br /&gt;
* &amp;#039;&amp;#039;Italics&amp;#039;&amp;#039; are used for emphasis and to signify the first use of a term. Italics are also used for web sites, file and directory names and email addresses.&lt;br /&gt;
* &amp;lt;code&amp;gt;Courier New&amp;lt;/code&amp;gt; is used in all Code Listings and for everything that is typed when programming.&lt;br /&gt;
&lt;br /&gt;
=== Acknowledgments ===&lt;br /&gt;
A publication like this can never be the work of a single person – it is the result of tremendous team effort. Of course, the OpenOffice.org/StarOffice development team played the most important role by creating the API in the first place. The knowledge and experience of this team will be documented here. Furthermore, there were several devoted individuals who contributed to making this documentation reality.&lt;br /&gt;
&lt;br /&gt;
First of all, we would like to thank Ralf Kuhnert and Dietrich Schulten. Using their technical expertise and articulate mode of expression, they accomplished the challenging task of gathering the wealth of API knowledge from the minds of the developers and transforming it into an understandable document.&lt;br /&gt;
&lt;br /&gt;
Many reviewers were involved in the creation of this documentation. Special thanks go to Michael Hönnig who was one of the few who reviewed almost every single word. His input also played a decisive role in how the documentation was structured. A big thank you also goes to Diane O&amp;#039;Brien for taking on the daunting task of reviewing the final draft and providing us with extensive feed back at such short notice.&lt;br /&gt;
&lt;br /&gt;
When looking at the diagrams and graphics, it is clear that a creative person with the right touch for design and aesthetics was involved. Many thanks, therefore, are due Stella Schulze who redrew all of the diagrams and graphics from the originals supplied by various developers. We also thank Svante Schubert who converted the original XML file format into HTML pages and was most patient with us in spite of our demands and changes. Special thanks also to Jörg Heilig, who made this whole project possible.&lt;br /&gt;
&lt;br /&gt;
Jürgen would like to thank Götz Wohlberg for all his help in getting the right people involved and making sure things ran smoothly.&lt;br /&gt;
&lt;br /&gt;
Götz would like to thank Jürgen Schmidt for his never-ending energy to hold everything together and for pushing the contributors in the right direction. He can be considered as the heart of the opus because of his guidance and endurance throughout the entire project.&lt;br /&gt;
&lt;br /&gt;
We would like to take this opportunity to thank all these people – and anyone else we forgot! – for their support.&lt;br /&gt;
&lt;br /&gt;
Jürgen Schmidt, Götz Wohlberg&lt;br /&gt;
&lt;br /&gt;
[[Category: Documentation/Developer&amp;#039;s Guide]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Documentation]]&lt;br /&gt;
{{PDL1}}&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Scripting/Writing_Macros&amp;diff=111954</id>
		<title>Documentation/DevGuide/Scripting/Writing Macros</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Scripting/Writing_Macros&amp;diff=111954"/>
		<updated>2009-02-15T13:28:23Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: /* The HelloWorld macro */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/ScriptingTOC&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Scripting/Macro Recording&lt;br /&gt;
|NextPage=Documentation/DevGuide/Scripting/How the Scripting Framework Works&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:Writing Macros}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
=== The HelloWorld macro ===&lt;br /&gt;
&lt;br /&gt;
When the user creates a new macro in BeanShell or JavaScript, the default content of the macro is the HelloWorld. Here is what the code looks like for BeanShell:&lt;br /&gt;
&lt;br /&gt;
  import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
  &lt;br /&gt;
  import com.sun.star.text.XTextDocument;&lt;br /&gt;
  import com.sun.star.text.XText;&lt;br /&gt;
  import com.sun.star.text.XTextRange;&lt;br /&gt;
  &lt;br /&gt;
  oDoc = context.getDocument();&lt;br /&gt;
  xTextDoc = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class,oDoc);&lt;br /&gt;
  xText = xTextDoc.getText();&lt;br /&gt;
  xTextRange = xText.getEnd();&lt;br /&gt;
  xTextRange.setString( &amp;quot;Hello World (in BeanShell)&amp;quot; );&lt;br /&gt;
  &lt;br /&gt;
  // BeanShell OpenOffice.org scripts should always return 0&lt;br /&gt;
  return 0;&lt;br /&gt;
&lt;br /&gt;
Here is the same code in JavaScript:&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  importClass(Packages.com.sun.star.uno.UnoRuntime);&lt;br /&gt;
  importClass(Packages.com.sun.star.text.XTextDocument);&lt;br /&gt;
  importClass(Packages.com.sun.star.text.XText);&lt;br /&gt;
  importClass(Packages.com.sun.star.text.XTextRange);&lt;br /&gt;
  &lt;br /&gt;
  oDoc = XSCRIPTCONTEXT.getDocument();&lt;br /&gt;
  xTextDoc = UnoRuntime.queryInterface(XTextDocument,oDoc);&lt;br /&gt;
  xText = xTextDoc.getText();&lt;br /&gt;
  xTextRange = xText.getEnd();&lt;br /&gt;
  xTextRange.setString( &amp;quot;Hello World (in JavaScript)&amp;quot; );&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Here is the code for HelloWorld in Java:&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
  import com.sun.star.frame.XModel;&lt;br /&gt;
  import com.sun.star.text.XTextDocument;&lt;br /&gt;
  import com.sun.star.text.XTextRange;&lt;br /&gt;
  import com.sun.star.text.XText;&lt;br /&gt;
  import com.sun.star.script.provider.XScriptContext;&lt;br /&gt;
  &lt;br /&gt;
  public class HelloWorld {&lt;br /&gt;
      public static void printHW(XScriptContext xScriptContext)&lt;br /&gt;
      {&lt;br /&gt;
          XModel xDocModel = xScriptContext.getDocument();&lt;br /&gt;
    &lt;br /&gt;
          // getting the text document object&lt;br /&gt;
          XTextDocument xtextdocument = (XTextDocument) UnoRuntime.queryInterface(&lt;br /&gt;
              XTextDocument.class, xDocModel);&lt;br /&gt;
      &lt;br /&gt;
          XText xText = xtextdocument.getText();&lt;br /&gt;
          XTextRange xTextRange = xText.getEnd();&lt;br /&gt;
          xTextRange.setString( &amp;quot;Hello World (in Java)&amp;quot; );&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
The table below outlines some of the features of macro development in the different languages:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=4 style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|-bgcolor=#EDEDED&lt;br /&gt;
!Language &lt;br /&gt;
!Interpreted &lt;br /&gt;
!Typeless &lt;br /&gt;
!Editor &lt;br /&gt;
!Debugger &lt;br /&gt;
|-&lt;br /&gt;
|BeanShell &lt;br /&gt;
|Yes &lt;br /&gt;
|Yes &lt;br /&gt;
|Yes &lt;br /&gt;
|No &lt;br /&gt;
|-&lt;br /&gt;
|JavaScript &lt;br /&gt;
|Yes &lt;br /&gt;
|Yes &lt;br /&gt;
|Yes &lt;br /&gt;
|Yes &lt;br /&gt;
|-&lt;br /&gt;
|Java &lt;br /&gt;
|No &lt;br /&gt;
|No &lt;br /&gt;
|No &lt;br /&gt;
|No &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Note|Instructions on compiling and deploying Java macros can be found later in this chapter.}}&lt;br /&gt;
&lt;br /&gt;
=== Using the {{PRODUCTNAME}} API from macros ===&lt;br /&gt;
&lt;br /&gt;
All BeanShell, JavaScript and Java macros are supplied with a variable of type &amp;lt;idl&amp;gt;com.sun.star.script.provider.XScriptContext&amp;lt;/idl&amp;gt; which can be used to access the {{PRODUCTNAME}} API. This type has three methods:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;idl&amp;gt;com.sun.star.frame.XModel&amp;lt;/idl&amp;gt; &amp;lt;code&amp;gt;getDocument( )&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns the &amp;lt;code&amp;gt;XModel&amp;lt;/code&amp;gt; interface of the document for which the macro was invoked (see [[Documentation/DevGuide/OfficeDev/Using the Component Framework|Using the Component Framework]])&lt;br /&gt;
* &amp;lt;idl&amp;gt;com.sun.star.frame.XDesktop&amp;lt;/idl&amp;gt; &amp;lt;code&amp;gt;getDesktop( )&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns the &amp;lt;code&amp;gt;XDesktop&amp;lt;/code&amp;gt; interface for the application which can be used to access open document, and load documents (see [[Documentation/DevGuide/OfficeDev/Using the Desktop|Using the Desktop]])&lt;br /&gt;
* &amp;lt;idl&amp;gt;com.sun.star.uno.XComponentContext&amp;lt;/idl&amp;gt; &amp;lt;code&amp;gt;getComponentContext( )&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns the &amp;lt;code&amp;gt;XComponentContext&amp;lt;/code&amp;gt; interface which is used to create instances of services (see [[Documentation/DevGuide/ProUNO/Service Manager and Component Context|Service Manager and Component Context]])&lt;br /&gt;
&lt;br /&gt;
Depending on the language the macro accesses the &amp;lt;code&amp;gt;XScriptContext&amp;lt;/code&amp;gt; type in different ways:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;BeanShell&amp;#039;&amp;#039;&amp;#039;: Using the global variable &amp;lt;code&amp;gt;XSCRIPTCONTEXT&amp;lt;/code&amp;gt;&lt;br /&gt;
  oDoc = XSCRIPTCONTEXT.getDocument();&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;JavaScript&amp;#039;&amp;#039;&amp;#039;: Using the global variable &amp;lt;code&amp;gt;XSCRIPTCONTEXT&amp;lt;/code&amp;gt;&lt;br /&gt;
  oDoc = XSCRIPTCONTEXT.getDocument();&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Java&amp;#039;&amp;#039;&amp;#039;: The first parameter passed to the macro method is always of type &amp;lt;code&amp;gt;XScriptContext&amp;lt;/code&amp;gt;&lt;br /&gt;
  Xmodel xDocModel = xScriptContext.getDocument();&lt;br /&gt;
&lt;br /&gt;
=== Handling arguments passed to macros ===&lt;br /&gt;
&lt;br /&gt;
In certain cases arguments may be passed to macros, for example, when a macro is assigned to a button in a document. In this case the arguments are passed to the macro as follows:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;BeanShell&amp;#039;&amp;#039;&amp;#039;: In the global &amp;lt;code&amp;gt;Object[]&amp;lt;/code&amp;gt; variable &amp;lt;code&amp;gt;ARGUMENTS&amp;lt;/code&amp;gt;&lt;br /&gt;
  event = (ActionEvent) ARGUMENTS[0];&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;JavaScript&amp;#039;&amp;#039;&amp;#039;: In the global &amp;lt;code&amp;gt;Object[]&amp;lt;/code&amp;gt; variable &amp;lt;code&amp;gt;ARGUMENTS&amp;lt;/code&amp;gt;&lt;br /&gt;
  event = ARGUMENTS[0];&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Java&amp;#039;&amp;#039;&amp;#039;: The arguments are passed as an &amp;lt;code&amp;gt;Object[]&amp;lt;/code&amp;gt; in the second parameter to the macro method&lt;br /&gt;
  public void handleButtonPress(&lt;br /&gt;
      XScriptContext xScriptContext, Object[] args)&lt;br /&gt;
&lt;br /&gt;
Each of the arguments in the &amp;lt;code&amp;gt;Object[]&amp;lt;/code&amp;gt; are of the UNO type Any. For more information on how the Any type is used in Java see [[Documentation/DevGuide/ProUNO/Java/Type Mappings|Type Mappings]].&lt;br /&gt;
&lt;br /&gt;
The ButtonPressHandler macros in the Highlight library of a {{PRODUCTNAME}} installation show how a macro can handle arguments.&lt;br /&gt;
&lt;br /&gt;
=== Creating dialogs from macros ===&lt;br /&gt;
&lt;br /&gt;
Dialogs which have been built in the Dialog Editor can be loaded by macros using the &amp;lt;idl&amp;gt;com.sun.star.awt.XDialogProvider&amp;lt;/idl&amp;gt; API. The &amp;lt;code&amp;gt;XDialogProvider&amp;lt;/code&amp;gt; interface has one method &amp;lt;code&amp;gt;createDialog()&amp;lt;/code&amp;gt; which takes a string as a parameter. This string is the URL to the dialog. The URL is formed as follows:&lt;br /&gt;
&lt;br /&gt;
  vnd.sun.star.script:DIALOGREF?location=[application|document]&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;DIALOGREF&amp;lt;/code&amp;gt; is the name of the dialog that you want to create, and location is either application or document depending on where the dialog is stored.&lt;br /&gt;
&lt;br /&gt;
For example if you wanted to load dialog called MyDialog, which is in a Dialog Library called MyDialogLibrary in the {{PRODUCTNAME}} dialogs area of your installation then the URL would be:&lt;br /&gt;
&lt;br /&gt;
  vnd.sun.star.script:MyDialogLibrary.MyDialog?location=application&lt;br /&gt;
&lt;br /&gt;
If you wanted to load a dialog called MyDocumentDialog which in a library called MyDocumentLibrary which is located in a document then the URL would be:&lt;br /&gt;
&lt;br /&gt;
  vnd.sun.star.script:MyDocumentLibrary.MyDocumentDialog?location=document&lt;br /&gt;
&lt;br /&gt;
The following code shows how to create a dialog from a Java macro:&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  public XDialog getDialog(XScriptContext context)&lt;br /&gt;
  {&lt;br /&gt;
      XDialog theDialog;&lt;br /&gt;
  &lt;br /&gt;
      // We must pass the XModel of the current document when creating a DialogProvider object&lt;br /&gt;
      Object[] args = new Object[1];&lt;br /&gt;
      args[0] = context.getDocument();&lt;br /&gt;
    &lt;br /&gt;
      Object obj;&lt;br /&gt;
      try {&lt;br /&gt;
          obj = xmcf.createInstanceWithArgumentsAndContext(&lt;br /&gt;
              &amp;quot;com.sun.star.awt.DialogProvider&amp;quot;, args, context.getComponentContext());&lt;br /&gt;
      }&lt;br /&gt;
      catch (com.sun.star.uno.Exception e) {&lt;br /&gt;
          System.err.println(&amp;quot;Error getting DialogProvider object&amp;quot;);&lt;br /&gt;
          return null;&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      XDialogProvider xDialogProvider = (XDialogProvider)&lt;br /&gt;
          UnoRuntime.queryInterface(XDialogProvider.class, obj);&lt;br /&gt;
      &lt;br /&gt;
      // Got DialogProvider, now get dialog &lt;br /&gt;
      try {&lt;br /&gt;
          theDialog = xDialogProvider.createDialog(&lt;br /&gt;
              &amp;quot;vnd.sun.star.script:MyDialogLibrary.MyDialog?location=application&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
      catch (java.lang.Exception e) {&lt;br /&gt;
          System.err.println(&amp;quot;Got exception on first creating dialog: &amp;quot; + e.getMessage());&lt;br /&gt;
      }&lt;br /&gt;
      return theDialog;&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
=== Compiling and Deploying Java macros ===&lt;br /&gt;
&lt;br /&gt;
Because Java is a compiled language it is not possible to execute Java source code as a macro directly from within {{PRODUCTNAME}}. The code must first be compiled and then deployed within a {{PRODUCTNAME}} installation or document. The following steps show how to create a Java macro using the HelloWorld example code:&lt;br /&gt;
&lt;br /&gt;
* Create a &amp;#039;&amp;#039;HelloWorld&amp;#039;&amp;#039; directory for your macro&lt;br /&gt;
* Create a &amp;#039;&amp;#039;HelloWorld.java&amp;#039;&amp;#039; file using the HelloWorld source code&lt;br /&gt;
* Compile the &amp;#039;&amp;#039;HelloWorld.java&amp;#039;&amp;#039; file. The following jar files from the &amp;#039;&amp;#039;program/classes&amp;#039;&amp;#039; directory of a {{PRODUCTNAME}} installation must be in the classpath: &amp;#039;&amp;#039;ridl.jar&amp;#039;&amp;#039;, &amp;#039;&amp;#039;unoil.jar&amp;#039;&amp;#039;, &amp;#039;&amp;#039;jurt.jar&amp;#039;&amp;#039;&lt;br /&gt;
* Create a &amp;#039;&amp;#039;HelloWorld.jar&amp;#039;&amp;#039; file containing the &amp;#039;&amp;#039;HelloWorld.class&amp;#039;&amp;#039; file&lt;br /&gt;
* Create a &amp;#039;&amp;#039;parcel-descriptor.xml&amp;#039;&amp;#039; file for your macro&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;
  &lt;br /&gt;
  &amp;lt;parcel language=&amp;quot;Java&amp;quot; xmlns:parcel=&amp;quot;scripting.dtd&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;script language=&amp;quot;Java&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;locale lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;displayname value=&amp;quot;HelloWorld&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;&lt;br /&gt;
          Prints &amp;quot;Hello World&amp;quot;.&lt;br /&gt;
        &amp;lt;/description&amp;gt;&lt;br /&gt;
      &amp;lt;/locale&amp;gt;&lt;br /&gt;
      &amp;lt;functionname value=&amp;quot;HelloWorld.printHW&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;logicalname value=&amp;quot;HelloWorld.printHW&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;languagedepprops&amp;gt;&lt;br /&gt;
          &amp;lt;prop name=&amp;quot;classpath&amp;quot; value=&amp;quot;HelloWorld.jar&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;/languagedepprops&amp;gt;&lt;br /&gt;
    &amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;/parcel&amp;gt;&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
The &amp;#039;&amp;#039;parcel-descriptor.xml&amp;#039;&amp;#039; file is used by the Scripting Framework to find macros. The functionname element indicates the name of the Java method which should be executed as a macro. The classpath element can be used to indicate any jar or class files which are used by the macro. If the classpath element is not included, then the directory in which the &amp;#039;&amp;#039;parcel-desciptor.xml&amp;#039;&amp;#039; file is found and any jar files in that directory will be used as the classpath. The necessary Java UNO classes are available automatically.&lt;br /&gt;
&lt;br /&gt;
* Copy the HelloWorld directory into the &amp;#039;&amp;#039;share/Scripts/java&amp;#039;&amp;#039; directory of a {{PRODUCTNAME}} installation or into the &amp;#039;&amp;#039;user/Scripts/java&amp;#039;&amp;#039; directory of a user installation. If you want to deploy the macro to a document you need to place it in a &amp;#039;&amp;#039;Scripts/java&amp;#039;&amp;#039; directory within the document zip file.&lt;br /&gt;
* If {{PRODUCTNAME}} is running, you will need to restart it in order for the macro to appear in the Macro Selector dialog.&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Note|The &amp;#039;&amp;#039;parcel-descriptor.xml&amp;#039;&amp;#039; file is also used to detect BeanShell and JavaScript macros. It is created automatically when creating macros using the Organizer dialogs for BeanShell and JavaScript.}}&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Scripting]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Scripting/Macro_Recording&amp;diff=111953</id>
		<title>Documentation/DevGuide/Scripting/Macro Recording</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Scripting/Macro_Recording&amp;diff=111953"/>
		<updated>2009-02-15T13:05:32Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/ScriptingTOC&lt;br /&gt;
|Scripting2b=block&lt;br /&gt;
|ScriptingEdit=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Scripting/Basic and Dialogs&lt;br /&gt;
|NextPage=Documentation/DevGuide/Scripting/Writing Macros&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:Macro Recording}}&lt;br /&gt;
Macro Recording is only supported for {{PRODUCTNAME}} Basic and is accessible via the &amp;#039;&amp;#039;&amp;#039;Tools &amp;gt; Macro &amp;gt; Record Macro&amp;#039;&amp;#039;&amp;#039; menu item.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Scripting]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Scripting/JavaScript_Editor&amp;diff=111952</id>
		<title>Documentation/DevGuide/Scripting/JavaScript Editor</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Scripting/JavaScript_Editor&amp;diff=111952"/>
		<updated>2009-02-15T13:04:43Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/ScriptingTOC&lt;br /&gt;
|Scripting2b=block&lt;br /&gt;
|ScriptingEdit=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Scripting/BeanShell Editor&lt;br /&gt;
|NextPage=Documentation/DevGuide/Scripting/Basic and Dialogs&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:JavaScript Editor}}&lt;br /&gt;
Clicking the Edit button in the JavaScript Organizer will open the Rhino JavaScript Debugger:&lt;br /&gt;
&lt;br /&gt;
[[Image:JavaScriptEditorNoTabs.png|none|thumb|400px|JavaScript Debugger]]&lt;br /&gt;
&lt;br /&gt;
The source of the JavaScript macro is displayed in the main window. The line numbers are shown in the left-hand sidebar. Clicking in the sidebar will set and remove breakpoints in the macro. There is currently a bug in the debugger which is not clearing the symbol in the sidebar when breakpoints are removed.&lt;br /&gt;
&lt;br /&gt;
The contents of the text window can be saved by selecting the &amp;#039;&amp;#039;&amp;#039;File &amp;gt; Save&amp;#039;&amp;#039;&amp;#039; menu item. The macro can be run by selecting the &amp;#039;&amp;#039;&amp;#039;File &amp;gt; Run&amp;#039;&amp;#039;&amp;#039; menu item. This activates the four buttons above the main text window:&lt;br /&gt;
&lt;br /&gt;
* Break&lt;br /&gt;
:Sets a breakpoint at the line where the cursor is.&lt;br /&gt;
* Go&lt;br /&gt;
:Runs the macro, stopping at the next breakpoint (if one is set).&lt;br /&gt;
* Step Into&lt;br /&gt;
:Runs a single line of code, stepping into functions if they exist and then stop.&lt;br /&gt;
* Step Over&lt;br /&gt;
:Runs a single line of code, without stepping into functions and then stop.&lt;br /&gt;
* Step Out&lt;br /&gt;
:Continues the execution of the macro until it exits the current function.&lt;br /&gt;
There are two other panes in the debugger which are hidden by default. These allow the developer to view the stack and watch variables:&lt;br /&gt;
&lt;br /&gt;
[[Image:JavaScriptEditorWithTabs.png|none|thumb|400px|JavaScript Debugger with Stack and Watch tabs displayed]]&lt;br /&gt;
&lt;br /&gt;
For more information on the Rhino JavaScript Debugger see [http://www.mozilla.org/rhino/debugger.html http://www.mozilla.org/rhino/debugger.html].&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Scripting]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Scripting/Editing,_Creating_and_Managing_Macros&amp;diff=111951</id>
		<title>Documentation/DevGuide/Scripting/Editing, Creating and Managing Macros</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Scripting/Editing,_Creating_and_Managing_Macros&amp;diff=111951"/>
		<updated>2009-02-15T13:03:32Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/ScriptingTOC&lt;br /&gt;
|Scripting2b=block&lt;br /&gt;
|ScriptingEdit=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Scripting/Running Macros&lt;br /&gt;
|NextPage=Documentation/DevGuide/Scripting/The Organizer dialogs for BeanShell and JavaScript&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:Editing, Creating and Managing Macros}}&lt;br /&gt;
The Scripting Framework provides support for editing, creating and managing macros via the &amp;#039;&amp;#039;&amp;#039;Tools &amp;gt; Macro &amp;gt; Organize Macros&amp;#039;&amp;#039;&amp;#039; menu. From there you can open a macro management dialog for BeanShell, JavaScript or {{PRODUCTNAME}} Basic macros.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Scripting]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Scripting/Running_Macros&amp;diff=111950</id>
		<title>Documentation/DevGuide/Scripting/Running Macros</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/Scripting/Running_Macros&amp;diff=111950"/>
		<updated>2009-02-15T13:02:48Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/ScriptingTOC&lt;br /&gt;
|Scripting2b=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/Scripting/Using the Scripting Framework&lt;br /&gt;
|NextPage=Documentation/DevGuide/Scripting/Editing, Creating and Managing Macros&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:Running Macros}}&lt;br /&gt;
To run a macro use the menu item &amp;#039;&amp;#039;&amp;#039;Tools &amp;gt; Macros &amp;gt; Run Macro...&amp;#039;&amp;#039;&amp;#039; This opens the Macro Selector dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:MacroSelectorDialog.png|none|thumb|400px|Macro Selector dialog]]&lt;br /&gt;
&lt;br /&gt;
The Library list box contains a tree representation of all macro libraries. At the top level, there are three entries:&lt;br /&gt;
&lt;br /&gt;
* My Macros (macros belonging to the current user)&lt;br /&gt;
* {{PRODUCTNAME}} Macros (macros available to all users of the installation)&lt;br /&gt;
* DocumentName Macros (macros contained in the currently active document)&lt;br /&gt;
Each of these entries can be expanded to show any macro libraries they contain. When a library has been selected, the macros contained in that library are displayed in the Macro name list box. When a macro is selected its description, if one exists, is displayed at the bottom of the dialog. Selecting a macro and clicking Run will close the dialog and run the macro. Clicking Cancel will close the dialog without running a macro.&lt;br /&gt;
&lt;br /&gt;
Macros can also be run directly from the Macro Organizer [[Documentation/DevGuide/Scripting/Editing, Creating and Managing Macros|Editing, Creating and Managing Macros]] and from some of the macro editors.&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Scripting]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/OOo3_User_Guides/Getting_Started/Choosing_language_settings&amp;diff=111948</id>
		<title>Documentation/OOo3 User Guides/Getting Started/Choosing language settings</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/OOo3_User_Guides/Getting_Started/Choosing_language_settings&amp;diff=111948"/>
		<updated>2009-02-15T12:39:31Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:Choosing language settings}}&lt;br /&gt;
{{Documentation/SetupOOo3TOC&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/OOo3_User_Guides/Getting Started/Choosing options for loading and saving documents&lt;br /&gt;
|NextPage=Documentation/OOo3_User_Guides/Getting Started/Internet options}}&lt;br /&gt;
You may need to do several things to set the language settings to what you want:&lt;br /&gt;
&lt;br /&gt;
* Install the required dictionaries&lt;br /&gt;
* Change some locale and language settings&lt;br /&gt;
* Choose spelling options&lt;br /&gt;
&lt;br /&gt;
== Install the required dictionaries ==&lt;br /&gt;
OOo 3.0 automatically installs several dictionaries with the program. To add other dictionaries, use &amp;#039;&amp;#039;&amp;#039;Tools &amp;gt; Language &amp;gt; More Dictionaries Online&amp;#039;&amp;#039;&amp;#039;. OOo will open your default web browser to a page containing links to additional dictionaries that you can install. Follow the prompts to install them.&lt;br /&gt;
&lt;br /&gt;
== Change locale and language settings ==&lt;br /&gt;
You can change some details of the locale and language settings that OOo uses for all documents, or for specific documents.&lt;br /&gt;
&lt;br /&gt;
In the Options dialog, click &amp;#039;&amp;#039;&amp;#039;Language Settings &amp;gt; Languages&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Options-LangSet.png|thumb|none|500px|&amp;#039;&amp;#039;Language Setting Options.&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
On the right-hand side of the &amp;#039;&amp;#039;Language Settings – Languages&amp;#039;&amp;#039; page, change the &amp;#039;&amp;#039;User interface, Locale setting&amp;#039;&amp;#039;, &amp;#039;&amp;#039;Default currency&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;Default languages for documents&amp;#039;&amp;#039; as required. In the example, English (UK) has been chosen for all the appropriate settings.&lt;br /&gt;
&lt;br /&gt;
If you want the language (dictionary) setting to apply to the current document only, instead of being the default for all new documents, select the option labelled &amp;#039;&amp;#039;For the current document only&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Options-languages.png|thumb|none|500px|&amp;#039;&amp;#039;Choosing language options.&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
If necessary, select the options to enable support for Asian languages (Chinese, Japanese, Korean) and support for CTL (complex text layout) languages such as Hindi, Thai, Hebrew, and Arabic. If you choose either of these options, the next time you open this dialog, you will see some extra choices under Language Settings, as shown below. These choices (&amp;#039;&amp;#039;Searching in Japanese&amp;#039;&amp;#039;, &amp;#039;&amp;#039;Asian Layout&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;Complex Text Layout&amp;#039;&amp;#039;) are not discussed here.&lt;br /&gt;
&lt;br /&gt;
[[Image:Options-languages2.png|thumb|none|500px|&amp;#039;&amp;#039;Extra pages when enhanced language support options are selected.&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
== Choose spelling options ==&lt;br /&gt;
To choose the options for checking spelling, click &amp;#039;&amp;#039;&amp;#039;Language Settings &amp;gt; Writing Aids&amp;#039;&amp;#039;&amp;#039;. In the &amp;#039;&amp;#039;Options&amp;#039;&amp;#039; section of the page, choose the settings that are useful for you. Some considerations:&lt;br /&gt;
&lt;br /&gt;
* If you do not want spelling checked while you type, deselect &amp;#039;&amp;#039;Check spelling as you type &amp;#039;&amp;#039;and select &amp;#039;&amp;#039;Do not mark errors&amp;#039;&amp;#039;. (To find the second item, scroll down in the Options list.)&lt;br /&gt;
* If you use a custom dictionary that includes words in all upper case and words with numbers (for example, AS/400), select &amp;#039;&amp;#039;Check uppercase words&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Check words with numbers&amp;#039;&amp;#039;.&lt;br /&gt;
* &amp;#039;&amp;#039;Check special regions&amp;#039;&amp;#039; includes headers, footers, frames, and tables when checking spelling.&lt;br /&gt;
&lt;br /&gt;
Here you can also check which user-defined (custom) dictionaries are active by default, and add or remove dictionaries, by clicking the &amp;#039;&amp;#039;&amp;#039;New&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;Delete&amp;#039;&amp;#039;&amp;#039; buttons. &lt;br /&gt;
&lt;br /&gt;
[[Image:Options-spelling.png|thumb|none|500px|&amp;#039;&amp;#039;Choosing languages, dictionaries, and options for checking spelling.&amp;#039;&amp;#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{CCBY}}&lt;br /&gt;
[[Category:Getting Started (Documentation)]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Template:Documentation/MasterTOC&amp;diff=111931</id>
		<title>Template:Documentation/MasterTOC</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Template:Documentation/MasterTOC&amp;diff=111931"/>
		<updated>2009-02-14T14:51:25Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div id=&amp;quot;tocwrapper&amp;quot; class=&amp;quot;docooo_tocwrapper&amp;quot; style=&amp;quot;float:right;  width: 200px; padding: 0px; border: 3px solid #fff; border-left: 20px solid #fff; border-bottom: 20px solid #fff; margin-left: 40px; margin-bottom: 20px; margin-top: -5px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
  &amp;lt;div id=&amp;quot;icon&amp;quot; style=&amp;quot;float:right; margin-right: -10px; margin-top: -10px;&amp;quot;&amp;gt;[[Image:Book.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;{{{bookid}}}&amp;quot; style=&amp;quot;border:1px solid #9BC0F5; padding: 0px; font-size: xx-small; background-color: #FFF;&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;doc_toctitle&amp;quot; class=&amp;quot;docooo_toctitle docsection&amp;quot;&amp;gt;{{{booktitle}}}&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;parttitle&amp;quot; class=&amp;quot;docooo_parttitle&amp;quot; style=&amp;quot;padding: 1px;font-weight: bold; text-align: left; border-bottom: 1px solid #9099a8; display:{{{ShowParttitle|none}}}&amp;quot;&amp;gt;&lt;br /&gt;
: {{{parttitle}}}&lt;br /&gt;
 &amp;lt;div id=&amp;quot;tocfooter&amp;quot; class=&amp;quot;docooo_tocfooter&amp;quot; style=&amp;quot;padding: 1px;&amp;quot;&amp;gt; &lt;br /&gt;
{|border=0 width=100%&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;|&amp;lt;span style=&amp;quot;display: {{{ShowPrevPart|none}}}&amp;quot;&amp;gt;[[{{{PrevPart}}}|&amp;amp;lt; Previous Section]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align:right;&amp;quot;|&amp;lt;span style=&amp;quot;display: {{{ShowNextPart|none}}}&amp;quot;&amp;gt;[[{{{NextPart}}}|Next Section &amp;amp;gt;]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;tocbody&amp;quot; class=&amp;quot;docooo_tocbody&amp;quot; style=&amp;quot;padding: 6px;&amp;quot;&amp;gt;&lt;br /&gt;
{{{toccontent}}}&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;PrevNextPage&amp;quot; class=&amp;quot;docooo_prevnextpage&amp;quot; style=&amp;quot;font-size: xx-small!important; margin-bottom: 3px; margin-top: 3px;&amp;quot;&amp;gt;&lt;br /&gt;
{|border=0 width=100%&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;|&amp;lt;span style=&amp;quot;display: {{{ShowPrevPage|none}}}&amp;quot;&amp;gt;[[{{{PrevPage}}}|&amp;amp;lt; Previous Page]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align:right;&amp;quot;|&amp;lt;span style=&amp;quot;display: {{{ShowNextPage|none}}}&amp;quot;&amp;gt;[[{{{NextPage}}}|Next Page &amp;amp;gt;]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Usage of Parameters==&lt;br /&gt;
;ShowPrevPage:set to &amp;quot;block&amp;quot; to show the &amp;quot;previous page&amp;quot; link, set to &amp;quot;none&amp;quot; to hide it. This parameter is not set in the TOC based on this template, but rather in the file containing that TOC. So the parameter value is &amp;quot;passed through&amp;quot; the TOC to this template and therefore &amp;#039;&amp;#039;&amp;#039;must explicitly&amp;#039;&amp;#039;&amp;#039; be set to none to hide the link. The TOC must use &amp;lt;nowiki&amp;gt;{{{ShowPrevPage}}}&amp;lt;/nowiki&amp;gt; as the parameter value to ensure passing along.&lt;br /&gt;
;PrevPage:the path to the previous page (no surrounding &amp;quot;[&amp;quot;)&lt;br /&gt;
;ShowNextPage:set to &amp;quot;block&amp;quot; to show the &amp;quot;next page&amp;quot; link, set to &amp;quot;none&amp;quot; to hide it. This parameter is not set in the TOC based on this template, but rather in the file containing that TOC. So the parameter value is &amp;quot;passed through&amp;quot; the TOC to this template and therefore &amp;#039;&amp;#039;&amp;#039;must explicitly&amp;#039;&amp;#039;&amp;#039; be set to none to hide the link. The TOC must use &amp;lt;nowiki&amp;gt;{{{ShowNextPage}}}&amp;lt;/nowiki&amp;gt; as the parameter value to ensure passing along.&lt;br /&gt;
;NextPage:the path to the previous page (no surrounding &amp;quot;[&amp;quot;)&lt;br /&gt;
;bookid:The id for the book (not yet evaluated)&lt;br /&gt;
;booktitle:The book title that appears at the top of the TOC in full wiki syntax (i.e. as a link: &amp;lt;nowiki&amp;gt;[[MyGuide|My Great Manual]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
;ShowParttitle:set to &amp;quot;block&amp;quot; to show the part title. This will be used in Sub-TOCs. It will default to hidden when not specified.&lt;br /&gt;
;parttitle:The title of the part that this Sub-TOC covers in full wiki syntax (i.e. as a link: &amp;lt;nowiki&amp;gt;[[MyGuide/MyPart|Part 1: My Great Part]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
;toccontent:The content of the TOC as lists and divs.&lt;br /&gt;
;ShowPrevPart:set to &amp;quot;block&amp;quot; in to show the &amp;quot;previous part&amp;quot; link at the bottom of the TOC. If this parameter is set at the TOC level (and not on the file level like the prev/next page parameter), it will default to hidden when not specified.&lt;br /&gt;
;PrevPart:the path to the first page of the previous part (no surrounding &amp;quot;[&amp;quot;)&lt;br /&gt;
;ShowNextPart:set to &amp;quot;block&amp;quot; in to show the &amp;quot;previous part&amp;quot; link at the bottom of the TOC. If this parameter is set at the TOC level (and not on the file level like the prev/next page parameter), it will default to hidden when not specified.&lt;br /&gt;
;NextPart:the path to the first page of the next part (no surrounding &amp;quot;[&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Note|The style classes are not yet created in the css file}}&lt;br /&gt;
&lt;br /&gt;
=== Simulated example ===&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ShowPrevPage&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;none&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ShowNextPage&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;block&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NextPage&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;The Next Page&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;bookid&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;1234&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;booktitle&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;[[My Manual]]&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ShowParttitle&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;block&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;parttitle&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;[[The First Part]]&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ShowPrevPart&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;none&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ShowNextPart&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;block&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NextPart&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;The Second Part&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;toccontent&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;* Chapter&amp;lt;br /&amp;gt; * Chapter&amp;lt;br /&amp;gt; * Chapter&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px dotted #000; padding: 20px; width: 400px; margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;tocwrapper&amp;quot; class=&amp;quot;docooo_tocwrapper&amp;quot; style=&amp;quot;width: 200px; padding: 0px; border: 5px solid #fff;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;icon&amp;quot; style=&amp;quot;float:right; margin-right: -10px; margin-top: -10px;&amp;quot;&amp;gt;[[Image:Book.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;1234&amp;quot; style=&amp;quot;border:1px solid #9099a8; padding: 0px; font-size: xx-small; background-color: #FFF;&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;toctitle&amp;quot; class=&amp;quot;docooo_toctitle&amp;quot; style=&amp;quot;background-color: #c5d0e1; border: 0px solid #9099a8; padding: 1px;font-weight: bold; text-align: left; font-size:120%;&amp;quot;&amp;gt;[[My Manual]]&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;parttitle&amp;quot; class=&amp;quot;docooo_parttitle&amp;quot; style=&amp;quot;padding: 1px;font-weight: bold; text-align: left; border-bottom: 1px solid #9099a8; display:block&amp;quot;&amp;gt;&lt;br /&gt;
: [[The First Part]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
 &amp;lt;div id=&amp;quot;tocfooter&amp;quot; class=&amp;quot;docooo_tocfooter&amp;quot; style=&amp;quot;padding: 1px;&amp;quot;&amp;gt; &lt;br /&gt;
{|border=0 width=100%&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;|&amp;lt;span style=&amp;quot;display: {{{ShowPrevPart|none}}}&amp;quot;&amp;gt;[[{{{PrevPart}}}|&amp;amp;lt; Previous Part]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align:right;&amp;quot;|&amp;lt;span style=&amp;quot;display: block&amp;quot;&amp;gt;[[The Second Part|Next Part &amp;amp;gt;]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;tocbody&amp;quot; class=&amp;quot;docooo_tocbody&amp;quot; style=&amp;quot;padding: 6px;&amp;quot;&amp;gt;&lt;br /&gt;
* Chapter&lt;br /&gt;
* Chapter&lt;br /&gt;
* Chapter&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;PrevNextPage&amp;quot; class=&amp;quot;docooo_prevnextpage&amp;quot; style=&amp;quot;font-size: small; margin-bottom: 10px;&amp;quot;&amp;gt;&lt;br /&gt;
{|border=0 width=100%&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;|&amp;lt;span style=&amp;quot;display: none&amp;quot;&amp;gt;[[{{{PrevPage}}}|&amp;amp;lt; Previous Page]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align:right;&amp;quot;|&amp;lt;span style=&amp;quot;display: block&amp;quot;&amp;gt;[[The Next Page|Next Page &amp;amp;gt;]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Calculated example===&lt;br /&gt;
(note: not usable in preview mode while editing this template):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Documentation/MasterTOC&lt;br /&gt;
|ShowPrevPage=none&lt;br /&gt;
|ShowNextPage=block&lt;br /&gt;
|NextPage=The Next Page&lt;br /&gt;
|bookid=1234&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|booktitle=[[My Manual]]&lt;br /&gt;
|ShowParttitle=block&lt;br /&gt;
|parttitle=[[The First Part]]&lt;br /&gt;
|ShowPrevPart=none&lt;br /&gt;
|ShowNextPart=block&lt;br /&gt;
|NextPart=The Second Part&lt;br /&gt;
|toccontent=* Chapter&lt;br /&gt;
* Chapter&lt;br /&gt;
* Chapter&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px dotted #000; padding: 20px; width: 400px; height: 200px; margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Documentation/MasterTOC&lt;br /&gt;
|ShowPrevPage=none&lt;br /&gt;
|ShowNextPage=block&lt;br /&gt;
|NextPage=The Next Page&lt;br /&gt;
|bookid=1234&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|booktitle=[[My Manual]]&lt;br /&gt;
|ShowParttitle=block&lt;br /&gt;
|parttitle=[[The First Part]]&lt;br /&gt;
|ShowPrevPart=none&lt;br /&gt;
|ShowNextPart=block&lt;br /&gt;
|NextPart=The Second Part&lt;br /&gt;
|toccontent=* Chapter&lt;br /&gt;
* Chapter&lt;br /&gt;
* Chapter&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Template:Documentation/MasterTOC&amp;diff=111930</id>
		<title>Template:Documentation/MasterTOC</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Template:Documentation/MasterTOC&amp;diff=111930"/>
		<updated>2009-02-14T14:47:58Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div id=&amp;quot;tocwrapper&amp;quot; class=&amp;quot;docooo_tocwrapper&amp;quot; style=&amp;quot;float:right;  width: 200px; padding: 0px; border: 3px solid #fff; border-left: 20px solid #fff; border-bottom: 20px solid #fff; margin-left: 40px; margin-bottom: 20px; margin-top: -5px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
  &amp;lt;div id=&amp;quot;icon&amp;quot; style=&amp;quot;float:right; margin-right: -10px; margin-top: -10px;&amp;quot;&amp;gt;[[Image:Book.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;{{{bookid}}}&amp;quot; style=&amp;quot;border:1px solid #9BC0F5; padding: 0px; font-size: xx-small; background-color: #FFF;&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;doc_toctitle&amp;quot; class=&amp;quot;docooo_toctitle docsection&amp;quot;&amp;gt;{{{booktitle}}}&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;parttitle&amp;quot; class=&amp;quot;docooo_parttitle&amp;quot; style=&amp;quot;padding: 1px;font-weight: bold; text-align: left; border-bottom: 1px solid #9099a8; display:{{{ShowParttitle|none}}}&amp;quot;&amp;gt;&lt;br /&gt;
: {{{parttitle}}}&lt;br /&gt;
 &amp;lt;div id=&amp;quot;tocfooter&amp;quot; class=&amp;quot;docooo_tocfooter&amp;quot; style=&amp;quot;padding: 1px;&amp;quot;&amp;gt; &lt;br /&gt;
{|border=0 width=100%&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;|&amp;lt;span style=&amp;quot;display: {{{ShowPrevPart|none}}}&amp;quot;&amp;gt;[[{{{PrevPart}}}|&amp;amp;lt; Previous Section]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align:right;&amp;quot;|&amp;lt;span style=&amp;quot;display: {{{ShowNextPart|none}}}&amp;quot;&amp;gt;[[{{{NextPart}}}|Next Section &amp;amp;gt;]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;tocbody&amp;quot; class=&amp;quot;docooo_tocbody&amp;quot; style=&amp;quot;padding: 6px;&amp;quot;&amp;gt;&lt;br /&gt;
{{{toccontent}}}&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;PrevNextPage&amp;quot; class=&amp;quot;docooo_prevnextpage&amp;quot; style=&amp;quot;font-size: xx-small!important; margin-bottom: 3px; margin-top: 3px;&amp;quot;&amp;gt;&lt;br /&gt;
{|border=0 width=100%&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;|&amp;lt;span style=&amp;quot;display: {{{ShowPrevPage|none}}}&amp;quot;&amp;gt;[[{{{PrevPage}}}|&amp;amp;lt; Previous Page]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align:right;&amp;quot;|&amp;lt;span style=&amp;quot;display: {{{ShowNextPage|none}}}&amp;quot;&amp;gt;[[{{{NextPage}}}|Next Page &amp;amp;gt;]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Usage of Parameters==&lt;br /&gt;
;ShowPrevPage:set to &amp;quot;block&amp;quot; to show the &amp;quot;previous page&amp;quot; link, set to &amp;quot;none&amp;quot; to hide it. This parameter is not set in the TOC based on this template, but rather in the file containing that TOC. So the parameter value is &amp;quot;passed through&amp;quot; the TOC to this template and therefore &amp;#039;&amp;#039;&amp;#039;must explicitly&amp;#039;&amp;#039;&amp;#039; be set to none to hide the link. The TOC must use &amp;lt;nowiki&amp;gt;{{{ShowPrevPage}}}&amp;lt;/nowiki&amp;gt; as the parameter value to ensure passing along.&lt;br /&gt;
;PrevPage:the path to the previous page (no surrounding &amp;quot;[&amp;quot;)&lt;br /&gt;
;ShowNextPage:set to &amp;quot;block&amp;quot; to show the &amp;quot;next page&amp;quot; link, set to &amp;quot;none&amp;quot; to hide it. This parameter is not set in the TOC based on this template, but rather in the file containing that TOC. So the parameter value is &amp;quot;passed through&amp;quot; the TOC to this template and therefore &amp;#039;&amp;#039;&amp;#039;must explicitly&amp;#039;&amp;#039;&amp;#039; be set to none to hide the link. The TOC must use &amp;lt;nowiki&amp;gt;{{{ShowNextPage}}}&amp;lt;/nowiki&amp;gt; as the parameter value to ensure passing along.&lt;br /&gt;
;NextPage:the path to the previous page (no surrounding &amp;quot;[&amp;quot;)&lt;br /&gt;
;bookid:The id for the book (not yet evaluated)&lt;br /&gt;
;booktitle:The book title that appears at the top of the TOC in full wiki syntax (i.e. as a link: &amp;lt;nowiki&amp;gt;[[MyGuide|My Great Manual]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
;ShowParttitle:set to &amp;quot;block&amp;quot; to show the part title. This will be used in Sub-TOCs. It will default to hidden when not specified.&lt;br /&gt;
;parttitle:The title of the part that this Sub-TOC covers in full wiki syntax (i.e. as a link: &amp;lt;nowiki&amp;gt;[[MyGuide/MyPart|Part 1: My Great Part]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
;toccontent:The content of the TOC as lists and divs.&lt;br /&gt;
;ShowPrevPart:set to &amp;quot;block&amp;quot; in to show the &amp;quot;previous part&amp;quot; link at the bottom of the TOC. If this parameter is set at the TOC level (and not on the file level like the prev/next page parameter), it will default to hidden when not specified.&lt;br /&gt;
;PrevPart:the path to the first page of the previous part (no surrounding &amp;quot;[&amp;quot;)&lt;br /&gt;
;ShowNextPart:set to &amp;quot;block&amp;quot; in to show the &amp;quot;previous part&amp;quot; link at the bottom of the TOC. If this parameter is set at the TOC level (and not on the file level like the prev/next page parameter), it will default to hidden when not specified.&lt;br /&gt;
;NextPart:the path to the first page of the next part (no surrounding &amp;quot;[&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Note|The style classes are not yet created in the css file}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Bold text&amp;#039;&amp;#039;&amp;#039;[[[[Link title]][[[Image:http://www.example.com link title]][[Media:&amp;lt;math&amp;gt;Example.ogg&amp;lt;/math&amp;gt;--[[User:PYRATE XCHANGE|PYRATE XCHANGE]] 11:15, 7 June 2008 (CEST)--[[User:PYRATE XCHANGE|PYRATE XCHANGE]] 11:15, 7 June 2008 (CEST)]]]]]&lt;br /&gt;
&lt;br /&gt;
=== Simulated example ===&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ShowPrevPage&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;none&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ShowNextPage&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;block&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NextPage&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;The Next Page&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;bookid&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;1234&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;booktitle&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;[[My Manual]]&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ShowParttitle&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;block&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;parttitle&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;[[The First Part]]&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ShowPrevPart&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;none&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ShowNextPart&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;block&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NextPart&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;The Second Part&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;toccontent&amp;#039;&amp;#039;&amp;#039; set to &amp;#039;&amp;#039;&amp;#039;* Chapter&amp;lt;br /&amp;gt; * Chapter&amp;lt;br /&amp;gt; * Chapter&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px dotted #000; padding: 20px; width: 400px; margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;tocwrapper&amp;quot; class=&amp;quot;docooo_tocwrapper&amp;quot; style=&amp;quot;width: 200px; padding: 0px; border: 5px solid #fff;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;icon&amp;quot; style=&amp;quot;float:right; margin-right: -10px; margin-top: -10px;&amp;quot;&amp;gt;[[Image:Book.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;1234&amp;quot; style=&amp;quot;border:1px solid #9099a8; padding: 0px; font-size: xx-small; background-color: #FFF;&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;toctitle&amp;quot; class=&amp;quot;docooo_toctitle&amp;quot; style=&amp;quot;background-color: #c5d0e1; border: 0px solid #9099a8; padding: 1px;font-weight: bold; text-align: left; font-size:120%;&amp;quot;&amp;gt;[[My Manual]]&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;parttitle&amp;quot; class=&amp;quot;docooo_parttitle&amp;quot; style=&amp;quot;padding: 1px;font-weight: bold; text-align: left; border-bottom: 1px solid #9099a8; display:block&amp;quot;&amp;gt;&lt;br /&gt;
: [[The First Part]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
 &amp;lt;div id=&amp;quot;tocfooter&amp;quot; class=&amp;quot;docooo_tocfooter&amp;quot; style=&amp;quot;padding: 1px;&amp;quot;&amp;gt; &lt;br /&gt;
{|border=0 width=100%&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;|&amp;lt;span style=&amp;quot;display: {{{ShowPrevPart|none}}}&amp;quot;&amp;gt;[[{{{PrevPart}}}|&amp;amp;lt; Previous Part]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align:right;&amp;quot;|&amp;lt;span style=&amp;quot;display: block&amp;quot;&amp;gt;[[The Second Part|Next Part &amp;amp;gt;]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;tocbody&amp;quot; class=&amp;quot;docooo_tocbody&amp;quot; style=&amp;quot;padding: 6px;&amp;quot;&amp;gt;&lt;br /&gt;
* Chapter&lt;br /&gt;
* Chapter&lt;br /&gt;
* Chapter&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;PrevNextPage&amp;quot; class=&amp;quot;docooo_prevnextpage&amp;quot; style=&amp;quot;font-size: small; margin-bottom: 10px;&amp;quot;&amp;gt;&lt;br /&gt;
{|border=0 width=100%&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:left;&amp;quot;|&amp;lt;span style=&amp;quot;display: none&amp;quot;&amp;gt;[[{{{PrevPage}}}|&amp;amp;lt; Previous Page]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align:right;&amp;quot;|&amp;lt;span style=&amp;quot;display: block&amp;quot;&amp;gt;[[The Next Page|Next Page &amp;amp;gt;]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Calculated example===&lt;br /&gt;
(note: not usable in preview mode while editing this template):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Documentation/MasterTOC&lt;br /&gt;
|ShowPrevPage=none&lt;br /&gt;
|ShowNextPage=block&lt;br /&gt;
|NextPage=The Next Page&lt;br /&gt;
|bookid=1234&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|booktitle=[[My Manual]]&lt;br /&gt;
|ShowParttitle=block&lt;br /&gt;
|parttitle=[[The First Part]]&lt;br /&gt;
|ShowPrevPart=none&lt;br /&gt;
|ShowNextPart=block&lt;br /&gt;
|NextPart=The Second Part&lt;br /&gt;
|toccontent=* Chapter&lt;br /&gt;
* Chapter&lt;br /&gt;
* Chapter&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px dotted #000; padding: 20px; width: 400px; height: 200px; margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Documentation/MasterTOC&lt;br /&gt;
|ShowPrevPage=none&lt;br /&gt;
|ShowNextPage=block&lt;br /&gt;
|NextPage=The Next Page&lt;br /&gt;
|bookid=1234&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|booktitle=[[My Manual]]&lt;br /&gt;
|ShowParttitle=block&lt;br /&gt;
|parttitle=[[The First Part]]&lt;br /&gt;
|ShowPrevPart=none&lt;br /&gt;
|ShowNextPart=block&lt;br /&gt;
|NextPart=The Second Part&lt;br /&gt;
|toccontent=* Chapter&lt;br /&gt;
* Chapter&lt;br /&gt;
* Chapter&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/JavaBean/API_Overview&amp;diff=111921</id>
		<title>Documentation/DevGuide/JavaBean/API Overview</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/JavaBean/API_Overview&amp;diff=111921"/>
		<updated>2009-02-14T13:26:09Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/JavaBeanTOC&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/JavaBean/The OOoBean by Example&lt;br /&gt;
|NextPage=Documentation/DevGuide/JavaBean/Configuring the Office Bean&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:API Overview}}&lt;br /&gt;
The &amp;lt;tt&amp;gt;OOoBean&amp;lt;/tt&amp;gt; offers methods that can be applied to all {{PRODUCTNAME}} document types.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=4 style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|-bgcolor=#EDEDED&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Methods of &amp;lt;code&amp;gt;com.sun.star.comp.beans.OOoBean&amp;lt;/code&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;OOoBean()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;constructor&amp;lt;/code&amp;gt; - creates an OOoBean with an implicit connection &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;OOoBean(OfficeConnection)&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;constructor&amp;lt;/code&amp;gt; - creates an OOoBean with an explicit connection &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;setOOoStartTimeOut(...)&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; - sets the timeout for methods which start {{PRODUCTNAME}} &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;setOOoCallTimeOut(...)&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; - sets the timeout for other methods &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;SetOOoCheckCycle(...)&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; - sets repeat period for cyclic {{PRODUCTNAME}} alive check &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;setOOoConnection(...)&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; - sets an explicit connection to a {{PRODUCTNAME}} instance  &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;startOOoConnection(...)&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; - starts a connection with an explicit connection URL &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;isOOoConnected()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; - returns whether the OOoBean is connected to a {{PRODUCTNAME}}&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;stopOOoConnection()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; - stops the current connection to {{PRODUCTNAME}} &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;getOOoConnection()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;OfficeConnection&amp;lt;/code&amp;gt; - returns the current connection to {{PRODUCTNAME}} &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;getMultiServiceFactory()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;idls&amp;gt;com.sun.star.lang.XMultiServiceFactory&amp;lt;/idls&amp;gt; -- returns the service factory of the connected {{PRODUCTNAME}}&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;getOOoDesktop()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;idls&amp;gt;com.sun.star.frame.XDesktop&amp;lt;/idls&amp;gt; - returns the desktop object of the connected {{PRODUCTNAME}}&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;clearDocument()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; -- resets the Bean to an empty document  &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;clear()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; - removes the document from the Bean  &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;aquireSystemWindow()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; - has to be called when the Bean has a parent component which has a valid system window  &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;releaseSystemWindow()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; -- has to be called before the parent component loses its system window, e.g. before it is removed from its parent omponent &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;loadFromURL()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; -- loads a document into the Bean  &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;loadFromStream()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; -- loads a document from a Java stream int o the Bean  &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;loadFromByteArray()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; -- loads a document from a byte array into the Bean &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;storeToURL()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; - stores the document in the Bean to an URL &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;storeToStream()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; - stores the document in the Bean to a stream &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;storeToByteArray()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; - stores the document in the Bean to a byte array &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;getFrame()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;Frame&amp;lt;/code&amp;gt; -- returns a wrapper for &amp;lt;idls&amp;gt;com.sun.star.frame.Frame&amp;lt;/idls&amp;gt;  &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;getController()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;Controller&amp;lt;/code&amp;gt; -- returns a wrapper for &amp;lt;idls&amp;gt;com.sun.star.frame.Controller&amp;lt;/idls&amp;gt;  &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;getDocument()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;Document&amp;lt;/code&amp;gt; -- returns a wrapper for &amp;lt;idls&amp;gt;com.sun.star.model.OfficeDocument&amp;lt;/idls&amp;gt;  &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;setAllBarsVisible()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; - sets visibility of all tool bars, known by this Bean &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;set...BarVisible()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; - sets visibility of a specific tool bar &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;is...BarVisible()&amp;lt;/code&amp;gt; &lt;br /&gt;
|&amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; - returns visibility of a specific tool bar &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/JavaBean for Office Components]]&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/FirstSteps/First_Contact&amp;diff=111873</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=111873"/>
		<updated>2009-02-13T22:50:25Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &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;
[[zh:Zh/Documentation/DevGuide/FirstSteps/First Contact]]&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;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 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;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;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;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;
=== 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&lt;br /&gt;
					.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&lt;br /&gt;
					.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 Tools - Options 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>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/FirstSteps/Configuration&amp;diff=111865</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=111865"/>
		<updated>2009-02-13T21:41:07Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &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;
[[zh:Zh/Documentation/DevGuide/FirstSteps/Configuration]]&lt;br /&gt;
{{DISPLAYTITLE:Configuration}}&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;gt; Build Path &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&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;
# 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;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>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/FirstSteps/First_Contact&amp;diff=111864</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=111864"/>
		<updated>2009-02-13T21:28:44Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &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;
[[zh:Zh/Documentation/DevGuide/FirstSteps/First Contact]]&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;code&amp;gt;FirstUnoContact&amp;lt;/code&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;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 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;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;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;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 standalone, without any IDE support.&lt;br /&gt;
	     It should also run with the NetBeans IDE --&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. It should also work with the NetBeans IDEs as it is. For use with other IDEs it may have to be adapted. The comments and all targets that have an &amp;lt;code&amp;gt;unless&amp;lt;/code&amp;gt; attribute with the value &amp;lt;code&amp;gt;eclipse.running&amp;lt;/code&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;code&amp;gt;/opt&amp;lt;/code&amp;gt;. For other installations the property &amp;lt;code&amp;gt;OFFICE_ROOT&amp;lt;/code&amp;gt; has to be set accordingly.&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&lt;br /&gt;
					.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&lt;br /&gt;
					.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 Tools - Options 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;code&amp;gt;FirstUnoContact&amp;lt;/code&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;code&amp;gt;com.sun.star.comp.helper.Bootstrap.bootstrap()&amp;lt;/code&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>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/FirstSteps/First_Contact&amp;diff=111767</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=111767"/>
		<updated>2009-02-12T23:10:21Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: /* Service Managers */&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;
[[zh:Zh/Documentation/DevGuide/FirstSteps/First Contact]]&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 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. Start the Java IDE or source editor, and enter the following source code for the &amp;lt;code&amp;gt;FirstUnoContact&amp;lt;/code&amp;gt; class.&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;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 as described in section [[Documentation/DevGuide/FirstSteps/Configuration#Set up the Eclipse IDE|Set up 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;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 shown below. &amp;lt;!--[SOURCE:FirstSteps/FirstUnoContact.java].--&amp;gt;&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;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 shown below. &amp;lt;!--[SOURCE:FirstSteps/build_FirstUnoContact.xml]--&amp;gt;&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;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 running the build script. &amp;lt;!--[SOURCE:FirstSteps/build_FirstUnoContact.xml]--&amp;gt;&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 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;
The FirstUnoContact example: &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&lt;br /&gt;
					.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&lt;br /&gt;
					.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;
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;
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 standalone, without any IDE support.&lt;br /&gt;
	     It should also run with the NetBeans IDE --&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;
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 Tools - Options 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;code&amp;gt;FirstUnoContact&amp;lt;/code&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;code&amp;gt;com.sun.star.comp.helper.Bootstrap.bootstrap()&amp;lt;/code&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>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/FirstSteps/First_Contact&amp;diff=111764</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=111764"/>
		<updated>2009-02-12T22:08:39Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: &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;
[[zh:Zh/Documentation/DevGuide/FirstSteps/First Contact]]&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 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. Start the Java IDE or source editor, and enter the following source code for the &amp;lt;code&amp;gt;FirstUnoContact&amp;lt;/code&amp;gt; class.&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;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 as described in section [[Documentation/DevGuide/FirstSteps/Configuration#Set up the Eclipse IDE|Set up 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;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 shown below. &amp;lt;!--[SOURCE:FirstSteps/FirstUnoContact.java].--&amp;gt;&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;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 shown below. &amp;lt;!--[SOURCE:FirstSteps/build_FirstUnoContact.xml]--&amp;gt;&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;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 running the build script. &amp;lt;!--[SOURCE:FirstSteps/build_FirstUnoContact.xml]--&amp;gt;&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 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;
The FirstUnoContact example: &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&lt;br /&gt;
					.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&lt;br /&gt;
					.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;
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;
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 standalone, without any IDE support.&lt;br /&gt;
	     It should also run with the NetBeans IDE --&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;
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;com.sun.star.frame.Desktop&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;com.sun.star.configuration.ConfigurationProvider&amp;#039;&amp;#039;&lt;br /&gt;
: yields access to the {{PRODUCTNAME}} configuration, for instance the settings in the Tools - Options dialog&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;com.sun.star.sdb.DatabaseContext&amp;#039;&amp;#039;&lt;br /&gt;
: holds databases registered with {{PRODUCTNAME}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;com.sun.star.system.SystemShellExecute&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;com.sun.star.text.GlobalSettings&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;code&amp;gt;FirstUnoContact&amp;lt;/code&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 &amp;lt;code&amp;gt;com.sun.star.comp.helper.Bootstrap.bootstrap()&amp;lt;/code&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>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/FirstSteps/First_Contact&amp;diff=111763</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=111763"/>
		<updated>2009-02-12T21:51:03Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: /* Getting Started */&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;
[[zh:Zh/Documentation/DevGuide/FirstSteps/First Contact]]&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 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. Start the Java IDE or source editor, and enter the following source code for the &amp;lt;code&amp;gt;FirstUnoContact&amp;lt;/code&amp;gt; class.&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;#039;&amp;#039;&amp;#039;, then select &amp;#039;&amp;#039;&amp;#039;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. On this tab add the following external JARs: &amp;#039;&amp;#039;&amp;#039;/opt/openoffice.org/ure/share/java/juh.jar&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;/opt/openoffice.org/ure/share/java/jurt.jar&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;/opt/openoffice.org/ure/share/java/ridl.jar&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/opt/openoffice.org/base3.0/program/classes/unoil.jar&amp;#039;&amp;#039;&amp;#039;. [[/Documentation/DevGuide/FirstSteps/Configuration#Set up the Eclipse IDE|AAA]] 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;#039;&amp;#039;&amp;#039;, then select &amp;#039;&amp;#039;&amp;#039;File&amp;#039;&amp;#039;&amp;#039; to create the file &amp;#039;&amp;#039;&amp;#039;build.xml&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
# Enter the ant build script shown below. &amp;lt;!--[SOURCE:FirstSteps/build_FirstUnoContact.xml]--&amp;gt;&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;#039;&amp;#039;&amp;#039;, then select &amp;#039;&amp;#039;&amp;#039;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;. Click &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;
# 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;#039;&amp;#039;&amp;#039;, then select &amp;#039;&amp;#039;&amp;#039;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 shown below &amp;lt;!--[SOURCE:FirstSteps/FirstUnoContact.java].--&amp;gt;.&lt;br /&gt;
# Build an run the project by running the build script shown below &amp;lt;!--[SOURCE:FirstSteps/build_FirstUnoContact.xml]--&amp;gt;.&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 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;
The FirstUnoContact example: &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&lt;br /&gt;
					.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&lt;br /&gt;
					.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;
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;
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 standalone, without any IDE support.&lt;br /&gt;
	     It should also run with the NetBeans IDE --&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;
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;com.sun.star.frame.Desktop&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;com.sun.star.configuration.ConfigurationProvider&amp;#039;&amp;#039;&lt;br /&gt;
: yields access to the {{PRODUCTNAME}} configuration, for instance the settings in the Tools - Options dialog&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;com.sun.star.sdb.DatabaseContext&amp;#039;&amp;#039;&lt;br /&gt;
: holds databases registered with {{PRODUCTNAME}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;com.sun.star.system.SystemShellExecute&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;com.sun.star.text.GlobalSettings&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;code&amp;gt;FirstUnoContact&amp;lt;/code&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 &amp;lt;code&amp;gt;com.sun.star.comp.helper.Bootstrap.bootstrap()&amp;lt;/code&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>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/FirstSteps/Configuration&amp;diff=111738</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=111738"/>
		<updated>2009-02-12T20:42:29Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: /* Set up the 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;
[[zh:Zh/Documentation/DevGuide/FirstSteps/Configuration]]&lt;br /&gt;
{{DISPLAYTITLE:Configuration}}&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;
==== Set up the NetBeans IDE ====&lt;br /&gt;
&lt;br /&gt;
For NetBeans the necessary jar files are made available by simply installing the [http://wiki.services.openoffice.org/wiki/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;
==== Set up 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;gt; Build Path &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 OpenOffice.org 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&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;
# 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;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;
===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>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/FirstSteps/Configuration&amp;diff=111737</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=111737"/>
		<updated>2009-02-12T20:40:35Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: /* Set up the 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;
[[zh:Zh/Documentation/DevGuide/FirstSteps/Configuration]]&lt;br /&gt;
{{DISPLAYTITLE:Configuration}}&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;
==== Set up the NetBeans IDE ====&lt;br /&gt;
&lt;br /&gt;
For NetBeans the necessary jar files are made available by simply installing the [http://wiki.services.openoffice.org/wiki/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;
==== Set up 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;gt; Build Path &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 OpenOffice.org 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&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;
# 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;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 new project wizard.&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>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/FirstSteps/Configuration&amp;diff=111730</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=111730"/>
		<updated>2009-02-12T20:28:29Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: /* Using the Java UNO runtime and API in your 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;
[[zh:Zh/Documentation/DevGuide/FirstSteps/Configuration]]&lt;br /&gt;
{{DISPLAYTITLE:Configuration}}&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;
==== Set up the NetBeans IDE ====&lt;br /&gt;
&lt;br /&gt;
For NetBeans the necessary jar files are made available by simply installing the [http://wiki.services.openoffice.org/wiki/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;
==== Set up 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;gt; Build Path &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. Press &amp;#039;&amp;#039;&amp;#039;OK&amp;#039;&amp;#039;&amp;#039; to save the User Library.&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;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 new project wizard.&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>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=User:OOoLerner&amp;diff=111615</id>
		<title>User:OOoLerner</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=User:OOoLerner&amp;diff=111615"/>
		<updated>2009-02-11T23:49:22Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: New page: This is just a placeholder text. Real content to come.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is just a placeholder text. Real content to come.&lt;/div&gt;</summary>
		<author><name>OOoLerner</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/FirstSteps/First_Contact&amp;diff=111614</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=111614"/>
		<updated>2009-02-11T23:44:10Z</updated>

		<summary type="html">&lt;p&gt;OOoLerner: /* Getting Started */&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;
[[zh:Zh/Documentation/DevGuide/FirstSteps/First Contact]]&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 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. Start the Java IDE or source editor, and enter the following source code for the &amp;lt;code&amp;gt;FirstUnoContact&amp;lt;/code&amp;gt; class.&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;#039;&amp;#039;&amp;#039;, then select &amp;#039;&amp;#039;&amp;#039;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. On this tab add the following external JARs: &amp;#039;&amp;#039;&amp;#039;/opt/openoffice.org/ure/share/java/juh.jar&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;/opt/openoffice.org/ure/share/java/jurt.jar&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;/opt/openoffice.org/ure/share/java/ridl.jar&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;/opt/openoffice.org/base3.0/program/classes/unoil.jar&amp;#039;&amp;#039;&amp;#039;. 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;#039;&amp;#039;&amp;#039;, then select &amp;#039;&amp;#039;&amp;#039;File&amp;#039;&amp;#039;&amp;#039; to create the file &amp;#039;&amp;#039;&amp;#039;build.xml&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
# Enter the ant build script shown below. &amp;lt;!--[SOURCE:FirstSteps/build_FirstUnoContact.xml]--&amp;gt;&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;#039;&amp;#039;&amp;#039;, then select &amp;#039;&amp;#039;&amp;#039;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;. Click &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;
# 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;#039;&amp;#039;&amp;#039;, then select &amp;#039;&amp;#039;&amp;#039;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 shown below &amp;lt;!--[SOURCE:FirstSteps/FirstUnoContact.java].--&amp;gt;.&lt;br /&gt;
# Build an run the project by running the build script shown below &amp;lt;!--[SOURCE:FirstSteps/build_FirstUnoContact.xml]--&amp;gt;.&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 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;
The FirstUnoContact example: &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&lt;br /&gt;
					.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&lt;br /&gt;
					.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;
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;
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 standalone, without any IDE support.&lt;br /&gt;
	     It should also run with the NetBeans IDE --&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;
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;com.sun.star.frame.Desktop&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;com.sun.star.configuration.ConfigurationProvider&amp;#039;&amp;#039;&lt;br /&gt;
: yields access to the {{PRODUCTNAME}} configuration, for instance the settings in the Tools - Options dialog&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;com.sun.star.sdb.DatabaseContext&amp;#039;&amp;#039;&lt;br /&gt;
: holds databases registered with {{PRODUCTNAME}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;com.sun.star.system.SystemShellExecute&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;com.sun.star.text.GlobalSettings&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;code&amp;gt;FirstUnoContact&amp;lt;/code&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 &amp;lt;code&amp;gt;com.sun.star.comp.helper.Bootstrap.bootstrap()&amp;lt;/code&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>OOoLerner</name></author>
	</entry>
</feed>