このページにコントリビュートすることができます。  (Menu)

 

 

PlantUML Server

オンザフライでイメージを生成するのに、オンラインの Web サービスとして PlantUML を使うことができます。オンラインのデモンストレーションは http://www.plantuml.com/plantuml から試すことができます。また、手元の J2EE Web アプリケーションサーバに PlantUML を

Installation of the PlantUML Server|インストール
することもできます。

 

 

対話型インターフェース

The big input field is used to enter your diagram description. You can type in any diagram description, then press the submit button and the diagram will be displayed below. It's a good practice to start your diagram by the @startxxx keyword.

When you validate the diagram, you are redirected to an encoded URL encoding your diagram. The encoded form is a convenient way to share your diagrams with others because it's shorter than the many lines of a diagram and it can be easily displayed in a browser using the online PlantUML Server.

For example, SyfFKj2rKt3CoKnELR1Io4ZDoSa70000 is the encoded form of:

@startuml
Bob -> Alice : hello
@enduml 

 

 

Specify an initial diagram

By default, the PlantUML Server shows the well-known Bob -> Alice sample but it's easy to invoke it with an other diagram using its encoded form. Just append /uml/ENCODED to the URL.

For example, this link http://www.plantuml.com/plantuml/uml/Aov9B2hXil98pSd9LoZFByf9iUOgBial0000 opens the PlantUML Server with a simple Hello World activity diagram.

 

 

Metadata

PlantUML saves the diagram's source code in the generated PNG Metadata in the form of encoded text. So it is possible to retrieve this source by using the query parameter metadata, giving it some image URL.

For example, if you want to retrieve the diagram's source of the image http://i.stack.imgur.com/HJvKF.png, use the following server request: http://www.plantuml.com/plantuml/?metadata=http://i.stack.imgur.com/HJvKF.png.

Sounds like magic! No, merely clever engineering :-)

 

 

Web service mode

The web service interface of the PlantUML Server is dedicated to developers.

 

 

PNG service

To get a PNG file of a diagram, use the following URL scheme: /plantuml/png/ENCODED

 

 

SVG service

To get a SVG XML file of a diagram, use the following URL scheme: /plantuml/svg/ENCODED

Note that not all diagrams can be produced in SVG. For example, ditaa diagrams are only available in PNG format.

 

 

ASCII Art service

To get an ASCII Art representation of a diagram, encoded in UTF-8, use the following URL scheme: /plantuml/txt/ENCODED

Note that only sequence diagrams can be produced in ASCII Art.

 

 

Image Map service

To get the client image map related to a previously generated PNG image, use the following URL scheme: /plantuml/map/ENCODED

The output is a list of <area> tags, each line matching a link present in the diagram description.

For example, the following diagram:

@startuml
participant Bob [[http://plantuml.com]]
Bob -> Alice : [[http://forum.plantuml.net]] hello
@enduml

produces the following output:

<map id="plantuml_map" name="plantuml_map">
<area shape="rect" id="id1" href="http://forum.plantuml.net" title="http://forum.plantuml.net" alt="" coords="38,50,199,65"/>
<area shape="rect" id="id2" href="http://plantuml.com" title="http://plantuml.com" alt="" coords="8,3,50,116"/>
</map>

Note that you need to include these <area... tags inside a <map... html tag to make the complete image map.

 

 

Proxy service

With the proxy service, the source description of the diagram can be fetched by the PlantUML Server from a remote document.

The proxy service uses the following URL scheme: /plantuml/proxy?src=RESOURCE&idx=INDEX&fmt=FORMAT

For example, try this link: http://www.plantuml.com/plantuml/proxy?src=https://raw.github.com/plantuml/plantuml-server/master/src/main/webapp/resource/test2diagrams.txt

Note that the address of the remote document is specified as a parameter, so it is not necessary to URL encode the URL.

 

 

Installation of the PlantUML Server

To install PlantUML Server on your own JEE 5 web server, download the plantuml.war file and copy it on the webapp folder of your server.

PlantUML Server have been successfully tested on Tomcat 6 and 7 and Jetty 8 and 9.

 

 

Source code

PlantUML Server is open source, the code is available on GitHub.

(The main source is at https://github.com/plantuml/plantuml)