PlantUML Server¶
A PlantUML server generates an output image from input PlantUML source code.
It is possible to setup your own server (docker images available).
Here we will use the public plantuml server http://www.plantuml.com/plantuml
We provide our PlantUML source code as input via a URL and get back a PNG/SVG image.
Using a similar PlantUML Server, we can edit the PlantUML source code via a webbrowser.
Encoding URL for PlantUML Server for source and diagram¶
Example Diagram Source¶
We will use our Context diagram source as an example.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | @startuml
!include <c4/C4_Context.puml>
'ref http://plantuml.com/stdlib
!include <office/Users/user.puml>
!include <office/Users/mobile_user.puml>
'LAYOUT_TOP_DOWN
'LAYOUT_AS_SKETCH()
LAYOUT_WITH_LEGEND()
title System Landscape diagram for Big Bank plc
Person(customer , Customer , "<$user> <$mobile_user>\n A customer of the bank, with personal bank accounts" )
Enterprise_Boundary(c0, "Big Bank plc") {
System(banking_system, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.")
System_Ext(atm, "ATM", "Allows customers to withdraw cash.")
System_Ext(mail_system, "E-mail system", "The internal Microsoft Exchange e-mail system.")
System_Ext(mainframe, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")
Person_Ext(customer_service, "Customer Service Staff", "Customer service staff within the bank.")
Person_Ext(back_office, "Back Office Staff", "Administration and support staff within the bank.")
}
Rel_Neighbor(customer, banking_system, "Uses")
Rel_R(customer, atm, "Withdraws cash using")
Rel_Back(customer, mail_system, "Sends e-mails to")
Rel_R(customer, customer_service, "Asks questions to", "Telephone")
Rel_D(banking_system, mail_system, "Sends e-mail using")
Rel_R(atm, mainframe, "Uses")
Rel_R(banking_system, mainframe, "Uses")
Rel_D(customer_service, mainframe, "Uses")
Rel_U(back_office, mainframe, "Uses")
Lay_D(atm, banking_system)
Lay_D(atm, customer)
Lay_U(mail_system, customer)
@enduml
|
Diagram Source Encoded as URL¶
The input PlantUML source code and output image can be encoded as URLs:
http://www.plantuml.com/plantuml/uml/TLL1R-8y4BtdLyo7AXKalhA7dbPLLGfeMoqjLGEgLbefCiw4M3XsrkEKejN-zxL3o9e25nJFl9bvR_mixiWoOwj2Hly9nMML8jpmwy7eEXbfPV73NfKkUGiGHPS6CyYjBRyE1gLaobTTSLqCoAPIB8C6Eii4ny62qD2WSh-x9kSGXLuAYKa0Z2wdmn-pnJoPprwIyUpjkGqCuoJ-FfcF7hgzg0czFSuVakdas-Hvx8AH5LOYn5koMC2KgPGuAn5ImLQ65P1f0_TY1VTChQ6KF8fU70UjkhmYgmiq07qOxR_xqBcvyCHkuUOYu7dxKy4GsXATWSqHbgvd7pR2vb3MJPciOy0urvMor057SA8icj88mkJUHLDcjbt-nKqAQNLwy3i2W4P8rxSHQfLGVNJWHzz5eVKLFjC0Eourb59lg6L7O3My2zo0K4vzmQpG2jXILzQp5kQGOn_Spg1WQuIIRGjqeQjEBmh899CFssMsyAFcJ-Sc-ZMaXcs0CyfTXyyD2YRaFpcJ__qPg1Knpn54hP59U1BSQDAPXSa7pvbQ8M1OS8gWIwlCi09TiwVzzubjnLOR961Ixg-Hkm0q2p-nirPbFzYPDKmHunxcJcXvIsbdhvhIlZ8XDE-2UsQjq-9T26BBigmJPXemaC_KQnMgjPiRytdAal5ridjWtbJk13Dt2diFqq8eGTOqkbGAL9MbDlRyb3zHz8eoUKQnofVQj6BwSEJD1I6v2Wz_3N0xoxmrlg3Q652HAst0dck0FtH8Z2gbvjgzmLpDqOGJ2nxIck1NXUILrdNUN2YnpBN2VPFnqGCxFpoaxARNgaApXUgFsvu6Ze-zSGww22xuD2gQicqotX4xd7-Osu_irS55-2B3v9tJxlyW_W80
where this URL can be generated by
copyNpasting the source code into http://www.plantuml.com/plantuml server uml window
plantuml running locally
This URL contains the encoded PlantUML diagram source code.
Link to Render PNG from Diagram Source Encoded URL¶
http://www.plantuml.com/plantuml/png/TLL1R-8y4BtdLyo7AXKalhA7dbPLLGfeMoqjLGEgLbefCiw4M3XsrkEKejN-zxL3o9e25nJFl9bvR_mixiWoOwj2Hly9nMML8jpmwy7eEXbfPV73NfKkUGiGHPS6CyYjBRyE1gLaobTTSLqCoAPIB8C6Eii4ny62qD2WSh-x9kSGXLuAYKa0Z2wdmn-pnJoPprwIyUpjkGqCuoJ-FfcF7hgzg0czFSuVakdas-Hvx8AH5LOYn5koMC2KgPGuAn5ImLQ65P1f0_TY1VTChQ6KF8fU70UjkhmYgmiq07qOxR_xqBcvyCHkuUOYu7dxKy4GsXATWSqHbgvd7pR2vb3MJPciOy0urvMor057SA8icj88mkJUHLDcjbt-nKqAQNLwy3i2W4P8rxSHQfLGVNJWHzz5eVKLFjC0Eourb59lg6L7O3My2zo0K4vzmQpG2jXILzQp5kQGOn_Spg1WQuIIRGjqeQjEBmh899CFssMsyAFcJ-Sc-ZMaXcs0CyfTXyyD2YRaFpcJ__qPg1Knpn54hP59U1BSQDAPXSa7pvbQ8M1OS8gWIwlCi09TiwVzzubjnLOR961Ixg-Hkm0q2p-nirPbFzYPDKmHunxcJcXvIsbdhvhIlZ8XDE-2UsQjq-9T26BBigmJPXemaC_KQnMgjPiRytdAal5ridjWtbJk13Dt2diFqq8eGTOqkbGAL9MbDlRyb3zHz8eoUKQnofVQj6BwSEJD1I6v2Wz_3N0xoxmrlg3Q652HAst0dck0FtH8Z2gbvjgzmLpDqOGJ2nxIck1NXUILrdNUN2YnpBN2VPFnqGCxFpoaxARNgaApXUgFsvu6Ze-zSGww22xuD2gQicqotX4xd7-Osu_irS55-2B3v9tJxlyW_W80
where
http://www.plantuml.com/plantuml/uml/… changes to