LibreOffice / noa-libre

UNO API of LibreOffice easy and understandable - Nice Office Access
GNU Lesser General Public License v2.1
37 stars 21 forks source link

New classloader #5

Closed xbubli closed 8 years ago

xbubli commented 8 years ago

This pull request adds a new OfficeLoader class that will try to find UNO installation on the system, in the following order of priority:

  1. Path from noa configuration (IOfficeApplication.APPLICATION_HOME_KEY)
  2. com.sun.star.lib.loader.unopath Java property
  3. UNO_PATH environment variable 4a. (Windows only) Registry key Software\LibreOffice\UNO\InstallPath 4b. (Linux/Mac) PATH env.variable
  4. (Linux/Mac) 'which soffice'

OfficeLoader contains a customized URLClassLoader that is, using the URLs gathered as described above, meant to load NOA and UNO classes so no more hard-coded paths in the manifest, hurray \o/ OfficeLoader::run() can be used to kick off any NOA app. It will load its primary class of by name and call its main method. This is demonstrated in Lo4ConnectionTest example

It contains a customized URLClassLoader which is meant to be used to load all NOA classes