Default Configuration
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:
- 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.
- 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"
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). |