Difference between revisions of "Documentation/DevGuide/JavaBean/Default Configuration"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Robot: Changing Category:Documentation/Developers Guide/JavaBean for Office Components)
 
(2 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
|NextPage=Documentation/DevGuide/JavaBean/Customized Configuration
 
|NextPage=Documentation/DevGuide/JavaBean/Customized Configuration
 
}}
 
}}
{{DISPLAYTITLE:Default Configuration}}
+
{{Documentation/DevGuideLanguages|Documentation/DevGuide/JavaBean/{{SUBPAGENAME}}}}
 +
{{DISPLAYTITLE:Default Configuration}}
 
The Office Bean uses default values for all the configuration settings, if none are provided:
 
The Office Bean uses default values for all the configuration settings, if none are provided:
  
* Since {{PRODUCTNAME}} {{OO1.1.0}} the ''officebean.jar'' is located in the ''<OfficePath>/program/classes'' directory.
+
* Since OpenOffice.org 1.1.0 the ''officebean.jar'' is located in the ''<OfficePath>/program/classes'' directory.
 
* It looks for the local library (Windows: ''officebean.dll'', Unix: ''libofficebean.so'') relative to the ''officebean.jar'' in the ''<OfficePath>/program'' directory. The local library depends on the following shared libraries:
 
* It looks for the local library (Windows: ''officebean.dll'', Unix: ''libofficebean.so'') relative to the ''officebean.jar'' in the ''<OfficePath>/program'' directory. The local library depends on the following shared libraries:
 
*# The library sal3 (Windows: ''sal3.dll'', Unix: ''libsal3.so'') is located in the ''<OfficePath>/program'' folder. It maybe necessary to add the ''<OfficePath>/program'' folder to the PATH environment variable if the bean cannot find sal3.
 
*# The library sal3 (Windows: ''sal3.dll'', Unix: ''libsal3.so'') is located in the ''<OfficePath>/program'' folder. It maybe necessary to add the ''<OfficePath>/program'' folder to the PATH environment variable if the bean cannot find sal3.
 
*# The library ''jawt.dll'' is needed in Windows. If the bean cannot find it, check the Java Runtime Environment binaries (''<JRE>/bin'') in your PATH environment variable.
 
*# The library ''jawt.dll'' is needed in Windows. If the bean cannot find it, check the Java Runtime Environment binaries (''<JRE>/bin'') in your PATH environment variable.
* It expects the {{PRODUCTNAME}} installation in the default install location for the current platform. The ''soffice'' executable is in the program folder of a standard installation.
+
* It expects the {{AOo}} installation in the default install location for the current platform. The ''soffice'' executable is in the program folder of a standard installation.
 
* The pipe name is created using the value of the <code>user.name</code> Java property. The name of the pipe is created by appending "<code>_office</code>" to the name of the currently logged on user, for example, if the user.name is "<code>JohnDoe</code>", the name of the pipe is "<code>JohnDoe_office</code>".
 
* The pipe name is created using the value of the <code>user.name</code> Java property. The name of the pipe is created by appending "<code>_office</code>" to the name of the currently logged on user, for example, if the user.name is "<code>JohnDoe</code>", the name of the pipe is "<code>JohnDoe_office</code>".
  
Based on these default values, the Office Bean tries to connect to an office. The office must run in in listening mode. That is, it must have been started with the -accept command line option. If there is no running office, then it attempts to start one. The exact parameters used by the bean are:
+
Based on these default values, the Office Bean tries to connect to an office. The office must run in listening mode. That is, it must have been started with the -accept command line option. If there is no running office, then it attempts to start one. The exact parameters used by the bean are:
  
 
   # WINDOWS
 
   # WINDOWS
Line 23: Line 24:
 
   soffice -bean "-accept=pipe,name=<user.name>_Office;urp;StarOffice.NamingService"
 
   soffice -bean "-accept=pipe,name=<user.name>_Office;urp;StarOffice.NamingService"
  
{{Documentation/Caution|There is a limitation in the communication process with the Office Bean and older versions of {{PRODUCTNAME}}. If a {{PRODUCTNAME}} process is already running that was not started with the proper <tt><nowiki>-accept=pipe</nowiki></tt> option, the Office Bean does not connect to it. Since {{PRODUCTNAME}} {{OO1.1.0}} this limitation is obsolete.}}
+
{{Warn|There is a limitation in the communication process with the Office Bean and older versions of {{AOo}}. If a {{AOo}} process is already running that was not started with the proper <tt><nowiki>-accept=pipe</nowiki></tt> option, the Office Bean does not connect to it. Since OpenOffice.org 1.1.0 this limitation is obsolete.}}
  
In case an office document is displayed outside of the Java frame, then the office has probably been started with wrong or no arguments. Providing the proper command-line arguments is necessary, so that the {{PRODUCTNAME}} process can open a correctly named pipe, through which it communicates with the Java application. Only if this pipe can be established, the office will display the document in the Java window.
+
In case an office document is displayed outside of the Java frame, then the office has probably been started with wrong or no arguments. Providing the proper command-line arguments is necessary, so that the {{AOo}} process can open a correctly named pipe, through which it communicates with the Java application. Only if this pipe can be established, the office will display the document in the Java window.
  
 
You can avoid providing the command-line options by editing the file ''<OfficePath>\user\config\registry\instance\org\openoffice\Setup.xml''. Within the <code><Office/></code> element, the developer adds an <code><ooSetupConnectionURL/></code> element with settings for a named pipe. The following example shows a user-specific ''Setup.xml'' that configures a named pipe for a user named <code>JohnDoe</code>:
 
You can avoid providing the command-line options by editing the file ''<OfficePath>\user\config\registry\instance\org\openoffice\Setup.xml''. Within the <code><Office/></code> element, the developer adds an <code><ooSetupConnectionURL/></code> element with settings for a named pipe. The following example shows a user-specific ''Setup.xml'' that configures a named pipe for a user named <code>JohnDoe</code>:
<source lang="xml">
+
<syntaxhighlight lang="xml">
 
   <?xml version="1.0" encoding="UTF-8"?>
 
   <?xml version="1.0" encoding="UTF-8"?>
 
   <Setup state="modified" cfg:package="org.openoffice"  
 
   <Setup state="modified" cfg:package="org.openoffice"  
Line 47: Line 48:
 
     </Office>
 
     </Office>
 
   </Setup>
 
   </Setup>
</source>
+
</syntaxhighlight>
With this user-specific ''Setup.xml'' file, the office opens a named pipe <code>JohnDoe_Office</code> whenever it starts up. It does not matter if the user double clicks a document, runs the Quickstarter, or starts a new, empty document from a {{PRODUCTNAME}} template.
+
With this user-specific ''Setup.xml'' file, the office opens a named pipe <code>JohnDoe_Office</code> whenever it starts up. It does not matter if the user double clicks a document, runs the Quickstarter, or starts a new, empty document from a {{AOo}} template.
  
 
{{PDL1}}
 
{{PDL1}}
  
 
[[Category:Documentation/Developer's Guide/JavaBean for Office Components]]
 
[[Category:Documentation/Developer's Guide/JavaBean for Office Components]]

Latest revision as of 17:31, 21 December 2020



The Office Bean uses default values for all the configuration settings, if none are provided:

  • Since OpenOffice.org 1.1.0 the officebean.jar is located in the <OfficePath>/program/classes directory.
  • It looks for the local library (Windows: officebean.dll, Unix: libofficebean.so) relative to the officebean.jar in the <OfficePath>/program directory. The local library depends on the following shared libraries:
    1. The library sal3 (Windows: sal3.dll, Unix: libsal3.so) is located in the <OfficePath>/program folder. It maybe necessary to add the <OfficePath>/program folder to the PATH environment variable if the bean cannot find sal3.
    2. The library jawt.dll is needed in Windows. If the bean cannot find it, check the Java Runtime Environment binaries (<JRE>/bin) in your PATH environment variable.
  • It expects the Apache OpenOffice installation in the default install location for the current platform. The soffice executable is in the program folder of a standard installation.
  • The pipe name is created using the value of the user.name Java property. The name of the pipe is created by appending "_office" to the name of the currently logged on user, for example, if the user.name is "JohnDoe", the name of the pipe is "JohnDoe_office".

Based on these default values, the Office Bean tries to connect to an office. The office must run in listening mode. That is, it must have been started with the -accept command line option. If there is no running office, then it attempts to start one. The exact parameters used by the bean are:

 # WINDOWS
 soffice.exe -bean -accept=pipe,name=<user.name>_Office;urp;StarOffice.NamingService
 
 # UNIX
 soffice -bean "-accept=pipe,name=<user.name>_Office;urp;StarOffice.NamingService"
Documentation caution.png There is a limitation in the communication process with the Office Bean and older versions of Apache OpenOffice. If a Apache OpenOffice process is already running that was not started with the proper -accept=pipe option, the Office Bean does not connect to it. Since OpenOffice.org 1.1.0 this limitation is obsolete.

In case an office document is displayed outside of the Java frame, then the office has probably been started with wrong or no arguments. Providing the proper command-line arguments is necessary, so that the Apache OpenOffice process can open a correctly named pipe, through which it communicates with the Java application. Only if this pipe can be established, the office will display the document in the Java window.

You can avoid providing the command-line options by editing the file <OfficePath>\user\config\registry\instance\org\openoffice\Setup.xml. Within the <Office/> element, the developer adds an <ooSetupConnectionURL/> element with settings for a named pipe. The following example shows a user-specific Setup.xml that configures a named pipe for a user named JohnDoe:

  <?xml version="1.0" encoding="UTF-8"?>
  <Setup state="modified" cfg:package="org.openoffice" 
    xmlns="http://openoffice.org/2000/registry/components/Setup" 
    xmlns:cfg="http://openoffice.org/2000/registry/instance" 
    xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
  <Office>
    <ooSetupConnectionURL cfg:type="string">
      pipe,name=JohnDoe_Office;urp;StarOffice.NamingService
    </ooSetupConnectionURL>
      <Factories cfg:element-type="Factory">
        <Factory cfg:name="com.sun.star.text.TextDocument">
          <ooSetupFactoryWindowAttributes cfg:type="string">
            193,17,1231,1076;1; 
          </ooSetupFactoryWindowAttributes>
        </Factory>
      </Factories>
    </Office>
  </Setup>

With this user-specific Setup.xml file, the office opens a named pipe JohnDoe_Office whenever it starts up. It does not matter if the user double clicks a document, runs the Quickstarter, or starts a new, empty document from a Apache OpenOffice template.

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