Opened 11 years ago

Closed 11 years ago

#2295 closed defect (worksforme)

URIs as references to external resources don't work

Reported by: paul Owned by: Adeel Asghar
Priority: high Milestone: 1.9.0
Component: OMEdit Version: trunk
Keywords: Cc:

Description

The Modelica-specification (3.3) defines the use of URIs in order to reference external resources in documentation HTML-text (in an annotation section of a class) (see section 13.2.3 External resources). In various classes of the Modelica standard library that comes with OpenModelica these kind of URIs are used to reference to images, but the references don't work, so that no images are to be seen in the documentation browser of OMEdit.

It is not clear to me what the reason for the failure is, however, some bug seems to be the most thinkable one, since the URIs seem not to work throughout the library, so that an individual error of a class author is not likely).

Attachments (1)

uriTest.mo (220 bytes ) - added by Adeel Asghar 11 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 by Martin Sjölund, 11 years ago

Component: BackendOMEdit
Owner: changed from probably noone to Adeel Asghar

What version of omc/OMEdit are you using? The images look fine for me.

comment:2 by paul, 11 years ago

I am using rev. 16072 of OpenModelica under Windows.

comment:3 by Martin Sjölund, 11 years ago

Can you try the latest version? I was under the impression that images would be working in that revision, but maybe we tweaked it a little more... I am assuming you are using MSL 3.2.1 and not 3.1 since 3.1 does not use modelica:// links.

comment:4 by paul, 11 years ago

Ok, i tried rev. 16743, and it works. (Sorry, i could have done it before, but over several revisions the behavior was the same, so that i did not count for a change now i wanted to use this feature.) Also, i could use the modelica:// link to reference my own resources. However, i still could not get the file:// link to work for me (i gave it the absolute path to the resource, but it did not show up). So either that scheme does still not work, or i used a wrong syntax (i said 'file:///c:/<rest of the path>/<resource-file>'; my resource sits somewhere on the c: drive). Can you tell what is wrong, or, if it seems right, try out whether this scheme is working for you, please?

As to the version of MSL: how could i choose a specific version of the MSL (in case i wanted to)? I just installed OpenModelica, and in OMEdit the MSL shows up. That is what i used.

comment:5 by Martin Sjölund, 11 years ago

I don't know what URL to use for Windows file://.
Probably: file://C:/.../ or file:///c/.../.
You can try the following in OMShell:

uriToFilename("file://...")

If you want to change library version, Tools->Options->Libraries. Add System Library: Modelica and select version "3.1" or something.

by Adeel Asghar, 11 years ago

Attachment: uriTest.mo added

comment:6 by Adeel Asghar, 11 years ago

Use r16757. I have also attached a sample file just change the location of the image file in it.

comment:7 by paul, 11 years ago

I've tried the new rev. Now it's possible to specify an absolute path with the file:// URI without getting some unwanted prefix in front of it. Thanks. However, when the path is not correct, then OMEdit is blocked; it seems as if it searches forever, and to go one can do nothing but kill it and start over.

in reply to:  7 comment:8 by Adeel Asghar, 11 years ago

Replying to paul:

I've tried the new rev. Now it's possible to specify an absolute path with the file:// URI without getting some unwanted prefix in front of it. Thanks. However, when the path is not correct, then OMEdit is blocked; it seems as if it searches forever, and to go one can do nothing but kill it and start over.

It worked fine for me even with the wrong path. I am using Windows 7 with OpenModelica 1.9.0 beta4+dev (r16777).

comment:9 by paul, 11 years ago

I am using beta4+dev (r16769) on Windows XP. Curious (there have been no changements concerning the URIs meanwhile).

comment:10 by Adeel Asghar, 11 years ago

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.