Giter Club home page Giter Club logo

noa-libre's Introduction

noa-libre

UNO API of LibreOffice easy and understandable - Nice Office Access

NOA-libre is an object-oriented lightweight Java wrapper around LibreOffice UNO API, providing higher-level abstraction of many UNO interfaces. It is a fork of Ubion's NOA (Nice Office Access) built around API of OpenOffice.org.

Documentation

Find documentation in the Wiki.

There are also a number of examples in the examples folder.

Building

To build NOA-libre, maven-ant-tasks is needed to pull LibreOffice Java artifacts from Maven central repository. Install it into your ant's lib/ directory or adjust ${ant.lib} property in build.xml accordingly to point to maven-ant-tasks location.

Additionally, you need swt.jar added to your build path. Download the matching version for your operating system from http://maven-eclipse.github.io/maven and add it to the build path (e.g. place it in lib folder.

Release Notes

Please read Release Notes if you are upgrading from older versions of NOA-libre

noa-libre's People

Contributors

anti43 avatar os-cib avatar smehrbrodt avatar thorstenb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

noa-libre's Issues

Connection test fails even if office path is correct

C:\\Program Files (x86)\\LibreOffice 4\\URE\\java
C:\\Program Files (x86)\\LibreOffice 4\\program\\classes
Updating property file: C:\Users\andreas\Documents\noa-libre\build\built-jar.properties
Compiling 1 source file to C:\Users\andreas\Documents\noa-libre\build\classes
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning
compile-single:
run-single:
com.sun.star.comp.helper.BootstrapException: no office executable found!
    at com.sun.star.comp.helper.Bootstrap.bootstrap(Bootstrap.java:266)
    at Lo4ConnectionTest.main(Lo4ConnectionTest.java:25)

Getting SWT embedding to work under Linux

I managed to switch from AWT to SWT embedding on Windows. This however broke the Linux Version. With the arguments for XSystemChildFactory#createSystemChild(...) in LocalOfficeConnection#getOfficeFrame(Composite) set correctly - container.embeddedHandle instead of container.handle and SystemDependent.SYSTEM_XWINDOW instead of SystemDependent.SYSTEM_WIN32 - I can open a document. Loading another document after closing the previous yields an exception however (https://github.com/LibreOffice/core/blob/539c75b910f518a1fe51e9a21f6368a91c69ed88/framework/source/fwi/threadhelp/transactionmanager.cxx#L183).

Did anyone manage to embed LO successfully using SWT under Linux?

nativeview.dll (32 bit version)

Hi everybody.
I'm doing some tests with last release of noa-libre.
I noticed that the last commited nativeview.dll binary is a 64bit version. Since I've to load noa-libre in a Java 32 bit environment, I will appreciate if you can confirm me that I could safely use pre-last commit of nativeview.dll that seems compiled for 32 bit.
Thanks

Searching UNO in Windows registry currently doesn't work

Now that noa-libre comes with OfficeLoader that will try to find UNO on the system in the following places & following order:

  1. 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'

the point 4a isn't quite implemented in new code yet. FIXME is planted in WinRegKey.java class in the following commit: 0f71008

Since registry.jar is shipped w/ noa-libre and already used in noa-libre code, we should use it to read Win registry and find UNO install path also in InstallationFinder/WinRegKey classes. Relying on unowinreg.dll won't work in most of the installations, as one needs to have LibO SDK installed

Building a simple swing panel

Hi,
I'm trying to build an Swing panel which should display LibreOffice writer in it.
I tried to wrap the code with the documentation along with the officeLoader,
but couldn't make it work.
Here is the code snippets (basically a copy- paste of the documentation + OfficeLoader):
https://gist.github.com/meirlo/89f90996369d57b8bd4c5851ecd632b0

running the code results in the following error:

java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
javax/swing/JFrame.getAccessibleContext()Ljavax/accessibility/AccessibleContext; @16: putfield
Reason:
Type 'javax/swing/JFrame$AccessibleJFrame' (current frame, stack[1]) is not assignable to 'javax/accessibility/AccessibleContext'
Current Frame:
bci: @16
flags: { }
locals: { 'javax/swing/JFrame' }
stack: { 'javax/swing/JFrame', 'javax/swing/JFrame$AccessibleJFrame' }
Bytecode:
0x0000000: 2ab4 0005 c700 0f2a bb00 6659 2ab7 0067
0x0000010: b500 052a b400 05b0
Stackmap Table:
same_frame(@19)

Also, I tried to embed open office into my existing application and got slight different error:

ag.ion.bion.officelayer.util.Assert$AssertionException: ag.ion.bion.officelayer.internal.desktop.Frame: The submitted com.sun.star.frame.XFrame is not valid.
at ag.ion.bion.officelayer.util.Assert.isNotNull(Assert.java:91)
at ag.ion.bion.officelayer.internal.desktop.Frame.(Frame.java:255)

Any help will be appreciated :)

Thanks,
Meir

Netbeans build fails

Could not load definitions from resource org/apache/maven/artifact/ant/antlib.xml. It could not be found.

${ure.dir}
${liboclass.dir}

C:\Users\andreas\Downloads\noa-libre-3.0.0-beta1\noa-libre-3.0.0-beta1\${ure.dir} does not exist.

Visual Programming for a modern LibreOffice

Actually, Excel is the main worksheet for and construction and I think LibreOffice could same, creating nodes for Dynamo BIM nodes to interconnect with Privative software, Pyflow nodes to interconnect with FOSS or Sverchok nodes for Blender.

the result should be automatic documentation if LibreOffice creates nodes to link all their features to other software and possible integration to any AI.

https://github.com/wonderworks-software/PyFlow

https://github.com/nortikin/sverchok

https://dynamobim.org/download/

here a sample open-source with excel and Dynamo BIM:

https://konradsobon.gitbooks.io/bumblebee-primer/content/110_read_data_from_excel.html

Possibility to suppress loading of native Libs in NativeView

Hi,
we're trying to use noa-libre in an Osgi-Environment which is responsible for selecting / loading approriate native libs.
Therefore it would be really helpful if there would be a possibility to suppress loading of native Libs in NativeView class.

Best Regards
Ewald

EasyHack: Can't pass custom bootstrap CLI arguments anymore

This is a regression in noa-libre 3.0.

Older versions of noa-libre used to come with bootstrapsocketconnector ( jar w/ couple of methods for creating a socket connection to *Office), which allowed passing custom command line arguments to bootstrapped instance of *Office.

bootstrapsocketconnector has been replaced by functionality from Libreoffice core javaunohelper Bootstrap class, however the ability to pass custom arguments has been lost in the process.

This task is about restoring the feature. See this and this commit and the code removed therein for where to start.

In LocalOfficeConnectionGhost class, if officeArguments member variable is non-null and non-empty, you will need to call the overloaded version of bootstrap method (from com.sun.star.comp.helper.Bootstrap class), the one that takes the array of strings as an argument

In IOfficeApplication class, I'd be nice to comment/document how the users can set their APPLICATION_ARGUMENTS_KEY variable (i.e. that they have to use getDefaultOptions method from com.sun.star.comp.helper.Boostrap class, add/remove options from its return value and then convert it back to array of strings)

nativeview.dll in 64bit Java and with 64bit LibreOffice (nativeview.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform)

Hi,

we are in the process of switching our application to 64bit. We move from a 32bit Java and LibreOffice to the 64bit versions.
I updated the Java binding (like officebean.jar and unoil.jar) with the versions from the 64bit LibreOffice installation (/program/classes) and tried using the libnativeview.so from the 64bit folder of noa-libre (is this even important when on Windows?)

The background startup of the LibreOffice process seem to work but when accessing the UI part the application is failing with:

configuration\org.eclipse.osgi\5\0\.cp\lib\nativeview.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(Unknown Source)
	at java.lang.ClassLoader.loadLibrary(Unknown Source)
	at java.lang.Runtime.load0(Unknown Source)
	at java.lang.System.load(Unknown Source)
	at ag.ion.bion.officelayer.NativeView.loadLibrary(NativeView.java:230)
	at ag.ion.bion.officelayer.NativeView.<init>(NativeView.java:135)
	at ag.ion.bion.officelayer.internal.application.connection.LocalOfficeConnection.getOfficeFrame(LocalOfficeConnection.java:390)
	at ag.ion.bion.officelayer.internal.desktop.DesktopService.constructNewOfficeFrame(DesktopService.java:264)
	at com.godyo.noa.openoffice.panel.OfficePanel.activateNewFrame(OfficePanel.java:520)

So the problem seems to be that the provided version of nativeview.dll is 32bit!?

Has anybody a working embedded LibreOffice in a 64bit Java Apllication?

EasyHack: Update code examples to work with noa-libre >= 3.0

Since noa-libre 3.0, Libreoffice UNO runtime environment jars are no longer included in the release. This means that the old code will no longer work with 3.0 and newer, as the main class of an application using noa is now best to be loaded with URLClassLoader aware of possible locations of UNO on the system.

This task is about rewriting all code examples (in examples folder) to work with noa-libre 3.0 using URLClassLoader that comes with it (ag.ion.bion.officelayer.util.OfficeLoader). One of the possible ways to do it is to move the body of the code example into a nested class and load it with OfficeLoader from the top-level class.

It is already done in this Calc example and this simple connection example, feel free to use those as an inspiration.

weird tiny libreoffice writer embedded

Hi,
I was trying some of the examples available in website, the one with Writer in a Swing JFrame, the code works but as soon as it starts I get the frame size normal (500x500) but the libreoffice writer "window" is tiny and misplaced and cannot resize/access all controls.
I'm using Java Oracle SDK 8, in Ubuntu Linux 15.10, Gnome-Shell Desktop

I provide you a screenshot and the code used by me (even if is almost the same of original from your wiki, despite changes).
noa-libre
LibrePanel.zip

Double focus problem with Swing

I got a prblem when using noa-libre with Swing.
When I'm focusing the Writer and typing and then klick on swing component like JTextField there are two cursors blinking one in Writer and another in JTextField. Text input is appended to the writer.

This happens with Java > 1.6 on Windows even with the latest Java 1.8 and latest LibreOffice 5.2.6.2.

I used the SimpleApp and added the JTextField to demonstrate:

    noaPanel = new JPanel();
    JTextField field = new JTextField();
    getContentPane().add(noaPanel);
    getContentPane().add(field);

The problem does not appear with Java 6.

Any ideas how to fix or work around.

How can I edit text with noa-libre?

I'm doing some tests with noa-libre. I tested the Hello World in SWING. The frame open with the Writer, but I can not edit the text. Neither the text cursor appears in the writer.
How can I edit text with noa-libre?
Thanks

How can I close LibreOffice server process

Currently I am trying to call officeApplication.deactivate(); and officeApplication.dispose(); but with no effect as said by documentation. So after my app closes, there is a libreoffice process left behind. How can I close it?
Thanks

missing imports

Hi,
forgive me, if this a stupid question: I'm rather a newbie to libreoffice and noa-libre
The ant-built of noa-libre in eclipse seemed to be successful, but eclipse shows me this error message afterwards:
"The project was not built since its build path is incomplete. Cannot find the class file for com.sun.star.uno.XComponentContext."

Eclipse tells me that the error is in the class ag.ion.noa.internal.service.ServiceProvider.
But from there i get to the interface IOfficeConnection where these imports cannot be resolved:
import com.sun.star.uno.XComponentContext;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.lang.XMultiServiceFactory;

I am aware that the modules "import com.sun.star.uno" and "import com.sun.star.lang" are to be found as .idl in the sdk, but then I'm stuck.
I would be very grateful for any hint or clue how to resolve this! thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.