OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

URL seems to be an unsupported one

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Adryen31
Newbie
Newbie


Joined: 22 Sep 2008
Posts: 3

PostPosted: Mon Sep 22, 2008 6:40 am    Post subject: URL seems to be an unsupported one Reply with quote

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
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Mon Sep 22, 2008 10:47 am    Post subject: Re: URL seems to be an unsupported one Reply with quote

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
View user's profile Send private message
Adryen31
Newbie
Newbie


Joined: 22 Sep 2008
Posts: 3

PostPosted: Tue Sep 23, 2008 12:25 am    Post subject: Reply with quote

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
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Tue Sep 23, 2008 9:08 am    Post subject: Reply with quote

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
View user's profile Send private message
Adryen31
Newbie
Newbie


Joined: 22 Sep 2008
Posts: 3

PostPosted: Wed Sep 24, 2008 1:07 am    Post subject: Reply with quote

OOo : 2.2.0
OP: Window XP Profesional
JDK: 1.5.0

With http => http://static.springframework.org/spring/docs/2.5.x/reference/introduction.html
I hasn't the url problem, but even a simple url like "file:///c:/temp/dt.odt" the problem is generated.
Back to top
View user's profile Send private message
jsimas
General User
General User


Joined: 07 Sep 2009
Posts: 10

PostPosted: Mon Oct 12, 2009 8:55 am    Post subject: Any solutions yet Reply with quote

Hi,

I'm having the same problem also... did you find a solution yet?

Best regards

João Simas
Back to top
View user's profile Send private message
pir
OOo Advocate
OOo Advocate


Joined: 20 May 2009
Posts: 200
Location: France

PostPosted: Mon Oct 12, 2009 9:05 am    Post subject: Reply with quote

and if you use ConvertToURL("c:/temp/dt.odt") ?
_________________
OpenOffice.org, teh best firewall
Back to top
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Mon Oct 12, 2009 9:20 am    Post subject: Re: Any solutions yet Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group