Link url for file is not working properly in class diagram

0 votes
asked May 12, 2017 in Bug by nikhil (520 points)

I am using class diagram and component diagram together where I am using JQeury plugin for creation of SVG.

I have created a link on component 

1. component [MyComp1] as comp1 [[http://google.com]] - Works well on click on Chrome, Opera and IE as well.

2. component [MyComp2] as comp2 [[C:\Users\Nikhil\Desktop\PlantUml\jquery_plantuml\example.html]]  - This does not work on click. Need to right click and open in new tab only then it works that too on Chrome and Opera. Right Click doesnot work on IE 11.

Any work around or fix for this? Am I missing anything here?

 

2 Answers

0 votes
answered May 12, 2017 by plantuml (295,760 points)

I think that some browsers expect links to start with "http://" (maybe for security reason)

In your example, PlantUML generates the following code for SVG:

<a target="_top" xlink:actuate="onRequest" xlink:href="C:\Users\Nikhil\Desktop\PlantUml\jquery_plantuml\example.html" xlink:show="new" xlink:title="C:\Users\Nikhil\Desktop\PlantUml\jquery_plantuml\example.html" xlink:type="simple">

If someone knows some settings that would allow this link to work in Chrome/Opera, please post here : any hint is welcome!
Thanks,
 

commented May 12, 2017 by nikhil (520 points)
edited May 12, 2017 by nikhil
In case of normal html the browser renders the link properly. For e.g.
<a href="C:\Users\Nikhil\Desktop\PlantUml\jquery_plantuml\example.html">Click Me</a>

When we click on Click Me browser will open the line correctly even though it is link to a file. All browsers IE, Chrome Safari loads correctly on one click. So, I dont think it is an issue.

I suppose since its an SVG form, it may be expecting http: for identifying it as a link, not sure though.

Any help is welcomed.
Thanks.
commented Oct 18, 2017 by nikhil (520 points)
Is there any support for file linking?
URL linking is working properly but cannot work with file linking.
commented Oct 19, 2017 by plantuml (295,760 points)
I don't know what we can do.

The following example if working fine for us:

@startuml
component [MyComp1] as comp1 [[http://plantuml.com]]
component [MyComp2] as comp2 [[file://C:/example.html]]
@enduml

http://www.plantuml.com/plantuml/uml/IyxFBSZFIyqhKOZshNG6SWnZ5HAB5P91B8New8oIaW8hVVs2dCIyajBS73sWU6oi0bSokYuZk2uZeAwqp9nKe2vdA_tKYiJSWfnKlOoIt9pOM2u0

You may have to change "file://C:/example.html" to something else, but from a PlantUML point of view, the generated SVG contains the link.
Does it help ?
0 votes
answered Dec 17, 2020 by Cavitedev

Try to use [[file:///C:/Users/Nikhil/Desktop/PlantUml/jquery_plantuml/example.html]] 

Note that "\" are converted into "/"
You can use file:// instead of file:/// but file:/// contains more features, for instance blank spaces could be represented with %20 that way.

If "jquery_plantuml" folder was called "jquery plantuml" the query would be
[[file:///C:/Users/Nikhil/Desktop/PlantUml/jquery%20plantuml/example.html]] 

I hope this helped you

...