Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OOoBeans dead? - What are my alternatives?

recently I've started to explore the Officebean Library, in other words I've tried to get an simple OOoBean example running. Unfortunately I didn't get anything going.

First of all I've tried to build a Swing JFrame with a JPanel and the bean inside, but nothing was shown inside the window.

public class OpenOfficeGUI extends JFrame
{
    private OOoBean ooBeanObj = null;
    private OfficeConnection ooConnection = null;

    public OpenOfficeGUI()
    {
        init();
    }

    private void init()
    {
        JPanel panel = new JPanel();
        JButton myButton = new JButton("Arsch");
        ooBeanObj = new OOoBean();

        myButton.setSize(100, 32);

        panel.setSize(800, 500);
        panel.setLocation(5, 5);
        panel.setBackground(new Color(125, 125, 125));
        panel.add(ooBeanObj);
        panel.add(myButton);
        panel.setLayout(null);
        this.add(panel);

        this.setSize(800, 600);
        this.setLocation(0, 0);
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
    }
}

My second attempt was an SWT application, shown at eclipsezone.com (http://www.eclipsezone.com/eclipse/forums/t48966.html). I get this thing running, but at the startup an "com.sun.star.comp.beans.NoConnectionException" occurs.

My third and last try was the OOoBeanViewer form the OpenOffice Wiki. Therefor I've found a blog post which seems to adress the above ConnectionException, but it doesn't run either and the same Exception appears.

I also tried to manually start OpenOffice in the "listening" mode, by executing the command: soffice.exe -bean -accept=pipe,name=login.name_Office;urp;StarOffice.NamingService

In the end I didn't get anything going and noticed that there are nearly no up to date information about the OpenOffice Bean. Also many of the methods in the Officebean.jar are deprecated.

So my questions are:

  1. is OpenOfficeBean dead?
  2. do you have any advice how I can get a simple OpenOffice Java integration running?
  3. is the OpenOffice SDK an alternative to embed OpenOffice in a Java Swing app?
  4. do you know some kind of ongoing information source about the bean or the SDK?
  5. is there an equivalent possibility for LibreOffice?

Thank you

like image 353
Richard Avatar asked Dec 08 '10 12:12

Richard


2 Answers

After doing some further research I can give some answers to my own questions:

  1. OpenOffice Bean seems to be pretty dead. The last version I've found is from 2006 and in my opinion the latest developments of the OO SDK are not addressed. Furthermore the bean isn't very large (1500 LOC) so it would make sense to rewrite it from scratch.
  2. I got my app running by executing two steps. At first I changed the code and did a manual connect to a running OO instance (ooBeanObj.startOOoConnection ("uno:socket,host=localhost,port=2002;urp;StarOffice.ServiceManager");). The second change was to use a socket (soffice -bean -accept=socket,host=0,port=2002;urp;) instead of pipe. But I've got no idea why this change is required.
  3. The SDK isn't an alternative, because it is the basis for the OO bean. It would be possible to enhance or rewrite the bean, using the methods of the SDK.
  4. The OpenOffice.org API Project seems to be the best place to search for information, although not every peace of information or advice is up-to-date.
  5. At the moment OpenOffice bean can still connect to a LibreOffice instance (tested with LO v.3.3.0 RC1).

Bye,
Richard

like image 63
Richard Avatar answered Sep 22 '22 02:09

Richard


I've been using NOA recently which does the same thing as OOOBean but seems up to date. It has allowed me to embed writer in a JPanel fairly easily. It also manages the discovery and creation of the native openoffice app behind the scenes. NOA - nice open office access

like image 38
Adam Avatar answered Sep 18 '22 02:09

Adam