Re: [api-dev] Migrating simple bootstrap to OOo3

2008-09-30 Thread Juergen Schmidt
the java.lang.UnsatisfiedLinkError has indeed nothing to do with the 
office. The unowinreg.dll can't be loaded for whatever reason. Do you 
know the depends tool under windows? A nice tool that shows all the 
dependencies of a library. Maybe that give us more info what's going 
wrong in your situation or on your system.


It works fine in all my tests.

Juergen

Matthias B. wrote:

On Tue, Sep 30, 2008 at 3:08 PM, Tobias Krais <[EMAIL PROTECTED]> wrote:

OK. I tested the same on other computers. The result: it worked on just
one machine, but did not work on 5 machines!


I assume that your OOo 2.4.1 installation is
on a different computer than your OOo 3.0 installation and you'll have
to look for the answer to this problem in the differences between the
two.

I tested it on the same machine, installing, uninstalling and
reinstalling the neede OpenOffice.org version...


Hmm. I cannot explain this. The error message certainly looks as if it
were happening when the Java VM attempts to load the included
unowinreg.dll. This process should be independent of the
OpenOffice.org that is currently installed.  Please make sure that
you're using the same Java version for both tests. Some OOo installers
include their own JVM so it's possible that when you switch OOo
installations, you're switching Java at the same time.

How are you launching your program? java -jar jar   on the
console? That's how I tested. Run java -version before running your
app to make sure you're using the Java version you think you're using.

Another test: Do you get the same error message when you uninstall ALL
OpenOffice.org versions and then run your app?

Matthias

-
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: [api-dev] Migrating simple bootstrap to OOo3

2008-09-30 Thread Tobias Krais
Hi Matthias,

thanks for your answer. I even did not expect any hints!

> Hmm. I cannot explain this. The error message certainly looks as if it
> were happening when the Java VM attempts to load the included
> unowinreg.dll. This process should be independent of the
> OpenOffice.org that is currently installed.  Please make sure that
> you're using the same Java version for both tests. Some OOo installers
> include their own JVM so it's possible that when you switch OOo
> installations, you're switching Java at the same time.

Today, I am not in office. I'll answer this tomorrow.

> How are you launching your program? java -jar jar   on the
> console? That's how I tested. Run java -version before running your
> app to make sure you're using the Java version you think you're using.

I run is java -jar oocom-ng.jar. I'll have a look for the Java versions.

> Another test: Do you get the same error message when you uninstall ALL
> OpenOffice.org versions and then run your app?

Yes, same error uninstalling all OOo.

Greetings, Tobias

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



Re: [api-dev] Migrating simple bootstrap to OOo3

2008-09-30 Thread Matthias B.
On Tue, Sep 30, 2008 at 3:08 PM, Tobias Krais <[EMAIL PROTECTED]> wrote:
> OK. I tested the same on other computers. The result: it worked on just
> one machine, but did not work on 5 machines!
>
>> I assume that your OOo 2.4.1 installation is
>> on a different computer than your OOo 3.0 installation and you'll have
>> to look for the answer to this problem in the differences between the
>> two.
>
> I tested it on the same machine, installing, uninstalling and
> reinstalling the neede OpenOffice.org version...

Hmm. I cannot explain this. The error message certainly looks as if it
were happening when the Java VM attempts to load the included
unowinreg.dll. This process should be independent of the
OpenOffice.org that is currently installed.  Please make sure that
you're using the same Java version for both tests. Some OOo installers
include their own JVM so it's possible that when you switch OOo
installations, you're switching Java at the same time.

How are you launching your program? java -jar jar   on the
console? That's how I tested. Run java -version before running your
app to make sure you're using the Java version you think you're using.

Another test: Do you get the same error message when you uninstall ALL
OpenOffice.org versions and then run your app?

Matthias

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



Re: [api-dev] Get Selected Text in the actual TextDocument

2008-09-30 Thread Ariel Constenla-Haile

Hi Joel,

Joel Cordeiro escribió:

Hi,

does anyone could help me about how to get the selected text in the actual
TextDocument (Writer)? How does we cast the returned object in the method
getCurrentSelection() ? Or there is another way?



basically, you have to check if the object returned by
getCurrentSelection() is not null/void/empty (depending on your
programming language), and if not, then query for the selection's
com.sun.star.lang.XServiceInfo. According to the service supported by
the selection, you can know what is selected.



If possible, a simple example would be really nice..


http://www.ArielConstenlaHaile.com.ar/ooo/temp/WriterSelectionDetector.zip
is an example of a selection change listener, but you can adapt it
easyly (see the file
WriterSelectionDetector/src/org/openoffice/sdk/java/text/WriterSelectionListener.java, 


it has some comments explaining the different types of selections).

Besides, you'll find the documentation in
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Text/TextView


Regards
Ariel.

--
Ariel Constenla-Haile
La Plata, Argentina

[EMAIL PROTECTED]
http://www.ArielConstenlaHaile.com.ar/ooo/



"Aus der Kriegsschule des Lebens
- Was mich nicht umbringt,
macht mich härter."
Nietzsche Götzendämmerung, Sprüche und Pfeile, 8.


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



Re: [api-dev] Get Selected Text in the actual TextDocument

2008-09-30 Thread Fernand Vanrie

Joel Cordeiro wrote:

in basic

   oDocument = ThisComponent

if 
oDocument.getCurrentSelection.SupportsService("com.sun.star.text.TextRanges") 
then

  oSelections = oDocument.getCurrentSelection
  sSelection = oSelections.getByIndex(0).getString()
 elseif 
oDocument.getCurrentSelection.SupportsService("com.sun.star.text.TextFrame") 
then

   sSelection = oDocument.getCurrentSelection.GetText.GetString
 
endif


hope it helps

Fernand

Hi,

does anyone could help me about how to get the selected text in the actual
TextDocument (Writer)? How does we cast the returned object in the method
getCurrentSelection() ? Or there is another way?
If possible, a simple example would be really nice..

Regards,

Joel Filipe Antunes Cordeiro
[EMAIL PROTECTED]
[EMAIL PROTECTED]

  



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



[api-dev] Some interesting OOo macros, many based on Andrew Pitonyaks great Basic examples ...

2008-09-30 Thread Rony G. Flatscher
Hi there,

from time to time students work on creating/transcribing OOo macros for
the different document types using an end-user developer (EUD)
programming/scripting language named ooRexx. As ooRexx uses the Java
bridge, those macros/examples may proof helpful for others, creating
macros in different programming languages.

Here is a very nice Bacherlor paper from this September by Josef Frysak,
who intends to "snippetize" his snippets for the OOo code snippet
repository. (Those snippets will have links to the OOo interfaces and
service definitions right in the code.)

Many of the interesting/helpful macros in Josef Frysak's work relate to
the great repository of the "Andrew Pitonyak" macros available on the
Internet, especially to his "scratch book"
.

Here's the direct link to the Bachelor paper:
.
Here's the link to the overview page:
.

Regards,

---rony


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



Re: [api-dev] Get Selected Text in the actual TextDocument

2008-09-30 Thread Rony G. Flatscher
Joel Cordeiro wrote:
> does anyone could help me about how to get the selected text in the actual
> TextDocument (Writer)? How does we cast the returned object in the method
> getCurrentSelection() ? Or there is another way?
> If possible, a simple example would be really nice..
>   
You could look-up
,
page 95-98, which demonstrates this. It is based on one of Andrew
Pitonyaks great macros which are written in Basic.

Although in ooRexx, the syntax is easy, such that you probably can get
the gist of it and know how to proceed from skimming over the few lines
of code.

HTH,

---rony



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



[api-dev] Get Selected Text in the actual TextDocument

2008-09-30 Thread Joel Cordeiro
Hi,

does anyone could help me about how to get the selected text in the actual
TextDocument (Writer)? How does we cast the returned object in the method
getCurrentSelection() ? Or there is another way?
If possible, a simple example would be really nice..

Regards,

Joel Filipe Antunes Cordeiro
[EMAIL PROTECTED]
[EMAIL PROTECTED]


Re: [api-dev] Migrating simple bootstrap to OOo3

2008-09-30 Thread Tobias Krais
Hi Stephan,
>>> is that the recently introduced
>>> com/sun/star/lib/loader/Loader$Drain.class is not included.
>>
>> my SDK 2.4.1 does not come with this file. I do not have an Release
>> candidate SDK installed (where can I get it?). Since when does the new
>> class come along?
> 
> The Simple Bootstrap mechanism had to be adapted for OOo 3.0.0, see the
> mail thread starting at
> .
> Quoting :
> "The net result is that newly built Simple Bootstrap applications should
> work against old and new OOo installations, but old Simple Bootstrap
> applications will not work against new OOo installations."

Thanks for the links, they were really useful to get acustomed to the
backgrounds.

Greetings, Tobias

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



Re: [api-dev] Migrating simple bootstrap to OOo3

2008-09-30 Thread Tobias Krais
Hi Matthias,

thanks for your answer.

>> Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Dokumente
>> und Einstellungen\twc\Lokale Einstellungen\Temp\unowinreg7421.dll: Diese
>> Anwendung konnt e nicht gestartet werden, weil die Anwenungskonfiguration
>> nicht korrekt ist.

> As you can see from the error message, there's a problem starting the
> unowinreg.dll. This happens before OOo is even started (this DLL is
> used to determine the location of the soffice.exe to start by reading
> certain registry keys). So this error cannot be related to to your
> OpenOffice.org version.

OK. I tested the same on other computers. The result: it worked on just
one machine, but did not work on 5 machines!

> I assume that your OOo 2.4.1 installation is
> on a different computer than your OOo 3.0 installation and you'll have
> to look for the answer to this problem in the differences between the
> two.

I tested it on the same machine, installing, uninstalling and
reinstalling the neede OpenOffice.org version...

> I've tested our own program built with the exact same classes/
> and it works fine under Windows 2000 regardless of which OOo version
> is installed.

... I envy your installation. I tested on different WinXP (some have SP2
others SP3) machines.

Lost greetings,

Tobias

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



Re: [api-dev] Migrating simple bootstrap to OOo3

2008-09-30 Thread Matthias B.
On Tue, Sep 30, 2008 at 12:29 PM, Tobias Krais
<[EMAIL PROTECTED]> wrote:
> Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Dokumente
> und Eins
> tellungen\twc\Lokale Einstellungen\Temp\unowinreg7421.dll: Diese
> Anwendung konnt
> e nicht gestartet werden, weil die Anwenungskonfiguration nicht korrekt
> ist.


As you can see from the error message, there's a problem starting the
unowinreg.dll. This happens before OOo is even started (this DLL is
used to determine the location of the soffice.exe to start by reading
certain registry keys). So this error cannot be related to to your
OpenOffice.org version. I assume that your OOo 2.4.1 installation is
on a different computer than your OOo 3.0 installation and you'll have
to look for the answer to this problem in the differences between the
two. I've tested our own program built with the exact same classes/
and it works fine under Windows 2000 regardless of which OOo version
is installed.

Matthias

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



Re: [api-dev] Migrating simple bootstrap to OOo3

2008-09-30 Thread Tobias Krais
Hi Juergen,

> you can find a SDK under
> http://distribution.openoffice.org/mirrors/#mirrors -> select one of the
> mirrors and search under .../contrib/rc/3.0.0rc2
> 
> Sorry that it is so complicate and i promise that we will provide an
> easier mechanism in the near future. I always have the same problem to
> find a snapshot SDK.

I found the 3rc3 SDK here:
ftp://mirror.csclub.uwaterloo.ca/openoffice/contrib/rc/3.0.0rc3/

The files are named OOo-SDK_3.0.0rc3_...

Thanks for fixing it so fast!

But using all the files in the classes folder leads to a
java.lang.UnsatisfiedLinkError as I wrote in answer to Matthias' mail.

Greetings,

Tobias

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



Re: [api-dev] Migrating simple bootstrap to OOo3

2008-09-30 Thread Tobias Krais
Hi Matthias,

thanks for the classes.

> All that's really needed is the classes/ subtree of the 3.0 SDK. We're
> building our own program with the 2.4 SDK and the classes/ from 3.0
> and it bootstraps fine with 2.4 and 3.0. I've uploaded the classes to

These classes work for me in Linux with OOo 2.4.1 and 3.0rc3. But in
Windows they work only with OOo 3.0rc3, not with 2.4.1. Using it with
OOo 2.4.1 gives me following Java Exception:
-%<-
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Dokumente
und Eins
tellungen\twc\Lokale Einstellungen\Temp\unowinreg7421.dll: Diese
Anwendung konnt
e nicht gestartet werden, weil die Anwenungskonfiguration nicht korrekt
ist. Zur
 Problembehebung sollten Sie die Anwendung neu installieren
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 com.sun.star.lib.loader.WinRegKey.(WinRegKey.java:88)
at
com.sun.star.lib.loader.InstallationFinder.getPathFromWindowsRegistry
(InstallationFinder.java:207)
at
com.sun.star.lib.loader.InstallationFinder.getPath(InstallationFinder
.java:115)
at com.sun.star.lib.loader.Loader.getCustomLoader(Loader.java:176)
at com.sun.star.lib.loader.Loader.main(Loader.java:137)
-%<-

Did I make a mistake?

Greetings, Tobias

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



Re: [api-dev] Migrating simple bootstrap to OOo3

2008-09-30 Thread Matthias B.
All that's really needed is the classes/ subtree of the 3.0 SDK. We're
building our own program with the 2.4 SDK and the classes/ from 3.0
and it bootstraps fine with 2.4 and 3.0. I've uploaded the classes to

http://wollmux.forge.osor.eu/classes.tar.gz

Matthias

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