| View previous topic :: View next topic |
| Author |
Message |
Adryen31 Newbie

Joined: 22 Sep 2008 Posts: 3
|
Posted: Mon Sep 22, 2008 6:40 am Post subject: URL seems to be an unsupported one |
|
|
Good afternoon all,
I have saw this topic http://www.oooforum.org/forum/viewtopic.phtml?t=69306 but my problem (the same) is always here. when I generate a document, one com.sun.star.lang.IllegalArgumentException: URL seems to be an unsupported one. is generated. Can you help me please?
My function (with http://) :
XDesktop xDesktop = aOooManager.getDesktop();
XComponentLoader xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, xDesktop);
String loadURL = "http://localhost:8080/OGRH_COLLAB/src/main/webapp/templates/odt/DT.odt";
PropertyValue[] propertyvalue = new PropertyValue[1];
propertyvalue[0] = new PropertyValue();
propertyvalue[0].Name = "Hidden";
propertyvalue[0].Value = new Boolean(true);
System.out.println("3");
xComp = xComponentLoader.loadComponentFromURL(loadURL, "_blank", 0, propertyvalue);
Or I used file:/// ==>
XDesktop xDesktop = aOooManager.getDesktop();
XComponentLoader xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, xDesktop);
// Ouvrir un doc existant
PropertyValue[] prop = new PropertyValue[1];
prop[0] = new PropertyValue();
prop[0].Name = "Hidden";
prop[0].Value = Boolean.TRUE;
prop[0].Name = "ReadOnly";
prop[0].Value = Boolean.FALSE;
System.out.println("file:///"+aTemplateName);
/*aTemplateName = D:\workspace\GPMQ_Project\src\main\webapp\templates\odt\DT.odt*/
xComp = xComponentLoader.loadComponentFromURL("file:///"+aTemplateName,"_blank", 0, prop);
Thank |
|
| Back to top |
|
 |
hol.sten Super User


Joined: 14 Nov 2004 Posts: 3533 Location: Hamburg, Germany
|
Posted: Mon Sep 22, 2008 10:47 am Post subject: Re: URL seems to be an unsupported one |
|
|
| Adryen31 wrote: | My function (with http://) :
...
String loadURL = "http://localhost:8080/OGRH_COLLAB/src/main/webapp/templates/odt/DT.odt"; |
I tried once something like String loadURL = "http://static.springframework.org/spring/docs/2.5.x/reference/introduction.html"; and it worked. So the problem might be a local one.
| Adryen31 wrote: | Or I used file:/// ==>
System.out.println("file:///"+aTemplateName);
/*aTemplateName = D:\workspace\GPMQ_Project\src\main\webapp\templates\odt\DT.odt*/
xComp = xComponentLoader.loadComponentFromURL("file:///"+aTemplateName,"_blank", 0, prop); |
And what exactly did you assign to aTemplateName? All I can see is a comment. And on which operating system are you trying to load the template?
Anyway, something like "aTemplateName = D:\workspace\somefile.odt" is not possible with OOo! With OOo you have always to use slashes instead of backslashes. So String aTemplateName = "file:///D:/workspace/GPMQ_Project/src/main/webapp/templates/odt/DT.odt"; might work on Windows. |
|
| Back to top |
|
 |
Adryen31 Newbie

Joined: 22 Sep 2008 Posts: 3
|
Posted: Tue Sep 23, 2008 12:25 am Post subject: |
|
|
No sorry but the same error always here with:
String loadURL = "file:///D:/workspace/GPMQ_Prjoect/src/main/webapp/templates/odt/DT.odt";
PropertyValue[] propertyvalue = new PropertyValue[1];
propertyvalue[0] = new PropertyValue();
propertyvalue[0].Name = "Hidden";
propertyvalue[0].Value = new Boolean(true);
System.out.println("3");
xComp = xComponentLoader.loadComponentFromURL(loadURL, "_blank", 0, propertyvalue); |
|
| Back to top |
|
 |
hol.sten Super User


Joined: 14 Nov 2004 Posts: 3533 Location: Hamburg, Germany
|
Posted: Tue Sep 23, 2008 9:08 am Post subject: |
|
|
| Adryen31 wrote: | No sorry but the same error always here with:
String loadURL = "file:///D:/workspace/GPMQ_Prjoect/src/main/webapp/templates/odt/DT.odt"; |
Looks like misspelling to me here in this of your folders GPMQ_Prjoect. Try an easier folder name like "file:///c:/temp/dt.odt" and continue from there if it works.
And the http example works now?
BTW: OOo version? Operating system? Java version? |
|
| Back to top |
|
 |
Adryen31 Newbie

Joined: 22 Sep 2008 Posts: 3
|
|
| Back to top |
|
 |
jsimas General User

Joined: 07 Sep 2009 Posts: 10
|
Posted: Mon Oct 12, 2009 8:55 am Post subject: Any solutions yet |
|
|
Hi,
I'm having the same problem also... did you find a solution yet?
Best regards
João Simas |
|
| Back to top |
|
 |
pir OOo Advocate


Joined: 20 May 2009 Posts: 200 Location: France
|
Posted: Mon Oct 12, 2009 9:05 am Post subject: |
|
|
and if you use ConvertToURL("c:/temp/dt.odt") ? _________________ OpenOffice.org, teh best firewall |
|
| Back to top |
|
 |
hol.sten Super User


Joined: 14 Nov 2004 Posts: 3533 Location: Hamburg, Germany
|
Posted: Mon Oct 12, 2009 9:20 am Post subject: Re: Any solutions yet |
|
|
| jsimas wrote: | | I'm having the same problem also... did you find a solution yet? |
And how does your URL look like? |
|
| Back to top |
|
 |
|