Re: [api-dev] Java and com.sun.star.beans.XIntrospection.inspect() ?

2005-07-18 Thread Stephan Bergmann

Rony G. Flatscher wrote:

Hi,

w.r.t. my problem description with the subject Runtime problems when 
using IntrospectionReflection via Java I also get a runtime error with 
your program.


F:\work\tmp\ooo\testjava Introspect
Exception in thread main java.lang.NullPointerException
at Introspect.main(Introspect.java:28)

Line # 28 is highlighted as red and bold in your original code below:



The following Java program works just fine for me:

import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XIntrospection;
import com.sun.star.beans.XIntrospectionAccess;
import com.sun.star.beans.XPropertySet;
import com.sun.star.bridge.UnoUrlResolver;
import com.sun.star.comp.helper.Bootstrap;
import com.sun.star.frame.FrameSearchFlag;
import com.sun.star.frame.XComponentLoader;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
public final class Introspect {
public static void main(String[] arguments) throws Exception {
XMultiComponentFactory factory = (XMultiComponentFactory)
UnoRuntime.queryInterface(
XMultiComponentFactory.class,
(UnoUrlResolver.create(
Bootstrap.createInitialComponentContext(null)).
 resolve(
 uno:socket,host=127.0.0.1,port=12345;urp;
 + StarOffice.ServiceManager)));
XComponentContext context = (XComponentContext)
UnoRuntime.queryInterface(
XComponentContext.class,
(((XPropertySet) UnoRuntime.queryInterface(
  XPropertySet.class, factory)).
 getPropertyValue(DefaultContext)));
*XIntrospectionAccess access =
((XIntrospection) UnoRuntime.queryInterface(
XIntrospection.class,
factory.createInstanceWithContext(
com.sun.star.beans.Introspection, context))).
inspect(
(((XComponentLoader) UnoRuntime.queryInterface(
  XComponentLoader.class,
  factory.createInstanceWithContext(
  com.sun.star.frame.Desktop, context))).
 loadComponentFromURL(
 private:factory/scalc, _blank,
 FrameSearchFlag.CREATE, new PropertyValue[0]))); *
System.exit(0);
}
private Introspect() {}
}


So it is affected as well (does not work anymore).

In the meantime I have de-installed all OpenOffices (1.1.4, 1.9), 
deleted all remainders of these installations in the file-system, tried 
to find traces in the Windows registry and deleted them.


Then - after reboots - I re-installed OOo 1.9 only, but to no avail.

Are there any registry-entries which might affect this behaviour that 
have keys other than OpenOffice or soffice ? Or could it be, that 
some cache is being used that contains erroneous data?


There should be no registry entries that have any influence on this. 
Did you re-use any old user installation (its location is determined by 
line UserInstallation= in program\bootstrap.ini?  Normally, soffice 
finds services like com.sun.star.beans.Introspection in 
program\services.rdb, which it locates via the line UNO_SERVICES= in 
program\uno.ini ($ORIGIN should expand to the soffice program 
directory); but if something is broken there, soffice itself would most 
likely not start up at all.



Regards,

---rony


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



Re: [api-dev] How to use th PathSettings service

2005-07-18 Thread Jürgen Schmidt

Hi,

Ennio-Sr wrote:

Hi all,
I'm trying to set up a macro to change the default _MyDocuments_ dir.
Found a good example in Andrew Pitonyak macro.sxc (sublisting 5.76 by
Paolo Mantovani) but cannot fully understand  what happens:

I open a .sxc file in ~/OO_files/dir1 and save in it a macro which
simply calls the two functions found in Andrew's sublisting 5.76 after
defining sNewDir=file:///~/OO_files/dir2.
After running the macro I can see that _MyDocuments_ dir (as seen with
Tools - Options - OO.org/Paths) correctly shows dir2 as _MyDocuments_
directory. However, if I do: File/Open, the old dir1 is shown in the
selection box: I would expect this to be now positioned on 'dir2' (as I
think to have read in the relative Help).


See the SDK example 
sdk\examples\DevelopersGuide\OfficeDev\PathSettigns\PathSettings.java

Ok, its Java but you can probably see how the service works in general.

Juergen



Could somebody explain why?

Thanks for your attention.
Ennio.



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



Re: [api-dev] Java and com.sun.star.beans.XIntrospection.inspect() ?

2005-07-18 Thread Rony G. Flatscher




Hi Stephan,


  So it is affected as well (does not work
anymore).


In the meantime I have de-installed all OpenOffices (1.1.4, 1.9),
deleted all remainders of these installations in the file-system, tried
to find traces in the Windows registry and deleted them.


Then - after reboots - I re-installed OOo 1.9 only, but to no avail.


Are there any registry-entries which might affect this behaviour that
have keys other than "OpenOffice" or "soffice" ? Or could it be, that
some cache is being used that contains erroneous data?

  
  
There should be no registry entries that have any influence on this.
Did you re-use any old user installation (its location is determined by
line "UserInstallation=" in program\bootstrap.ini? Normally, soffice
finds services like "com.sun.star.beans.Introspection" in
program\services.rdb, which it locates via the line "UNO_SERVICES=" in
program\uno.ini ("$ORIGIN" should expand to the soffice program
directory); but if something is broken there, soffice itself would most
likely not start up at all.
  

Hmm, will look at that as well.

Here the "latest" news:

  
did de-install OOo 1.1.4 and OOo 1.9.113 and rebooted


  re-installed 1.1.4, doesn't work
  de-installed 1.1.4, rebooted, ran two different registry
cleaners
  re-installed 1.1.4, worked a few times, then stopped working;
  
de-installed, ran registry-cleaners
  


  re-installed .1.9.113
  
worked; after a few tests decided to become a little bit
happy and haven't touched it since yesterday... 
;)
  

  

>From your answer I infer that you have not encountered this behaviours
so far. Could it be that (again being an OOo rookie) using Java
reflection to use the OOo reflection has to do with it, maybe that I am
instantiating classes in the wrong order? Or (*pure* speculation) that
the Java runtime itself is caching data causing the recurrence of that
very bug, once it appeared?

Any idea, speculation that might help solve this situation would be
highly appreciated.

Regards,

---rony






Re: [api-dev] How to use th PathSettings service

2005-07-18 Thread Ennio-Sr
* Jürgen Schmidt [EMAIL PROTECTED] [180705, 09:48]:
 Hi,
 
 Ennio-Sr wrote:
 Hi all,
 [skip]
 After running the macro I can see that _MyDocuments_ dir (as seen with
 Tools - Options - OO.org/Paths) correctly shows dir2 as _MyDocuments_
 directory. However, if I do: File/Open, the old dir1 is shown in the
 selection box: I would expect this to be now positioned on 'dir2' (as I
 think to have read in the relative Help).
 
 See the SDK example 
 sdk\examples\DevelopersGuide\OfficeDev\PathSettigns\PathSettings.java
 Ok, its Java but you can probably see how the service works in general.
 
 Juergen

Thanks Juergen. In the meantime I found a different way to achieve what
I wanted (as per my other post you answered). I'll study it when I come
back from holidays.
Regards,
Ennio.

-- 
[Perche' usare Win$ozz (dico io) se ...anche uno sciocco sa farlo.   \\?//
 Fa' qualche cosa di cui non sei capace!  (diceva Henry Miller) ](°|°)
[Why use Win$ozz (I say) if ... even a fool can do that.  )=(
 Do something you aren't good at! (as Henry Miller used to say) ]

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



Re: [api-dev] Assigning a macro to Start Application

2005-07-18 Thread Ennio-Sr
* Ennio-Sr [EMAIL PROTECTED] [180705, 00:08]:
 Hi all!
 In Tools/Configure/(OpenOffice.org) I'm trying to assign a macro
 contained in a menu.sxc Library/Module in order to get the menu
 opened when I start OOo, but it doesn't work. However, if I copy the
 same macro in the Standard/Module OOo Library, it works!
 The problem is that then I'm unable to call the macro contained in the
 menu.sxc file, as OOo will still be searching them in the
 Standard/Module ...
 Apart from copying all menu's macros in the Standard/Module is there any
 better solution?
 Thanks for your attention.
 Regards,
   Ennio.
 
 [Using OOo-1.1.4 unde Linux/Debian-Sarge] 
 
 

Just to add some more strangeness ;):

If, once the menu.sxc has been opened (on Start Application), I open the
macro doalog and choose the module/macros attached to the menu.sxc I'm
not allowed to run any of them (Security check will prevent me from
doing that, although I included the relative path in the appropriate
list). After closing the file and re-opening it from the dialog box all
macros are available and running smoothly.
What is going on behind the scene? (Apparently, as shown in the upper
left box, path and file names are perfectly the same in both cases!).

Ennio.


-- 
[Perche' usare Win$ozz (dico io) se ...anche uno sciocco sa farlo.   \\?//
 Fa' qualche cosa di cui non sei capace!  (diceva Henry Miller) ](°|°)
[Why use Win$ozz (I say) if ... even a fool can do that.  )=(
 Do something you aren't good at! (as Henry Miller used to say) ]

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



Re: [api-dev] Assigning a macro to Start Application

2005-07-18 Thread Ennio-Sr
* Jürgen Schmidt [EMAIL PROTECTED] [180705, 09:46]:
 Hi,
 
 Ennio-Sr wrote:
 [skip]
 
 it looks that your macros should run in the global application context 
 and not in the context of a single document.
 I would create a globally available Basic library containing all my 
 macros. For the menu entries i would create add-on specific 
 configuration files (*.xcu) where you can specify the context where your 
 menu entry should appear (for example in the context of the writer 
 application only) and which macros should be called. For more details of 
 add-ons see the Developers Guide or the examples on 
 framework.openoffice.org.
 You can put your Basic library and the xcu files in a UNO package and 
 can deploy this package easily in several office installations if you want.
 These macros are also available from within documents and you don't have 
 to load a specific document.
 Maybe i have misunderstood you but this approach looks more straight 
 forward to me then the hassle with macros in a document which should be 
 global.
 
 Juergen
 

Hi Juergen,
thanks for your message: I'll have to reconsider what I did at the light
of the hints you gave. I've not 'consciously' met .xcu files or set up a UNO
package, so I need some further reading to understand how they work ...

My bewilderness (driven by ignorance of the fundamentals behind
appearance) is still there, however, about how is it possibile that
you get the impression you've opened a file (with all that is attached
to it, including  macros) whereas you get a different environment. In
other words, having used (in the macro) the service/command(?):

-  StarDesktop.loadComponentFromUrl(sUrl, _blank, 0, Array() )

where sUrl was initialized to contain path and file name, I thought what
appeared on the screen was my file with all its attributes!

Conclusion: surely I do need much further reading (and I'll do that after
a few weeks holiday), perhaps, however, somewhere should it be made clear
that 'What You See Is NOT What You Get' :-)

Best regards,
Ennio.
-- 
[Perche' usare Win$ozz (dico io) se ...anche uno sciocco sa farlo.   \\?//
 Fa' qualche cosa di cui non sei capace!  (diceva Henry Miller) ](°|°)
[Why use Win$ozz (I say) if ... even a fool can do that.  )=(
 Do something you aren't good at! (as Henry Miller used to say) ]

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



Re: [api-dev] instantiating Basic dialogs from UNO componets

2005-07-18 Thread Thomas Benisch

Jorge Marques Pelizzoni wrote:


Hi, all! Once Mathias Bauer wrote:



But why do you want to call Basic macros from C++? I would expect that
you instantiate your (IDE-designed) dialog from your C++ code (should 
be possible by some UNO calls) ...



Its is exactly those UNO calls that interest me. How can I (i) load/access Basic
libraries from an arbitrary UNO component, (ii) identify my dialog there and
finally instantiate it if I do not have e.g. CreateUnoDialog or DialogLibraries
outside Basic?

Thanks in advance. Cheers,

Jorge.


Especially for dialogs designed with the dialog
editor in the Basic IDE there's the
com.sun.star.awt.DialogProvider service available
(OOo 2.0 code line). The dialog can be created
with the createDialog() method and takes a
script URL as parameter.

If you want to load a dialog called 'MyDialog' in the
dialog library 'MyDialogLibrary' of the user/share
installation, the script URL would be:

vnd.sun.star.script:MyDialogLibrary.MyDialog?location=application

A dialog of the current document can be loaded by

vnd.sun.star.script:MyDocumentLibrary.MyDocumentDialog?location=document

Please note, that for dialogs in documents the XModel of
the current document must be passed as parameter when
instantiating the DialogProvider service.

See also section 18.3.4 of the developers guide, which contains
an example written in Java.

Thomas


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



Re: [api-dev] Assigning a macro to Start Application

2005-07-18 Thread Joerg Barfurth

Hi,

Ennio-Sr wrote:



If, once the menu.sxc has been opened (on Start Application), I open the
macro doalog and choose the module/macros attached to the menu.sxc I'm
not allowed to run any of them (Security check will prevent me from
doing that, although I included the relative path in the appropriate
list). After closing the file and re-opening it from the dialog box all
macros are available and running smoothly.



What is going on behind the scene? (Apparently, as shown in the upper
left box, path and file names are perfectly the same in both cases!).



When the document is loaded a macro execution mode is set on the 
document. When you open the document via the GUI, the macro mode is 
selected according to the configuration settings. When you open a 
document via API, the default is to prohibit execution of macros.


There is a parameter you can add to the loadComponent call to select a 
different macro execution mode. Look into the Developer's guide for details.


HTH, Joerg

--
Joerg Barfurth  Sun Microsystems - Desktop - Hamburg
 using std::disclaimer 
Software Engineer [EMAIL PROTECTED]
OpenOffice.org Configuration  http://util.openoffice.org


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



Re: [api-dev] Documenation of com.sun.star.lib.uno.helper.WeakBase

2005-07-18 Thread Jürgen Schmidt

Hi Tom,

where are you looking for the docu? It should be still part of the SDK 
Java UNO runtime documentation.


Juergen

Tom Schindl wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

Isn't there any API-Doc for com.sun.star.lib.uno.helper.WeakBase, has it
been erased with 2.0?

Tom
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC25bQkVPeOFLgZFIRAvyfAJ0XSviP07uDprE9UQdHHCHpULb9fgCfe9eS
Jk6lJpS30yVVMLvheMQwekA=
=6KAy
-END PGP SIGNATURE-

-
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] Documenation of com.sun.star.lib.uno.helper.WeakBase

2005-07-18 Thread Tom Schindl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Oh. I see but it is not part of the IDL-Docs at
http://api.openoffice.org/docs/common/ref/com/sun/star/module-ix.html?

Are these docs online the one for:

As well as one for:
- - com.sun.star.comp.loader.FactoryHelper

Tom

Jürgen Schmidt schrieb:
 Hi Tom,
 
 where are you looking for the docu? It should be still part of the SDK
 Java UNO runtime documentation.
 
 Juergen
 
 Tom Schindl wrote:
 
 Hi,
 
 Isn't there any API-Doc for com.sun.star.lib.uno.helper.WeakBase, has it
 been erased with 2.0?
 
 Tom

- -
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]



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC26P4kVPeOFLgZFIRApj9AJ4go/rBQxUQoqMX/LN1lXMrVDpbiACggZiy
B/MWgLggWB7+Ds9iY2LXWco=
=kubL
-END PGP SIGNATURE-

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



Re: [api-dev] Call a class Java from an Open Office Basic

2005-07-18 Thread Tom Schindl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

http://codesnippets.services.openoffice.org/Office/Office.CallingJavaFromOOBasic.snip

Tom

Cristian Fonti schrieb:
 Hi to all,
 i have made a java class that interact with openoffice (create a writer
 document, and insert some text).
 Now i would invoke a method of it in a macro writed in Open Office
 Basic... Something like this:
 Sub Main()
 --some code to invoke a java class
 End sub
 It's possible to do this??
 I think it isn't possible... If it is so, can i use a dll (that i have
 created from my Java class) or something similar???
 Thanks to all
 Cristian Fonti
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC26StkVPeOFLgZFIRAjhqAKCD8KYFpVW6ylCxlwaQK+hfs/+IKgCfacV9
uvoufi6LA+wXT7fKqOh1euc=
=DYsL
-END PGP SIGNATURE-

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



Re: [api-dev] Documenation of com.sun.star.lib.uno.helper.WeakBase

2005-07-18 Thread Jürgen Schmidt

Hi Tom,

they should be available from api.openoffice.org (left navigation bar)

Juergen

Tom Schindl wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Oh. I see but it is not part of the IDL-Docs at
http://api.openoffice.org/docs/common/ref/com/sun/star/module-ix.html?

Are these docs online the one for:

As well as one for:
- - com.sun.star.comp.loader.FactoryHelper

Tom

Jürgen Schmidt schrieb:


Hi Tom,

where are you looking for the docu? It should be still part of the SDK
Java UNO runtime documentation.

Juergen

Tom Schindl wrote:

Hi,

Isn't there any API-Doc for com.sun.star.lib.uno.helper.WeakBase, has it
been erased with 2.0?

Tom


- -
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]





-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC26P4kVPeOFLgZFIRApj9AJ4go/rBQxUQoqMX/LN1lXMrVDpbiACggZiy
B/MWgLggWB7+Ds9iY2LXWco=
=kubL
-END PGP SIGNATURE-

-
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]



[api-dev] Dialog controls: relative ImageURLs

2005-07-18 Thread Jorge Marques Pelizzoni

Hi, all! I wonder if there is a way to set property ImageURL (e.g. of
CommandButtons) to some kind of relative URL at _design time_ (i.e. not
resorting to com.sun.star.util.PathSettings at runtime). I what I need is (in
decreasing order of importance):

1 - an application dialog to retrieve images from its installation folder
(inside OpenOffice.org/user/basic or OpenOffice.org/share/basic);

2 - a document dialog to retrieve images from the directory where its document
is located.

Unfortuantely, I am bound to version 1.1.4 and no higher. Thanks in advance.
Cheers,

Jorge.

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



[api-dev] A first basis for an OOO eclipse integration

2005-07-18 Thread Cedric Bosdonnat
Hello,

I am quite new on this list. I work on an eclipse plugin providing a
support for OpenOffice.org development. I commited a first working basic
version on the CVS. The features implemented in this version are :
   + syntax highlighting for uno-idl files
   + SDK Configuration using eclipse preferences. (This is not used now,
but in the next version)

The plugin corresponds to the api/ooeclipseintegration module on the
CVS. If you want to install it, just move the content of the
build/ooeclipseintegration.zip file in your eclipse directory and
restart eclipse. I will write another section in the README for
integrating the CVS tree in the eclipse workspace... when the challenge
will be over.

I am aware that this may include some bug (specialy graphical bug with
the Linux/GTK platform). Please do not hesitate to give me your ideas
and bug reports to make it better.

Regards,
Cedric

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



Re: [api-dev] Dialog controls: relative ImageURLs

2005-07-18 Thread Christian Junker
Hi Jorge, 
get your ooo-installationpath (folder) from PathSubstitution service, like so:
code
pathsub = createUnoService(com.sun.star.util.PathSubstitution)
oodir = pathsub.getSubstituteVariableValue($(inst))
/code

Once you have the installation path it shouldn't be hard to get to
your desired folders (just use string manipulations).

2005/7/18, Jorge Marques Pelizzoni [EMAIL PROTECTED]:
 
 Hi, all! I wonder if there is a way to set property ImageURL (e.g. of
 CommandButtons) to some kind of relative URL at _design time_ (i.e. not
 resorting to com.sun.star.util.PathSettings at runtime). I what I need is (in
 decreasing order of importance):
 
 1 - an application dialog to retrieve images from its installation folder
 (inside OpenOffice.org/user/basic or OpenOffice.org/share/basic);
 
 2 - a document dialog to retrieve images from the directory where its document
 is located.
 
 Unfortuantely, I am bound to version 1.1.4 and no higher. Thanks in advance.
 Cheers,
 
 Jorge.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
Best Regards
Christian Junker

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