PlantUML Macro
Macro and API to generate diagram images using PlantUML |
Type | JAR |
Category | Macro |
Developed by | |
Active Installs | 67 |
Rating | |
License | GNU Lesser General Public License 2.1 |
Table of contents
Description
This macro permits to easily generate various diagram types from a textual definition inside a wiki page, using PlantUML.
Usage
content here...
{{/plantuml}}
The content of the macro can refer to any of the following diagram types supported by PlantUML :
- PlantUML (diagrams starting with @startuml)
- DITAA (diagams starting with @startditaa)
- GraphViz (diagrams starting with @startdot)
- JCCKIT (diagrams starting with @startjcckit)
- Salt (diagrams starting with @startsalt)
- Mind maps (diagrams starting with @startmindmap)
- Regexes (diagrams starting with @startregex)
- Gantt (diagrams starting with @startgantt)
- Chronology (diagrams starting with @startchronology)
- Work breakdown structures (diagrams starting with @startwbs)
- EBNF (diagrams starting with @startebnf)
- JSON (diagrams starting with @startjson)
- YAML (diagrams starting with @startyaml)
For more detail see the description of the PlantUML language.
PlantUML 2.3.0+
It is possible to use the parameter type to set the type of diagram.
If this parameter is used, you don't need to add @startXXX and @endXXX markers within your diagram.
PlantUML 2.3.1+
For diagrams of type "PlantUML", the attribute title can be used to set the diagram title.
If a title is already defined in the diagram content, the attribute will not be used.
Examples
Use Case Diagram
@startuml
:Customer: -> (Withdraw)
note right of (Withdraw) : This is an example.
@enduml
{{/plantuml}}
Generates:
Class Diagram
@startuml
package "Classic Collections" #DDDDDD {
Object <|-- ArrayList
}
package net.sourceforge.plantuml {
Object <|-- Demo1
Demo1 *- Demo2
}
@enduml
{{/plantuml}}
Generates:
Ditaa Diagram
@startditaa
Web Browser JEE Server
/--------\ +---------+ Database
+--------+ |c789 | +---+
|c1FF |<------->| XWIKI |<-=-->|{s}|
| Wiki | text | | +---+
| page | +---------+
| with | |c789 | +---+
|diagrams|<------->|PlantUML |<-=-->|{o}|
| | image | Server| +---+
\--------/ +---------+ Graphviz
@endditaa
{{/plantuml}}
Generates:
Configuration
It works out of the box with all the different kinds of diagrams, using the PlantUML server available on the internet. You can also configure the macro to use your own PlantUML server that you can install on the web container used by your XWiki installation (for example). Once installed, internet access is not necessary. Another option is to leave the PlantUML server field empty, in which case the macro will use PlantUML in embedded mode (you'll then need to have GraphViz installed to generate all diagrams except for the Sequence one).
XWiki 2.0+
The PlantUML server configuration is accessible from xwiki.properties by setting the plantuml.server property. For example:
It's also accessible from the Admin UI by installing the PlantUML Administration Application.
It's also possible to override the PlantUML server to use when using the macro by using the server parameter, as in:
content here...
{{/plantuml}}
If a PlantUML server is specified in the Admin UI, then you can force not using any server at the level of the macro by specifying an empty server parameter, as in:
content here...
{{/plantuml}}
Prerequisites & Installation Instructions
We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager).
You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.
If you were using version 1.1, note that the PlantUML server configuration location has changed, see above.
Release Notes
v2.3.2
Fix source URL
v2.2.0
v2.1.1
v2.1
v2.0.2
v2.0.1
And also make it possible to upgrade from versions 1.x using the Extension Manager (without having to uninstall v1.x first).
v2.0
v1.1
If a previous version is installed, remove it before installing this new one.
With the new include parameter, you can include the content of the specified page at the begining of the macro content. It's similar to the !include directive of PlantUML http://plantuml.sourceforge.net/preprocessing.html
It is very useful to locate skin directives in an unique place.
v1.0
If a previous version is installed, remove it before installing this new one.
The macro works out of the box with all the different kinds of UML diagrams, using the PlantUML server available on the internet. But you can configure the macro to use your own PlantUML server.
An embedded version of PlantUML server is also available. To use it, just leave empty the Server configuration entry.
Diagrams larger than the page are now resized to avoid the horizontal scrollbar.
v0.7
v0.6
Initial version.
Dependencies
Dependencies for this extension (org.xwiki.contrib.plantuml:macro-plantuml-macro 2.3.2):
- org.xwiki.commons:xwiki-commons-component-api 12.10
- org.xwiki.commons:xwiki-commons-script 12.10
- net.sourceforge.plantuml:plantuml 1.2023.9
- org.xwiki.rendering:xwiki-rendering-transformation-macro 12.10
- org.xwiki.platform:xwiki-platform-rendering-async-default 12.10
- org.apache.httpcomponents.client5:httpclient5 5.1
- org.xwiki.platform:xwiki-platform-configuration-default 12.10
- org.xwiki.platform:xwiki-platform-resource-temporary 12.10