Quantcast

PlantUML

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

PlantUML

Timo Dachs-Wegmann
Hello,

I want to draw a UML Diagram with the XWiki Plugin "PlantUML". As I tested it, I found a problem with the feature of including links in the diagram.
I can't connect an URL to an object, because XWiki seems to import the Macro as a picture (something like jpeg or gif).

There is a good Manual on how to insert links on the HowTo Page of PlantUML.com ( http://plantuml.com/incubation ). The one I tried was a very basic test:
        @startuml
        Bob -> Alice : ok
        url of Bob is [[http://www.google.com]]
        @enduml

The problem with this is, that you can't click on "Bob" as a link because the link is not passed through to the XWiki page.
Maybe you have an idea how to solve it or could tell me if there is a way to work around this.

Thank you in advance

Kind regards,

Timo Dachs-Wegmann
-IT-



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: PlantUML

Timo Dachs-Wegmann
I guess there is no one else who has this problem?!



Hello,

I want to draw a UML Diagram with the XWiki Plugin "PlantUML". As I tested it, I found a problem with the feature of including links in the diagram.
I can't connect an URL to an object, because XWiki seems to import the Macro as a picture (something like jpeg or gif).

There is a good Manual on how to insert links on the HowTo Page of PlantUML.com ( http://plantuml.com/incubation ). The one I tried was a very basic test:
        @startuml
        Bob -> Alice : ok
        url of Bob is [[http://www.google.com]]
        @enduml

The problem with this is, that you can't click on "Bob" as a link because the link is not passed through to the XWiki page.
Maybe you have an idea how to solve it or could tell me if there is a way to work around this.

Thank you in advance

Kind regards,

Timo Dachs-Wegmann
-IT-






Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: PlantUML

vmassol
Administrator
In reply to this post by Timo Dachs-Wegmann
Hi Timo,

> On 22 Feb 2017, at 14:19, Timo Dachs-Wegmann <[hidden email]> wrote:
>
> Hello,
>
> I want to draw a UML Diagram with the XWiki Plugin "PlantUML". As I tested it, I found a problem with the feature of including links in the diagram.
> I can't connect an URL to an object, because XWiki seems to import the Macro as a picture (something like jpeg or gif).
>
> There is a good Manual on how to insert links on the HowTo Page of PlantUML.com ( http://plantuml.com/incubation ). The one I tried was a very basic test:
> @startuml
> Bob -> Alice : ok
> url of Bob is [[http://www.google.com]]
> @enduml
>
> The problem with this is, that you can't click on "Bob" as a link because the link is not passed through to the XWiki page.
> Maybe you have an idea how to solve it or could tell me if there is a way to work around this.

I’ve not used this extension but its source code is at https://github.com/xwiki-contrib/macro-plantuml

For example looking at:
https://github.com/xwiki-contrib/macro-plantuml/blob/master/src/main/resources/XWiki/PlantUMLMacro.xml#L278

I see (for an externally configured plantuml server):

  println "[[image:"+serverurl+"img/"+encoded+"||style=\"max-width:100%\"]]"

This means this will call a URL to the plantuml server and that it returns an image which xwiki only displays.

I’ve used your example here:
http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuNBAJrBGjLDmpCbCJbMmKiZFvYejob78JrC0IMGMAqH7PvIK55ZfwvUNb-kbv-UdvwJg9UVdniPoEQJcfG1D0000 and it works for the link (because it’s an image + an image map).

So AFAICS the reason it won’t work as is with xwiki is that the url used by xwiki to get the image is http://www.plantuml.com/plantuml/png/SyfFKj2rKt3CoKnELR1IoC_cAYtAKSXFKt02IcGMAqH7PvIK55ZfwvUNb-kbv-UdvwJg9UVdniO20000 which returns only the image and not the image map.
 
Haha… found something. There’s another url to call to get the map:
http://www.plantuml.com/plantuml/map/SyfFKj2rKt3CoKnELR1IoC_cAYtAKSXFKt02IcGMAqH7PvIK55ZfwvUNb-kbv-UdvwJg9UVdniO20000

So it’s very easy to add support for this. The code needs to be modified with something like this:

def htmlMap = “${serverurl}/map/${encoded}”.toURL().text
println “{{html clean=false}}${htmlMap}{{/html}}"

And that should work! :)

You should create a jira issue at http://jira.xwiki.org/browse/PLANTUML for this.

Thanks
-Vincent

>
> Thank you in advance
>
> Kind regards,
>
> Timo Dachs-Wegmann
> -IT-
>
>
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: PlantUML

vmassol
Administrator
Note that another option is to return the result as SVG and let the browser display it:

http://www.plantuml.com/plantuml/svg/SyfFKj2rKt3CoKnELR1IoC_cAYtAKSXFKt02IcGMAqH7PvIK55ZfwvUNb-kbv-UdvwJg9UVdniO20000

Notice the “svg/” part in the url instead of “img/“.

For this you’d just need to replace:

 println "[[image:"+serverurl+"img/"+encoded+"||style=\"max-width:100%\"]]”

With:

def svg = “${serverurl}/svg/${encoded}||style=\"max-width:100%\”".toURL().text
println “{{html clean=false}}${svg}{{/html}}"

Ofc the browser needs to be able to render svg.

Thanks
-Vincent

> On 27 Feb 2017, at 09:32, Vincent Massol <[hidden email]> wrote:
>
> Hi Timo,
>
>> On 22 Feb 2017, at 14:19, Timo Dachs-Wegmann <[hidden email]> wrote:
>>
>> Hello,
>>
>> I want to draw a UML Diagram with the XWiki Plugin "PlantUML". As I tested it, I found a problem with the feature of including links in the diagram.
>> I can't connect an URL to an object, because XWiki seems to import the Macro as a picture (something like jpeg or gif).
>>
>> There is a good Manual on how to insert links on the HowTo Page of PlantUML.com ( http://plantuml.com/incubation ). The one I tried was a very basic test:
>> @startuml
>> Bob -> Alice : ok
>> url of Bob is [[http://www.google.com]]
>> @enduml
>>
>> The problem with this is, that you can't click on "Bob" as a link because the link is not passed through to the XWiki page.
>> Maybe you have an idea how to solve it or could tell me if there is a way to work around this.
>
> I’ve not used this extension but its source code is at https://github.com/xwiki-contrib/macro-plantuml
>
> For example looking at:
> https://github.com/xwiki-contrib/macro-plantuml/blob/master/src/main/resources/XWiki/PlantUMLMacro.xml#L278
>
> I see (for an externally configured plantuml server):
>
>  println "[[image:"+serverurl+"img/"+encoded+"||style=\"max-width:100%\"]]"
>
> This means this will call a URL to the plantuml server and that it returns an image which xwiki only displays.
>
> I’ve used your example here:
> http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuNBAJrBGjLDmpCbCJbMmKiZFvYejob78JrC0IMGMAqH7PvIK55ZfwvUNb-kbv-UdvwJg9UVdniPoEQJcfG1D0000 and it works for the link (because it’s an image + an image map).
>
> So AFAICS the reason it won’t work as is with xwiki is that the url used by xwiki to get the image is http://www.plantuml.com/plantuml/png/SyfFKj2rKt3CoKnELR1IoC_cAYtAKSXFKt02IcGMAqH7PvIK55ZfwvUNb-kbv-UdvwJg9UVdniO20000 which returns only the image and not the image map.
>
> Haha… found something. There’s another url to call to get the map:
> http://www.plantuml.com/plantuml/map/SyfFKj2rKt3CoKnELR1IoC_cAYtAKSXFKt02IcGMAqH7PvIK55ZfwvUNb-kbv-UdvwJg9UVdniO20000
>
> So it’s very easy to add support for this. The code needs to be modified with something like this:
>
> def htmlMap = “${serverurl}/map/${encoded}”.toURL().text
> println “{{html clean=false}}${htmlMap}{{/html}}"
>
> And that should work! :)
>
> You should create a jira issue at http://jira.xwiki.org/browse/PLANTUML for this.
>
> Thanks
> -Vincent
>
>>
>> Thank you in advance
>>
>> Kind regards,
>>
>> Timo Dachs-Wegmann
>> -IT-

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: PlantUML

vmassol
Administrator
Note that that these replies assume you’re using an external plantuml server.

If not, then you’ll need to make modifications to the https://github.com/xwiki-contrib/macro-plantuml/blob/master/src/main/resources/XWiki/PlantUMLMacroGClass.xml page. It probably contains some attachment containing the plantuml code which needs to be adapted in a similar way (should be pretty easy)

Thanks
-Vìncent

> On 27 Feb 2017, at 09:37, Vincent Massol <[hidden email]> wrote:
>
> Note that another option is to return the result as SVG and let the browser display it:
>
> http://www.plantuml.com/plantuml/svg/SyfFKj2rKt3CoKnELR1IoC_cAYtAKSXFKt02IcGMAqH7PvIK55ZfwvUNb-kbv-UdvwJg9UVdniO20000
>
> Notice the “svg/” part in the url instead of “img/“.
>
> For this you’d just need to replace:
>
> println "[[image:"+serverurl+"img/"+encoded+"||style=\"max-width:100%\"]]”
>
> With:
>
> def svg = “${serverurl}/svg/${encoded}||style=\"max-width:100%\”".toURL().text
> println “{{html clean=false}}${svg}{{/html}}"
>
> Ofc the browser needs to be able to render svg.
>
> Thanks
> -Vincent
>
>> On 27 Feb 2017, at 09:32, Vincent Massol <[hidden email]> wrote:
>>
>> Hi Timo,
>>
>>> On 22 Feb 2017, at 14:19, Timo Dachs-Wegmann <[hidden email]> wrote:
>>>
>>> Hello,
>>>
>>> I want to draw a UML Diagram with the XWiki Plugin "PlantUML". As I tested it, I found a problem with the feature of including links in the diagram.
>>> I can't connect an URL to an object, because XWiki seems to import the Macro as a picture (something like jpeg or gif).
>>>
>>> There is a good Manual on how to insert links on the HowTo Page of PlantUML.com ( http://plantuml.com/incubation ). The one I tried was a very basic test:
>>> @startuml
>>> Bob -> Alice : ok
>>> url of Bob is [[http://www.google.com]]
>>> @enduml
>>>
>>> The problem with this is, that you can't click on "Bob" as a link because the link is not passed through to the XWiki page.
>>> Maybe you have an idea how to solve it or could tell me if there is a way to work around this.
>>
>> I’ve not used this extension but its source code is at https://github.com/xwiki-contrib/macro-plantuml
>>
>> For example looking at:
>> https://github.com/xwiki-contrib/macro-plantuml/blob/master/src/main/resources/XWiki/PlantUMLMacro.xml#L278
>>
>> I see (for an externally configured plantuml server):
>>
>> println "[[image:"+serverurl+"img/"+encoded+"||style=\"max-width:100%\"]]"
>>
>> This means this will call a URL to the plantuml server and that it returns an image which xwiki only displays.
>>
>> I’ve used your example here:
>> http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuNBAJrBGjLDmpCbCJbMmKiZFvYejob78JrC0IMGMAqH7PvIK55ZfwvUNb-kbv-UdvwJg9UVdniPoEQJcfG1D0000 and it works for the link (because it’s an image + an image map).
>>
>> So AFAICS the reason it won’t work as is with xwiki is that the url used by xwiki to get the image is http://www.plantuml.com/plantuml/png/SyfFKj2rKt3CoKnELR1IoC_cAYtAKSXFKt02IcGMAqH7PvIK55ZfwvUNb-kbv-UdvwJg9UVdniO20000 which returns only the image and not the image map.
>>
>> Haha… found something. There’s another url to call to get the map:
>> http://www.plantuml.com/plantuml/map/SyfFKj2rKt3CoKnELR1IoC_cAYtAKSXFKt02IcGMAqH7PvIK55ZfwvUNb-kbv-UdvwJg9UVdniO20000
>>
>> So it’s very easy to add support for this. The code needs to be modified with something like this:
>>
>> def htmlMap = “${serverurl}/map/${encoded}”.toURL().text
>> println “{{html clean=false}}${htmlMap}{{/html}}"
>>
>> And that should work! :)
>>
>> You should create a jira issue at http://jira.xwiki.org/browse/PLANTUML for this.
>>
>> Thanks
>> -Vincent
>>
>>>
>>> Thank you in advance
>>>
>>> Kind regards,
>>>
>>> Timo Dachs-Wegmann
>>> -IT-
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: PlantUML

Timo Dachs-Wegmann
In reply to this post by vmassol
Hi Vincent,

Thank you for your reply.

So the plugin just needs to fetch the image map from the plantUML Server?
And I guess I'm using an external plantuml server?!


Kind regards,
Timo
-IT-


Note that another option is to return the result as SVG and let the browser display it:

http://www.plantuml.com/plantuml/svg/SyfFKj2rKt3CoKnELR1IoC_cAYtAKSXFKt02IcGMAqH7PvIK55ZfwvUNb-kbv-UdvwJg9UVdniO20000

Notice the “svg/” part in the url instead of “img/“.

For this you’d just need to replace:

 println "[[image:"+serverurl+"img/"+encoded+"||style=\"max-width:100%\"]]”

With:

def svg = “${serverurl}/svg/${encoded}||style=\"max-width:100%\”".toURL().text
println “{{html clean=false}}${svg}{{/html}}"

Ofc the browser needs to be able to render svg.

Thanks
-Vincent

> On 27 Feb 2017, at 09:32, Vincent Massol <[hidden email]> wrote:
>
> Hi Timo,
>
>> On 22 Feb 2017, at 14:19, Timo Dachs-Wegmann <[hidden email]> wrote:
>>
>> Hello,
>>
>> I want to draw a UML Diagram with the XWiki Plugin "PlantUML". As I tested it, I found a problem with the feature of including links in the diagram.
>> I can't connect an URL to an object, because XWiki seems to import the Macro as a picture (something like jpeg or gif).
>>
>> There is a good Manual on how to insert links on the HowTo Page of PlantUML.com ( http://plantuml.com/incubation ). The one I tried was a very basic test:
>> @startuml
>> Bob -> Alice : ok
>> url of Bob is [[http://www.google.com]]
>> @enduml
>>
>> The problem with this is, that you can't click on "Bob" as a link because the link is not passed through to the XWiki page.
>> Maybe you have an idea how to solve it or could tell me if there is a way to work around this.
>
> I’ve not used this extension but its source code is at https://github.com/xwiki-contrib/macro-plantuml
>
> For example looking at:
> https://github.com/xwiki-contrib/macro-plantuml/blob/master/src/main/resources/XWiki/PlantUMLMacro.xml#L278
>
> I see (for an externally configured plantuml server):
>
>  println "[[image:"+serverurl+"img/"+encoded+"||style=\"max-width:100%\"]]"
>
> This means this will call a URL to the plantuml server and that it returns an image which xwiki only displays.
>
> I’ve used your example here:
> http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuNBAJrBGjLDmpCbCJbMmKiZFvYejob78JrC0IMGMAqH7PvIK55ZfwvUNb-kbv-UdvwJg9UVdniPoEQJcfG1D0000 and it works for the link (because it’s an image + an image map).
>
> So AFAICS the reason it won’t work as is with xwiki is that the url used by xwiki to get the image is http://www.plantuml.com/plantuml/png/SyfFKj2rKt3CoKnELR1IoC_cAYtAKSXFKt02IcGMAqH7PvIK55ZfwvUNb-kbv-UdvwJg9UVdniO20000 which returns only the image and not the image map.
>
> Haha… found something. There’s another url to call to get the map:
> http://www.plantuml.com/plantuml/map/SyfFKj2rKt3CoKnELR1IoC_cAYtAKSXFKt02IcGMAqH7PvIK55ZfwvUNb-kbv-UdvwJg9UVdniO20000
>
> So it’s very easy to add support for this. The code needs to be modified with something like this:
>
> def htmlMap = “${serverurl}/map/${encoded}”.toURL().text
> println “{{html clean=false}}${htmlMap}{{/html}}"
>
> And that should work! :)
>
> You should create a jira issue at http://jira.xwiki.org/browse/PLANTUML for this.
>
> Thanks
> -Vincent
>
>>
>> Thank you in advance
>>
>> Kind regards,
>>
>> Timo Dachs-Wegmann
>> -IT-




Loading...