PlantUML Server
Sie können PlantUML über den Online-Webdienst verwenden, um Bilder on-the-fly zu generieren. Eine Online-Demonstration ist unter http://www.plantuml.com/plantuml verfügbar, aber Sie können es auch auf Ihrem eigenen JEE-Webapplikationsserver installieren. Wenn Sie keinen vollständigen JEE-Applikationsserver installieren möchten, können Sie PlantUML PicoWeb Server auch lokal ausführen
Interactive interface
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
Spezifizieren Sie ein Ausgangsdiagramm
Standardmäßig zeigt der PlantUML Server das bekannte Bob -> Alice Beispiel, aber es ist einfach, ihn mit einem anderen Diagramm in seiner verschlüsselten Form aufzurufen.
Hängen Sie einfach /uml/ENCODED an die URL an.
Zum Beispiel öffnet dieser Link http://www.plantuml.com/plantuml/uml/Aov9B2hXil98pSd9LoZFByf9iUOgBial0000 den PlantUML Server mit einem einfachen Hello World Aktivitätsdiagramm
Metadaten
PlantUML speichert den Quellcode des Diagramms in den generierten PNG-Metadaten in Form von kodiertem Text. Daher ist es möglich, diese Quelle mit dem Abfrageparameter metadata abzurufen, indem man eine Bild-URL angibt.
Wenn Sie zum Beispiel die Diagrammquelle des Bildes http://i.stack.imgur.com/HJvKF.png abrufen möchten, verwenden Sie folgende Serveranfrage: http://www.plantuml.com/plantuml/?metadata=http://i.stack.imgur.com/HJvKF.png.
Klingt wie Magie! Nein, nur clevere Technik :-)
Webservice-Modus
Die Webservice-Schnittstelle des PlantUML Servers ist für Entwickler gedacht
PNG-Dienst
Um eine PNG-Datei eines Diagramms zu erhalten, verwenden Sie das folgende URL-Schema:
/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-Dienst
Um eine ASCII-Art-Darstellung eines Diagramms zu erhalten, die in UTF-8 kodiert ist, verwenden Sie das folgende URL-Schema:
/plantuml/txt/ENCODED
Beachten Sie, dass nur Sequenzdiagramme in ASCII-Art erstellt werden können
Image Map Service
Um die Client Image Map zu einem zuvor generierten PNG-Bild abzurufen, verwenden Sie das folgende URL-Schema:
/plantuml/map/ENCODED
Die Ausgabe ist eine Liste von <area> tags, wobei jede Zeile mit einem Link in der Diagrammbeschreibung übereinstimmt.
Zum Beispiel das folgende Diagramm
@startuml
participant Bob [[http://plantuml.com]]
Bob -> Alice : [[http://forum.plantuml.net]] hello
@enduml
erzeugt die folgende Ausgabe
<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>
Beachten Sie, dass Sie diese
<area... Tags innerhalb eines <map... html-Tags einfügen müssen, um die vollständige Image Map zu erstellen
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
- RESOURCE is the complete URL of the document which contains the diagram description (with the
@startxxxand@endxxxtags), it could be a.htmlor a.txtfile. - INDEX is optional, it specifies the occurrence (starting at 0) of the diagram description that will be parsed when there are more than one diagram descriptions in the remote document. It defaults to zero.
- FORMAT is optional, it specifies the format to return. Supported values are:
png,svg,eps,epstextandtxt. Default ispng,
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.
Because of the transition from javax.* to jakarta.*, the PlantUML Server does not work on Tomcat 6/7/8/9 anymore. You have to use Tomcat 10.