Re: [dev] Seeking help on Ubuntu 6.10 OOo v. 2.0.4 for starting OOo via Java

2007-02-04 Thread Rony G. Flatscher
Hi Caio Tiago,

thank you *very* much, your directions worked right out of the book! ;)

First I deinstalled the Ubuntu OOo, then followed your instructions and
was able to install the genuine OOo from the OOo homepage, getting the
standard installation tree on the /opt branch.

Could get the Java program to run from the command line, ie.
bootstrapping OOo worked!

[However, the Extension manager on the tools menu does not work either
in this version; it does from the commandline, though, ie. unopkg
works there.]

Again, thank you *very* much for your kind and exact help!

---rony

P.S.: Will take another look into the OOo installation as coming from
Ubuntu (also Suse, I found out).


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] Seeking help on Ubuntu 6.10 OOo v. 2.0.4 for starting OOo via Java

2007-02-04 Thread Rony G. Flatscher
Hi Jim,
 You should get the Software Development Kit from your distribution or
 from http://api.openoffice.org, there are examples in
 SDK/examples/DevelopersGuide/FirstSteps
This assumes, that the Java program I use would not work. However, it is
a simple test-program which has been working like a charm, and which I
have been using to make sure that the environment for Java is set up
correctly, such that I am assured that problems in developing apps do
not stem from a wrong environment.

---

Caio Tiago Oliveria hit the nail right on the top and I could
successfully get and install the genuine OOo from the OOo homepage
(kudos to him) !

Regards,

---rony



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[dev] Little update (Re: [dev] Seeking help on Ubuntu 6.10 OOo v. 2.0.4 for starting OOo via Java

2007-02-04 Thread Rony G. Flatscher
Hi there,

just wanted to report that the genuine OOo 2.1 can be invoked via Java
from the command line, whereas the Ubuntu version cannot.

Did remove the genuine OOo 2.1 and re-installed the Ubuntu OOo 2.0.4
version (the latest they have). The Ubuntu version places the binaries
into /usr/lib/openoffice/program and the Java support to
/usr/share/java/openoffice. Setting CLASSPATH and LD_LIBRARY_PATH+PATH
to their respective settings does throw a
com.sun.star.comp.helper.BootstrapException (bootstrap cannot find
office executable).

Could it be that they have no test case for running OOo from the
commandline using Java ? Could that really be the case?? Or is there
something that I might still oversee, which is important for the Ubuntu
version but not for the genuine OOo distribution?

Regards,

---rony


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] Little update (Re: [dev] Seeking help on Ubuntu 6.10 OOo v. 2.0.4 for starting OOo via Java

2007-02-04 Thread ashok _

I am running oOo 2.1 on ubuntu...

I am running the standard jdk 1.5.08 installation... everything works
fine for me.

I noticed that i had to explicitly enable Java in oOo after the
installation, by going to tools-options-java and expicitly selecting
a JVM there

maybe that is the step you are missing?

On 2/4/07, Rony G. Flatscher [EMAIL PROTECTED] wrote:

Hi there,

just wanted to report that the genuine OOo 2.1 can be invoked via Java
from the command line, whereas the Ubuntu version cannot.

Did remove the genuine OOo 2.1 and re-installed the Ubuntu OOo 2.0.4
version (the latest they have). The Ubuntu version places the binaries
into /usr/lib/openoffice/program and the Java support to
/usr/share/java/openoffice. Setting CLASSPATH and LD_LIBRARY_PATH+PATH
to their respective settings does throw a
com.sun.star.comp.helper.BootstrapException (bootstrap cannot find
office executable).

Could it be that they have no test case for running OOo from the
commandline using Java ? Could that really be the case?? Or is there
something that I might still oversee, which is important for the Ubuntu
version but not for the genuine OOo distribution?

Regards,

---rony


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] Little update (Re: [dev] Seeking help on Ubuntu 6.10 OOo v. 2.0.4 for starting OOo via Java

2007-02-04 Thread ashok _

I noticed you were setting a whole lot of classpaths

i would suggest you get hold of netbeans 6 milestone 5 IDE,  and
install the openoffice development plugin on top of that.  It takes  a
lot of pain out of the openoffice development process.by detecting
and setting up environment variables and so on

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] Little update (Re: [dev] Seeking help on Ubuntu 6.10 OOo v. 2.0.4 for starting OOo via Java

2007-02-04 Thread Rony G. Flatscher
Hi,

ashok _ wrote:
 I am running oOo 2.1 on ubuntu...

 I am running the standard jdk 1.5.08 installation... everything works
 fine for me.

 I noticed that i had to explicitly enable Java in oOo after the
 installation, by going to tools-options-java and expicitly selecting
 a JVM there
 maybe that is the step you are missing?
This seems to be necessary only, if Java is invoked from OpenOffice
itself (either via the scripting framework, or because of using a Java
UNO component, etc.).

If one is using Java from the outside of OOo then that version of Java
is used to drive OOo. One could set up different vesions of Java and use
them to interface with OOo (as a matter of fact I have Java 1.1, 1.2,
1.3, 1.4, 1.5 and 1.6 on my machine, using 1.4 through 1.6 when running
against OOo).

---

So the question would be for me whether you are able to compile and run
the enclosed Java program from the *command* line (not NetBeans, Eclipse
etc.) under Ubuntu's OOo? If so, I would be *very* interested in your
environment settings!

TIA,

---rony



CreateTextDocument.java
Description: java/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: [dev] Little update (Re: [dev] Seeking help on Ubuntu 6.10 OOo v. 2.0.4 for starting OOo via Java

2007-02-04 Thread ashok _

Hello Rony:

I used your code to successfully build and execute an openoffice UNO
client application.
(See the attached code).

i executed the jar file from the command line using:
java -jar helloworld.jar
and it launched openoffice writer and wrote the hellow world text into
the editor windwo

I am running ubuntu edgy, openoffice 2.1 , openoffice 2.1 SDK (in
/opt/openoffice.org2.1_sdk), jdk 1.5.08

I built the code using Netbeans (using the openoffice wizard, by
choosing OpenOffice UNO/Client Application as the project option).



On 2/5/07, Rony G. Flatscher [EMAIL PROTECTED] wrote:

Hi,

ashok _ wrote:
 I am running oOo 2.1 on ubuntu...

 I am running the standard jdk 1.5.08 installation... everything works
 fine for me.

 I noticed that i had to explicitly enable Java in oOo after the
 installation, by going to tools-options-java and expicitly selecting
 a JVM there
 maybe that is the step you are missing?
This seems to be necessary only, if Java is invoked from OpenOffice
itself (either via the scripting framework, or because of using a Java
UNO component, etc.).

If one is using Java from the outside of OOo then that version of Java
is used to drive OOo. One could set up different vesions of Java and use
them to interface with OOo (as a matter of fact I have Java 1.1, 1.2,
1.3, 1.4, 1.5 and 1.6 on my machine, using 1.4 through 1.6 when running
against OOo).

---

So the question would be for me whether you are able to compile and run
the enclosed Java program from the *command* line (not NetBeans, Eclipse
etc.) under Ubuntu's OOo? If so, I would be *very* interested in your
environment settings!

TIA,

---rony



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



/*
 * helloworld.java
 *
 * Created on 05.01.2007 - 09:59:46
 *
 */

package org.openoffice.helloworld;

import com.sun.star.uno.XComponentContext;
import com.sun.star.comp.helper.Bootstrap;

/**
 *
 * @author administrator
 */
public class helloworld {

/** Creates a new instance of helloworld */
public helloworld() {
}

/**
 * @param args the command line arguments
 */
public static void main(String[] args) {
try {
// get the remote office component context
XComponentContext xContext = Bootstrap.bootstrap();
com.sun.star.frame.XDesktop xDesktop = null;
com.sun.star.lang.XMultiComponentFactory xMCF = null;


// (2) get the service manager
xMCF = xContext.getServiceManager();
if( xMCF != null ) {
System.out.println(Connected to a running office ...);

// (3) start up an instance of office
Object oDesktop = xMCF.createInstanceWithContext(
com.sun.star.frame.Desktop, xContext);

// (4a) get the XDesktop interface object
xDesktop = (com.sun.star.frame.XDesktop)
com.sun.star.uno.UnoRuntime.queryInterface(
com.sun.star.frame.XDesktop.class, oDesktop);

// (4b) get the desktop's component loader interface object
com.sun.star.frame.XComponentLoader xComponentLoader =
(com.sun.star.frame.XComponentLoader)
com.sun.star.uno.UnoRuntime.queryInterface(
com.sun.star.frame.XComponentLoader.class, xDesktop);

// create an empty text (swriter) document
com.sun.star.beans.PropertyValue xEmptyArgs[] = // empty property array
new com.sun.star.beans.PropertyValue[0];

// (5) create an empty word processor (swriter) component (document)
com.sun.star.lang.XComponent xComponent = 
xComponentLoader.loadComponentFromURL( private:factory/swriter,_blank,
   0, xEmptyArgs);

// (6) get Text interface object and set a text
com.sun.star.text.XTextDocument xTextDocument =
(com.sun.star.text.XTextDocument)
com.sun.star.uno.UnoRuntime.queryInterface(
com.sun.star.text.XTextDocument.class, xComponent);

com.sun.star.text.XText xText = xTextDocument.getText();

// ((com.sun.star.text.XTextRange) xText).setString(Java was here!\r---rgf);
xText.setString(Java was here!\r---rgf);
}



}
catch (java.lang.Exception e){
e.printStackTrace();
}
System.exit( 0 );
}

}
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]