Difference between revisions of "Documentation/DevGuide/ProUNO/Starting OpenOffice.org in Listening Mode"

From Apache OpenOffice Wiki
Jump to: navigation, search
 
(9 intermediate revisions by 5 users not shown)
Line 6: Line 6:
 
|NextPage=Documentation/DevGuide/ProUNO/Importing a UNO Object
 
|NextPage=Documentation/DevGuide/ProUNO/Importing a UNO Object
 
}}
 
}}
{{DISPLAYTITLE:Starting OpenOffice.org in Listening Mode}}
+
{{Documentation/DevGuideLanguages|Documentation/DevGuide/ProUNO/{{SUBPAGENAME}}}}
Most examples in this developers guide connect to a running {{PRODUCTNAME}} and perform API calls, which are then executed in {{PRODUCTNAME}}. By default, the office does not listen on a resource for security reasons. This makes it necessary to make {{PRODUCTNAME}} listen on an interprocess connection resource, for example, a socket. Currently this can be done in two ways:  
+
{{DISPLAYTITLE:Starting Apache OpenOffice in Listening Mode}}
 +
Most examples in this developers guide connect to a running {{AOo}} and perform API calls, which are then executed in {{AOo}}. By default, the office does not listen on a resource for security reasons. This makes it necessary to make {{AOo}} listen on an interproces connection resource, for example, a socket. Currently this can be done in two ways:  
  
 
* Start the office with an additional parameter:
 
* Start the office with an additional parameter:
Line 18: Line 19:
 
:''<OfficePath>/share/registry/data/org/openoffice/Setup.xcu''
 
:''<OfficePath>/share/registry/data/org/openoffice/Setup.xcu''
 
:and replace the tag  
 
:and replace the tag  
  <source lang="idl">
+
<syntaxhighlight lang="xml">
 
   <prop oor:name="ooSetupConnectionURL"/>
 
   <prop oor:name="ooSetupConnectionURL"/>
  </source>
+
</syntaxhighlight>
 
with  
 
with  
  <source lang="idl">
+
<syntaxhighlight lang="xml">
 
   <prop oor:name="ooSetupConnectionURL">
 
   <prop oor:name="ooSetupConnectionURL">
 
   <value>socket,host=localhost,port=2002;urp;StarOffice.ServiceManager
 
   <value>socket,host=localhost,port=2002;urp;StarOffice.ServiceManager
 
   </value>
 
   </value>
 
   </prop>
 
   </prop>
  </source>
+
</syntaxhighlight>
 
If the tag is not present, add it within the tag
 
If the tag is not present, add it within the tag
  <source lang="idl">
+
<syntaxhighlight lang="xml">
 
   <node oor:name="Office"/>
 
   <node oor:name="Office"/>
  </source>
+
</syntaxhighlight>
 
This change affects the whole installation. If you want to configure it for a certain user in a network installation, add the same tag within the node <code><node oor:name="Office/></code> to the file ''Setup.xcu'' in the user dependent configuration directory ''<OfficePath>/user/registry/data/org/openoffice/''
 
This change affects the whole installation. If you want to configure it for a certain user in a network installation, add the same tag within the node <code><node oor:name="Office/></code> to the file ''Setup.xcu'' in the user dependent configuration directory ''<OfficePath>/user/registry/data/org/openoffice/''
  
Choose the procedure that suits your requirements and launch {{PRODUCTNAME}} in listening mode now. Check if it is listening by calling ''netstat -a'' or ''-na'' on the command-line. An output similar to the following shows that the office is listening:
+
Choose the procedure that suits your requirements and launch {{AOo}} in listening mode now. Check if it is listening by calling ''netstat -a'' or ''-na'' on the command-line. An output similar to the following shows that the office is listening:
  
 
   TCP <Hostname>:8100 <Fully qualified hostname>: 0 Listening
 
   TCP <Hostname>:8100 <Fully qualified hostname>: 0 Listening
Line 42: Line 43:
 
If the office is not listening, it probably was not started with the proper connection URL parameter. Check the Setup.xcu file or your command-line for typing errors and try again.  
 
If the office is not listening, it probably was not started with the proper connection URL parameter. Check the Setup.xcu file or your command-line for typing errors and try again.  
  
{{Documentation/Note|Note: In versions before {{PRODUCTNAME}} {{OOo1.x}}, there are several differences.
+
{{Note|Note: In versions before OpenOffice.org 1.x, there are several differences.
  
 
The configuration setting that makes the office listen every time is located elsewhere. Open the file ''<OfficePath>/share/config/registry/instance/org/openoffice/Setup.xml'' in an editor, and look for the element:
 
The configuration setting that makes the office listen every time is located elsewhere. Open the file ''<OfficePath>/share/config/registry/instance/org/openoffice/Setup.xml'' in an editor, and look for the element:
  
  <nowiki><ooSetupConnectionURL cfg:type="string"/></nowiki>
+
<syntaxhighlight lang="xml">
 +
  <ooSetupConnectionURL cfg:type="string"/>
 +
</syntaxhighlight>
  
 
Extend it with the following code:
 
Extend it with the following code:
  
  <nowiki><ooSetupConnectionURL cfg:type="string">
+
<syntaxhighlight lang="xml">
 +
  <ooSetupConnectionURL cfg:type="string">
 
   socket,port=2083;urp;
 
   socket,port=2083;urp;
   </ooSetupConnectionURL></nowiki>
+
   </ooSetupConnectionURL>
 +
</syntaxhighlight>
  
 
The commandline option -accept is ignored when there is a running instance of the office, including the quick starter and the online help. If you use it, make sure that no soffice process runs on your system.}}
 
The commandline option -accept is ignored when there is a running instance of the office, including the quick starter and the online help. If you use it, make sure that no soffice process runs on your system.}}
Line 59: Line 64:
  
 
{{PDL1}}
 
{{PDL1}}
[[Category: Professional UNO]]
+
 
 +
[[Category:Documentation/Developer's Guide/Professional UNO]]

Latest revision as of 10:51, 23 December 2020



Most examples in this developers guide connect to a running Apache OpenOffice and perform API calls, which are then executed in Apache OpenOffice. By default, the office does not listen on a resource for security reasons. This makes it necessary to make Apache OpenOffice listen on an interproces connection resource, for example, a socket. Currently this can be done in two ways:

  • Start the office with an additional parameter:
 soffice -accept=socket,host=0,port=2002;urp;

This string has to be quoted on unix shells, because the semicolon ';' is interpreted by the shells

  • Place the same string without '-accept=' into a configuration file. You can edit the file
<OfficePath>/share/registry/data/org/openoffice/Setup.xcu
and replace the tag
  <prop oor:name="ooSetupConnectionURL"/>

with

  <prop oor:name="ooSetupConnectionURL">
  <value>socket,host=localhost,port=2002;urp;StarOffice.ServiceManager
  </value>
  </prop>

If the tag is not present, add it within the tag

  <node oor:name="Office"/>

This change affects the whole installation. If you want to configure it for a certain user in a network installation, add the same tag within the node <node oor:name="Office/> to the file Setup.xcu in the user dependent configuration directory <OfficePath>/user/registry/data/org/openoffice/

Choose the procedure that suits your requirements and launch Apache OpenOffice in listening mode now. Check if it is listening by calling netstat -a or -na on the command-line. An output similar to the following shows that the office is listening:

 TCP <Hostname>:8100 <Fully qualified hostname>: 0 Listening

If you use the -n option, netstat displays addresses and port numbers in numerical form. This is sometimes useful on UNIX systems where it is possible to assign logical names to ports.

If the office is not listening, it probably was not started with the proper connection URL parameter. Check the Setup.xcu file or your command-line for typing errors and try again.

Documentation note.png Note: In versions before OpenOffice.org 1.x, there are several differences.

The configuration setting that makes the office listen every time is located elsewhere. Open the file <OfficePath>/share/config/registry/instance/org/openoffice/Setup.xml in an editor, and look for the element:

  <ooSetupConnectionURL cfg:type="string"/>

Extend it with the following code:

  <ooSetupConnectionURL cfg:type="string">
  socket,port=2083;urp;
  </ooSetupConnectionURL>

The commandline option -accept is ignored when there is a running instance of the office, including the quick starter and the online help. If you use it, make sure that no soffice process runs on your system.

The various parts of the connection URL will be discussed in the next section.

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages