Hi Dietmar,

Dietmar Hiller escribió:
Hi,
sorry me again.

I think you meant to send this to the extensions mailing list, where
this all started ;-)

While trying to implement the Dialog, I keep getting the
following error:

com.sun.star.lang.IllegalArgumentException:
DialogProviderImpl::getDialogModel: failed to parse URI:

at first sight, the error is what the stack trace tells you:

an IllegalArgumentException is thrown because it was not possible to
parse the URI you provide in createDialogWithHandler() (that's what says
createDialogWithHandler(*Unknown Source*) )

If you read the API, createDialogWithHandler()  throws
"com::sun::star::lang::IllegalArgumentException if no dialog for the
given URL is found or if the URL is invalid or xHandler is null".

So check
1. if no dialog for the given URL is found
2. if the URL is invalid
3. if the XDialogEventHandler is null

As the error message says "failed to parse URI" I think 1 or 2 will give
the answer.

 at com.sun.star.bridges.jni_uno.JNI_proxy.dispatch_call(Native Method)
 at com.sun.star.bridges.jni_uno.JNI_proxy.invoke(JNI_proxy.java:183)
 at $Proxy17.createDialogWithHandler(Unknown Source)
 at
name.dhiller.jBorderLiner.ColorDialog.createDialog(ColorDialog.java:50)
 at
name.dhiller.jBorderLiner.BL_TB_SelectColorBtn.dispatch(BL_TB_SelectColorBtn.java:42)
 at
name.dhiller.jBorderLiner.jBorderLiner.dispatch(jBorderLiner.java:165)

This is an extract of the code of "createDialog"
[...]
The URL is correct, I also tried everything imaginable. So, where am I
wrong?

are you sure the URL is correct? Try XSimpleFileAccess.exists() to see
if the file really exists before you try to create the dialog from this
URL (as you are passing an URL, not a vnd.sun.star.script:*).

I can not imagine other thing.
You can try this example

http://www.ArielConstenlaHaile.com.ar/ooo/temp/DialogProvider.zip

it is a Scripting Framework example using a Java "macro", you have to
unzip and store the folder inside your OOo user dir. user/Scripts/java
and restart OOo to deploy it.
To debug it you can create a NB project out of it. You can follow my
"tutorial" at

http://www.arielconstenlahaile.com.ar/ooo/tut/NB_IDE_Scripting_Project_TUTORIAL

The example uses a common URL, not vnd.sun.star.script:*, and checks if
the file exists first. It uses XDialogProvider not XDialogProvider2, but
you can read it and adapt it if you find it useful.


Regards,
Ariel.


--
Ariel Constenla-Haile
La Plata, Argentina

[EMAIL PROTECTED]
[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]

Reply via email to