Hi Ariel, Am Montag, den 14.01.2008, 02:50 -0300 schrieb Ariel Constenla-Haile: > Hi Dietmar, > > Dietmar Hiller escribió: > ... > > 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.
Thanks to XSimpleFileAccess.exists() I am now sure, that the URL is correct (it returned true). > 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. > > I replaced XDialogProvider2 with XDialogProvider (quick and dirty) which creates the same error, so that now I believe that "this" (in m_xDialog = aDialogProvider.createDialogWithHandler(DialogURL, this );) is not the error. Maybe the root cause is before? I will continue investigations tomorrow. Dietmar --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
