Apache OpenOffice (AOO) Bugzilla – Issue 55177
OOoBean: support for simple bootstrap
Last modified: 2013-02-24 21:09:22 UTC
An application can use the com.sun.star.lib.loader.Loader class from the ODK to load the actual aplication. the main class then uses com.sun.star.comp.helper.Bootstrap.bootstrap(); to get the context. This context could be passed on to the OOoBean. See the example SDK\examples\DevelopersGuide\ProfUNO\SimpleBootstrap_java The advantage is that the user does not have to set the class path to all the office jars.
The OOoBean examines in a separate thread if the connection still exists and if it is broken then it disposes the LocaleOfficeConnection which in turn notifies listeners. If OOoBean uses an "external" XComponentContext then the application should register itself as listener. This can be done by LocalOfficeConnection.addEventListener
It may not be necessary to change OOoBean. LocalOfficeConnection.getProgramPath calls // find soffice executable relative to this class's class loader: File path = NativeLibraryLoader.getResource( LocalOfficeConnection.class.getClassLoader(), aExec); Because the class loader is the one that loaded the application and knows the location of the jars, it should also find soffice. The implementation of NativeLibraryLoader.getResource calls getResource of the class loader. It may be necessary to modify the class loader. It is contained odk/source/com/sun/star/lib/loader/Loader.java, class CustomClassLoader
.
I do not think this is needed right now -> closing.