diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index ded3ec7..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,72 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ main ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ main ] - schedule: - - cron: '28 14 * * 4' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - language: [ 'csharp' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - - name: Setup .NET - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '6.0' - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index bb8ed8e..35f71d6 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -7,8 +7,8 @@ on: branches: [ main ] env: - VERSION: 7.0.${{ github.run_number }} - CLI_VERSION: 3.0.${{ github.run_number }} + VERSION: 8.0.${{ github.run_number }} + CLI_VERSION: 4.0.${{ github.run_number }} NUGET_INDEX: https://api.nuget.org/v3/index.json BUILD_TYPE: Release @@ -25,30 +25,22 @@ jobs: - name: Release CLI version run: echo ${{env.CLI_VERSION}} - - - name: Setup .NET Core 6.0.x - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 6.0.x - - name: Setup .NET Core 7.0.x + - name: Setup .NET Core 8.0.x uses: actions/setup-dotnet@v1 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - - name: Setup .NET Core 8.0.x + - name: Setup .NET Core 9.0.x uses: actions/setup-dotnet@v1 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Restore dependencies run: dotnet restore - name: Build run: dotnet build --no-restore --configuration Release - -# - name: Integrated Tests -# run: dotnet test ./tests/**/*.IntegratedTests.csproj --no-restore - name: Publish DLL Artifact if: github.ref == 'refs/heads/main' diff --git a/README.md b/README.md index acb707f..4f3735f 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Deployment diagrams. The library generates the following diagram types: PNG, SVG ## Getting Started -First, you will need the [.NET 5.0+](https://docs.microsoft.com/pt-br/dotnet/standard/net-standard) +First, you will need the [.NET 8.0+](https://docs.microsoft.com/pt-br/dotnet/standard/net-standard) and [Java](https://www.java.com/en/download/) to run C4Sharp. Also, you should install the C4Sharp package in your project. This package is available through [Nuget Packages](https://www.nuget.org/packages/C4Sharp). @@ -31,55 +31,89 @@ This package is available through [Nuget Packages](https://www.nuget.org/package To build a diagram using the C4S library we need to identify the structures and their relationships through a class that inherits properties directly from `DiagramBuilder` (_ContainerDiagram, ComponentDiagram, ContextDiagram, SequenceDiagram, DeploymentDiagram_). See the following example of building a container diagram: -```C# +```csharp public class ContainerDiagramSample : ContainerDiagram { - protected override string Title => "Container diagram for Internet Banking System"; + protected override string Title => "Container diagram for Internet Banking System v2"; + + protected override IEnumerable Structures => + [ + Person.None | Boundary.External | ( + alias: "Customer", + label: "Personal Banking Customer", + description: "A customer of the bank, with personal bank accounts." + ), + + SoftwareSystem.None | ( + alias: "BankingSystem", + label: "Internet Banking System", + description: "Allows customers to view information about their bank accounts, and make payments." + ), + + SoftwareSystem.None | Boundary.External | ( + alias: "MailSystem", + label: "E-mail system", + description: "The internal Microsoft Exchange e-mail system." + ), - protected override IEnumerable Structures => new Structure[] - { - Person.None | Boundary.External - | ("Customer", "Personal Banking Customer", "A customer of the bank, with personal bank accounts."), - - SoftwareSystem.None | ("BankingSystem", "Internet Banking System", - "Allows customers to view information about their bank accounts, and make payments."), - - SoftwareSystem.None | Boundary.External - | ("MailSystem", "E-mail system", "The internal Microsoft Exchange e-mail system."), - Bound("c1", "Internet Banking", - Container.None | (WebApplication, "WebApp", "WebApp", "C#, WebApi", - "Delivers the static content and the Internet banking SPA"), - - Container.None | (Spa, "Spa", "Spa", "JavaScript, Angular", - "Delivers the static content and the Internet banking SPA"), - - Container.None | (Mobile, "MobileApp", "Mobile App", "C#, Xamarin", - "Provides a mobile banking experience"), - - Container.None | (Database, "SqlDatabase", "SqlDatabase", "SQL Database", - "Stores user registration information, hashed auth credentials, access logs, etc."), - - Container.None | (Queue, "RabbitMQ", "RabbitMQ", "RabbitMQ", - "Stores user registration information, hashed auth credentials, access logs, etc."), - - Container.None | (Api, "BackendApi", "BackendApi", "Dotnet, Docker Container", - "Provides Internet banking functionality via API.") + Container.Undefined | ( + type: WebApplication, + alias: "WebApp", + label: "WebApp", + technology: "C#, WebApi", + description: "Delivers the static content and the Internet banking SPA" + ), + Container.None | ( + type: Spa, + alias: "Spa", + label: "Spa", + technology: "JavaScript, Angular", + description: "Delivers the static content and the Internet banking SPA" + ), + Container.None | ( + type: Mobile, + alias: "MobileApp", + label: "Mobile App", + technology: "C#, Xamarin", + description: "Provides a mobile banking experience" + ), + Container.None | ( + type: Database, + alias: "SqlDatabase", + label: "SqlDatabase", + technology: "SQL Database", + description: "Stores user registration information, hashed auth credentials, access logs, etc." + ), + Container.None | ( + type: Queue, + alias: "RabbitMQ", + label: "RabbitMQ", + technology: "RabbitMQ", + description: "Stores user registration information, hashed auth credentials, access logs, etc." + ), + Container.None | ( + type: Api, + alias: "BackendApi", + label: "BackendApi", + technology: "Dotnet, Docker Container", + description: "Provides Internet banking functionality via API." + ) ) - }; + ]; protected override IEnumerable Relationships => new[] { this["Customer"] > this["WebApp"] | ("Uses", "HTTPS"), this["Customer"] > this["Spa"] | ("Uses", "HTTPS"), this["Customer"] > this["MobileApp"] | "Uses", - + this["WebApp"] > this["Spa"] | "Delivers" | Position.Neighbor, this["Spa"] > this["BackendApi"] | ("Uses", "async, JSON/HTTPS"), this["MobileApp"] > this["BackendApi"] | ("Uses", "async, JSON/HTTPS"), this["SqlDatabase"] < this["BackendApi"] | ("Uses", "async, JSON/HTTPS") | Position.Neighbor, this["RabbitMQ"] < this["BackendApi"] | ("Uses", "async, JSON"), - + this["Customer"] < this["MailSystem"] | "Sends e-mails to", this["MailSystem"] < this["BackendApi"] | ("Sends e-mails using", "sync, SMTP"), this["BackendApi"] > this["BankingSystem"] | ("Uses", "sync/async, XML/HTTPS") | Position.Neighbor @@ -93,25 +127,50 @@ you can create structures that will be used in the diagram, as in the following ```c# -//Person -public static Person Customer => new ("customer", "Personal Banking Customer", - "A customer of the bank, with personal bank accounts.", Boundary.External); - -public static Person InternalCustomer => new Person("internalcustomer", "Personal Banking Customer", - "An customer of the bank, with personal bank accounts."); - -public static Person Manager => new ("manager", "Manager Banking Customer", - "A manager of the bank, with personal bank accounts."); - -//SoftwareSystem -public static SoftwareSystem BankingSystem => new("BankingSystem", "Internet Banking System", - "Allows customers to view information about their bank accounts, and make payments."); - -public static SoftwareSystem Mainframe => new("Mainframe", "Mainframe Banking System", - "Stores all of the core banking information about customers, accounts, transactions, etc.", Boundary.External); +public static class People +{ + public static Person Customer => new( + alias: "customer", + label: "Personal Banking Customer", + description: "A customer of the bank, with personal bank accounts.", + boundary: Boundary.External + ); + + public static Person InternalCustomer => new( + alias: "internalcustomer", + label: "Personal Banking Customer", + description: "An customer of the bank, with personal bank accounts." + ); + + public static Person Manager => new( + alias: "manager", + label: "Manager Banking Customer", + description: "A manager of the bank, with personal bank accounts." + ); +} -public static SoftwareSystem MailSystem => new ("MailSystem", "E-mail system", - "The internal Microsoft Exchange e-mail system.", Boundary.External); +public static class Systems +{ + public static SoftwareSystem BankingSystem => new( + alias: "BankingSystem", + label: "Internet Banking System", + description: "Allows customers to view information about their bank accounts, and make payments." + ); + + public static SoftwareSystem Mainframe => new( + alias: "Mainframe", + label: "Mainframe Banking System", + description: "Stores all of the core banking information about customers, accounts, transactions, etc.", + boundary: Boundary.External + ); + + public static SoftwareSystem MailSystem => new( + alias: "MailSystem", + label: "E-mail system", + description: "The internal Microsoft Exchange e-mail system.", + boundary: Boundary.External + ); +} ``` diff --git a/docs/.c4s/C4.puml b/docs/.c4s/C4.puml deleted file mode 100644 index 3d7e330..0000000 --- a/docs/.c4s/C4.puml +++ /dev/null @@ -1,1658 +0,0 @@ -' C4-PlantUML - -' Global pre-settings -' ################################## -' ENABLE_ALL_PLANT_ELEMENTS -' If ENABLE_ALL_PLANT_ELEMENTS is set BEFORE the first C4_* file is loaded, nearly "all" PlantUML elements can be used like -' Component(StorageA, "Storage A ", $baseShape="storage") -' ENABLE_ALL_PLANT_ELEMENTS can be set via -' !ENABLE_ALL_PLANT_ELEMENTS = 1 -' or with additional command line argument -DENABLE_ALL_PLANT_ELEMENTS=1 - -'Version -' ################################## -!function C4Version() - ' 2 spaces and ' are used as unique marker, that the release scripts makes the correct version update - !$c4Version = "2.10.0beta1" - !return $c4Version -!end function - -!procedure C4VersionDetails() -rectangle C4VersionDetailsArea <> [ -| PlantUML | **%version()** | -| C4-PlantUML | **C4Version()** | -] -!end procedure - -' Colors -' ################################## -!$ELEMENT_FONT_COLOR ?= "#FFFFFF" - -!$ARROW_COLOR ?= "#666666" -!$ARROW_FONT_COLOR ?= $ARROW_COLOR - -!$BOUNDARY_COLOR ?= "#444444" -!$BOUNDARY_BG_COLOR ?= "transparent" -!$BOUNDARY_BORDER_STYLE ?= "dashed" - -!$LEGEND_TITLE_COLOR ?= "#000000" -!$LEGEND_FONT_COLOR ?= "#FFFFFF" -!$LEGEND_BG_COLOR ?= "transparent" -!$LEGEND_BORDER_COLOR ?= "transparent" -' %darken(darkkhaki,50), #khaki -!$LEGEND_DARK_COLOR ?= "#66622E" -!$LEGEND_LIGHT_COLOR ?= "#khaki" - -!$SKETCH_BG_COLOR ?= "#EEEBDC" -!$SKETCH_FONT_COLOR ?= "" -!$SKETCH_WARNING_COLOR ?= "red" -!$SKETCH_FONT_NAME ?= "Comic Sans MS" - -' Labels -' ################################## - -!$LEGEND_SHADOW_TEXT ?= "shadow" -!$LEGEND_NO_SHADOW_TEXT ?= "no shadow" -!$LEGEND_NO_FONT_BG_TEXT ?= "last text and back color" -!$LEGEND_NO_FONT_TEXT ?= "last text color" -!$LEGEND_NO_BG_TEXT ?= "last back color" -!$LEGEND_NO_LINE_TEXT ?= "last line color" -!$LEGEND_ROUNDED_BOX ?= "rounded box" -!$LEGEND_EIGHT_SIDED ?= "eight sided" -!$LEGEND_DOTTED_LINE ?= "dotted" -!$LEGEND_DASHED_LINE ?= "dashed" -!$LEGEND_BOLD_LINE ?= "bold" -!$LEGEND_SOLID_LINE ?= "solid" - -!$LEGEND_BOUNDARY ?= "boundary" -' ignore (boundary) transparent atm, that the legend is smaller -' !$LEGEND_BOUNDARY_TRANSPARENT_INCL_COMA ?= "transparent, " -!$LEGEND_BOUNDARY_TRANSPARENT_INCL_COMA ?= "" -' (boundary) dashed should not be ignored atm -!$LEGEND_BOUNDARY_DASHED_INCL_COMA ?= "dashed, " -' !$LEGEND_BOUNDARY_DASHED_INCL_COMA ?= "" - -!$LEGEND_THICKNESS ?= "thickness" - -!$SKETCH_FOOTER_WARNING ?= "Warning:" -!$SKETCH_FOOTER_TEXT ?= "Created for discussion, needs to be validated" - -' Styling -' ################################## - -!$STEREOTYPE_FONT_SIZE ?= 12 -!global $TRANSPARENT_STEREOTYPE_FONT_SIZE = $STEREOTYPE_FONT_SIZE/2 -!$TECHN_FONT_SIZE ?= 12 - -!$ARROW_FONT_SIZE ?= 12 - -!$LEGEND_DETAILS_SMALL_SIZE ?= 10 -!$LEGEND_DETAILS_NORMAL_SIZE ?= 14 -!global $LEGEND_DETAILS_SIZE = $LEGEND_DETAILS_SMALL_SIZE - -' element symbols typically 4 times too big in legend -!$LEGEND_IMAGE_SIZE_FACTOR ?= 0.25 - -!$ROUNDED_BOX_SIZE ?= 25 -!$EIGHT_SIDED_SIZE ?= 18 - -' Default element wrap width (of an element) -!$DEFAULT_WRAP_WIDTH ?= 200 -' Maximum size in pixels, of a message (in a sequence diagram?) -!$MAX_MESSAGE_SIZE ?= 150 -' PlantUML supports no DETERMINISTIC/automatic line breaks of "PlantUML line" (C4 Relationships) -' therefore Rel...() implements an automatic line break based on spaces (like in all other objects). -' If a $type contains \n then these are used (and no automatic space based line breaks are done) -' $REL_TECHN_MAX_CHAR_WIDTH defines the automatic line break position -!$REL_TECHN_MAX_CHAR_WIDTH ?= 35 -!$REL_DESCR_MAX_CHAR_WIDTH ?= 32 - -' internal -' ################################## - -!global $ROUNDED_BOX = "roundedBox" -!global $EIGHT_SIDED = "eightSided" - -!global $DOTTED_LINE = "dotted" -!global $DASHED_LINE = "dashed" -!global $BOLD_LINE = "bold" -' solid is not defined in plantUML, but works as reset of all other styles too -!global $SOLID_LINE = "solid" - -!global $LEGEND_DETAILS_NONE = "none" -!global $LEGEND_DETAILS_NORMAL = "normal" -!global $LEGEND_DETAILS_SMALL = "small" - -skinparam defaultTextAlignment center - -skinparam wrapWidth $DEFAULT_WRAP_WIDTH -skinparam maxMessageSize $MAX_MESSAGE_SIZE - -skinparam LegendFontColor $LEGEND_FONT_COLOR -skinparam LegendBackgroundColor $LEGEND_BG_COLOR -skinparam LegendBorderColor $LEGEND_BORDER_COLOR - -skinparam rectangle<> { - backgroundcolor $LEGEND_BG_COLOR - bordercolor $LEGEND_BORDER_COLOR -} - -skinparam rectangle { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} - -skinparam database { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} - -skinparam queue { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} - -skinparam participant { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} - -skinparam arrow { - Color $ARROW_COLOR - FontColor $ARROW_FONT_COLOR - FontSize $ARROW_FONT_SIZE -} - -skinparam person { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} - -skinparam actor { - StereotypeFontSize $STEREOTYPE_FONT_SIZE - style awesome -} - -!if %variable_exists("ENABLE_ALL_PLANT_ELEMENTS") -skinparam agent { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam artifact { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam boundary { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam card { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam circle { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam cloud { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam collections { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam control { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam entity { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam file { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam folder { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam frame { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam hexagon { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam interface { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam label { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam stack { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam storage { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam usecase { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam person { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -!endif - -' Some boundary skinparams have to be set as package skinparams too (PlantUML uses internal packages) -' UpdateBoundaryStyle() called in boundary section below -skinparam rectangle<> { - StereotypeFontSize $TRANSPARENT_STEREOTYPE_FONT_SIZE - StereotypeFontColor $BOUNDARY_BG_COLOR - BorderStyle $BOUNDARY_BORDER_STYLE -} - -skinparam package { - StereotypeFontSize $TRANSPARENT_STEREOTYPE_FONT_SIZE - StereotypeFontColor $BOUNDARY_BG_COLOR - FontStyle plain - BackgroundColor $BOUNDARY_BG_COLOR -} - -' Legend and Tags -' ################################## -!global $tagDefaultLegend = "" -!global $tagCustomLegend = "" - -' rel specific -!unquoted function $toStereos($tags) - !if (%strlen($tags) == 0) - !return '' - !endif - !$stereos = '' - !$brPos = %strpos($tags, "+") - !while ($brPos >= 0) - !$tag = %substr($tags, 0, $brPos) - !$stereos = $stereos + '<<' + $tag + '>>' -%set_variable_value("$" + $tag + "_LineLegend", %true()) - !$tags = %substr($tags, $brPos+1) - !$brPos = %strpos($tags, "+") - !endwhile - !if (%strlen($tags) > 0) - !$stereos = $stereos + '<<' + $tags + '>>' -%set_variable_value("$" + $tags + "_LineLegend", %true()) - !endif - !return $stereos -!endfunction - -' if $sprite/$techn is an empty argument, try to calculate it via the defined $tag -!unquoted function $toRelArg($arg, $tags, $varPostfix) - !if ($arg > "") - !return $arg - !endif - - !if (%strlen($tags) == 0) - !return $arg - !endif - !$brPos = %strpos($tags, "+") - !while ($brPos >= 0) - !$tag = %substr($tags, 0, $brPos) - !$newArg = %get_variable_value("$" + $tag + $varPostfix) - !if ($newArg > "") - !return $newArg - !endif - !$tags = %substr($tags, $brPos+1) - !$brPos = %strpos($tags, "+") - !endwhile - !if (%strlen($tags) > 0) - !$newArg = %get_variable_value("$" + $tags + $varPostfix) - !if ($newArg > "") - !return $newArg - !endif - !endif - !return $arg -!endfunction - -' element specific (unused are hidden based on mask) -!unquoted function $toStereos($elementType, $tags) - !if (%strlen($tags) == 0) - !$stereos = '<<' + $elementType + '>>' -%set_variable_value("$" + $elementType + "Legend", %true()) - !return $stereos - !endif - !$stereos = '' - !$mask = $resetMask() - !$brPos = %strpos($tags, "+") - !while ($brPos >= 0) - !$tag = %substr($tags, 0, $brPos) - !$stereos = $stereos + '<<' + $tag + '>>' - !$mergedMask = $combineMaskWithTag($mask, $tag) - !if ($mergedMask != $mask) -%set_variable_value("$" + $tag + "Legend", %true()) - !$mask = $mergedMask - !endif - !$tags = %substr($tags, $brPos+1) - !$brPos = %strpos($tags, "+") - !endwhile - !if (%strlen($tags) > 0) - !$stereos = $stereos + '<<' + $tags + '>>' - !$mergedMask = $combineMaskWithTag($mask, $tags) - !if ($mergedMask != $mask) -%set_variable_value("$" + $tags + "Legend", %true()) - !$mask = $mergedMask - !endif - !endif - ' has to be last, otherwise PlantUML overwrites all tag specific skinparams - !$stereos = $stereos + '<<' + $elementType + '>>' - !$mergedMask = $combineMaskWithTag($mask, $elementType) - !if ($mergedMask != $mask) -%set_variable_value("$" + $elementType + "Legend", %true()) - !$mask = $mergedMask - !endif - !return $stereos -!endfunction - -' if $sprite/$techn is an empty argument, try to calculate it via the defined $tag -!unquoted function $toElementArg($arg, $tags, $varPostfix, $elementType) - !if ($arg > "") - !return $arg - !endif - - !if (%strlen($tags) == 0) - !$newArg = %get_variable_value("$" + $elementType + $varPostfix) - !if ($newArg > "") - !return $newArg - !else - !return $arg - !endif - !endif - !$brPos = %strpos($tags, "+") - !while ($brPos >= 0) - !$tag = %substr($tags, 0, $brPos) - !$newArg = %get_variable_value("$" + $tag + $varPostfix) - !if ($newArg > "") - !return $newArg - !endif - !$tags = %substr($tags, $brPos+1) - !$brPos = %strpos($tags, "+") - !endwhile - !if (%strlen($tags) > 0) - !$newArg = %get_variable_value("$" + $tags + $varPostfix) - !if ($newArg > "") - !return $newArg - !endif - !$newArg = %get_variable_value("$" + $elementType + $varPostfix) - !if ($newArg > "") - !return $newArg - !endif - !endif - !return $arg -!endfunction - -' if $value is empty try to load it via variable, optional can it store the calculated value -!function $restoreEmpty($elementType, $property, $value, $store) - !$var = "$" + $elementType + "Restore" + $property - !if ($value == "") - !$value = %get_variable_value($var) - !elseif ($store) - %set_variable_value($var, $value) - !endif - !return $value -!endfunction - -' clear the restore property -!function $clearRestore($elementType, $property) - !$var = "$" + $elementType + "Restore" + $property - %set_variable_value($var, "") - !return "" -!endfunction - -!function $elementTagSkinparams($element, $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $borderStyle, $borderThickness) - !$elementSkin = "skinparam " + $element + "<<" + $tagStereo + ">> {" + %newline() - !if ($fontColor != "") - !if (%strpos($tagStereo, "boundary") < 0) - !$elementSkin = $elementSkin + " StereotypeFontColor " + $fontColor + %newline() - !endif - !$elementSkin = $elementSkin + " FontColor " + $fontColor + %newline() - !endif - !if ($bgColor != "") - !$elementSkin = $elementSkin + " BackgroundColor " + $bgColor + %newline() - !endif - !if ($borderColor != "") - !$elementSkin = $elementSkin + " BorderColor " + $borderColor+ %newline() - !endif - !if ($shadowing == "true") - !$elementSkin = $elementSkin + " Shadowing<<" + $tagStereo + ">> " + "true" + %newline() - !endif - !if ($shadowing == "false") - !$elementSkin = $elementSkin + " Shadowing<<" + $tagStereo + ">> " + "false" + %newline() - !endif - ' only rectangle supports shape(d corners), define both skinparam that overlays are working - !if ($shape != "" && $element == "rectangle") - !if ($shape == $ROUNDED_BOX) - !$elementSkin = $elementSkin + " RoundCorner " + $ROUNDED_BOX_SIZE+ %newline() - !$elementSkin = $elementSkin + " DiagonalCorner " + "0" + %newline() - !elseif ($shape == $EIGHT_SIDED) - !$elementSkin = $elementSkin + " RoundCorner " + "0" + %newline() - !$elementSkin = $elementSkin + " DiagonalCorner " + $EIGHT_SIDED_SIZE+ %newline() - !endif - !endif - !if ($borderStyle != "") - !$elementSkin = $elementSkin + " BorderStyle " + $borderStyle + %newline() - !endif - !if ($borderThickness != "") - !$elementSkin = $elementSkin + " BorderThickness " + $borderThickness + %newline() - !endif - !$elementSkin = $elementSkin + "}" + %newline() - !return $elementSkin -!endfunction - -!unquoted procedure $defineSkinparams($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $borderStyle, $borderThickness) - ' only rectangle supports shape(d corners) - !$tagSkin = $elementTagSkinparams("rectangle", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("database", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("queue", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - ' plantuml.jar bug - actor have to be after person - !$tagSkin = $tagSkin + $elementTagSkinparams("person", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - ' actor has style awesome, therefore $fontColor is ignored and text uses $bgColor too - !$tagSkin = $tagSkin + $elementTagSkinparams("actor", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - ' sequence requires participant - !$tagSkin = $tagSkin + $elementTagSkinparams("participant", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("sequencebox", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !if (%strpos($tagStereo, "boundary") >= 0 && $bgColor != "") - !$tagSkin = $tagSkin + "skinparam package<<" + $tagStereo + ">>StereotypeFontColor " + $bgColor + %newline() - !$tagSkin = $tagSkin + "skinparam rectangle<<" + $tagStereo + ">>StereotypeFontColor " + $bgColor + %newline() - !endif - !if %variable_exists("ENABLE_ALL_PLANT_ELEMENTS") - !$tagSkin = $tagSkin + $elementTagSkinparams("agent", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("artifact", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("card", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("cloud", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("collections", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("file", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("folder", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("frame", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("hexagon", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("package", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("stack", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("storage", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("usecase", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - ' elements without background: font uses $bgColor - !$tagSkin = $tagSkin + $elementTagSkinparams("boundary", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("circle", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("control", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("entity", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("interface", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - ' label uses wrong font color? (should be $bgColor too) - !$tagSkin = $tagSkin + $elementTagSkinparams("label", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !endif -$tagSkin -!endprocedure - -' arrow colors cannot start with # (legend background has to start with #) -!function $colorWithoutHash($c) - !if (%substr($c, 0, 1) == "#") - !$c = %substr($c,1) - !endif - !return $c -!endfunction - -!unquoted procedure $defineRelSkinparams($tagStereo, $textColor, $lineColor, $lineStyle, $lineThickness) - !$elementSkin = "skinparam arrow<<" + $tagStereo + ">> {" + %newline() - !if ($lineColor != "") || ($textColor != "") || ($lineStyle != "") - !$elementSkin = $elementSkin + " Color " - !if ($lineColor != "") - !$elementSkin = $elementSkin + $colorWithoutHash($lineColor) - !endif - !if ($textColor != "") - !$elementSkin = $elementSkin + ";text:" + $colorWithoutHash($textColor) - !endif - !if ($lineStyle != "") - !$elementSkin = $elementSkin + ";line." + $lineStyle - !endif - !$elementSkin = $elementSkin + %newline() - !endif - !if ($lineThickness != "") - !$elementSkin = $elementSkin + " thickness " + $lineThickness + %newline() - !endif - !$elementSkin = $elementSkin + "}" + %newline() -$elementSkin -!endprocedure - -' %is_dark() requires PlantUML version >= 1.2021.6 -!if (%function_exists("%is_dark")) - !$PlantUMLSupportsDynamicLegendColor = %true() -!else - !$PlantUMLSupportsDynamicLegendColor = %false() - !log "dynamic undefined legend colors" requires PlantUML version >= 1.2021.6, therefore only static assigned colors are used -!endif - -!unquoted function $contrastLegend($color) - !if (%is_dark($color)) - !$value = $LEGEND_LIGHT_COLOR - !else - !$value = $LEGEND_DARK_COLOR - !endif - !return $value -!endfunction - -!unquoted function $flatLegend($color) - !if (%is_dark($color)) - !$value = $LEGEND_DARK_COLOR - !else - !$value = $LEGEND_LIGHT_COLOR - !endif - !return $value -!endfunction - -' legend background has to start with # -!function $colorWithHash($c) - !if (%substr($c, 0, 1) != "#") - !$c = "#" + $c - !endif - !return $c -!endfunction - -!function $addMaskFlag($mask, $attr) - !if ($attr == "") - !$mask = $mask + "0" - !else - !$mask = $mask + "1" - !endif - !return $mask -!endfunction - -!function $orFlags($flag1, $flag2) - !if ($flag1 == "0" && $flag2 == "0") - !return "0" - !endif - !return "1" -!endfunction - -!function $tagLegendMask($bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $borderStyle, $borderThickness) - !$mask = "" - !$mask = $addMaskFlag($mask, $bgColor) - !$mask = $addMaskFlag($mask, $fontColor) - !$mask = $addMaskFlag($mask, $borderColor) - !$mask = $addMaskFlag($mask, $shadowing) - !$mask = $addMaskFlag($mask, $shape) - !$mask = $addMaskFlag($mask, $sprite) - !$mask = $addMaskFlag($mask, $borderStyle) - !$mask = $addMaskFlag($mask, $borderThickness) - !return $mask -!endfunction - -!function $resetMask() - !return "00000000" -!endfunction - -!function $combineMasks($mask1, $mask2) - !$mask = "" - !$mask = $mask + $orFlags(%substr($mask1, 0, 1), %substr($mask2, 0, 1)) - !$mask = $mask + $orFlags(%substr($mask1, 1, 1), %substr($mask2, 1, 1)) - !$mask = $mask + $orFlags(%substr($mask1, 2, 1), %substr($mask2, 2, 1)) - !$mask = $mask + $orFlags(%substr($mask1, 3, 1), %substr($mask2, 3, 1)) - !$mask = $mask + $orFlags(%substr($mask1, 4, 1), %substr($mask2, 4, 1)) - !$mask = $mask + $orFlags(%substr($mask1, 5, 1), %substr($mask2, 5, 1)) - !$mask = $mask + $orFlags(%substr($mask1, 6, 1), %substr($mask2, 6, 1)) - !$mask = $mask + $orFlags(%substr($mask1, 7, 1), %substr($mask2, 7, 1)) - !return $mask -!endfunction - -!function $combineMaskWithTag($mask1, $tag) - !$mask2 = %get_variable_value("$" + $tag+ "LegendMask") - !if ($mask2 == "") - ' !log combineMaskWithTag $mask1, $tag, ... only $mask1 - !return $mask1 - !endif - - ' !log combineMaskWithTag $mask1, $tag, $mask2 ... $combineMasks($mask1, $mask2) - !return $combineMasks($mask1, $mask2) -!endfunction - -' element symbols typically 4 times too big in legend -!function $smallVersionSprite($sprite) - ' ,scale= ... has to be first (...,color=black,scale=0.25... is invalid too) - !if (%strpos($sprite, "=") < 0) - !if (%substr($sprite, 0, 4) == "img:") - !$smallSprite = $sprite + "{scale=" + $LEGEND_IMAGE_SIZE_FACTOR + "}" - !else - !$smallSprite = $sprite + ",scale=" + $LEGEND_IMAGE_SIZE_FACTOR - !endif - !else - !$smallSprite = $sprite - !endif - !return $smallSprite -!endfunction - -' format sprite that it can be used in diagram -!function $getSprite($sprite) - ' if it starts with & it's a OpenIconic, details see https://useiconic.com/open/ - ' if it starts with img: it's an image, details see https://plantuml.com/creole - !if (%substr($sprite, 0, 1) != "&" && %substr($sprite, 0, 4) != "img:") - !$formatted = "<$" + $sprite + ">" - !else - !$formatted = "<" + $sprite + ">" - !endif - !return $formatted -!endfunction - -!function $setTagLegendVariables($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $legendText, $legendSprite, $borderStyle, $borderThickness) - !$bg = $bgColor - !$fo = $fontColor - !$bo = $borderColor - - !if ($fo == "") - !if ($bg != "") -!if ($PlantUMLSupportsDynamicLegendColor) - !$fo = $contrastLegend($bg) -!else - !$fo = $LEGEND_DARK_COLOR -!endif - !else - !if ($bo == "") - !$fo = $LEGEND_DARK_COLOR - !$bg = $LEGEND_LIGHT_COLOR - !else -!if ($PlantUMLSupportsDynamicLegendColor) - !$fo = $flatLegend($bo) - !$bg = $contrastLegend($bo) -!else - !$fo = $LEGEND_DARK_COLOR - !$bg = $LEGEND_LIGHT_COLOR -!endif - !endif - !endif - !else - !if ($bg == "") -!if ($PlantUMLSupportsDynamicLegendColor) - !$bg = $contrastLegend($fo) -!else - !$bg = $LEGEND_LIGHT_COLOR -!endif - !endif - !endif - - !if ($bo == "") - !$bo = $bg - !endif - - !$tagEntry = "|" - !$tagDetails = "(" - !$tagEntry = $tagEntry + "<" + $colorWithHash($bg) +">" - ' ..white rectangle - !$tagEntry = $tagEntry + " " - !$tagEntry = $tagEntry + "" - !if ($legendSprite != "") - !$tagEntry = $tagEntry + $getSprite($legendSprite) + " " - !endif - - !$isBoundary = 0 - !if ($legendText == "") - !if (%strpos($tagStereo, "boundary") >= 0) - !if ($tagStereo == "boundary") - !$isBoundary = 1 - !$tagEntry = $tagEntry + " " + $LEGEND_BOUNDARY + " " - !else - ' if contains/ends with _boundary remove _boundary and add "boundary (dashed)" - !$pos = %strpos($tagStereo, "_boundary") - !if ($pos > 0) - !$isBoundary = 1 - !$tagEntry = $tagEntry + " " + %substr($tagStereo, 0 ,$pos) + " " +$LEGEND_BOUNDARY + " " - !endif - !endif - !endif - !if ($isBoundary == 0) - !$tagEntry = $tagEntry + " " + $tagStereo + " " - !endif - - !if ($isBoundary == 1 && ($bgColor == "#00000000" || %lower($bgColor) == "transparent")) - !$tagDetails = $tagDetails + $LEGEND_BOUNDARY_TRANSPARENT_INCL_COMA - !endif - !if ($shadowing == "true") - !$tagDetails = $tagDetails + $LEGEND_SHADOW_TEXT + ", " - !endif - !if ($shadowing == "false") - !$tagDetails = $tagDetails + $LEGEND_NO_SHADOW_TEXT + ", " - !endif - !if ($shape == $ROUNDED_BOX) - !$tagDetails = $tagDetails + $LEGEND_ROUNDED_BOX + ", " - !endif - !if ($shape == $EIGHT_SIDED) - !$tagDetails = $tagDetails + $LEGEND_EIGHT_SIDED + ", " - !endif - !if ($fontColor == "" && $bgColor == "") - !$tagDetails = $tagDetails + $LEGEND_NO_FONT_BG_TEXT + ", " - !else - !if ($fontColor == "") - !$tagDetails = $tagDetails + $LEGEND_NO_FONT_TEXT + ", " - !endif - !if ($bgColor == "") - !$tagDetails = $tagDetails + $LEGEND_NO_BG_TEXT + ", " - !endif - !endif - !if ($borderStyle != "") - !if ($borderStyle == $DOTTED_LINE) - !$tagDetails = $tagDetails + $LEGEND_DOTTED_LINE + ", " - !elseif ($borderStyle == $DASHED_LINE) - !if ($isBoundary == 1) - !$tagDetails = $tagDetails + $LEGEND_BOUNDARY_DASHED_INCL_COMA - !else - !$tagDetails = $tagDetails + $LEGEND_DASHED_LINE + ", " - !endif - !elseif ($borderStyle == $BOLD_LINE) - !$tagDetails = $tagDetails + $LEGEND_BOLD_LINE + ", " - !elseif ($borderStyle == $SOLID_LINE) - !$tagDetails = $tagDetails + $LEGEND_SOLID_LINE + ", " - !else - !$tagDetails = $tagDetails + $lineStyle + ", " - !endif - !endif - !if ($borderThickness != "") - !$tagDetails = $tagDetails + $LEGEND_THICKNESS + " " + $borderThickness + ", " - !endif - !if ($tagDetails=="(" || $tagDetails=="(, ") - !$tagDetails = "" - !else - !$tagDetails = %substr($tagDetails, 0, %strlen($tagDetails)-2) - !$tagDetails = $tagDetails + ")" - !endif - !else - !$brPos = %strpos($legendText, "\n") - !if ($brPos > 0) - !$tagEntry = $tagEntry + %substr($legendText, 0, $brPos) + " " - !$details = %substr($legendText, $brPos + 2) - !if ($details=="") - !$tagDetails = "" - !else - !$tagDetails = $tagDetails + $details + ")" - !endif - !else - !$tagEntry = $tagEntry + " " + $legendText + " " - !$tagDetails = "" - !endif - !endif - - !$tagDetails = $tagDetails + " " - !$tagDetails = $tagDetails + "|" -%set_variable_value("$" + $tagStereo + "LegendEntry", $tagEntry) -%set_variable_value("$" + $tagStereo + "LegendDetails", $tagDetails) - !return $tagEntry -!endfunction - -!function $setTagRelLegendVariables($tagStereo, $textColor, $lineColor, $lineStyle, $legendText, $legendSprite, $lineThickness) - !$tc = $textColor - !$lc = $lineColor - - !if ($tc == "") - !if ($PlantUMLSupportsDynamicLegendColor) - !$tc = $flatLegend($ARROW_FONT_COLOR) - !else - !$tc = $LEGEND_DARK_COLOR - !endif - !endif - !if ($lc == "") - !if ($PlantUMLSupportsDynamicLegendColor) - !$lc = $flatLegend($ARROW_COLOR) - !else - !$lc = $LEGEND_DARK_COLOR - !endif - !endif - - !$tagEntry = "|" - !$tagDetails = "(" - ' ..white line - !$tagEntry = $tagEntry + " " - !$tagEntry = $tagEntry + "" - !if ($legendSprite != "") - !$tagEntry = $tagEntry + $getSprite($legendSprite) + " " - !endif - !if ($legendText == "") - !$tagEntry = $tagEntry + " " + $tagStereo + " " - !if ($textColor == "") - !$tagDetails = $tagDetails + $LEGEND_NO_FONT_TEXT + ", " - !endif - !if ($lineColor == "") - !$tagDetails = $tagDetails + $LEGEND_NO_LINE_TEXT + ", " - !endif - !if ($lineStyle != "") - !if ($lineStyle == $DOTTED_LINE) - !$tagDetails = $tagDetails + $LEGEND_DOTTED_LINE + ", " - !elseif ($lineStyle == $DASHED_LINE) - !$tagDetails = $tagDetails + $LEGEND_DASHED_LINE + ", " - !elseif ($lineStyle == $BOLD_LINE) - !$tagDetails = $tagDetails + $LEGEND_BOLD_LINE + ", " - !else - !$tagDetails = $tagDetails + $lineStyle + ", " - !endif - !endif - !if ($lineThickness != "") - !$tagDetails = $tagDetails + $LEGEND_THICKNESS + " " + $lineThickness + ", " - !endif - !if ($tagDetails=="(") - !$tagDetails = "" - !else - !$tagDetails = %substr($tagDetails, 0, %strlen($tagDetails)-2) - !$tagDetails = $tagDetails + ")" - !endif - !else - !$brPos = %strpos($legendText, "\n") - !if ($brPos > 0) - !$tagEntry = $tagEntry + " " + %substr($legendText, 0, $brPos) + " " - !$details = %substr($legendText, $brPos + 2) - !if ($details=="") - !$tagDetails = "" - !else - !$tagDetails = $tagDetails + $details + ")" - !endif - !else - !$tagEntry = $tagEntry + " " + $legendText + " " - !$tagDetails = "" - !endif - !endif - - !$tagDetails = $tagDetails + " " - !$tagDetails = $tagDetails + "|" -%set_variable_value("$" + $tagStereo + "_LineLegendEntry", $tagEntry) -%set_variable_value("$" + $tagStereo + "_LineLegendDetails", $tagDetails) - !return $tagEntry -!endfunction - -!unquoted procedure $addTagToLegend($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $legendText="", $legendSprite="", $borderStyle="", $borderThickness="") -'' if a combined element tag is defined (e.g. "v1.0&v1.1") then it is typically a merged color, -'' like a new $fontColor="#fdae61" therefore it should be added to the legend -'' and the & combined tags will be not removed -' !if (%strpos($tagStereo, "&") < 0) - !$dummyAlreadyVariables = $setTagLegendVariables($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $legendText, $legendSprite, $borderStyle, $borderThickness) - !$tagCustomLegend = $tagCustomLegend + $tagStereo + "\n" - !$tagMask = $tagLegendMask( $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $borderStyle, $borderThickness) -%set_variable_value("$" + $tagStereo + "LegendMask", $tagMask) -' !endif -!endprocedure - -!unquoted procedure $addRelTagToLegend($tagStereo, $textColor="", $lineColor="", $lineStyle="", $legendText="", $legendSprite="", $lineThickness="") -'' Arrows have a bug with stereotype/skinparams and cannot combine text colors of one stereotype -'' and the line color of another stereotype. Therefore the text color of one tag and the line color -'' of another tag have to be combined via a "workaround" tag ("v1.0&v1.1"). -'' This workaround tag could be theoretically removed in the legend but after that there would -'' be an inconsistency between the element tags and the rel tags and therefore -'' & combined workaround tags are not removed too (and in unlikely cases the color itself could be changed) -' !if (%strpos($tagStereo, "&") < 0) - !$dummyAlreadyVariables = $setTagRelLegendVariables($tagStereo, $textColor, $lineColor, $lineStyle, $legendText, $legendSprite, $lineThickness) - !$tagCustomLegend = $tagCustomLegend + $tagStereo + "_Line\n" -' !endif -!endprocedure - -!procedure $showActiveLegendEntries($allDefined) - !$brPos = %strpos($allDefined, "\n") - !while ($brPos >= 0) - !$tagStereo = %substr($allDefined, 0, $brPos) - !$allDefined = %substr($allDefined, $brPos+2) - !$brPos = %strpos($allDefined, "\n") - !if (%variable_exists("$" + $tagStereo + "Legend")) - ' is part of legendDetails - !$part1 = %get_variable_value("$" + $tagStereo + "LegendEntry") - !$partSize = "" - !$part2 = %get_variable_value("$" + $tagStereo + "LegendDetails") - !$line = $part1 + $partSize + $part2 -$line - !endif - !endwhile - !if (%strlen($allDefined) > 0) - !$tagStereo = $allDefined - !if (%variable_exists("$" + $tagStereo + "Legend")) - ' is part of legendDetails - !$part1 = %get_variable_value("$" + $tagStereo + "LegendEntry") - !$partSize = "" - !$part2 = %get_variable_value("$" + $tagStereo + "LegendDetails") - !$line = $part1 + $partSize + $part2 -$line - !endif - !endif -!endprocedure - -!function RoundedBoxShape() -!return $ROUNDED_BOX -!endfunction - -!function EightSidedShape() -!return $EIGHT_SIDED -!endfunction - -!function DottedLine() -!return $DOTTED_LINE -!endfunction - -!function DashedLine() -!return $DASHED_LINE -!endfunction - -!function BoldLine() -!return $BOLD_LINE -!endfunction - -!function SolidLine() -!return $SOLID_LINE -!endfunction - -' used by new defined tags -!unquoted procedure AddElementTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="", $borderStyle="", $borderThickness="") -$defineSkinparams($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $borderStyle, $borderThickness) - !if ($sprite!="") -%set_variable_value("$" + $tagStereo + "ElementTagSprite", $sprite) - !if ($legendSprite == "") - !$legendSprite = $smallVersionSprite($sprite) - !endif - !endif - !if ($techn != "") -%set_variable_value("$" + $tagStereo + "ElementTagTechn", $techn) - !endif -$addTagToLegend($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure - -!unquoted procedure $addElementTagInclReuse($elementName, $tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="", $borderStyle="", $borderThickness="") - !$bgColor=$restoreEmpty($elementName, "bgColor", $bgColor, %false()) - !$fontColor=$restoreEmpty($elementName, "fontColor", $fontColor, %false()) - !$borderColor=$restoreEmpty($elementName, "borderColor", $borderColor, %false()) - !$shadowing=$restoreEmpty($elementName, "shadowing", $shadowing, %false()) - !$shape=$restoreEmpty($elementName, "shape", $shape, %false()) - !$sprite=$restoreEmpty($elementName, "sprite", $sprite, %false()) - !$techn=$restoreEmpty($elementName, "techn", $techn, %false()) - ' new style should has its own legend text - ' !$legendText=$restoreEmpty($elementName, "legendText", $legendText, %false()) - !$legendSprite=$restoreEmpty($elementName, "legendSprite", $legendSprite, %false()) - !$borderStyle=$restoreEmpty($elementName, "borderStyle", $borderStyle, %false()) - !$borderThickness=$restoreEmpty($elementName, "borderThickness", $borderThickness, %false()) - - AddElementTag($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $techn, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure - -' used by new defined rel tags -!unquoted procedure AddRelTag($tagStereo, $textColor="", $lineColor="", $lineStyle="", $sprite="", $techn="", $legendText="", $legendSprite="", $lineThickness="") -$defineRelSkinparams($tagStereo, $textColor, $lineColor, $lineStyle, $lineThickness) - !if ($sprite != "") -%set_variable_value("$" + $tagStereo + "RelTagSprite", $sprite) - !if ($legendSprite == "") - ' relation symbols typically 1:1 no additional scale required - !$legendSprite = $sprite - !endif - !endif - !if ($techn != "") -%set_variable_value("$" + $tagStereo + "RelTagTechn", $techn) - !endif -$addRelTagToLegend($tagStereo, $textColor, $lineColor, $lineStyle, $legendText, $legendSprite, $lineThickness) -!endprocedure - -' update the style of existing elements like person, ... -!unquoted procedure UpdateElementStyle($elementName, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="", $borderStyle="", $borderThickness="") -!$bgColor=$restoreEmpty($elementName, "bgColor", $bgColor, %true()) -!$fontColor=$restoreEmpty($elementName, "fontColor", $fontColor, %true()) -!$borderColor=$restoreEmpty($elementName, "borderColor", $borderColor, %true()) -!$shadowing=$restoreEmpty($elementName, "shadowing", $shadowing, %true()) -!$shape=$restoreEmpty($elementName, "shape", $shape, %true()) -!$sprite=$restoreEmpty($elementName, "sprite", $sprite, %true()) -!$techn=$restoreEmpty($elementName, "techn", $techn, %true()) -!$legendText=$restoreEmpty($elementName, "legendText", $legendText, %true()) -!$legendSprite=$restoreEmpty($elementName, "legendSprite", $legendSprite, %true()) -!$borderStyle=$restoreEmpty($elementName, "borderStyle", $borderStyle, %true()) -!$borderThickness=$restoreEmpty($elementName, "borderThickness", $borderThickness, %true()) - -$defineSkinparams($elementName, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $borderStyle, $borderThickness) - !if ($sprite != "") -%set_variable_value("$" + $elementName + "ElementTagSprite", $sprite) - !if ($legendSprite == "") - !$legendSprite = $smallVersionSprite($sprite) - !endif - !endif - !if ($techn != "") -%set_variable_value("$" + $elementName + "ElementTagTechn", $techn) - !endif - !$dummyAlreadyVariables = $setTagLegendVariables($elementName, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $legendText, $legendSprite, $borderStyle, $borderThickness) - ' default tags sets at least bgColor and fontColor - !$tagMask = $tagLegendMask("CHANGED", "CHANGED", $borderColor, $shadowing, $shape, $sprite, $borderStyle, $borderThickness) -%set_variable_value("$" + $elementName + "LegendMask", $tagMask) -!endprocedure - -/' @deprecated in favor of UpdateElementStyle '/ -!unquoted procedure UpdateSkinparamsAndLegendEntry($elementName, $bgColor="", $fontColor="", $borderColor="", $shadowing="") -UpdateElementStyle($elementName, $bgColor, $fontColor, $borderColor, $shadowing) -!endprocedure - -' update the style of default relation, it has to set both properties (combined statement not working) -!unquoted procedure UpdateRelStyle($textColor, $lineColor) - !$elementSkin = "skinparam arrow {" + %newline() - !$elementSkin = $elementSkin + " Color " + $lineColor + %newline() - !$elementSkin = $elementSkin + " FontColor " + $textColor + %newline() - !$elementSkin = $elementSkin + "}" + %newline() -$elementSkin -!endprocedure - -' tags/stereotypes have to be delimited with \n -!unquoted procedure SetDefaultLegendEntries($tagStereoEntries) - !$tagDefaultLegend = $tagStereoEntries -!endprocedure - -' Links -' ################################## - -!function $getLink($link) - !if ($link != "") - !return "[[" + $link + "]]" - !else - !return "" - !endif -!endfunction - -' Line breaks -' ################################## - -!unquoted function $breakText($text, $usedNewLine, $widthStr="-1") -!$width = %intval($widthStr) -!$multiLine = "" -!if (%strpos($text, "\n") >= 0) - !while (%strpos($text, "\n") >= 0) - !$brPos = %strpos($text, "\n") - !if ($brPos > 0) - !$multiLine = $multiLine + %substr($text, 0, $brPos) + $usedNewLine - !else - ' non breaking change that newLine breaks with formats can be used with \n\n - !$multiLine = $multiLine + "" + $usedNewLine - !endif - !$text = %substr($text, $brPos+2) - !if (%strlen($text) == 0) - !$text = "" - !endif - !endwhile -!else - !while ($width>0 && %strlen($text) > $width) - !$brPos = $width - !while ($brPos > 0 && %substr($text, $brPos, 1) != ' ') - !$brPos = $brPos - 1 - !endwhile - - !if ($brPos < 1) - !$brPos = %strpos($text, " ") - !else - !endif - - !if ($brPos > 0) - !$multiLine = $multiLine + %substr($text, 0, $brPos) + $usedNewLine - !$text = %substr($text, $brPos + 1) - !else - !$multiLine = $multiLine+ $text - !$text = "" - !endif - !endwhile -!endif -!if (%strlen($text) > 0) - !$multiLine = $multiLine + $text -!endif -!return $multiLine -!endfunction - -!unquoted function $breakLabel($text) -!$usedNewLine = "\n== " -!$multiLine = $breakText($text, $usedNewLine) -!return $multiLine -!endfunction - -!unquoted function $breakDescr($text, $widthStr) - !$usedNewLine = "\n" - !return $breakText($text, $usedNewLine, $widthStr) -!endfunction - -' $breakTechn() supports //...//; $breakNode() in C4_Deployment supports no //....// -!unquoted function $breakTechn($text, $widthStr) - !$usedNewLine = '//\n//' - !return $breakText($text, $usedNewLine, $widthStr) -!endfunction - -' Element base layout -' ################################## - -!function $getElementBase($label, $techn, $descr, $sprite) - !$element = "" - !if ($sprite != "") - !$element = $element + $getSprite($sprite) - !if ($label != "") - !$element = $element + '\n' - !endif - !endif - !if ($label != "") - !$element = $element + '== ' + $breakLabel($label) - !else - !$element = $element + '.' - !endif - !if ($techn != "") - !$element = $element + '\n//[' + $breakTechn($techn, '-1') + ']//' - !endif - !if ($descr != "") - !$element = $element + '\n\n' + $descr - !endif - !return $element -!endfunction - -!function $getElementLine($umlShape, $elementType, $alias, $label, $techn, $descr, $sprite, $tags, $link) - !$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", $elementType) - !$techn=$toElementArg($techn, $tags, "ElementTagTechn", $elementType) - !$baseProp = $getElementBase($label, $techn, $descr, $sprite) + $getProps() - !$stereo = $toStereos($elementType,$tags) - !$calcLink = $getLink($link) - - !$line = $umlShape + " " + %chr(34) + $baseProp + %chr(34) +" " + $stereo + " as " + $alias + $calcLink - !return $line -!endfunction - -' Element properties -' ################################## - -' collect all defined properties as table rows -!global $propTable = "" -!global $propTableCaption = "" -!global $propColCaption = "=" - -!unquoted function SetPropertyHeader($col1Name, $col2Name, $col3Name = "", $col4Name = "") - !$propColCaption = "" - !$propTableCaption = "|= " + $col1Name + " |= " + $col2Name + " |" - !if ($col3Name != "") - !$propTableCaption = $propTableCaption + "= " + $col3Name + " |" - !endif - !if ($col4Name != "") - !$propTableCaption = $propTableCaption + "= " + $col4Name + " |" - !endif - !return "" -!endfunction - -!unquoted function WithoutPropertyHeader() - !$propTableCaption = "" - !$propColCaption = "=" - !return "" -!endfunction - -!unquoted function AddProperty($col1, $col2, $col3 = "", $col4 = "") - !if ($propTable == "") - !if ($propTableCaption != "") - !$propTable = $propTableCaption + "\n" - !endif - !else - !$propTable = $propTable + "\n" - !endif - !$propTable = $propTable + "| " + $col1 + " |" + $propColCaption + " " + $col2 + " |" - !if ($col3 != "") - !$propTable = $propTable + " " + $col3 + " |" - !endif - !if ($col4 != "") - !$propTable = $propTable + " " + $col4 + " |" - !endif - !return "" -!endfunction - -!unquoted function $getProps($alignedNL = "\n") - !if ($propTable != "") - !$retTable = $alignedNL + $propTable - !$propTable = "" - !return $retTable - !endif - !return "" -!endfunction - -!unquoted function $getProps_L() - !return $getProps("\l") -!endfunction - -!unquoted function $getProps_R() - !return $getProps("\r") -!endfunction - -SetPropertyHeader("Property","Value") - -' Layout -' ################################## - -!function $getLegendDetailsSize($detailsFormat) - !if $detailsFormat == $LEGEND_DETAILS_NONE - !$size = 0 - !elseif $detailsFormat == $LEGEND_DETAILS_SMALL - !$size = $LEGEND_DETAILS_SMALL_SIZE - !else - !$size = $LEGEND_DETAILS_NORMAL_SIZE - !endif - !return $size -!endfunction - -!procedure $getHideStereotype($hideStereotype) -!if ($hideStereotype == "true") -hide stereotype -!endif -!endprocedure - -!procedure $getLegendTable($detailsFormat) -!global $LEGEND_DETAILS_SIZE = $getLegendDetailsSize($detailsFormat) -<$colorWithHash(transparent),$colorWithHash(transparent)>|**Legend** | -$showActiveLegendEntries($tagDefaultLegend) -$showActiveLegendEntries($tagCustomLegend) -!endprocedure - -!procedure $getLegendArea($areaAlias, $hideStereotype, $details) -$getHideStereotype($hideStereotype) -rectangle $areaAlias<> [ -$getLegendTable($details) -] -!endprocedure - -!procedure HIDE_STEREOTYPE() -hide stereotype -!endprocedure - -!unquoted procedure SET_SKETCH_STYLE($bgColor="_dont_change_", $fontColor="_dont_change_", $warningColor="_dont_change_", $fontName="_dont_change_", $footerWarning="_dont_change_", $footerText="_dont_change_") -!if $bgColor != "_dont_change_" - !global $SKETCH_BG_COLOR = $bgColor -!endif -!if $fontColor != "_dont_change_" - !global $SKETCH_FONT_COLOR = $fontColor -!endif -!if $warningColor != "_dont_change_" - !global $SKETCH_WARNING_COLOR = $warningColor -!endif -!if $fontName != "_dont_change_" - !global $SKETCH_FONT_NAME = $fontName -!endif -!if $footerWarning != "_dont_change_" - !global $SKETCH_FOOTER_WARNING = $footerWarning -!endif -!if $footerText != "_dont_change_" - !global $SKETCH_FOOTER_TEXT = $footerText -!endif -!endprocedure - -!procedure LAYOUT_AS_SKETCH() - skinparam handwritten true -!if $SKETCH_BG_COLOR > "" - skinparam backgroundColor $SKETCH_BG_COLOR -!endif -!if $SKETCH_FONT_COLOR > "" - skinparam footer { - FontColor $SKETCH_FONT_COLOR - } - !if $ARROW_COLOR == "#666666" - !global $ARROW_COLOR = $SKETCH_FONT_COLOR - !global $ARROW_FONT_COLOR = $SKETCH_FONT_COLOR - skinparam arrow { - Color $ARROW_COLOR - FontColor $ARROW_FONT_COLOR - } - !endif - !if $BOUNDARY_COLOR == "#444444" - !global $BOUNDARY_COLOR = $SKETCH_FONT_COLOR - skinparam rectangle<> { - FontColor $BOUNDARY_COLOR - BorderColor $BOUNDARY_COLOR - } - !endif -!endif -!if $SKETCH_FONT_NAMES > "" - skinparam defaultFontName $SKETCH_FONT_NAME -!endif -!if $SKETCH_FOOTER_WARNING > "" || $SKETCH_FOOTER_TEXT > "" - !$line = "footer "+ $SKETCH_FOOTER_WARNING + " " + $SKETCH_FOOTER_TEXT - $line -!endif -!endprocedure - -!global $fix_direction=%false() - -!function $down($start,$end) -!if ($fix_direction) -!return $start+"RIGHT"+$end -!else -!return $start+"DOWN"+$end -!endif -!endfunction - -!function $up($start,$end) -!if ($fix_direction) -!return $start+"LEFT"+$end -!else -!return $start+"UP"+$end -!endif -!endfunction - -!function $left($start,$end) -!if ($fix_direction) -!return $start+"UP"+$end -!else -!return $start+"LEFT"+$end -!endif -!endfunction - -!function $right($start,$end) -!if ($fix_direction) -!return $start+"DOWN"+$end -!else -!return $start+"RIGHT"+$end -!endif -!endfunction - -!procedure LAYOUT_TOP_DOWN() -!global $fix_direction=%false() -top to bottom direction -!endprocedure - -!procedure LAYOUT_LEFT_RIGHT() -!global $fix_direction = %false() -left to right direction -!endprocedure - -!procedure LAYOUT_LANDSCAPE() -!global $fix_direction = %true() -left to right direction -!endprocedure - -' legend details can displayed as Normal(), Small(), None() -!function None() -!return $LEGEND_DETAILS_NONE -!endfunction - -!function Normal() -!return $LEGEND_DETAILS_NORMAL -!endfunction - -!function Small() -!return $LEGEND_DETAILS_SMALL -!endfunction - -' has to be last call in diagram -!unquoted procedure SHOW_LEGEND($hideStereotype="true", $details=Small()) -$getHideStereotype($hideStereotype) -legend right -$getLegendTable($details) -endlegend -!endprocedure - -/' @deprecated in favor of SHOW_LEGEND '/ -!unquoted procedure SHOW_DYNAMIC_LEGEND($hideStereotype="true") -SHOW_LEGEND($hideStereotype) -!endprocedure - -' legend is reserved and cannot be uses as alias of SHOW_FLOATING_LEGEND() therefore -' LEGEND() is introduced. It returns the default name of the floating alias "floating_legend_alias" -' and can be used in the Lay_Distance() calls -!function LEGEND() -!return "floating_legend_alias" -!endfunction - -' enables that legend can be located in drawing area of the diagram. It has to be last call in diagram followed by Lay_Distance() -!unquoted procedure SHOW_FLOATING_LEGEND($alias=LEGEND(), $hideStereotype="true", $details=Small()) -$getLegendArea($alias, $hideStereotype, $details) -!endprocedure - -' Boundaries -' ################################## - -!unquoted procedure UpdateBoundaryStyle($elementName="", $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $type="", $legendText="", $borderStyle="", $borderThickness="") - !if ($elementName != "") - !$elementBoundary = $elementName + '_boundary' - UpdateElementStyle($elementBoundary, $bgColor, $fontColor, $borderColor, $shadowing, $shape, "", $type, $legendText, "", $borderStyle, $borderThickness) - !else - UpdateElementStyle("boundary", $bgColor, $fontColor, $borderColor, $shadowing, $shape, "", $type, $legendText, "", $borderStyle, $borderThickness) - ' simulate color inheritance - UpdateBoundaryStyle("enterprise", $bgColor, $fontColor, $borderColor, $shadowing, $shape, "Enterprise", "", $borderStyle, $borderThickness) - UpdateBoundaryStyle("system", $bgColor, $fontColor, $borderColor, $shadowing, $shape, "System", "", $borderStyle, $borderThickness) - UpdateBoundaryStyle("container", $bgColor, $fontColor, $borderColor, $shadowing, $shape, "Container", "", $borderStyle, $borderThickness) - !endif -!endprocedure - -!unquoted procedure AddBoundaryTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $type="", $legendText="", $borderStyle="", $borderThickness="") - !$tagBoundary = $tagStereo + '_boundary' - AddElementTag($tagBoundary, $bgColor, $fontColor, $borderColor, $shadowing, $shape, "", $type, $legendText, "", $borderStyle, $borderThickness) -!endprocedure - -' add _boundary to all tags that short tag version can be used -!unquoted function $addBoundaryPostfix($tags) - !if (%strlen($tags) == 0) - !return '' - !endif - !$boundaryTags = '' - !$brPos = %strpos($tags, "+") - !while ($brPos >= 0) - !$tag = %substr($tags, 0, $brPos) - !$boundaryTags = $boundaryTags + $tag + '_boundary+' - !$tags = %substr($tags, $brPos+1) - !$brPos = %strpos($tags, "+") - !endwhile - !if (%strlen($tags) > 0) - !$boundaryTags = $boundaryTags + $tags + '_boundary' - !endif - !return $boundaryTags -!endfunction - -!function $getBoundary($label, $type) - !if ($type == "") - !return '== ' + $breakLabel($label) - !endif - !if (type != "") - !return '== ' + $breakLabel($label) + '\n[' + $type + ']' - !endif -!endfunction - -!unquoted procedure Boundary($alias, $label, $type="", $tags="", $link="") -!$boundaryTags = $addBoundaryPostfix($tags) -' nodes $type reuses $techn definition of $boundaryTags -!$type=$toElementArg($type, $boundaryTags, "ElementTagTechn", "boundary") -rectangle "$getBoundary($label, $type)" $toStereos("boundary", $boundaryTags) as $alias $getLink($link) -!endprocedure - -' Boundary Styling -UpdateBoundaryStyle("", $bgColor=$BOUNDARY_BG_COLOR, $fontColor=$BOUNDARY_COLOR, $borderColor=$BOUNDARY_COLOR, $borderStyle=DashedLine()) - -' Index -' ################################## - -' Dynamic/Sequence diagram supports (automatically) numbered interactions: -' preferred function calls -' (Uppercase) LastIndex(): return the last used index (function which can be used as argument) -' (Uppercase) Index($offset=1): returns current index and calculates next index (function which can be used as argument) -' (Uppercase) SetIndex($new_index): returns new set index and calculates next index (function which can be used as argument) - -' old procedures calls -' (lowercase) increment($offset=1): increase current index (procedure which has no direct output) -' (lowercase) setIndex($new_index): set the new index (procedure which has no direct output) - -!$lastIndex = 0 -!$index = 1 - -!procedure increment($offset=1) - !$lastIndex = $index - !$index = $index + $offset -!endprocedure - -!procedure setIndex($new_index) - !$lastIndex = $index - !$index = $new_index -!endprocedure - -!function Index($offset=1) - !$lastIndex = $index - !$index = $lastIndex + $offset - !return $lastIndex -!endfunction - -!function LastIndex() - !return $lastIndex -!endfunction - -!function SetIndex($new_index, $offset=1) - !$lastIndex = $new_index - !$index = $new_index + $offset - !return $lastIndex -!endfunction - -!unquoted function $getPrefix($index) - !if ($index == "") - !$pre = Index() + ": " - !else - !$pre = $index + ": " - !endif - !return $pre -!endfunction - -' Relationship -' ################################## - -!function $getRel($direction, $alias1, $alias2, $label, $techn, $descr, $sprite, $tags, $link) - !$sprite = $toRelArg($sprite, $tags, "RelTagSprite") - !$techn = $toRelArg($techn, $tags, "RelTagTechn") - !$rel = $alias1 + ' ' + $direction + ' ' + $alias2 - !if ($tags != "") - !$rel = $rel + ' ' + $toStereos($tags) - !endif - !$rel = $rel + ' : ' - !if ($link != "") - !$rel = $rel + '**[[' + $link + ' ' - !endif - !if ($sprite != "") - !$rel = $rel + $getSprite($sprite) - !if ($label != "") - !$rel = $rel + ' ' - !endif - !endif - !if ($link != "") - !$usedNewLine = ']]**\n**[[' + $link + ' ' - ' if sprite and label is empty than the link url is shown (otherwise link cannot be activated at all) - !$rel = $rel + $breakText($label, $usedNewLine) + ']]**' - !else - !if ($label != "") - !$usedNewLine = '**\n**' - !$rel = $rel + '**' + $breakText($label, $usedNewLine) + '**' - !else - !$rel = $rel + '.' - !endif - !endif - !if ($techn != "") - ' line break is not deterministic, calculate it - !$rel = $rel + '\n//[' + $breakTechn($techn, $REL_TECHN_MAX_CHAR_WIDTH) + ']//' - !endif - !if ($descr != "") - ' line break is not deterministic, calculate it - !$rel = $rel + '\n\n' + $breakDescr($descr, $REL_DESCR_MAX_CHAR_WIDTH) - !endif - !$prop = $getProps() - !if ($prop != "") - ' reuse table - !$rel = $rel + $prop - !endif - !return $rel -!endfunction - -!unquoted procedure Rel_($alias1, $alias2, $label, $direction) -$getRel($direction, $alias1, $alias2, $label, "", "", "", "", "") -!endprocedure -!unquoted procedure Rel_($alias1, $alias2, $label, $techn, $direction) -$getRel($direction, $alias1, $alias2, $label, $techn, "", "", "", "") -!endprocedure - -!unquoted procedure Rel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure BiRel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_Back($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<--", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure BiRel_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_Back_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_D($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($down("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Down($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($down("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure BiRel_D($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($down("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure BiRel_Down($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($down("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_U($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($up("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Up($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($up("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure BiRel_U($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($up("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure BiRel_Up($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($up("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_L($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($left("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Left($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($left("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure BiRel_L($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($left("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure BiRel_Left($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($left("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_R($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($right("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Right($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($right("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure BiRel_R($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($right("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure BiRel_Right($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($right("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -' Layout Helpers -' ################################## - -!function $getHiddenLine($distance) - !return '-[hidden]' + %substr('------------', 0, %intval($distance) + 1) -!endfunction - -!unquoted procedure Lay_D($from, $to) -$from -[hidden]D- $to -!endprocedure -!unquoted procedure Lay_Down($from, $to) -$from -[hidden]D- $to -!endprocedure - -!unquoted procedure Lay_U($from, $to) -$from -[hidden]U- $to -!endprocedure -!unquoted procedure Lay_Up($from, $to) -$from -[hidden]U- $to -!endprocedure - -!unquoted procedure Lay_R($from, $to) -$from -[hidden]R- $to -!endprocedure -!unquoted procedure Lay_Right($from, $to) -$from -[hidden]R- $to -!endprocedure - -!unquoted procedure Lay_L($from, $to) -$from -[hidden]L- $to -!endprocedure -!unquoted procedure Lay_Left($from, $to) -$from -[hidden]L- $to -!endprocedure - -' PlantUML bug: lines which does "not match" with the orientation/direction of the diagram -' use the same length therefore the method offers no direction at all. -' If a direction is required the Lay_...() methods can be used -!unquoted procedure Lay_Distance($from, $to, $distance="0") -$from $getHiddenLine($distance) $to -!endprocedure diff --git a/docs/.c4s/C4_Component.puml b/docs/.c4s/C4_Component.puml deleted file mode 100644 index a4137d6..0000000 --- a/docs/.c4s/C4_Component.puml +++ /dev/null @@ -1,83 +0,0 @@ -' convert it with additional command line argument -DRELATIVE_INCLUDE="relative/absolute" to use locally -!if %variable_exists("RELATIVE_INCLUDE") - !include ./C4_Container.puml -!else - !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml -!endif - -' Scope: A single container. -' Primary elements: Components within the container in scope. -' Supporting elements: Containers (within the software system in scope) plus people and software systems directly connected to the components. -' Intended audience: Software architects and developers. - -' Colors -' ################################## - -!$COMPONENT_FONT_COLOR ?= "#000000" -!$COMPONENT_BG_COLOR ?= "#85BBF0" -!$COMPONENT_BORDER_COLOR ?= "#78A8D8" - -!$EXTERNAL_COMPONENT_FONT_COLOR ?= $COMPONENT_FONT_COLOR -!$EXTERNAL_COMPONENT_BG_COLOR ?= "#CCCCCC" -!$EXTERNAL_COMPONENT_BORDER_COLOR ?= "#BFBFBF" - -' Styling -' ################################## - -UpdateElementStyle("component", $COMPONENT_BG_COLOR, $COMPONENT_FONT_COLOR, $COMPONENT_BORDER_COLOR, false) -UpdateElementStyle("external_component", $EXTERNAL_COMPONENT_BG_COLOR, $EXTERNAL_COMPONENT_FONT_COLOR, $EXTERNAL_COMPONENT_BORDER_COLOR, false) - -' shortcuts with default colors -!unquoted procedure AddComponentTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="", $borderStyle="", $borderThickness="") - $addElementTagInclReuse("component", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $techn, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure -!unquoted procedure AddExternalComponentTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="", $borderStyle="", $borderThickness="") - $addElementTagInclReuse("external_component", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $techn, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure - -' Layout -' ################################## - -SetDefaultLegendEntries("person\nsystem\ncontainer\ncomponent\nexternal_person\nexternal_system\nexternal_container\nexternal_component\nenterprise_boundary\nsystem_boundary\ncontainer_boundary\nboundary") - -!procedure LAYOUT_WITH_LEGEND() -hide stereotype -legend right -|**Legend** | -|<$PERSON_BG_COLOR> person | -|<$SYSTEM_BG_COLOR> system | -|<$CONTAINER_BG_COLOR> container | -|<$COMPONENT_BG_COLOR> component | -|<$EXTERNAL_PERSON_BG_COLOR> external person | -|<$EXTERNAL_SYSTEM_BG_COLOR> external system | -|<$EXTERNAL_CONTAINER_BG_COLOR> external container | -|<$EXTERNAL_COMPONENT_BG_COLOR> external component | -endlegend -!endprocedure - -' Elements -' ################################## - -!unquoted procedure Component($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle") - $getElementLine($baseShape, "component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ComponentDb($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getElementLine("database", "component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ComponentQueue($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getElementLine("queue", "component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Component_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle") - $getElementLine($baseShape, "external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ComponentDb_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getElementLine("database", "external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ComponentQueue_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getElementLine("queue", "external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure diff --git a/docs/.c4s/C4_Container.puml b/docs/.c4s/C4_Container.puml deleted file mode 100644 index bccd6fd..0000000 --- a/docs/.c4s/C4_Container.puml +++ /dev/null @@ -1,103 +0,0 @@ -' convert it with additional command line argument -DRELATIVE_INCLUDE="relative/absolute" to use locally -!if %variable_exists("RELATIVE_INCLUDE") - !include ./C4_Context.puml -!else - !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml -!endif - -' Scope: A single software system. -' Primary elements: Containers within the software system in scope. -' Supporting elements: People and software systems directly connected to the containers. -' Intended audience: Technical people inside and outside of the software development team; including software architects, developers and operations/support staff. - -' Colors -' ################################## - -!$CONTAINER_FONT_COLOR ?= $ELEMENT_FONT_COLOR -!$CONTAINER_BG_COLOR ?= "#438DD5" -!$CONTAINER_BORDER_COLOR ?= "#3C7FC0" - -!$CONTAINER_BOUNDARY_COLOR ?= $BOUNDARY_COLOR -!$CONTAINER_BOUNDARY_BG_COLOR ?= $BOUNDARY_BG_COLOR -!$CONTAINER_BOUNDARY_BORDER_STYLE ?= $BOUNDARY_BORDER_STYLE - -!$EXTERNAL_CONTAINER_FONT_COLOR ?= $ELEMENT_FONT_COLOR -!$EXTERNAL_CONTAINER_BG_COLOR ?= "#B3B3B3" -!$EXTERNAL_CONTAINER_BORDER_COLOR ?= "#A6A6A6" - -' Styling -' ################################## -UpdateElementStyle("container", $CONTAINER_BG_COLOR, $CONTAINER_FONT_COLOR, $CONTAINER_BORDER_COLOR, false) -UpdateElementStyle("external_container", $EXTERNAL_CONTAINER_BG_COLOR, $EXTERNAL_CONTAINER_FONT_COLOR, $EXTERNAL_CONTAINER_BORDER_COLOR, false) - -UpdateBoundaryStyle("container", $bgColor=$CONTAINER_BOUNDARY_BG_COLOR, $fontColor=$CONTAINER_BOUNDARY_COLOR, $borderColor=$CONTAINER_BOUNDARY_COLOR, $type="Container", $shadowing="false") - -' shortcuts with default colors -!unquoted procedure AddContainerTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="", $borderStyle="", $borderThickness="") - $addElementTagInclReuse("container", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $techn, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure -!unquoted procedure AddExternalContainerTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="", $borderStyle="", $borderThickness="") - $addElementTagInclReuse("external_container", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $techn, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure - -!unquoted procedure UpdateContainerBoundaryStyle($bgColor=$CONTAINER_BOUNDARY_BG_COLOR, $fontColor=$CONTAINER_BOUNDARY_COLOR, $borderColor=$CONTAINER_BOUNDARY_COLOR, $shadowing="", $shape="", $type="Container", $legendText="", $borderStyle="", $borderThickness="") - UpdateBoundaryStyle("container", $bgColor, $fontColor, $borderColor, $shadowing, $shape, $type, $legendText, $borderStyle, $borderThickness) -!endprocedure - -' Layout -' ################################## - -SetDefaultLegendEntries("person\nsystem\ncontainer\nexternal_person\nexternal_system\nexternal_container\nenterprise_boundary\nsystem_boundary\ncontainer_boundary\nboundary") - -!procedure LAYOUT_WITH_LEGEND() -hide stereotype -legend right -|**Legend** | -|<$PERSON_BG_COLOR> person | -|<$SYSTEM_BG_COLOR> system | -|<$CONTAINER_BG_COLOR> container | -|<$EXTERNAL_PERSON_BG_COLOR> external person | -|<$EXTERNAL_SYSTEM_BG_COLOR> external system | -|<$EXTERNAL_CONTAINER_BG_COLOR> external container | -endlegend -!endprocedure - -' Elements -' ################################## - -!unquoted procedure Container($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle") - $getElementLine($baseShape , "container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ContainerDb($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getElementLine("database", "container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ContainerQueue($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getElementLine("queue", "container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Container_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle") - $getElementLine($baseShape , "external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ContainerDb_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getElementLine("database", "external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ContainerQueue_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getElementLine("queue", "external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -' Boundaries -' ################################## - -!unquoted procedure Container_Boundary($alias, $label, $tags="", $link="") - !if ($tags != "") - !$allTags = $tags + '+container' - !else - !$allTags = 'container' - !endif - ' $type defined via $tag style - Boundary($alias, $label, "", $allTags, $link) -!endprocedure diff --git a/docs/.c4s/C4_Context.puml b/docs/.c4s/C4_Context.puml deleted file mode 100644 index 71b2574..0000000 --- a/docs/.c4s/C4_Context.puml +++ /dev/null @@ -1,434 +0,0 @@ -' convert it with additional command line argument -DRELATIVE_INCLUDE="relative/absolute" to use locally -!if %variable_exists("RELATIVE_INCLUDE") - !include ./C4.puml -!else - !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4.puml -!endif - -' Scope: A single software system. -' Primary elements: The software system in scope. -' Supporting elements: People and software systems directly connected to the software system in scope. -' Intended audience: Everybody, both technical and non-technical people, inside and outside of the software development team. - -' Colors -' ################################## - -!$PERSON_FONT_COLOR ?= $ELEMENT_FONT_COLOR -!$PERSON_BG_COLOR ?= "#08427B" -!$PERSON_BORDER_COLOR ?= "#073B6F" - -!$EXTERNAL_PERSON_FONT_COLOR ?= $ELEMENT_FONT_COLOR -!$EXTERNAL_PERSON_BG_COLOR ?= "#686868" -!$EXTERNAL_PERSON_BORDER_COLOR ?= "#8A8A8A" - -!$SYSTEM_FONT_COLOR ?= $ELEMENT_FONT_COLOR -!$SYSTEM_BG_COLOR ?= "#1168BD" -!$SYSTEM_BORDER_COLOR ?= "#3C7FC0" - -!$SYSTEM_BOUNDARY_COLOR ?= $BOUNDARY_COLOR -!$SYSTEM_BOUNDARY_BG_COLOR ?= $BOUNDARY_BG_COLOR -!$SYSTEM_BOUNDARY_BORDER_STYLE ?= $BOUNDARY_BORDER_STYLE - -!$EXTERNAL_SYSTEM_FONT_COLOR ?= $ELEMENT_FONT_COLOR -!$EXTERNAL_SYSTEM_BG_COLOR ?= "#999999" -!$EXTERNAL_SYSTEM_BORDER_COLOR ?= "#8A8A8A" - -!$ENTERPRISE_BOUNDARY_COLOR ?= $BOUNDARY_COLOR -!$ENTERPRISE_BOUNDARY_BG_COLOR ?= $BOUNDARY_BG_COLOR -!$ENTERPRISE_BOUNDARY_BORDER_STYLE ?= $BOUNDARY_BORDER_STYLE - -' Styling -' ################################## - -UpdateElementStyle("person", $PERSON_BG_COLOR, $PERSON_FONT_COLOR, $PERSON_BORDER_COLOR, false) -UpdateElementStyle("external_person", $EXTERNAL_PERSON_BG_COLOR, $EXTERNAL_PERSON_FONT_COLOR, $EXTERNAL_PERSON_BORDER_COLOR, false) -UpdateElementStyle("system", $SYSTEM_BG_COLOR, $SYSTEM_FONT_COLOR, $SYSTEM_BORDER_COLOR, false) -UpdateElementStyle("external_system", $EXTERNAL_SYSTEM_BG_COLOR, $EXTERNAL_SYSTEM_FONT_COLOR, $EXTERNAL_SYSTEM_BORDER_COLOR, false) - -UpdateBoundaryStyle("system", $bgColor=$SYSTEM_BOUNDARY_BG_COLOR, $fontColor=$SYSTEM_BOUNDARY_COLOR, $borderColor=$SYSTEM_BOUNDARY_COLOR, $type="System", $shadowing="false") -UpdateBoundaryStyle("enterprise", $bgColor=$ENTERPRISE_BOUNDARY_BG_COLOR, $fontColor=$ENTERPRISE_BOUNDARY_COLOR, $borderColor=$ENTERPRISE_BOUNDARY_COLOR, $type="Enterprise", $shadowing="false") - -' shortcuts with default colors -!unquoted procedure AddPersonTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $legendText="", $legendSprite="", $type="", $borderStyle="", $borderThickness="") - $addElementTagInclReuse("person", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $type, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure -!unquoted procedure AddExternalPersonTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $legendText="", $legendSprite="", $type="", $borderStyle="", $borderThickness="") - $addElementTagInclReuse("external_person", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $type, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure -!unquoted procedure AddSystemTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $legendText="", $legendSprite="", $type="", $borderStyle="", $borderThickness="") - $addElementTagInclReuse("system", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $type, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure -!unquoted procedure AddExternalSystemTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $legendText="", $legendSprite="", $type="", $borderStyle="", $borderThickness="") - $addElementTagInclReuse("external_system", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $type, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure - -!unquoted procedure UpdateEnterpriseBoundaryStyle($bgColor=$ENTERPRISE_BOUNDARY_BG_COLOR, $fontColor=$ENTERPRISE_BOUNDARY_COLOR, $borderColor=$ENTERPRISE_BOUNDARY_COLOR, $shadowing="", $shape="", $type="Enterprise", $legendText="", $borderStyle="", $borderThickness="") - UpdateBoundaryStyle("enterprise", $bgColor, $fontColor, $borderColor, $shadowing, $shape, $type, $legendText, $borderStyle, $borderThickness) -!endprocedure -!unquoted procedure UpdateSystemBoundaryStyle($bgColor=$SYSTEM_BOUNDARY_BG_COLOR, $fontColor=$SYSTEM_BOUNDARY_COLOR, $borderColor=$SYSTEM_BOUNDARY_COLOR, $shadowing="", $shape="", $type="System", $legendText="", $borderStyle="", $borderThickness="") - UpdateBoundaryStyle("system", $bgColor, $fontColor, $borderColor, $shadowing, $shape, $type, $legendText, $borderStyle, $borderThickness) -!endprocedure - -' Sprites -' ################################## - -sprite $person [48x48/16] { -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -0000000000000000000049BCCA7200000000000000000000 -0000000000000000006EFFFFFFFFB3000000000000000000 -00000000000000001CFFFFFFFFFFFF700000000000000000 -0000000000000001EFFFFFFFFFFFFFF80000000000000000 -000000000000000CFFFFFFFFFFFFFFFF6000000000000000 -000000000000007FFFFFFFFFFFFFFFFFF100000000000000 -00000000000001FFFFFFFFFFFFFFFFFFF900000000000000 -00000000000006FFFFFFFFFFFFFFFFFFFF00000000000000 -0000000000000BFFFFFFFFFFFFFFFFFFFF40000000000000 -0000000000000EFFFFFFFFFFFFFFFFFFFF70000000000000 -0000000000000FFFFFFFFFFFFFFFFFFFFF80000000000000 -0000000000000FFFFFFFFFFFFFFFFFFFFF80000000000000 -0000000000000DFFFFFFFFFFFFFFFFFFFF60000000000000 -0000000000000AFFFFFFFFFFFFFFFFFFFF40000000000000 -00000000000006FFFFFFFFFFFFFFFFFFFE00000000000000 -00000000000000EFFFFFFFFFFFFFFFFFF800000000000000 -000000000000007FFFFFFFFFFFFFFFFFF100000000000000 -000000000000000BFFFFFFFFFFFFFFFF5000000000000000 -0000000000000001DFFFFFFFFFFFFFF70000000000000000 -00000000000000000BFFFFFFFFFFFF500000000000000000 -0000000000000000005DFFFFFFFFA1000000000000000000 -0000000000000000000037ABB96100000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000025788300000000005886410000000000000 -000000000007DFFFFFFD9643347BFFFFFFFB400000000000 -0000000004EFFFFFFFFFFFFFFFFFFFFFFFFFFB1000000000 -000000007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFD200000000 -00000006FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE10000000 -0000003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0000000 -000000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5000000 -000003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD000000 -000009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF200000 -00000DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF600000 -00000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF800000 -00001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA00000 -00001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB00000 -00001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB00000 -00001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB00000 -00001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA00000 -00000EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF700000 -000006FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE100000 -0000008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD3000000 -000000014555555555555555555555555555555300000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -} - -sprite $person2 [48x48/16] { -0000000000000000000049BCCA7200000000000000000000 -0000000000000000006EFFFFFFFFB3000000000000000000 -00000000000000001CFFFFFFFFFFFF700000000000000000 -0000000000000001EFFFFFFFFFFFFFF80000000000000000 -000000000000000CFFFFFFFFFFFFFFFF6000000000000000 -000000000000007FFFFFFFFFFFFFFFFFF100000000000000 -00000000000001FFFFFFFFFFFFFFFFFFF900000000000000 -00000000000006FFFFFFFFFFFFFFFFFFFF00000000000000 -0000000000000BFFFFFFFFFFFFFFFFFFFF40000000000000 -0000000000000EFFFFFFFFFFFFFFFFFFFF70000000000000 -0000000000000FFFFFFFFFFFFFFFFFFFFF80000000000000 -0000000000000FFFFFFFFFFFFFFFFFFFFF80000000000000 -0000000000000DFFFFFFFFFFFFFFFFFFFF60000000000000 -0000000000000AFFFFFFFFFFFFFFFFFFFF40000000000000 -00000000000006FFFFFFFFFFFFFFFFFFFE00000000000000 -00000000000000EFFFFFFFFFFFFFFFFFF800000000000000 -000000000000007FFFFFFFFFFFFFFFFFF100000000000000 -000000000000000BFFFFFFFFFFFFFFFF5000000000000000 -0000000000000001DFFFFFFFFFFFFFF70000000000000000 -00000000000000000BFFFFFFFFFFFF500000000000000000 -0000000000000000005DFFFFFFFFA1000000000000000000 -0000000000000000000037ABB96100000000000000000000 -000000000002578888300000000005888864100000000000 -0000000007DFFFFFFFFD9643347BFFFFFFFFFB4000000000 -00000004EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB10000000 -0000007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD2000000 -000006FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE100000 -00003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB00000 -0000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF50000 -0003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0000 -0009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2000 -000DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6000 -000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB000 -001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB000 -001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB000 -001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA000 -000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -000DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6000 -0009FFFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFFF2000 -0003FFFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFFD0000 -0000BFFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFF50000 -00003FFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFB00000 -000006FFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFE100000 -0000007FFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFD2000000 -00000004EFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFB10000000 -0000000007DF8FFFFFFFFFFFFFFFFFFFFFF8FB4000000000 -000000000002578888888888888888888864100000000000 -} - -sprite $robot [48x48/16] { -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000005BFFFFFFFFFFFFFFFFFFFFFE9100000000000 -0000000000AFFFFFFFFFFFFFFFFFFFFFFFFFE30000000000 -0000000007FFFFFFFFFFFFFFFFFFFFFFFFFFFE1000000000 -000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000000000 -000000004FFFFFFFFFFFFFFFFFFFFFFFFFFFFFC000000000 -000000005FFFFFFFFFFFFFFFFFFFFFFFFFFFFFD000000000 -000000005FFFFFFFFFFFFFFFFFFFFFFFFFFFFFE000000000 -000000005FFFFFFFFFFFFFFFFFFFFFFFFFFFFFE000000000 -000699405FFFFFFC427FFFFFFFFFC427FFFFFFE009982000 -008FFF705FFFFFE10006FFFFFFFE00007FFFFFE00FFFF100 -00CFFF705FFFFFA00001FFFFFFF900002FFFFFE00FFFF500 -00DFFF705FFFFFB00002FFFFFFFA00003FFFFFE00FFFF500 -00DFFF705FFFFFF4000AFFFFFFFF3000BFFFFFE00FFFF500 -00DFFF705FFFFFFFA8DFFFFFFFFFFA8DFFFFFFE00FFFF500 -00DFFF705FFFFFFFFFFFFFFFFFFFFFFFFFFFFFE00FFFF500 -00DFFF705FFFFFFFFFFFFFFFFFFFFFFFFFFFFFE00FFFF500 -00DFFF705FFFFFFFFFFFFFFFFFFFFFFFFFFFFFE00FFFF500 -00DFFF705FFFFFFFFFFFFFFFFFFFFFFFFFFFFFE00FFFF500 -00DFFF705FFFFFFFFFFFFFFFFFFFFFFFFFFFFFE00FFFF500 -00CFFF705FFFFFF87777777777777777CFFFFFE00FFFF500 -008FFF705FFFFFF100000000000000009FFFFFE00FFFF100 -000699405FFFFFF76666666666666666CFFFFFE009982000 -000000005FFFFFFFFFFFFFFFFFFFFFFFFFFFFFE000000000 -000000005FFFFFFFFFFFFFFFFFFFFFFFFFFFFFE000000000 -000000004FFFFFFFFFFFFFFFFFFFFFFFFFFFFFC000000000 -000000000EFFFFFFFFFFFFFFFFFFFFFFFFFFFF7000000000 -0000000005FFFFFFFFFFFFFFFFFFFFFFFFFFFD0000000000 -00000000004CFFFFFFFFFFFFFFFFFFFFFFFF910000000000 -000000000000011111111111111111111110000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -} - -sprite $robot2 [48x48/16] { -000000000000000088888888888888880000000000000000 -000000000000000AFFFFFFFFFFFFFFFFA000000000000000 -00000000000000CFFFFFFFFFFFFFFFFFFC00000000000000 -00000000000004EFFFFFFFFFFFFFFFFFFE40000000000000 -0000000000000AFFFFFFFFFFFFFFFFFFFFA0000000000000 -00000000000008FFFFFFFFFFFFFFFFFFFF80000000000000 -00000000000008FFFFFFFFFFFFFFFFFFFF80000000000000 -00000000000008FFFFFFFFFFFFFFFFFFFF80000000000000 -00000000000888FFFFFFFFFFFFFFFFFFFF88800000000000 -00000000008FF8FFFFFFFFFFFFFFFFFFFF8FF80000000000 -00000000008FF8FFFFFFFFFFFFFFFFFFFF8FF80000000000 -00000000008FF8FFFFFFFFFFFFFFFFFFFF8FF80000000000 -00000000008FF8FFFFFFFFFFFFFFFFFFFF8FF80000000000 -00000000008FF8FFFFFFFFFFFFFFFFFFFF8FF80000000000 -00000000008FF8FFFFFFFFFFFFFFFFFFFF8FF80000000000 -00000000000888FFFFFFFFFFFFFFFFFFFF88800000000000 -00000000000008FFFFFFFFFFFFFFFFFFFF80000000000000 -00000000000008FFFFFFFFFFFFFFFFFFFF80000000000000 -00000000000008FFFFFFFFFFFFFFFFFFFF80000000000000 -00000000000008FFFFFFFFFFFFFFFFFFFF80000000000000 -00000000000008FFFFFFFFFFFFFFFFFFFF80000000000000 -00000000000004CFFFFFFFFFFFFFFFFFFC40000000000000 -000000488888848CFFFFFFFFFFFFFFFFC848888884000000 -00000CFFFFFFFFC888888888888888888CFFFFFFFFC00000 -00008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF80000 -0000CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFFF8000 -0008FFFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFFF8000 -0008FFFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFFF8000 -0008FFFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFFF8000 -0000CFFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFFC0000 -00008FFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFF80000 -00000CFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFC00000 -000000488887578888888888888888888864688884000000 -000000000000000000000000000000000000000000000000 -} - -' Layout -' ################################## - -SetDefaultLegendEntries("person\nsystem\nexternal_person\nexternal_system\nenterprise_boundary\nsystem_boundary\nboundary") - -!procedure LAYOUT_WITH_LEGEND() -hide stereotype -legend right -|**Legend** | -|<$PERSON_BG_COLOR> person | -|<$SYSTEM_BG_COLOR> system| -|<$EXTERNAL_PERSON_BG_COLOR> external person | -|<$EXTERNAL_SYSTEM_BG_COLOR> external system | -endlegend -!endprocedure - -!global $defaultPersonSprite = "person" -!$dummy = $restoreEmpty("person", "sprite", $defaultPersonSprite, %true()) -UpdateElementStyle("person") -' workaround of plantuml.jar bug - person overwrites external_person setting -!$dummy = $restoreEmpty("external_person", "sprite", $defaultPersonSprite, %true()) -UpdateElementStyle("external_person") -!global $portraitPerson = "false" - -!procedure $clearPersonRestore() - !$dummy = $clearRestore("person", "sprite") - !$dummy = $clearRestore("person", "legendSprite") - %set_variable_value("$" + "person" + "ElementTagSprite", "") - UpdateElementStyle("person") - ' workaround of plantuml.jar bug - person overwrites external_person setting - !$dummy = $clearRestore("external_person", "sprite") - !$dummy = $clearRestore("external_person", "legendSprite") - %set_variable_value("$" + "external_person" + "ElementTagSprite", "") - UpdateElementStyle("external_person") -!endprocedure - -!procedure HIDE_PERSON_SPRITE() - !$defaultPersonSprite = "" - !$portraitPerson = "false" - $clearPersonRestore() -!endprocedure - -!unquoted procedure SHOW_PERSON_SPRITE($sprite="") - !if ($sprite == "") - !$defaultPersonSprite = "person" - !else - !$defaultPersonSprite = $sprite - !endif - !$dummy = $restoreEmpty("person", "sprite", $defaultPersonSprite, %true()) - UpdateElementStyle("person") - ' workaround of plantuml.jar bug - person overwrites external_person setting - !$dummy = $restoreEmpty("external_person", "sprite", $defaultPersonSprite, %true()) - UpdateElementStyle("external_person") - !$portraitPerson = "false" -!endprocedure - -!unquoted procedure SHOW_PERSON_PORTRAIT() - !$defaultPersonSprite = "" - !$portraitPerson = "portrait" - $clearPersonRestore() -!endprocedure - -!unquoted procedure SHOW_PERSON_OUTLINE() - !$defaultPersonSprite = "" - !$portraitPerson = "outline" - $clearPersonRestore() -!endprocedure - -' Elements -' ################################## - -!function $getPerson($label, $type, $descr, $sprite) - !if ($sprite == "") && ($defaultPersonSprite != "") - !$sprite = $defaultPersonSprite - !endif - !return $getElementBase($label, $type, $descr, $sprite) -!endfunction - -!unquoted procedure Person($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "person") -' $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "person") -!if ($portraitPerson == "portrait") && ($sprite == "") -actor "$getPerson($label, $type, $descr, $sprite)$getProps()" $toStereos("person", $tags) as $alias $getLink($link) -!elseif ($portraitPerson == "outline") && ($sprite == "") -person "$getPerson($label, $type, $descr, $sprite)$getProps()" $toStereos("person", $tags) as $alias $getLink($link) -!else -rectangle "$getPerson($label, $type, $descr, $sprite)$getProps()" $toStereos("person", $tags) as $alias $getLink($link) -!endif -!endprocedure - -!unquoted procedure Person_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_person") -' $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "external_person") -!if ($portraitPerson == "portrait") && ($sprite == "") -actor "$getPerson($label, $type, $descr, $sprite)$getProps()" $toStereos("external_person", $tags) as $alias $getLink($link) -!elseif ($portraitPerson == "outline") && ($sprite == "") -person "$getPerson($label, $type, $descr, $sprite)$getProps()" $toStereos("external_person", $tags) as $alias $getLink($link) -!else -rectangle "$getPerson($label, $type, $descr, $sprite)$getProps()" $toStereos("external_person", $tags) as $alias $getLink($link) -!endif -!endprocedure - -!unquoted procedure System($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="", $baseShape="rectangle") - ' $type reuses $techn definition of $tags - $getElementLine($baseShape, "system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure SystemDb($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getElementLine("database", "system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure SystemQueue($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getElementLine("queue", "system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure System_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="", $baseShape="rectangle") - ' $type reuses $techn definition of $tags - $getElementLine($baseShape , "external_system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure SystemDb_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getElementLine("database", "external_system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure SystemQueue_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getElementLine("queue", "external_system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -' Boundaries -' ################################## - -!unquoted procedure Enterprise_Boundary($alias, $label, $tags="", $link="") - !if ($tags != "") - !$allTags = $tags + '+enterprise' - !else - !$allTags = 'enterprise' - !endif - ' $type defined via $tag style - Boundary($alias, $label, "", $allTags, $link) -!endprocedure - -!unquoted procedure System_Boundary($alias, $label, $tags="", $link="") - !if ($tags != "") - !$allTags = $tags + '+system' - !else - !$allTags = 'system' - !endif - ' $type defined via $tag style - Boundary($alias, $label, "", $allTags, $link) -!endprocedure diff --git a/docs/.c4s/C4_Deployment.puml b/docs/.c4s/C4_Deployment.puml deleted file mode 100644 index afc9945..0000000 --- a/docs/.c4s/C4_Deployment.puml +++ /dev/null @@ -1,140 +0,0 @@ -' convert it with additional command line argument -DRELATIVE_INCLUDE="relative/absolute" to use locally -!if %variable_exists("RELATIVE_INCLUDE") - !include ./C4_Container.puml -!else - !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml -!endif - -' Colors -' ################################## - -!$NODE_FONT_COLOR ?= "#000000" -!$NODE_BG_COLOR ?= "#FFFFFF" -!$NODE_BORDER_COLOR ?= "#A2A2A2" - -' Styling -' ################################## - -' PlantUML supports no automatic line breaks of "PlantUML containers" (C4 Deployment_Node is a "PlantUML container") -' therefore (Deployment_)Node() implements an automatic line break based on spaces (like in all other objects). -' If a $type contains \n then these are used (and no automatic space based line breaks are done) -' $NODE_TYPE_MAX_CHAR_WIDTH defines the automatic line break position -!$NODE_TYPE_MAX_CHAR_WIDTH ?= 35 -!$NODE_DESCR_MAX_CHAR_WIDTH ?= 32 - -UpdateElementStyle("node", $bgColor=$NODE_BG_COLOR, $fontColor=$NODE_FONT_COLOR, $borderColor=$NODE_BORDER_COLOR, false) -skinparam rectangle<> { - FontStyle normal -} - -' shortcuts with default colors -' node specific: $techn is only used in old scripts, new scripts uses $type ($techn has to remain, it could be called via named argument) -!unquoted procedure AddNodeTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $type="", $legendText="", $legendSprite="", $techn="", $borderStyle="", $borderThickness="") - !$type=$type+$techn - $addElementTagInclReuse("node", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $type, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure - -' Layout -' ################################## - -' comment if node should not be added to legend. No calculated legend extension required -SetDefaultLegendEntries("person\nsystem\ncontainer\nexternal_person\nexternal_system\nexternal_container\nnode\nenterprise_boundary\nsystem_boundary\ncontainer_boundary\nboundary") - -' Line breaks -' ################################## - -' $breakTechn() in C4 supports //...//; $breakNode() in C4_Deployment supports no //....// -!unquoted function $breakNode($text, $widthStr) - !$usedNewLine = '\n' - !return $breakText($text, $usedNewLine, $widthStr) -!endfunction - -' Elements -' ################################## - -!function $getNode($label, $type, $descr, $sprite) - !$nodeText = "" - !if ($sprite != "") - !$nodeText = $nodeText + $getSprite($sprite) + '\n' - !endif - !$nodeText = $nodeText + '== ' + $breakText($label, "\n== ") - !if ($type != "") - !$nodeText = $nodeText + '\n[' + $breakNode($type, $NODE_TYPE_MAX_CHAR_WIDTH) + ']' - !endif - !if ($descr != "") - !$nodeText = $nodeText + '\n\n' + $breakDescr($descr, $NODE_DESCR_MAX_CHAR_WIDTH) - !endif - !return $nodeText -!endfunction - -!function $getNode_L($label, $type, $descr, $sprite) - !$nodeText = "" - !if ($sprite != "") - !$nodeText = $nodeText + $getSprite($sprite) + '\l' - !endif - !$nodeText = $nodeText + '== ' + $breakText($label, "\l== ") - !if ($type != "") - !$nodeText = $nodeText + '\l[' + $breakNode($type, $NODE_TYPE_MAX_CHAR_WIDTH) + ']' - !endif - !if ($descr != "") - !$nodeText = $nodeText + '\l\l' + $breakDescr($descr, $NODE_DESCR_MAX_CHAR_WIDTH) - !endif - !return $nodeText -!endfunction - -!function $getNode_R($label, $type, $descr, $sprite) - !$nodeText = "" - !if ($sprite != "") - !$nodeText = $nodeText + $getSprite($sprite) + '\r' - !endif - !$nodeText = $nodeText + '== ' + $breakText($label, "\r== ") - !if ($type != "") - !$nodeText = $nodeText + '\r[' + $breakNode($type, $NODE_TYPE_MAX_CHAR_WIDTH) + ']' - !endif - !if ($descr != "") - !$nodeText = $nodeText + '\r\r' + $breakDescr($descr, $NODE_DESCR_MAX_CHAR_WIDTH) - !endif - !return $nodeText -!endfunction - -!unquoted procedure Deployment_Node($alias, $label, $type="", $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "node") -' nodes $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "node") -rectangle "$getNode($label, $type, $descr, $sprite)$getProps()" $toStereos("node",$tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure Deployment_Node_L($alias, $label, $type="", $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "node") -' nodes $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "node") -rectangle "$getNode_L($label, $type, $descr, $sprite)$getProps_L()" $toStereos("node",$tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure Deployment_Node_R($alias, $label, $type="", $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "node") -' nodes $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "node") -rectangle "$getNode_R($label, $type, $descr, $sprite)$getProps_R()" $toStereos("node",$tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure Node($alias, $label, $type="", $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "node") -' nodes $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "node") -rectangle "$getNode($label, $type, $descr, $sprite)$getProps()" $toStereos("node",$tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure Node_L($alias, $label, $type="", $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "node") -' nodes $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "node") -rectangle "$getNode_L($label, $type, $descr, $sprite)$getProps_L()" $toStereos("node",$tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure Node_R($alias, $label, $type="", $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "node") -' nodes $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "node") -rectangle "$getNode_R($label, $type, $descr, $sprite)$getProps_R()" $toStereos("node",$tags) as $alias $getLink($link) -!endprocedure diff --git a/docs/.c4s/C4_Sequence.puml b/docs/.c4s/C4_Sequence.puml deleted file mode 100644 index ee40694..0000000 --- a/docs/.c4s/C4_Sequence.puml +++ /dev/null @@ -1,398 +0,0 @@ -' convert it with additional command line argument -DRELATIVE_INCLUDE="relative/absolute" to use locally -!if %variable_exists("RELATIVE_INCLUDE") - !include ./C4_Component.puml -!else - !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml -!endif - -' Scope: Interactions in an enterprise, software system or container. -' Primary and supporting elements: Depends on the diagram scope - -' enterprise - people and software systems Related to the enterprise in scope -' software system - see system context or container diagrams, -' container - see component diagram. -' Intended audience: Technical and non-technical people, inside and outside of the software development team. - -' Sequence diagram introduces (automatically) numbered interactions: -' (lowercase) increment($offset=1): increase current index (procedure which has no direct output) -' (lowercase) setIndex($new_index): set the new index (procedure which has no direct output) -' -' (Uppercase) LastIndex(): return the last used index (function which can be used as argument) -' (Uppercase) Index($offset=1): returns current index and calculates next index (function which can be used as argument) -' (Uppercase) SetIndex($new_index): returns new set index and calculates next index (function which can be used as argument) - -' enables multi-level boxes -!pragma teoz true - - -' Legend redefintion -' ################################## -' sequence has no dashed boxes -!if ($LEGEND_DASHED_BOUNDARY == "dashed") - !$LEGEND_DASHED_BOUNDARY = "" -!endif -!if ($LEGEND_DASHED_TRANSPARENT_BOUNDARY == "dashed") - !$LEGEND_DASHED_TRANSPARENT_BOUNDARY = "" -!endif -UpdateBoundaryStyle("", $bgColor=$BOUNDARY_BG_COLOR, $fontColor=$BOUNDARY_COLOR, $borderColor=$BOUNDARY_COLOR) -UpdateBoundaryStyle("enterprise", $bgColor=$ENTERPRISE_BOUNDARY_BG_COLOR, $fontColor=$ENTERPRISE_BOUNDARY_COLOR, $borderColor=$ENTERPRISE_BOUNDARY_COLOR, $type="Enterprise") -UpdateBoundaryStyle("system", $bgColor=$SYSTEM_BOUNDARY_BG_COLOR, $fontColor=$SYSTEM_BOUNDARY_COLOR, $borderColor=$SYSTEM_BOUNDARY_COLOR, $type="System") -UpdateBoundaryStyle("container", $bgColor=$CONTAINER_BOUNDARY_BG_COLOR, $fontColor=$CONTAINER_BOUNDARY_COLOR, $borderColor=$CONTAINER_BOUNDARY_COLOR, $type="Container") - -' Styling and Layout -' ################################## - -!global $display_element_description = %false() - -' typically the element/participant descriptions are not displayed in a sequence diagram, but it can be activated with this call -!unquoted procedure SHOW_ELEMENT_DESCRIPTIONS($show="true") -!if ($show == "true") - !global $display_element_description = %true() -!else - !global $display_element_description = %false() -!endif -!endprocedure - -' typically the foot boxes descriptions are not displayed in a sequence diagram, but it can be activated with this call -!unquoted procedure SHOW_FOOT_BOXES($show="true") -!if ($show == "true") - show footbox -!else - hide footbox -!endif -!endprocedure - -!global $show_index = %false() -' All relation specific (default) ordinary index numbers can be shown with this call -!unquoted procedure SHOW_INDEX($show="true") -!if ($show == "true") - !global $show_index = %true() -!else - !global $show_index = %false() -!endif -!endprocedure - -' ======= if no theme is defined hide foot box and activate C4_blue styles -!if (%variable_exists("$THEME")) -!else -' $BOUNDARY_BG_COLOR... have to be defined in theme itself that it can be used in styles,... -' (no default values which are defined in C4.puml) -' If skinparams and styles are defined with concrete values no variables are required -!$BOUNDARY_BG_COLOR ?= "transparent" -!$BOUNDARY_COLOR ?= "#444444" -!$ARROW_COLOR ?= "#666666" - -' replace transparent with concrete background that it can be used as font color too -!if ($BOUNDARY_BG_COLOR == "transparent") - !$SEQUENCE_BG_COLOR = white -!else - !$SEQUENCE_BG_COLOR = $BOUNDARY_BG_COLOR -!endif - -' "C4 styled" default is no foot boxes -hide footbox -' "C4 styled" default is that lifeline is arrow color -skinparam SequenceLifelineBorderColor $ARROW_COLOR - -skinparam SequenceGroupBodyBackgroundColor $SEQUENCE_BG_COLOR -skinparam SequenceGroupFontColor $BOUNDARY_COLOR -skinparam SequenceGroupBackgroundColor $BOUNDARY_COLOR -skinparam SequenceGroupHeaderFontColor $SEQUENCE_BG_COLOR -skinparam SequenceGroupBorderColor $BOUNDARY_COLOR - -skinparam SequenceReferenceBackgroundColor $SEQUENCE_BG_COLOR -skinparam SequenceReferenceFontColor $BOUNDARY_COLOR -skinparam SequenceReferenceHeaderBackgroundColor $BOUNDARY_COLOR -' VIA STYLE -' skinparam SequenceReferenceHeaderFontColor $SEQUENCE_BG_COLOR - -skinparam SequenceReferenceBorderColor $BOUNDARY_COLOR - -skinparam SequenceDividerBackgroundColor $SEQUENCE_BG_COLOR -skinparam SequenceDividerFontColor $BOUNDARY_COLOR -skinparam SequenceDividerBorderColor $BOUNDARY_COLOR - -' VIA STYLE -' skinparam SequenceDelayFontColor green - -!endif -' ======= if no theme is defined hide foot box and activate C4_blue styles - -' Elements redefinition -' ################################## - -' all elements have to be displayed as participant -' participants requires ` %newline()` instead of `\n` - -!unquoted function $breakWithNewline($text, $lineEnd, $lineStart, $widthStr="-1") -!$width = %intval($widthStr) -!$multiLine = "" -!if (%strpos($text, "\n") >= 0) - !while (%strpos($text, "\n") >= 0) - !$brPos = %strpos($text, "\n") - !if ($brPos > 0) - !$multiLine = $multiLine + %substr($text, 0, $brPos) + $lineEnd + %newline() + $lineStart - !else - ' non breaking change that newLine breaks with formats can be used with \n\n - !$multiLine = $multiLine + "" + $lineEnd + %newline() + $lineStart - !endif - !$text = %substr($text, $brPos+2) - !if (%strlen($text) == 0) - !$text = "" - !endif - !endwhile -!else - !while ($width>0 && %strlen($text) > $width) - !$brPos = $width - !while ($brPos > 0 && %substr($text, $brPos, 1) != ' ') - !$brPos = $brPos - 1 - !endwhile - - !if ($brPos < 1) - !$brPos = %strpos($text, " ") - !else - !endif - - !if ($brPos > 0) - !$multiLine = $multiLine + %substr($text, 0, $brPos) + $lineEnd + %newline() + $lineStart - !$text = %substr($text, $brPos + 1) - !else - !$multiLine = $multiLine+ $text - !$text = "" - !endif - !endwhile -!endif -!if (%strlen($text) > 0) - !$multiLine = $multiLine + $text -!endif -!return $multiLine -!endfunction - -!unquoted function $breakNewLineLabel($text) -!$multiLine = $breakWithNewline($text, "", "==") -!return $multiLine -!endfunction - -!unquoted function $breakNewLineDescr($text) - !return $breakWithNewline($text, "", "", $REL_DESCR_MAX_CHAR_WIDTH) -!endfunction - -!unquoted function $breakNewLineTechn($text) - !$lineStart = "//" - !$lineEnd = '//' - !return $breakWithNewline($text, $lineStart, $lineEnd, $REL_TECHN_MAX_CHAR_WIDTH) -!endfunction - -' description is not displayed (size too big, line breaks not supported) -' properties are not displayed in sequence diagram (size would be too big) -' $breakLabel() not required by participant -!procedure $getParticipant($elementType, $alias, $label, $techn, $descr, $sprite, $tags, $link) - !$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", $elementType) - !$techn=$toElementArg($techn, $tags, "ElementTagTechn", $elementType) - !$stereo = $toStereos($elementType,$tags) - !$calcLabel = "== " + $breakNewLineLabel($label) - !$calcTech = "//[" + $breakNewLineTechn($techn) + "]//" - !$calcDescr = $breakNewLineDescr($descr) - !$calcLink = $getLink($link) - -participant $alias $stereo $calcLink [ -!if ($sprite != "") -$getSprite($sprite) -!endif -!if ($label != "") -$calcLabel -!endif -!if ($techn != "") -$calcTech -!endif -!if ($display_element_description == %true() && $descr != "") - -$calcDescr -!endif -] -!endprocedure - - -!unquoted procedure Person($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getParticipant("person", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Person_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getParticipant("external_person", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure System($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="", $baseShape="rectangle") - ' $type reuses $techn definition of $tags - $getParticipant("system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure SystemDb($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getParticipant("system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure SystemQueue($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getParticipant("system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure System_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="", $baseShape="rectangle") - ' $type reuses $techn definition of $tags - $getParticipant("external_system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure SystemDb_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getParticipant("external_system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure SystemQueue_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getParticipant("external_system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - - - -!unquoted procedure Container($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle") - $getParticipant("container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ContainerDb($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getParticipant("container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ContainerQueue($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getParticipant("container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Container_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle") - $getParticipant("external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ContainerDb_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getParticipant("external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ContainerQueue_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getParticipant("external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - - - -!unquoted procedure Component($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle") - $getParticipant("component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ComponentDb($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getParticipant("component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ComponentQueue($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getParticipant("component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Component_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle") - $getParticipant("external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ComponentDb_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getParticipant("external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ComponentQueue_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getParticipant("external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - - -' Boundary redefinition -' ################################## - -' all boundaries have to be displayed as box and -' !!! important changes: without { at the end; and boundary ends with Boundary_End() instead of } - -' alias ignored -' $breakLabel() not required by participant - -!unquoted procedure Boundary($alias, $label, $type="", $tags="", $link="") -!$boundaryTags = $addBoundaryPostfix($tags) -' nodes $type reuses $techn definition of $boundaryTags -!$type=$toElementArg($type, $boundaryTags, "ElementTagTechn", "boundary") -!if ($link != "") - !$usedNewLine = ']]\n== [[' + $link + ' ' - !$labelType = '== [[' + $link + ' ' + $breakText($label, $usedNewLine) + ']]' -!else - !$usedNewLine = '\n== ' - !$labelType = $breakText($label, $usedNewLine) -!endif -!if (type != "") - !$labelType = $labelType + '\n[' + $type + ']' -!endif -box "$labelType" $toStereos("boundary", $boundaryTags) -!endprocedure - -!procedure Boundary_End() -end box -!endprocedure - -!unquoted procedure Enterprise_Boundary($alias, $label, $tags="", $link="") - !if ($tags != "") - !$allTags = $tags + '+enterprise' - !else - !$allTags = 'enterprise' - !endif - ' $type defined via $tag style - Boundary($alias, $label, "", $allTags, $link) -!endprocedure - -!unquoted procedure System_Boundary($alias, $label, $tags="", $link="") - !if ($tags != "") - !$allTags = $tags + '+system' - !else - !$allTags = 'system' - !endif - ' $type defined via $tag style - Boundary($alias, $label, "", $allTags, $link) -!endprocedure - -!unquoted procedure Container_Boundary($alias, $label, $tags="", $link="") - !if ($tags != "") - !$allTags = $tags + '+container' - !else - !$allTags = 'container' - !endif - ' $type defined via $tag style - Boundary($alias, $label, "", $allTags, $link) -!endprocedure - -' Relationship (redefinition) -' ################################## - -' only Rel is supported in sequence diagram - -' first Rel() supports the $index and $rel argument too; second Rel() overwrites C4.puml definition -' don't add empty lines in procedure otherwise & calls are not working anymore '& a -> b: call' are not working anymore -!unquoted procedure Rel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="", $rel="") - !if ($show_index == %true()) - !$pre = $getPrefix($index) - !else - !$pre = "" - !endif - !if ($rel == "") - !$rel = "->" - !endif -$getRel($rel, $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -Rel($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "", "") -!endprocedure \ No newline at end of file diff --git a/docs/images/8t4-c4-brand-2.png b/docs/images/8t4-c4-brand-2.png deleted file mode 100644 index 403054f..0000000 Binary files a/docs/images/8t4-c4-brand-2.png and /dev/null differ diff --git a/docs/images/c4bank-deposit-area-c4container-bw.png b/docs/images/c4bank-deposit-area-c4container-bw.png index 447a522..559e85d 100644 Binary files a/docs/images/c4bank-deposit-area-c4container-bw.png and b/docs/images/c4bank-deposit-area-c4container-bw.png differ diff --git a/docs/images/c4bank-deposit-area-c4container.png b/docs/images/c4bank-deposit-area-c4container.png deleted file mode 100644 index 79a1acc..0000000 Binary files a/docs/images/c4bank-deposit-area-c4container.png and /dev/null differ diff --git a/docs/images/card-github.png b/docs/images/card-github.png deleted file mode 100644 index 37861b9..0000000 Binary files a/docs/images/card-github.png and /dev/null differ diff --git a/docs/images/component-diagram-for-internet-banking-system-c4component.png b/docs/images/component-diagram-for-internet-banking-system-c4component.png deleted file mode 100644 index 6756477..0000000 Binary files a/docs/images/component-diagram-for-internet-banking-system-c4component.png and /dev/null differ diff --git a/docs/images/component-diagram-for-internet-banking-system-c4component.puml b/docs/images/component-diagram-for-internet-banking-system-c4component.puml deleted file mode 100644 index 9030561..0000000 --- a/docs/images/component-diagram-for-internet-banking-system-c4component.puml +++ /dev/null @@ -1,28 +0,0 @@ -@startuml component-diagram-for-internet-banking-system-c4component -!include ../.c4s/C4_Component.puml - -UpdateElementStyle("system", $bgColor=#D4E6F1,$fontColor=#1A5276,$borderColor=#1A5276,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=2) -UpdateElementStyle("external_system", $bgColor=#F8F9F9,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=1) -UpdateElementStyle("person", $bgColor=#797D7F,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=2) -UpdateElementStyle("component", $bgColor=#FAE5D3,$fontColor=#CA6F1E,$borderColor=#CA6F1E,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=2) -UpdateElementStyle("external_component", $bgColor=#F8F9F9,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=1) -UpdateElementStyle("container", $bgColor=#EAF2F8,$fontColor=#2E86C1,$borderColor=#2E86C1,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=2) -UpdateElementStyle("external_container", $bgColor=#F8F9F9,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=1) -UpdateBoundaryStyle($elementName=system,$bgColor=#F8F9F9,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape()) -UpdateBoundaryStyle($elementName=container,$bgColor=#F8F9F9,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape()) -UpdateBoundaryStyle($elementName=enterprise,$bgColor=#F8F9F9,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape()) -SHOW_PERSON_PORTRAIT() -LAYOUT_TOP_DOWN() - -title Component diagram for Internet Banking System - -Person_Ext(customer, "Personal Banking Customer", "A customer of the bank, with personal bank accounts.") -System(BankingSystem, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.") -System_Ext(Mainframe, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.") -System_Ext(MailSystem, "E-mail system", "The internal Microsoft Exchange e-mail system.") - -Rel(customer, BankingSystem, "uses") -Rel_Back(customer, MailSystem, "Sends e-mails to") -Rel_Neighbor(BankingSystem, MailSystem, "Sends e-mails", "SMTP") -Rel(BankingSystem, Mainframe, "uses") -@enduml diff --git a/docs/images/component-diagram-for-internet-banking-system-c4component.svg b/docs/images/component-diagram-for-internet-banking-system-c4component.svg deleted file mode 100644 index 5c41bba..0000000 --- a/docs/images/component-diagram-for-internet-banking-system-c4component.svg +++ /dev/null @@ -1 +0,0 @@ -Component diagram for Internet Banking SystemPersonal BankingCustomer A customer of the bank, withpersonal bank accounts.«external_person»«system»Internet Banking System Allows customers to viewinformation about their bankaccounts, and makepayments.«external_system»Mainframe BankingSystem Stores all of the corebanking information aboutcustomers, accounts,transactions, etc.«external_system»E-mail system The internal MicrosoftExchange e-mail system.usesSends e-mails toSends e-mails[SMTP]uses \ No newline at end of file diff --git a/docs/images/component-diagram-for-internet-banking-system-c4context.png b/docs/images/component-diagram-for-internet-banking-system-c4context.png index 43683b1..08b0b54 100644 Binary files a/docs/images/component-diagram-for-internet-banking-system-c4context.png and b/docs/images/component-diagram-for-internet-banking-system-c4context.png differ diff --git a/docs/images/component-diagram-for-internet-banking-system-c4context.puml b/docs/images/component-diagram-for-internet-banking-system-c4context.puml index 0d9bc0a..0dc3eab 100644 --- a/docs/images/component-diagram-for-internet-banking-system-c4context.puml +++ b/docs/images/component-diagram-for-internet-banking-system-c4context.puml @@ -1,5 +1,5 @@ @startuml component-diagram-for-internet-banking-system-c4context -!include ../.c4s/C4_Context.puml +!include UpdateElementStyle("system", $bgColor=#D4E6F1,$fontColor=#1A5276,$borderColor=#1A5276,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=2) UpdateElementStyle("external_system", $bgColor=#F8F9F9,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=1) diff --git a/docs/images/component-diagram-for-internet-banking-system-c4context.svg b/docs/images/component-diagram-for-internet-banking-system-c4context.svg index ef10e10..84de661 100644 --- a/docs/images/component-diagram-for-internet-banking-system-c4context.svg +++ b/docs/images/component-diagram-for-internet-banking-system-c4context.svg @@ -1 +1 @@ -Component diagram for Internet Banking SystemPersonal BankingCustomer A customer of the bank, withpersonal bank accounts.«external_person»«system»Internet Banking System Allows customers to viewinformation about their bankaccounts, and makepayments.«external_system»Mainframe BankingSystem Stores all of the corebanking information aboutcustomers, accounts,transactions, etc.«external_system»E-mail system The internal MicrosoftExchange e-mail system.usesSends e-mails toSends e-mails[SMTP]uses \ No newline at end of file +Component diagram for Internet Banking SystemPersonal BankingCustomer A customer of the bank, withpersonal bank accounts.«external_person»«system»Internet Banking System Allows customers to viewinformation about their bankaccounts, and makepayments.«external_system»Mainframe BankingSystem Stores all of the corebanking information aboutcustomers, accounts,transactions, etc.«external_system»E-mail system The internal MicrosoftExchange e-mail system.usesSends e-mails toSends e-mails[SMTP]uses \ No newline at end of file diff --git a/docs/images/container-diagram-for-internet-banking-system-c4container.png b/docs/images/container-diagram-for-internet-banking-system-c4container.png deleted file mode 100644 index d244713..0000000 Binary files a/docs/images/container-diagram-for-internet-banking-system-c4container.png and /dev/null differ diff --git a/docs/images/container-diagram-for-internet-banking-system-c4container.puml b/docs/images/container-diagram-for-internet-banking-system-c4container.puml deleted file mode 100644 index 7ad8703..0000000 --- a/docs/images/container-diagram-for-internet-banking-system-c4container.puml +++ /dev/null @@ -1,44 +0,0 @@ -@startuml container-diagram-for-internet-banking-system-c4container -!include ../.c4s/C4_Container.puml - -UpdateElementStyle("system", $bgColor=#1a67be,$fontColor=#FFFFFF,$borderColor=#175eaa,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=2) -UpdateElementStyle("external_system", $bgColor=#999999,$fontColor=#FFFFFF,$borderColor=#8a8a8a,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=1) -UpdateElementStyle("person", $bgColor=#0d437b,$fontColor=#FFFFFF,$borderColor=#0d437b,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=2) -UpdateElementStyle("component", $bgColor=#85bbf0,$fontColor=#000000,$borderColor=#78a8d9,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=2) -UpdateElementStyle("external_component", $bgColor=#999999,$fontColor=#FFFFFF,$borderColor=#8a8a8a,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=1) -UpdateElementStyle("container", $bgColor=#438dd4,$fontColor=#FFFFFF,$borderColor=#3e82c5,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=2) -UpdateElementStyle("external_container", $bgColor=#999999,$fontColor=#FFFFFF,$borderColor=#8a8a8a,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=1) -UpdateBoundaryStyle($elementName=system,$bgColor=#FFFFFF,$fontColor=#000000,$borderColor=#000000,$shadowing="false",$shape=RoundedBoxShape()) -UpdateBoundaryStyle($elementName=container,$bgColor=#FFFFFF,$fontColor=#000000,$borderColor=#000000,$shadowing="false",$shape=RoundedBoxShape()) -UpdateBoundaryStyle($elementName=enterprise,$bgColor=#FFFFFF,$fontColor=#000000,$borderColor=#000000,$shadowing="false",$shape=RoundedBoxShape()) -SHOW_PERSON_PORTRAIT() -LAYOUT_TOP_DOWN() - -title Container diagram for Internet Banking System - -Person_Ext(Customer, "Personal Banking Customer", "A customer of the bank, with personal bank accounts.") -System(BankingSystem, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.") -System_Ext(MailSystem, "E-mail system", "The internal Microsoft Exchange e-mail system.") - -System_Boundary(c1, "Internet Banking") { - Container(WebApp, "WebApp", "Web Application:C#, WebApi", "Delivers the static content and the Internet banking SPA") - Container(Spa, "Spa", "Spa:JavaScript, Angular", "Delivers the static content and the Internet banking SPA") - Container(MobileApp, "Mobile App", "Mobile:C#, Xamarin", "Provides a mobile banking experience") - ContainerDb(SqlDatabase, "SqlDatabase", "Database:SQL Database", "Stores user registration information, hashed auth credentials, access logs, etc.") - ContainerQueue(RabbitMQ, "RabbitMQ", "Queue:RabbitMQ", "Stores user registration information, hashed auth credentials, access logs, etc.") - Container(BackendApi, "BackendApi", "Api:Dotnet, Docker Container", "Provides Internet banking functionality via API.") -} - - -Rel(Customer, WebApp, "Uses", "HTTPS") -Rel(Customer, Spa, "Uses", "HTTPS") -Rel(Customer, MobileApp, "Uses") -Rel_Neighbor(WebApp, Spa, "Delivers") -Rel(Spa, BackendApi, "Uses", "async, JSON/HTTPS") -Rel(MobileApp, BackendApi, "Uses", "async, JSON/HTTPS") -Rel_Back_Neighbor(SqlDatabase, BackendApi, "Uses", "async, JSON/HTTPS") -Rel_Back(RabbitMQ, BackendApi, "Uses", "async, JSON") -Rel_Back(Customer, MailSystem, "Sends e-mails to") -Rel_Back(MailSystem, BackendApi, "Sends e-mails using", "sync, SMTP") -Rel_Neighbor(BackendApi, BankingSystem, "Uses", "sync/async, XML/HTTPS") -@enduml diff --git a/docs/images/container-diagram-for-internet-banking-system-c4container.svg b/docs/images/container-diagram-for-internet-banking-system-c4container.svg deleted file mode 100644 index 1fc4e43..0000000 --- a/docs/images/container-diagram-for-internet-banking-system-c4container.svg +++ /dev/null @@ -1 +0,0 @@ -Container diagram for Internet Banking System«system_boundary»«boundary»Internet Banking[System]Personal BankingCustomer A customer of the bank, withpersonal bank accounts.«external_person»«system»Internet Banking System Allows customers to viewinformation about their bankaccounts, and makepayments.«external_system»E-mail system The internal MicrosoftExchange e-mail system.«container»WebApp[Web Application:C#, WebApi] Delivers the static contentand the Internet banking SPA«container»Spa[Spa:JavaScript, Angular] Delivers the static contentand the Internet banking SPA«container»Mobile App[Mobile:C#, Xamarin] Provides a mobile bankingexperience«container»SqlDatabase[Database:SQL Database] Stores user registrationinformation, hashed authcredentials, access logs, etc.«container»RabbitMQ[Queue:RabbitMQ] Stores user registrationinformation, hashed authcredentials, access logs, etc.«container»BackendApi[Api:Dotnet, Docker Container] Provides Internet bankingfunctionality via API.Uses[HTTPS]Uses[HTTPS]UsesDeliversUses[async, JSON/HTTPS]Uses[async, JSON/HTTPS]Uses[async, JSON/HTTPS]Uses[async, JSON]Sends e-mails toSends e-mails using[sync, SMTP]Uses[sync/async, XML/HTTPS] \ No newline at end of file diff --git a/docs/images/container-diagram-for-internet-banking-system-v2-c4container.png b/docs/images/container-diagram-for-internet-banking-system-v2-c4container.png index 5d038ee..405cbb6 100644 Binary files a/docs/images/container-diagram-for-internet-banking-system-v2-c4container.png and b/docs/images/container-diagram-for-internet-banking-system-v2-c4container.png differ diff --git a/docs/images/container-diagram-for-internet-banking-system-v2-c4container.puml b/docs/images/container-diagram-for-internet-banking-system-v2-c4container.puml index af96ac7..a49ccbc 100644 --- a/docs/images/container-diagram-for-internet-banking-system-v2-c4container.puml +++ b/docs/images/container-diagram-for-internet-banking-system-v2-c4container.puml @@ -1,5 +1,5 @@ @startuml container-diagram-for-internet-banking-system-v2-c4container -!include ../.c4s/C4_Container.puml +!include UpdateElementStyle("system", $bgColor=#D4E6F1,$fontColor=#1A5276,$borderColor=#1A5276,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=2) UpdateElementStyle("external_system", $bgColor=#F8F9F9,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=1) diff --git a/docs/images/container-diagram-for-internet-banking-system-v2-c4container.svg b/docs/images/container-diagram-for-internet-banking-system-v2-c4container.svg index 0a13ae6..9b970b2 100644 --- a/docs/images/container-diagram-for-internet-banking-system-v2-c4container.svg +++ b/docs/images/container-diagram-for-internet-banking-system-v2-c4container.svg @@ -1 +1 @@ -Container diagram for Internet Banking System v2«system_boundary»«boundary»Internet Banking[System]Personal BankingCustomer A customer of the bank, withpersonal bank accounts.«external_person»«system»Internet Banking System Allows customers to viewinformation about their bankaccounts, and makepayments.«external_system»E-mail system The internal MicrosoftExchange e-mail system.«container»WebApp[Web Application:C#, WebApi] Delivers the static contentand the Internet banking SPA«container»Spa[Spa:JavaScript, Angular] Delivers the static contentand the Internet banking SPA«container»Mobile App[Mobile:C#, Xamarin] Provides a mobile bankingexperience«container»SqlDatabase[Database:SQL Database] Stores user registrationinformation, hashed authcredentials, access logs, etc.«container»RabbitMQ[Queue:RabbitMQ] Stores user registrationinformation, hashed authcredentials, access logs, etc.«container»BackendApi[Api:Dotnet, Docker Container] Provides Internet bankingfunctionality via API.Uses[HTTPS]Uses[HTTPS]UsesDeliversUses[async, JSON/HTTPS]Uses[async, JSON/HTTPS]Uses[async, JSON/HTTPS]Uses[async, JSON]Sends e-mails toSends e-mails using[sync, SMTP]Uses[sync/async, XML/HTTPS] \ No newline at end of file +Container diagram for Internet Banking System v2«system_boundary»«boundary»Internet Banking[System]Personal BankingCustomer A customer of the bank, withpersonal bank accounts.«external_person»«system»Internet Banking System Allows customers to viewinformation about their bankaccounts, and makepayments.«external_system»E-mail system The internal MicrosoftExchange e-mail system.«container»WebApp[Web Application:C#, WebApi] Delivers the static contentand the Internet banking SPA«container»Spa[Spa:JavaScript, Angular] Delivers the static contentand the Internet banking SPA«container»Mobile App[Mobile:C#, Xamarin] Provides a mobile bankingexperience«container»SqlDatabase[Database:SQL Database] Stores user registrationinformation, hashed authcredentials, access logs, etc.«container»RabbitMQ[Queue:RabbitMQ] Stores user registrationinformation, hashed authcredentials, access logs, etc.«container»BackendApi[Api:Dotnet, Docker Container] Provides Internet bankingfunctionality via API.Uses[HTTPS]Uses[HTTPS]UsesDeliversUses[async, JSON/HTTPS]Uses[async, JSON/HTTPS]Uses[async, JSON/HTTPS]Uses[async, JSON]Sends e-mails toSends e-mails using[sync, SMTP]Uses[sync/async, XML/HTTPS] \ No newline at end of file diff --git a/docs/images/context-example.png b/docs/images/context-example.png deleted file mode 100644 index a7f2168..0000000 Binary files a/docs/images/context-example.png and /dev/null differ diff --git a/docs/images/icon.png b/docs/images/icon.png deleted file mode 100644 index 2b8ec80..0000000 Binary files a/docs/images/icon.png and /dev/null differ diff --git a/docs/images/internet-banking-system-api-application-c4component.png b/docs/images/internet-banking-system-api-application-c4component.png index 9d0144b..8f65422 100644 Binary files a/docs/images/internet-banking-system-api-application-c4component.png and b/docs/images/internet-banking-system-api-application-c4component.png differ diff --git a/docs/images/internet-banking-system-api-application-c4component.puml b/docs/images/internet-banking-system-api-application-c4component.puml index 7302226..d5a710d 100644 --- a/docs/images/internet-banking-system-api-application-c4component.puml +++ b/docs/images/internet-banking-system-api-application-c4component.puml @@ -1,5 +1,5 @@ @startuml internet-banking-system-api-application-c4component -!include ../.c4s/C4_Component.puml +!include UpdateElementStyle("system", $bgColor=#D4E6F1,$fontColor=#1A5276,$borderColor=#1A5276,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=2) UpdateElementStyle("external_system", $bgColor=#F8F9F9,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=1) @@ -16,6 +16,7 @@ LAYOUT_LEFT_RIGHT() title Internet Banking System API Application +Container(ModelDiagrams.PersonController, "Person Controller", "Api", "Person Controller") Container(MobileApp, "MobileApp", "Mobile:C#, Xamarin", "Provides a limited subset of the Internet banking functionality to customers via their mobile device") ContainerDb(Database, "SqlDatabase", "Database:SQL Database", "Stores user registration information, hashed auth credentials, access logs, etc.") System_Ext(Mainframe, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.") @@ -36,4 +37,6 @@ Rel(Spa, sign, "Uses", "JSON/HTTPS") Rel(Spa, accounts, "Uses", "JSON/HTTPS") Rel(MobileApp, sign, "Uses", "JSON/HTTPS") Rel(MobileApp, accounts, "Uses", "JSON/HTTPS") + +SHOW_LEGEND() @enduml diff --git a/docs/images/internet-banking-system-api-application-c4component.svg b/docs/images/internet-banking-system-api-application-c4component.svg index 83f3a83..1898f2e 100644 --- a/docs/images/internet-banking-system-api-application-c4component.svg +++ b/docs/images/internet-banking-system-api-application-c4component.svg @@ -1 +1 @@ -Internet Banking System API Application«container_boundary»«boundary»API Application[Container]«container»MobileApp[Mobile:C#, Xamarin] Provides a limited subset ofthe Internet bankingfunctionality to customersvia their mobile device«container»SqlDatabase[Database:SQL Database] Stores user registrationinformation, hashed authcredentials, access logs, etc.«external_system»Mainframe BankingSystem Stores all of the corebanking information aboutcustomers, accounts,transactions, etc.Spa«component»Sign In Controller[MVC Controller] Allows users to sign in to theinternet banking system«component»Accounts SummaryController[MVC Controller] Provides customers with asummary of their bankaccounts«component»Security Component[Spring Bean] Provides functionality relatedto singing in, changingpasswords, etc.«component»Mainframe BankingSystem Facade[Spring Bean] A facade onto the mainframebanking system.usesusesRead & write to[JDBC]Uses[XML/HTTPS]Uses[JSON/HTTPS]Uses[JSON/HTTPS]Uses[JSON/HTTPS]Uses[JSON/HTTPS] \ No newline at end of file +Internet Banking System API ApplicationAPI Application[Container]Person Controller[Api] Person ControllerMobileApp[Mobile:C#, Xamarin] Provides a limited subset ofthe Internet bankingfunctionality to customersvia their mobile deviceSqlDatabase[Database:SQL Database] Stores user registrationinformation, hashed authcredentials, access logs, etc.Mainframe BankingSystem Stores all of the corebanking information aboutcustomers, accounts,transactions, etc.SpaSign In Controller[MVC Controller] Allows users to sign in to theinternet banking systemAccounts SummaryController[MVC Controller] Provides customers with asummary of their bankaccountsSecurity Component[Spring Bean] Provides functionality relatedto singing in, changingpasswords, etc.Mainframe BankingSystem Facade[Spring Bean] A facade onto the mainframebanking system.usesusesRead & write to[JDBC]Uses[XML/HTTPS]Uses[JSON/HTTPS]Uses[JSON/HTTPS]Uses[JSON/HTTPS]Uses[JSON/HTTPS]Legend  container(no shadow, rounded box, solid, thickness 2)  component(no shadow, rounded box, solid, thickness 2)  external_system(no shadow, rounded box, solid, thickness 1)  container boundary(no shadow, rounded box, dashed)  \ No newline at end of file diff --git a/docs/images/sequence-diagram-for-internet-banking-system-c4sequence.png b/docs/images/sequence-diagram-for-internet-banking-system-c4sequence.png index 70b28f9..5449f63 100644 Binary files a/docs/images/sequence-diagram-for-internet-banking-system-c4sequence.png and b/docs/images/sequence-diagram-for-internet-banking-system-c4sequence.png differ diff --git a/docs/images/sequence-diagram-for-internet-banking-system-c4sequence.puml b/docs/images/sequence-diagram-for-internet-banking-system-c4sequence.puml index 4399ef2..a03af02 100644 --- a/docs/images/sequence-diagram-for-internet-banking-system-c4sequence.puml +++ b/docs/images/sequence-diagram-for-internet-banking-system-c4sequence.puml @@ -1,5 +1,5 @@ @startuml sequence-diagram-for-internet-banking-system-c4sequence -!include ../.c4s/C4_Sequence.puml +!include UpdateElementStyle("system", $bgColor=#D4E6F1,$fontColor=#1A5276,$borderColor=#1A5276,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=2) UpdateElementStyle("external_system", $bgColor=#F8F9F9,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=1) diff --git a/docs/images/sequence-diagram-for-internet-banking-system-c4sequence.svg b/docs/images/sequence-diagram-for-internet-banking-system-c4sequence.svg index d6189fa..e91ea78 100644 --- a/docs/images/sequence-diagram-for-internet-banking-system-c4sequence.svg +++ b/docs/images/sequence-diagram-for-internet-banking-system-c4sequence.svg @@ -1 +1 @@ -Api Application[Container]Sequence diagram for Internet Banking System«container»Single-Page Application[None:JavaScript and Angular]«component»Sign In Controller[Spring MVC Rest Controller]«component»Security Component[Spring Bean]«container»Database[Database:Relational Database Schema]Submits credentials to[JSON/HTTPS]Calls isAuthenticated()onselect * from userswhere username = ?o[JDBCS] \ No newline at end of file +Api Application[Container]Sequence diagram for Internet Banking System«container»Single-Page Application[None:JavaScript and Angular]«component»Sign In Controller[Spring MVC Rest Controller]«component»Security Component[Spring Bean]«container»Database[Database:Relational Database Schema]Submits credentials to[JSON/HTTPS]Calls isAuthenticated()onselect * from userswhere username = ?o[JDBCS] \ No newline at end of file diff --git a/docs/images/system-context-diagram-for-internet-banking-system-c4deployment.png b/docs/images/system-context-diagram-for-internet-banking-system-c4deployment.png index 0b5dc50..96bf259 100644 Binary files a/docs/images/system-context-diagram-for-internet-banking-system-c4deployment.png and b/docs/images/system-context-diagram-for-internet-banking-system-c4deployment.png differ diff --git a/docs/images/system-context-diagram-for-internet-banking-system-c4deployment.puml b/docs/images/system-context-diagram-for-internet-banking-system-c4deployment.puml index d433c68..a263036 100644 --- a/docs/images/system-context-diagram-for-internet-banking-system-c4deployment.puml +++ b/docs/images/system-context-diagram-for-internet-banking-system-c4deployment.puml @@ -1,5 +1,5 @@ @startuml system-context-diagram-for-internet-banking-system-c4deployment -!include ../.c4s/C4_Deployment.puml +!include UpdateElementStyle("system", $bgColor=#D4E6F1,$fontColor=#1A5276,$borderColor=#1A5276,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=2) UpdateElementStyle("external_system", $bgColor=#F8F9F9,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=1) diff --git a/docs/images/system-context-diagram-for-internet-banking-system-c4deployment.svg b/docs/images/system-context-diagram-for-internet-banking-system-c4deployment.svg index 9ee3cc1..c8b86c3 100644 --- a/docs/images/system-context-diagram-for-internet-banking-system-c4deployment.svg +++ b/docs/images/system-context-diagram-for-internet-banking-system-c4deployment.svg @@ -1 +1 @@ -System Context diagram for Internet Banking System«node»Big Bank plc[Big Bank plc data center]«node»bigbank-api***x8[Ubuntu 16.04 LTS]«node»Apache Tomcat[Apache Tomcat 8.x]PropertyValueJava Version8Xmx512MXms1024M«node»bigbank-db01[Ubuntu 16.04 LTS]«node»Oracle - Primary[Oracle 12c]«node»bigbank-db02[Ubuntu 16.04 LTS]«node»Oracle - Primary[Oracle 12c]«node»bigbank-web***x4[Ubuntu 16.04 LTS]«node»Apache Tomcat[Apache Tomcat 8.x]PropertyValueJava Version8Xmx512MXms1024M«node»Customer's mobile device[Apple IOS]«node»Customer's computer[Mircosoft Windows and Apple macOS]«node»Web Browser[Google Chrome, Mozilla Firefox,Apple Safari or Microsoft Edge]«container»BackendApi[Api:Dotnet, Docker Container] Provides Internet bankingfunctionality via API.«container»OracleDatabase[Database:Oracle Database] Stores user registrationinformation, hashed authcredentials, access logs, etc.«container»OracleDatabase[Database:Oracle Database] Stores user registrationinformation, hashed authcredentials, access logs, etc.«container»WebApp[Web Application:C#, WebApi] Delivers the static contentand the Internet banking SPA«container»MobileApp[Mobile:C#, Xamarin] Provides a limited subset ofthe Internet bankingfunctionality to customersvia their mobile device«container»SPA[Spa:JavaScript, Angular] Provides all the Internetbanking functionality tocustomers via their webbrowserMakes API calls to[json/HTTPS]Makes API calls to[json/HTTPS]Delivers to the customer's web browserWrites to[JDBC]Reads from[JDBC]Replicates data to[JDBC] \ No newline at end of file +System Context diagram for Internet Banking System«node»Big Bank plc[Big Bank plc data center]«node»bigbank-api***x8[Ubuntu 16.04 LTS]«node»Apache Tomcat[Apache Tomcat 8.x]PropertyValueJava Version8Xmx512MXms1024M«node»bigbank-db01[Ubuntu 16.04 LTS]«node»Oracle - Primary[Oracle 12c]«node»bigbank-db02[Ubuntu 16.04 LTS]«node»Oracle - Primary[Oracle 12c]«node»bigbank-web***x4[Ubuntu 16.04 LTS]«node»Apache Tomcat[Apache Tomcat 8.x]PropertyValueJava Version8Xmx512MXms1024M«node»Customer's mobile device[Apple IOS]«node»Customer's computer[Mircosoft Windows and Apple macOS]«node»Web Browser[Google Chrome, Mozilla Firefox,Apple Safari or Microsoft Edge]«container»BackendApi[Api:Dotnet, Docker Container] Provides Internet bankingfunctionality via API.«container»OracleDatabase[Database:Oracle Database] Stores user registrationinformation, hashed authcredentials, access logs, etc.«container»OracleDatabase[Database:Oracle Database] Stores user registrationinformation, hashed authcredentials, access logs, etc.«container»WebApp[Web Application:C#, WebApi] Delivers the static contentand the Internet banking SPA«container»MobileApp[Mobile:C#, Xamarin] Provides a limited subset ofthe Internet bankingfunctionality to customersvia their mobile device«container»SPA[Spa:JavaScript, Angular] Provides all the Internetbanking functionality tocustomers via their webbrowserMakes API calls to[json/HTTPS]Makes API calls to[json/HTTPS]Delivers to the customer's web browserWrites to[JDBC]Reads from[JDBC]Replicates data to[JDBC] \ No newline at end of file diff --git a/docs/images/system-enterprise-diagram-for-internet-banking-system-c4component.png b/docs/images/system-enterprise-diagram-for-internet-banking-system-c4component.png deleted file mode 100644 index e8ad2ea..0000000 Binary files a/docs/images/system-enterprise-diagram-for-internet-banking-system-c4component.png and /dev/null differ diff --git a/docs/images/system-enterprise-diagram-for-internet-banking-system-c4component.puml b/docs/images/system-enterprise-diagram-for-internet-banking-system-c4component.puml deleted file mode 100644 index cb6c9c2..0000000 --- a/docs/images/system-enterprise-diagram-for-internet-banking-system-c4component.puml +++ /dev/null @@ -1,44 +0,0 @@ -@startuml system-enterprise-diagram-for-internet-banking-system-c4component -!include ../.c4s/C4_Component.puml - -UpdateElementStyle("system", $bgColor=#D4E6F1,$fontColor=#1A5276,$borderColor=#1A5276,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=2) -UpdateElementStyle("external_system", $bgColor=#F8F9F9,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=1) -UpdateElementStyle("person", $bgColor=#797D7F,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=2) -UpdateElementStyle("component", $bgColor=#FAE5D3,$fontColor=#CA6F1E,$borderColor=#CA6F1E,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=2) -UpdateElementStyle("external_component", $bgColor=#F8F9F9,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=1) -UpdateElementStyle("container", $bgColor=#EAF2F8,$fontColor=#2E86C1,$borderColor=#2E86C1,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=2) -UpdateElementStyle("external_container", $bgColor=#F8F9F9,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=1) -UpdateBoundaryStyle($elementName=system,$bgColor=#F8F9F9,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape()) -UpdateBoundaryStyle($elementName=container,$bgColor=#F8F9F9,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape()) -UpdateBoundaryStyle($elementName=enterprise,$bgColor=#F8F9F9,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape()) -SHOW_PERSON_PORTRAIT() -LAYOUT_TOP_DOWN() - -title System Enterprise diagram for Internet Banking System - -Person_Ext(customer, "Personal Banking Customer", "A customer of the bank, with personal bank accounts.") - -Enterprise_Boundary(enterprise.boundary, "Domain A") { - System(BankingSystem, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.") - -Enterprise_Boundary(enterprise.boundary.1, "Domain Internal Users") { - Person(internalcustomer, "Personal Banking Customer", "An customer of the bank, with personal bank accounts.") -} - - -Enterprise_Boundary(enterprise.boundary.2, "Domain Managers") { - Person(manager, "Manager Banking Customer", "A manager of the bank, with personal bank accounts.") -} - -} - -System_Ext(Mainframe, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.") -System_Ext(MailSystem, "E-mail system", "The internal Microsoft Exchange e-mail system.") - -Rel(customer, BankingSystem, "uses") -Rel(internalcustomer, BankingSystem, "uses") -Rel(manager, BankingSystem, "uses") -Rel_Back(customer, MailSystem, "Sends e-mails to") -Rel_Neighbor(BankingSystem, MailSystem, "Sends e-mails", "SMTP") -Rel(BankingSystem, Mainframe, "uses") -@enduml diff --git a/docs/images/system-enterprise-diagram-for-internet-banking-system-c4component.svg b/docs/images/system-enterprise-diagram-for-internet-banking-system-c4component.svg deleted file mode 100644 index ccbc277..0000000 --- a/docs/images/system-enterprise-diagram-for-internet-banking-system-c4component.svg +++ /dev/null @@ -1 +0,0 @@ -System Enterprise diagram for Internet Banking System«enterprise_boundary»«boundary»Domain A[Enterprise]«enterprise_boundary»«boundary»Domain Internal Users[Enterprise]«enterprise_boundary»«boundary»Domain Managers[Enterprise]Personal BankingCustomer A customer of the bank, withpersonal bank accounts.«external_person»«external_system»Mainframe BankingSystem Stores all of the corebanking information aboutcustomers, accounts,transactions, etc.«external_system»E-mail system The internal MicrosoftExchange e-mail system.«system»Internet Banking System Allows customers to viewinformation about their bankaccounts, and makepayments.Personal BankingCustomer An customer of the bank,with personal bank accounts.«person»Manager BankingCustomer A manager of the bank, withpersonal bank accounts.«person»usesusesusesSends e-mails toSends e-mails[SMTP]uses \ No newline at end of file diff --git a/docs/images/system-enterprise-diagram-for-internet-banking-system-c4context.png b/docs/images/system-enterprise-diagram-for-internet-banking-system-c4context.png index afaa837..d227979 100644 Binary files a/docs/images/system-enterprise-diagram-for-internet-banking-system-c4context.png and b/docs/images/system-enterprise-diagram-for-internet-banking-system-c4context.png differ diff --git a/docs/images/system-enterprise-diagram-for-internet-banking-system-c4context.puml b/docs/images/system-enterprise-diagram-for-internet-banking-system-c4context.puml index 4e53bed..98c543e 100644 --- a/docs/images/system-enterprise-diagram-for-internet-banking-system-c4context.puml +++ b/docs/images/system-enterprise-diagram-for-internet-banking-system-c4context.puml @@ -1,5 +1,5 @@ @startuml system-enterprise-diagram-for-internet-banking-system-c4context -!include ../.c4s/C4_Context.puml +!include UpdateElementStyle("system", $bgColor=#D4E6F1,$fontColor=#1A5276,$borderColor=#1A5276,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=2) UpdateElementStyle("external_system", $bgColor=#F8F9F9,$fontColor=#797D7F,$borderColor=#797D7F,$shadowing="false",$shape=RoundedBoxShape(),$borderStyle=SolidLine(),$borderThickness=1) diff --git a/docs/images/system-enterprise-diagram-for-internet-banking-system-c4context.svg b/docs/images/system-enterprise-diagram-for-internet-banking-system-c4context.svg index 0520387..fb8d6ea 100644 --- a/docs/images/system-enterprise-diagram-for-internet-banking-system-c4context.svg +++ b/docs/images/system-enterprise-diagram-for-internet-banking-system-c4context.svg @@ -1 +1 @@ -System Enterprise diagram for Internet Banking System«enterprise_boundary»«boundary»Domain A[Enterprise]«enterprise_boundary»«boundary»Domain Internal Users[Enterprise]«enterprise_boundary»«boundary»Domain Managers[Enterprise]Personal BankingCustomer A customer of the bank, withpersonal bank accounts.«external_person»«external_system»Mainframe BankingSystem Stores all of the corebanking information aboutcustomers, accounts,transactions, etc.«external_system»E-mail system The internal MicrosoftExchange e-mail system.«system»Internet Banking System Allows customers to viewinformation about their bankaccounts, and makepayments.Personal BankingCustomer An customer of the bank,with personal bank accounts.«person»Manager BankingCustomer A manager of the bank, withpersonal bank accounts.«person»usesusesusesSends e-mails toSends e-mails[SMTP]uses \ No newline at end of file +System Enterprise diagram for Internet Banking System«enterprise_boundary»«boundary»Domain A[Enterprise]«enterprise_boundary»«boundary»Domain Internal Users[Enterprise]«enterprise_boundary»«boundary»Domain Managers[Enterprise]Personal BankingCustomer A customer of the bank, withpersonal bank accounts.«external_person»«external_system»Mainframe BankingSystem Stores all of the corebanking information aboutcustomers, accounts,transactions, etc.«external_system»E-mail system The internal MicrosoftExchange e-mail system.«system»Internet Banking System Allows customers to viewinformation about their bankaccounts, and makepayments.Personal BankingCustomer An customer of the bank,with personal bank accounts.«person»Manager BankingCustomer A manager of the bank, withpersonal bank accounts.«person»usesusesusesSends e-mails toSends e-mails[SMTP]uses \ No newline at end of file diff --git a/docs/system-enterprise-diagram-for-internet-banking-system-c4context.mermaid.md b/docs/system-enterprise-diagram-for-internet-banking-system-c4context.mermaid.md deleted file mode 100644 index 7935dd8..0000000 --- a/docs/system-enterprise-diagram-for-internet-banking-system-c4context.mermaid.md +++ /dev/null @@ -1,31 +0,0 @@ -```mermaid -C4Context - -title System Enterprise diagram for Internet Banking System - -Person_Ext(customer, "Personal Banking Customer", "A customer of the bank, with personal bank accounts.") - -Enterprise_Boundary(enterprise.boundary, "Domain A") { - System(BankingSystem, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.", $tags="services") - -Enterprise_Boundary(enterprise.boundary.1, "Domain Internal Users") { - Person(internalcustomer, "Personal Banking Customer", "An internal customer of the bank, with personal bank accounts.") -} - - -Enterprise_Boundary(enterprise.boundary.2, "Domain Managers") { - Person(manager, "Manager Banking Customer", "A manager of the bank, with personal bank accounts.") -} - -} - -System_Ext(Mainframe, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.") -System_Ext(MailSystem, "E-mail system", "The internal Microsoft Exchange e-mail system.") - -Rel(customer, BankingSystem, "uses") -Rel(internalcustomer, BankingSystem, "uses") -Rel(manager, BankingSystem, "uses") -Rel_Back(customer, MailSystem, "Sends e-mails to") -Rel(BankingSystem, MailSystem, "Sends e-mails", "SMTP") -Rel(BankingSystem, Mainframe, "uses") -``` diff --git a/samples/ModelDiagrams/Diagrams/ComponentDiagramSample.cs b/samples/ModelDiagrams/Diagrams/ComponentDiagramSample.cs index 71cca9d..097d75a 100644 --- a/samples/ModelDiagrams/Diagrams/ComponentDiagramSample.cs +++ b/samples/ModelDiagrams/Diagrams/ComponentDiagramSample.cs @@ -3,7 +3,6 @@ using C4Sharp.Elements; using C4Sharp.Elements.Containers; using C4Sharp.Elements.Relationships; -using static C4Sharp.Elements.Relationships.Boundary; using static ModelDiagrams.Structures.Systems; using static ModelDiagrams.Structures.Containers; using static ModelDiagrams.Structures.Components; @@ -14,9 +13,11 @@ public class ComponentDiagramSample : ComponentDiagram { protected override string Title => "Internet Banking System API Application"; protected override DiagramLayout FlowVisualization => DiagramLayout.LeftRight; + protected override bool ShowLegend => true; - protected override IEnumerable Structures => new Structure[] - { + protected override IEnumerable Structures => + [ + new Api(), MobileApp, SqlDatabase, Mainframe, @@ -25,19 +26,18 @@ public class ComponentDiagramSample : ComponentDiagram Accounts, Security, MainframeFacade - ), - }; + ) + ]; - protected override IEnumerable Relationships => new Relationship[] - { + protected override IEnumerable Relationships => + [ Sign > Security, Accounts > MainframeFacade, Security > SqlDatabase | ("Read & write to", "JDBC"), MainframeFacade > Mainframe | ("Uses", "XML/HTTPS"), - SpaApp > Sign | ("Uses", "JSON/HTTPS"), SpaApp > Accounts | ("Uses", "JSON/HTTPS"), MobileApp > Sign | ("Uses", "JSON/HTTPS"), MobileApp > Accounts | ("Uses", "JSON/HTTPS") - }; + ]; } \ No newline at end of file diff --git a/samples/ModelDiagrams/Diagrams/ContainerDiagramSample.cs b/samples/ModelDiagrams/Diagrams/ContainerDiagramSample.cs index d10ba0a..b44b100 100644 --- a/samples/ModelDiagrams/Diagrams/ContainerDiagramSample.cs +++ b/samples/ModelDiagrams/Diagrams/ContainerDiagramSample.cs @@ -9,50 +9,84 @@ public class ContainerDiagramSample : ContainerDiagram { protected override string Title => "Container diagram for Internet Banking System v2"; - protected override IEnumerable Structures => new Structure[] - { - Person.None | Boundary.External - | ("Customer", "Personal Banking Customer", "A customer of the bank, with personal bank accounts."), - - SoftwareSystem.None | ("BankingSystem", "Internet Banking System", - "Allows customers to view information about their bank accounts, and make payments."), - - SoftwareSystem.None | Boundary.External - | ("MailSystem", "E-mail system", "The internal Microsoft Exchange e-mail system."), - + protected override IEnumerable Structures => + [ + Person.None | Boundary.External | ( + alias: "Customer", + label: "Personal Banking Customer", + description: "A customer of the bank, with personal bank accounts." + ), + + SoftwareSystem.None | ( + alias: "BankingSystem", + label: "Internet Banking System", + description: "Allows customers to view information about their bank accounts, and make payments." + ), + + SoftwareSystem.None | Boundary.External | ( + alias: "MailSystem", + label: "E-mail system", + description: "The internal Microsoft Exchange e-mail system." + ), + Bound("c1", "Internet Banking", - Container.None | (WebApplication, "WebApp", "WebApp", "C#, WebApi", - "Delivers the static content and the Internet banking SPA"), - - Container.None | (Spa, "Spa", "Spa", "JavaScript, Angular", - "Delivers the static content and the Internet banking SPA"), - - Container.None | (Mobile, "MobileApp", "Mobile App", "C#, Xamarin", - "Provides a mobile banking experience"), - - Container.None | (Database, "SqlDatabase", "SqlDatabase", "SQL Database", - "Stores user registration information, hashed auth credentials, access logs, etc."), - - Container.None | (Queue, "RabbitMQ", "RabbitMQ", "RabbitMQ", - "Stores user registration information, hashed auth credentials, access logs, etc."), - - Container.None | (Api, "BackendApi", "BackendApi", "Dotnet, Docker Container", - "Provides Internet banking functionality via API.") + Container.None | ( + type: WebApplication, + alias: "WebApp", + label: "WebApp", + technology: "C#, WebApi", + description: "Delivers the static content and the Internet banking SPA" + ), + Container.None | ( + type: Spa, + alias: "Spa", + label: "Spa", + technology: "JavaScript, Angular", + description: "Delivers the static content and the Internet banking SPA" + ), + Container.None | ( + type: Mobile, + alias: "MobileApp", + label: "Mobile App", + technology: "C#, Xamarin", + description: "Provides a mobile banking experience" + ), + Container.None | ( + type: Database, + alias: "SqlDatabase", + label: "SqlDatabase", + technology: "SQL Database", + description: "Stores user registration information, hashed auth credentials, access logs, etc." + ), + Container.None | ( + type: Queue, + alias: "RabbitMQ", + label: "RabbitMQ", + technology: "RabbitMQ", + description: "Stores user registration information, hashed auth credentials, access logs, etc." + ), + Container.None | ( + type: Api, + alias: "BackendApi", + label: "BackendApi", + technology: "Dotnet, Docker Container", + description: "Provides Internet banking functionality via API." + ) ) - }; + ]; protected override IEnumerable Relationships => new[] { this["Customer"] > this["WebApp"] | ("Uses", "HTTPS"), this["Customer"] > this["Spa"] | ("Uses", "HTTPS"), this["Customer"] > this["MobileApp"] | "Uses", - + this["WebApp"] > this["Spa"] | "Delivers" | Position.Neighbor, this["Spa"] > this["BackendApi"] | ("Uses", "async, JSON/HTTPS"), this["MobileApp"] > this["BackendApi"] | ("Uses", "async, JSON/HTTPS"), this["SqlDatabase"] < this["BackendApi"] | ("Uses", "async, JSON/HTTPS") | Position.Neighbor, this["RabbitMQ"] < this["BackendApi"] | ("Uses", "async, JSON"), - + this["Customer"] < this["MailSystem"] | "Sends e-mails to", this["MailSystem"] < this["BackendApi"] | ("Sends e-mails using", "sync, SMTP"), this["BackendApi"] > this["BankingSystem"] | ("Uses", "sync/async, XML/HTTPS") | Position.Neighbor diff --git a/samples/ModelDiagrams/Diagrams/ContextDiagramSample.cs b/samples/ModelDiagrams/Diagrams/ContextDiagramSample.cs index 5a3911c..bb3bb7b 100644 --- a/samples/ModelDiagrams/Diagrams/ContextDiagramSample.cs +++ b/samples/ModelDiagrams/Diagrams/ContextDiagramSample.cs @@ -11,19 +11,19 @@ public class ContextDiagramSample : ContextDiagram { protected override string Title => "Component diagram for Internet Banking System"; - protected override IEnumerable Structures => new Structure[] - { + protected override IEnumerable Structures => + [ Customer, BankingSystem, Mainframe, MailSystem - }; + ]; - protected override IEnumerable Relationships => new[] - { + protected override IEnumerable Relationships => + [ Customer > BankingSystem, Customer < MailSystem | "Sends e-mails to", BankingSystem > MailSystem | ("Sends e-mails", "SMTP") | Neighbor, BankingSystem > Mainframe - }; + ]; } \ No newline at end of file diff --git a/samples/ModelDiagrams/Diagrams/DeploymentDiagramSample.cs b/samples/ModelDiagrams/Diagrams/DeploymentDiagramSample.cs index ec232f3..4674f08 100644 --- a/samples/ModelDiagrams/Diagrams/DeploymentDiagramSample.cs +++ b/samples/ModelDiagrams/Diagrams/DeploymentDiagramSample.cs @@ -6,28 +6,30 @@ namespace ModelDiagrams.Diagrams; -public class DeploymentDiagramSample: DeploymentDiagram +public class DeploymentDiagramSample : DeploymentDiagram { protected override string Title => "System Context diagram for Internet Banking System"; - protected override IEnumerable Structures => new Structure[] - { + protected override IEnumerable Structures => + [ Node("plc", "Big Bank plc", "Big Bank plc data center", + [ Nodes.Ubuntu("dn", "bigbank-api***\tx8", Nodes.ApacheTomCat("apache", Containers.BackendApi)), Nodes.Ubuntu("bigbankdb01", "bigbank-db01", Nodes.OracleNode("oracle", Containers.OracleDatabase[1])), Nodes.Ubuntu("bigbankdb02", "bigbank-db02", Nodes.OracleNode("oracle2", Containers.OracleDatabase["Data Reader"])), - Nodes.Ubuntu("bb2", "bigbank-web***\tx4", Nodes.ApacheTomCat("apache2", Containers.WebApp))), + Nodes.Ubuntu("bb2", "bigbank-web***\tx4", Nodes.ApacheTomCat("apache2", Containers.WebApp)) + ]), Nodes.Ios("ios", Containers.MobileApp), Nodes.PersonalComputer("computer", Nodes.Browser("browser", Containers.SpaApp)) - }; + ]; - protected override IEnumerable Relationships => new[] - { + protected override IEnumerable Relationships => + [ Containers.MobileApp > Containers.BackendApi | ("Makes API calls to", "json/HTTPS"), Containers.SpaApp > Containers.BackendApi | ("Makes API calls to", "json/HTTPS"), - Containers.WebApp > Containers.SpaApp | "Delivers to the customer's web browser"| Position.Up, + Containers.WebApp > Containers.SpaApp | "Delivers to the customer's web browser" | Position.Up, Containers.BackendApi > Containers.OracleDatabase[1] | ("Writes to", "JDBC"), Containers.BackendApi < Containers.OracleDatabase["Data Reader"] | ("Reads from", "JDBC"), - Containers.OracleDatabase[1] > Containers.OracleDatabase["Data Reader"] | ("Replicates data to", "JDBC") | Position.Right, - }; + Containers.OracleDatabase[1] > Containers.OracleDatabase["Data Reader"] | ("Replicates data to", "JDBC") | Position.Right + ]; } \ No newline at end of file diff --git a/samples/ModelDiagrams/Diagrams/EnterpriseDiagramSample.cs b/samples/ModelDiagrams/Diagrams/EnterpriseDiagramSample.cs index b4be0c4..3c55745 100644 --- a/samples/ModelDiagrams/Diagrams/EnterpriseDiagramSample.cs +++ b/samples/ModelDiagrams/Diagrams/EnterpriseDiagramSample.cs @@ -13,8 +13,8 @@ public class EnterpriseDiagramSample: ContextDiagram { protected override string Title => "System Enterprise diagram for Internet Banking System"; - protected override IEnumerable Structures => new Structure[] - { + protected override IEnumerable Structures => + [ Customer, Bound("enterprise.boundary", "Domain A", BankingSystem, @@ -23,15 +23,15 @@ public class EnterpriseDiagramSample: ContextDiagram ), Mainframe, MailSystem - }; + ]; - protected override IEnumerable Relationships => new[] - { + protected override IEnumerable Relationships => + [ Customer > BankingSystem, InternalCustomer > BankingSystem, Manager > BankingSystem, Customer < MailSystem | "Sends e-mails to", BankingSystem > MailSystem | ("Sends e-mails", "SMTP") | Neighbor, - BankingSystem > Mainframe, - }; + BankingSystem > Mainframe + ]; } \ No newline at end of file diff --git a/samples/ModelDiagrams/Diagrams/SequenceDiagramSample.cs b/samples/ModelDiagrams/Diagrams/SequenceDiagramSample.cs index 31c31d1..ff8e4bc 100644 --- a/samples/ModelDiagrams/Diagrams/SequenceDiagramSample.cs +++ b/samples/ModelDiagrams/Diagrams/SequenceDiagramSample.cs @@ -8,26 +8,46 @@ public class SequenceDiagramSample : SequenceDiagram { protected override string Title => "Sequence diagram for Internet Banking System"; - protected override IEnumerable Structures => new Structure[] - { - new Container("cA", "Single-Page Application", ContainerType.None, "JavaScript and Angular", - "Provides all of the Internet banking functionality to customers via their web browser."), + protected override IEnumerable Structures => + [ + new Container( + alias: "cA", + label: "Single-Page Application", + type: ContainerType.None, + technology: "JavaScript and Angular", + description: "Provides all of the Internet banking functionality to customers via their web browser." + ), - Bound("b", "Api Application", - new("cB", "Sign In Controller", ComponentType.None, "Spring MVC Rest Controller", - "Allows users to sign in to the Internet Banking System."), - new("cC", "Security Component", ComponentType.None, "Spring Bean", - "Provides functionality Related to signing in, changing passwords, etc.") + Bound(alias: "b", label: "Api Application", + new Component( + alias: "cB", + label: "Sign In Controller", + type: ComponentType.None, + technology: "Spring MVC Rest Controller", + description: "Allows users to sign in to the Internet Banking System." + ), + new Component( + alias: "cC", + label: "Security Component", + type: ComponentType.None, + technology: "Spring Bean", + description: "Provides functionality Related to signing in, changing passwords, etc." + ) ), - - new Container("cD", "Database", ContainerType.Database, "Relational Database Schema", - "Stores user registration information, hashed authentication credentials, access logs, etc.") - }; - protected override IEnumerable Relationships => new[] - { + new Container( + alias: "cD", + label: "Database", + type: ContainerType.Database, + technology: "Relational Database Schema", + description: "Stores user registration information, hashed authentication credentials, access logs, etc." + ) + ]; + + protected override IEnumerable Relationships => + [ It("cA") > It("cB") | ("Submits credentials to", "JSON/HTTPS"), It("cB") > It("cC") | "Calls isAuthenticated() on", It("cC") > It("cD") | ("select * from users where username = ?o", "JDBCS") - }; + ]; } \ No newline at end of file diff --git a/samples/ModelDiagrams/IPersonController.cs b/samples/ModelDiagrams/IPersonController.cs new file mode 100644 index 0000000..32b5a66 --- /dev/null +++ b/samples/ModelDiagrams/IPersonController.cs @@ -0,0 +1,6 @@ +namespace ModelDiagrams; + +public class PersonController +{ + +} \ No newline at end of file diff --git a/samples/ModelDiagrams/Program.cs b/samples/ModelDiagrams/Program.cs index f2f7930..9333881 100644 --- a/samples/ModelDiagrams/Program.cs +++ b/samples/ModelDiagrams/Program.cs @@ -20,4 +20,4 @@ new PlantumlContext() .UseDiagramImageBuilder() .UseDiagramSvgImageBuilder() - .Export(path, diagrams, new ParadisoTheme()); \ No newline at end of file + .Export(path, diagrams, new ParadisoTheme()); diff --git a/samples/ModelDiagrams/Structures/People.cs b/samples/ModelDiagrams/Structures/People.cs index f8dcefd..58f1762 100644 --- a/samples/ModelDiagrams/Structures/People.cs +++ b/samples/ModelDiagrams/Structures/People.cs @@ -5,12 +5,22 @@ namespace ModelDiagrams.Structures; public static class People { - public static Person Customer => new ("customer", "Personal Banking Customer", - "A customer of the bank, with personal bank accounts.", Boundary.External); + public static Person Customer => new( + alias: "customer", + label: "Personal Banking Customer", + description: "A customer of the bank, with personal bank accounts.", + boundary: Boundary.External + ); - public static Person InternalCustomer => new Person("internalcustomer", "Personal Banking Customer", - "An customer of the bank, with personal bank accounts."); + public static Person InternalCustomer => new( + alias: "internalcustomer", + label: "Personal Banking Customer", + description: "An customer of the bank, with personal bank accounts." + ); - public static Person Manager => new ("manager", "Manager Banking Customer", - "A manager of the bank, with personal bank accounts."); -} + public static Person Manager => new( + alias: "manager", + label: "Manager Banking Customer", + description: "A manager of the bank, with personal bank accounts." + ); +} \ No newline at end of file diff --git a/samples/ModelDiagrams/Structures/Systems.cs b/samples/ModelDiagrams/Structures/Systems.cs index 11a8097..614f113 100644 --- a/samples/ModelDiagrams/Structures/Systems.cs +++ b/samples/ModelDiagrams/Structures/Systems.cs @@ -5,14 +5,23 @@ namespace ModelDiagrams.Structures; public static class Systems { - public static SoftwareSystem BankingSystem => - new("BankingSystem", "Internet Banking System", - "Allows customers to view information about their bank accounts, and make payments."); + public static SoftwareSystem BankingSystem => new( + alias: "BankingSystem", + label: "Internet Banking System", + description: "Allows customers to view information about their bank accounts, and make payments." + ); - public static SoftwareSystem Mainframe => - new("Mainframe", "Mainframe Banking System", - "Stores all of the core banking information about customers, accounts, transactions, etc.", Boundary.External); + public static SoftwareSystem Mainframe => new( + alias: "Mainframe", + label: "Mainframe Banking System", + description: "Stores all of the core banking information about customers, accounts, transactions, etc.", + boundary: Boundary.External + ); - public static SoftwareSystem MailSystem => - new ("MailSystem", "E-mail system", "The internal Microsoft Exchange e-mail system.", Boundary.External); -} + public static SoftwareSystem MailSystem => new( + alias: "MailSystem", + label: "E-mail system", + description: "The internal Microsoft Exchange e-mail system.", + boundary: Boundary.External + ); +} \ No newline at end of file diff --git a/src/C4Sharp.Tools/C4Sharp.Tools.csproj b/src/C4Sharp.Tools/C4Sharp.Tools.csproj index 25fda1f..08718e0 100644 --- a/src/C4Sharp.Tools/C4Sharp.Tools.csproj +++ b/src/C4Sharp.Tools/C4Sharp.Tools.csproj @@ -4,7 +4,7 @@ Exe enable c4scli - net6.0;net7.0;net8.0 + net8.0;net9.0 true C4SCLI - Tool for C4Sharp yanjustino, albertomonteiro @@ -14,7 +14,7 @@ https://github.com/8T4/c4sharp git c4, diagrams - 3.0.0 + 4.0.0 https://github.com/8T4/c4sharp/blob/main/LICENSE true true diff --git a/src/C4Sharp/C4Sharp.csproj b/src/C4Sharp/C4Sharp.csproj index c1da2af..14d8927 100644 --- a/src/C4Sharp/C4Sharp.csproj +++ b/src/C4Sharp/C4Sharp.csproj @@ -1,7 +1,7 @@ īģŋ - net6.0;net7.0;net8.0 + net8.0;net9.0 true C4Sharp - simple .NET superset of C4-PlantUML yanjustino, leisiamedeiros @@ -11,12 +11,13 @@ https://github.com/8T4/c4sharp git c4, diagrams - 7.0.0 + 8.0.0 https://github.com/8T4/c4sharp/blob/main/LICENSE true true snupkg enable + 13 @@ -32,7 +33,7 @@ - + diff --git a/src/C4Sharp/Commons/FileSystem/C4FileException.cs b/src/C4Sharp/Commons/FileSystem/C4FileException.cs index 42fe43a..5df21cd 100644 --- a/src/C4Sharp/Commons/FileSystem/C4FileException.cs +++ b/src/C4Sharp/Commons/FileSystem/C4FileException.cs @@ -5,7 +5,6 @@ namespace C4Sharp.Commons.FileSystem; /// /// C4File Exception /// -[Serializable] [ExcludeFromCodeCoverage] public class C4FileException : Exception { @@ -25,16 +24,4 @@ public C4FileException(string message) : base(message) public C4FileException(string message, Exception innerException) : base(message, innerException) { } - - -#if NET6 - /// - /// Constructor - /// - /// - /// - public C4FileException([NotNull] SerializationInfo info, StreamingContext context) : base(info, context) - { - } -#endif } diff --git a/src/C4Sharp/Commons/FileSystem/C4SharpDirectory.cs b/src/C4Sharp/Commons/FileSystem/C4SharpDirectory.cs index 05ef9b5..1047084 100644 --- a/src/C4Sharp/Commons/FileSystem/C4SharpDirectory.cs +++ b/src/C4Sharp/Commons/FileSystem/C4SharpDirectory.cs @@ -9,8 +9,4 @@ internal static class C4SharpDirectory /// Default Directory Name /// public static string DirectoryName => "c4"; - /// - /// Default Resource Folder Name - /// - public static string ResourcesFolderName => Path.Join("..", ".c4s"); } diff --git a/src/C4Sharp/Commons/TabIndentation.cs b/src/C4Sharp/Commons/TabIndentation.cs index 2c1c9ac..cdd3de0 100644 --- a/src/C4Sharp/Commons/TabIndentation.cs +++ b/src/C4Sharp/Commons/TabIndentation.cs @@ -6,7 +6,7 @@ namespace C4Sharp.Commons; /// Indentation methods /// [ExcludeFromCodeCoverage] -internal static class TabIndentation +internal readonly record struct TabIndentation { /// /// Default indentation. diff --git a/src/C4Sharp/Diagrams/Builders/ComponentDiagram.cs b/src/C4Sharp/Diagrams/Builders/ComponentDiagram.cs index 63496d3..a00d5d6 100644 --- a/src/C4Sharp/Diagrams/Builders/ComponentDiagram.cs +++ b/src/C4Sharp/Diagrams/Builders/ComponentDiagram.cs @@ -6,9 +6,9 @@ namespace C4Sharp.Diagrams.Builders; public abstract class ComponentDiagram: DiagramBuilder { - protected override string Title { get; } = "Component Diagram"; + protected override string Title => "Component Diagram"; protected override DiagramType DiagramType { get; } = DiagramType.Component; - protected ContainerBoundary Bound(string tag, string name, params Component[] components) + protected static ContainerBoundary Bound(string tag, string name, params Component[] components) => new(tag, name, components); } \ No newline at end of file diff --git a/src/C4Sharp/Diagrams/Builders/ContainerDiagram.cs b/src/C4Sharp/Diagrams/Builders/ContainerDiagram.cs index 51c3734..8798f19 100644 --- a/src/C4Sharp/Diagrams/Builders/ContainerDiagram.cs +++ b/src/C4Sharp/Diagrams/Builders/ContainerDiagram.cs @@ -5,9 +5,9 @@ namespace C4Sharp.Diagrams.Builders; public abstract class ContainerDiagram: DiagramBuilder { - protected override string Title { get; } = "Container Diagram"; + protected override string Title => "Container Diagram"; protected override DiagramType DiagramType { get; } = DiagramType.Container; - protected SoftwareSystemBoundary Bound(string tag, string name, params Container[] components) + protected static SoftwareSystemBoundary Bound(string tag, string name, params Container[] components) => new(tag, name, components); } \ No newline at end of file diff --git a/src/C4Sharp/Diagrams/Builders/ContextDiagram.cs b/src/C4Sharp/Diagrams/Builders/ContextDiagram.cs index aa48da8..2fbd6da 100644 --- a/src/C4Sharp/Diagrams/Builders/ContextDiagram.cs +++ b/src/C4Sharp/Diagrams/Builders/ContextDiagram.cs @@ -5,9 +5,9 @@ namespace C4Sharp.Diagrams.Builders; public abstract class ContextDiagram: DiagramBuilder { - protected override string Title { get; } = "Context Diagram"; + protected override string Title => "Context Diagram"; protected override DiagramType DiagramType { get; } = DiagramType.Context; - protected EnterpriseBoundary Bound(string alias, string label, params Structure[] structures) => + protected static EnterpriseBoundary Bound(string alias, string label, params Structure[] structures) => new(alias, label, structures); } \ No newline at end of file diff --git a/src/C4Sharp/Diagrams/Builders/DeploymentDiagram.cs b/src/C4Sharp/Diagrams/Builders/DeploymentDiagram.cs index 6a77e68..5cca105 100644 --- a/src/C4Sharp/Diagrams/Builders/DeploymentDiagram.cs +++ b/src/C4Sharp/Diagrams/Builders/DeploymentDiagram.cs @@ -2,14 +2,14 @@ namespace C4Sharp.Diagrams.Builders; -public abstract class DeploymentDiagram: DiagramBuilder +public abstract class DeploymentDiagram : DiagramBuilder { - protected override string Title { get; } = "Deployment Diagram"; + protected override string Title => "Deployment Diagram"; protected override DiagramType DiagramType { get; } = DiagramType.Deployment; - - protected DeploymentNode Node(string alias, string label, params DeploymentNode[] nodes) => + + protected static DeploymentNode Node(string alias, string label, params DeploymentNode[] nodes) => new(alias, label, nodes); - - protected DeploymentNode Node(string alias, string label, string description, params DeploymentNode[] nodes) => - new(alias, label, nodes) {Description = description}; + + protected static DeploymentNode Node(string alias, string label, string description, params DeploymentNode[] nodes) => + new(alias, label, nodes) { Description = description }; } \ No newline at end of file diff --git a/src/C4Sharp/Diagrams/Builders/SequenceDiagram.cs b/src/C4Sharp/Diagrams/Builders/SequenceDiagram.cs index 6aceb14..760911e 100644 --- a/src/C4Sharp/Diagrams/Builders/SequenceDiagram.cs +++ b/src/C4Sharp/Diagrams/Builders/SequenceDiagram.cs @@ -5,9 +5,9 @@ namespace C4Sharp.Diagrams.Builders; public abstract class SequenceDiagram: DiagramBuilder { - protected override string Title { get; } = "Sequence Diagram"; + protected override string Title => "Sequence Diagram"; protected override DiagramType DiagramType { get; } = DiagramType.Sequence; - protected SequenceContainerBoundary Bound(string alias, string label, params Component[] structures) => + protected static SequenceContainerBoundary Bound(string alias, string label, params Component[] structures) => new(alias, label, structures); } \ No newline at end of file diff --git a/src/C4Sharp/Diagrams/Diagram.cs b/src/C4Sharp/Diagrams/Diagram.cs index d96bbfb..9041737 100644 --- a/src/C4Sharp/Diagrams/Diagram.cs +++ b/src/C4Sharp/Diagrams/Diagram.cs @@ -8,38 +8,19 @@ namespace C4Sharp.Diagrams; /// Visualising this hierarchy of abstractions is then done by creating a collection of Context, Container, /// Component and (optionally) Code (e.g. UML class) diagrams. This is where the C4 model gets its name from. /// -public record Diagram +public record Diagram(DiagramType Type) { - internal string Name { get; } - public bool LayoutWithLegend { get; init; } - public bool ShowLegend { get; init; } - public bool LayoutAsSketch { get; init; } + internal string Name { get; } = Type.Value; + public bool LayoutWithLegend { get; init; } = true; + public bool ShowLegend { get; init; } = false; + public bool LayoutAsSketch { get; init; } = false; public string? Title { get; init; } - public string? Description { get; init; } - public DiagramLayout FlowVisualization { get; init; } - public DiagramType Type { get; } - public IEnumerable Structures { get; init; } - public IEnumerable Relationships { get; init; } + public string? Description { get; init; } = string.Empty; + public DiagramLayout FlowVisualization { get; init; } = DiagramLayout.TopDown; + public IEnumerable Structures { get; init; } = []; + public IEnumerable Relationships { get; init; } = []; public IElementStyle? Style { get; init; } public IBoundaryStyle? BoundaryStyle { get; init; } public IElementTag? Tags { get; init; } public IRelationshipTag? RelTags { get; init; } - - /// - /// Constructor - /// - /// - public Diagram(DiagramType type) - { - Type = type; - LayoutWithLegend = true; - Description = string.Empty; - Title = string.Empty; - LayoutAsSketch = false; - ShowLegend = false; - FlowVisualization = DiagramLayout.TopDown; - Name = type.Value; - Structures = Array.Empty(); - Relationships = Array.Empty(); - } } diff --git a/src/C4Sharp/Diagrams/DiagramBuilder.cs b/src/C4Sharp/Diagrams/DiagramBuilder.cs index ea4cf3f..aaabace 100644 --- a/src/C4Sharp/Diagrams/DiagramBuilder.cs +++ b/src/C4Sharp/Diagrams/DiagramBuilder.cs @@ -4,9 +4,6 @@ namespace C4Sharp.Diagrams; -[Obsolete("This class is obsolete, use DiagramBuilder instead.")] -public abstract class DiagramBuildRunner : DiagramBuilder { } - /// /// Base class to build diagrams /// diff --git a/src/C4Sharp/Diagrams/Interfaces/IDiagramBuilder.cs b/src/C4Sharp/Diagrams/Interfaces/IDiagramBuilder.cs index 01098c6..ffe3906 100644 --- a/src/C4Sharp/Diagrams/Interfaces/IDiagramBuilder.cs +++ b/src/C4Sharp/Diagrams/Interfaces/IDiagramBuilder.cs @@ -1,11 +1,5 @@ namespace C4Sharp.Diagrams.Interfaces; -[Obsolete("This interface is obsolete, use IDiagramBuilder instead")] -public interface IDiagramBuildRunner -{ - Diagram Build(); -} - public interface IDiagramBuilder { Diagram Build(IDiagramTheme? theme); diff --git a/src/C4Sharp/Diagrams/Plantuml/Constants/BorderStyle.cs b/src/C4Sharp/Diagrams/Plantuml/Constants/BorderStyle.cs index e90448d..79180dc 100644 --- a/src/C4Sharp/Diagrams/Plantuml/Constants/BorderStyle.cs +++ b/src/C4Sharp/Diagrams/Plantuml/Constants/BorderStyle.cs @@ -1,20 +1,24 @@ namespace C4Sharp.Diagrams.Plantuml.Constants; -public class BorderStyle +public readonly record struct BorderStyle(string Value) { /// /// This call returns the name of the dashed line and can be used as ?lineStyle argument. /// - public static BorderStyle SolidLine => new() { Value = "SolidLine()" }; + public static BorderStyle SolidLine => new("SolidLine()"); + /// /// This call returns the name of the dotted line and can be used as ?lineStyle argument. /// - public static BorderStyle DashedLine => new() { Value = "DashedLine()" }; + public static BorderStyle DashedLine => new("DashedLine()"); + /// /// This call returns the name of the bold line and can be used as ?lineStyle argument. /// - public static BorderStyle DottedLine => new() { Value = "DottedLine()" }; - public static BorderStyle BoldLine => new() { Value = "BoldLine()" }; + public static BorderStyle DottedLine => new("DottedLine()"); - public string Value { get; private init; } = string.Empty; + /// + /// This call returns the name of the bold line and can be used as ?lineStyle argument. + /// + public static BorderStyle BoldLine => new("BoldLine()"); } \ No newline at end of file diff --git a/src/C4Sharp/Diagrams/Plantuml/Constants/ElementName.cs b/src/C4Sharp/Diagrams/Plantuml/Constants/ElementName.cs index a81803d..13e0c91 100644 --- a/src/C4Sharp/Diagrams/Plantuml/Constants/ElementName.cs +++ b/src/C4Sharp/Diagrams/Plantuml/Constants/ElementName.cs @@ -1,16 +1,14 @@ namespace C4Sharp.Diagrams.Plantuml.Constants; -public record ElementName +public record struct ElementName(string Name) { - public static ElementName Person => new() { Name = "person" }; - public static ElementName ExternalPerson => new() { Name = "external_person" }; - public static ElementName System => new() { Name = "system" }; - public static ElementName ExternalSystem => new() { Name = "external_system" }; - public static ElementName Component => new() { Name = "component" }; - public static ElementName ExternalComponent => new() { Name = "external_component" }; - public static ElementName Container => new() { Name = "container" }; - public static ElementName ExternalContainer => new() { Name = "external_container" }; - public static ElementName Enterprise => new() { Name = "enterprise" }; - - public string Name { get; private init; } = string.Empty; -} + public static ElementName Person => new("person"); + public static ElementName ExternalPerson => new("external_person"); + public static ElementName System => new("system"); + public static ElementName ExternalSystem => new("external_system"); + public static ElementName Component => new("component"); + public static ElementName ExternalComponent => new("external_component"); + public static ElementName Container => new("container"); + public static ElementName ExternalContainer => new("external_container"); + public static ElementName Enterprise => new("enterprise"); +} \ No newline at end of file diff --git a/src/C4Sharp/Diagrams/Plantuml/PlantumlContext.cs b/src/C4Sharp/Diagrams/Plantuml/PlantumlContext.cs index 602460d..0e1718a 100644 --- a/src/C4Sharp/Diagrams/Plantuml/PlantumlContext.cs +++ b/src/C4Sharp/Diagrams/Plantuml/PlantumlContext.cs @@ -8,7 +8,6 @@ namespace C4Sharp.Diagrams.Plantuml; public partial class PlantumlContext : IDisposable { - private bool StandardLibraryBaseUrl { get; set; } private bool GenerateDiagramImages { get; set; } private bool GenerateDiagramSvgImages { get; set; } private bool GenerateMermaidFiles { get; set; } @@ -21,7 +20,6 @@ public partial class PlantumlContext : IDisposable public PlantumlContext() { PlantumlJarPath = null; - StandardLibraryBaseUrl = false; GenerateDiagramImages = false; GenerateDiagramSvgImages = false; GenerateMermaidFiles = false; @@ -35,19 +33,6 @@ public PlantumlContext() }; } - /// - /// The C4Sharp has embedded the current version of C4-PluntUML. - /// But, if you want to use the C4-PlantUML up-to-date version from their repo, - /// use this method - /// - /// PlantumlSession instance - [Obsolete("Now, we are suporting just embended version")] - public PlantumlContext UseStandardLibraryBaseUrl() - { - StandardLibraryBaseUrl = false; - return this; - } - /// /// The C4Sharp will generate *.puml files of your diagram. /// Also, you could save the *.png files using this method @@ -169,37 +154,34 @@ public partial class PlantumlContext /// /// C4 Diagram /// Output path - private string SavePumlFiles(Diagram diagram, string path) + private void SavePumlFiles(Diagram diagram, string path) { try { var filePath = Path.Combine(path, diagram.PumlFileName()); Directory.CreateDirectory(path); - File.WriteAllText(filePath, diagram.ToPumlString(StandardLibraryBaseUrl)); - return filePath; + File.WriteAllText(filePath, diagram.ToPumlString()); } catch (Exception e) { throw new PlantumlException($"{nameof(PlantumlException)}: Could not save puml file.", e); } } - + /// /// Save puml file. It's creates path if non exists. /// /// C4 Diagram /// Output path - private string SaveMermaidFiles(Diagram diagram, string path) + private void SaveMermaidFiles(Diagram diagram, string path) { - if (!GenerateMermaidFiles || diagram.Type.Value == DiagramConstants.Deployment) - return string.Empty; - + if (!GenerateMermaidFiles || diagram.Type.Value == DiagramConstants.Deployment) return; + try { var filePath = Path.Combine(path, diagram.MermaidFileName()); Directory.CreateDirectory(path); File.WriteAllText(filePath, diagram.ToMermaidString()); - return filePath; } catch (Exception e) { @@ -217,7 +199,6 @@ private void SaveDiagramFiles(string path, string generatedImageFormat) { try { - PlantumlResources.LoadResources(path); PlantumlJarPath ??= PlantumlResources.LoadPlantumlJar(); var directory = new DirectoryInfo(path).FullName; @@ -229,7 +210,7 @@ private void SaveDiagramFiles(string path, string generatedImageFormat) var results = new StringBuilder(); - var jar = CalculateJarCommand(StandardLibraryBaseUrl, generatedImageFormat, directory); + var jar = CalculateJarCommand(generatedImageFormat, directory); ProcessInfo.Arguments = $"{jar} \"{path}\""; ProcessInfo.RedirectStandardOutput = true; @@ -248,17 +229,14 @@ private void SaveDiagramFiles(string path, string generatedImageFormat) } } - private string CalculateJarCommand(bool useStandardLibrary, string generatedImageFormat, string directory) + private string CalculateJarCommand(string generatedImageFormat, string directory) { - const string includeLocalFilesArg = "-DRELATIVE_INCLUDE=\".\""; - - var resourcesOriginArg = useStandardLibrary ? string.Empty : includeLocalFilesArg; var imageFormatOutputArg = string.IsNullOrWhiteSpace(generatedImageFormat) ? string.Empty : $"-t{generatedImageFormat}"; return - $"-jar \"{PlantumlJarPath}\" {resourcesOriginArg} {imageFormatOutputArg} -Playout=smetana -verbose -o \"{directory}\" -charset UTF-8"; + $"-jar \"{PlantumlJarPath}\" {imageFormatOutputArg} -Playout=smetana -verbose -o \"{directory}\" -charset UTF-8"; } /// diff --git a/src/C4Sharp/Diagrams/Plantuml/PlantumlDiagram.cs b/src/C4Sharp/Diagrams/Plantuml/PlantumlDiagram.cs index 0709658..33977f7 100644 --- a/src/C4Sharp/Diagrams/Plantuml/PlantumlDiagram.cs +++ b/src/C4Sharp/Diagrams/Plantuml/PlantumlDiagram.cs @@ -1,8 +1,5 @@ using System.Text; -using C4Sharp.Commons.FileSystem; using C4Sharp.Elements.Relationships; -using System.Collections.Generic; -using System.Linq; namespace C4Sharp.Diagrams.Plantuml; @@ -16,29 +13,19 @@ public static partial class PlantumlDiagram /// /// /// - public static string ToPumlString(this Diagram diagram) => ToPumlString(diagram, false); - - - /// - /// Create PUML content from Diagram - /// - /// - /// - /// - public static string ToPumlString(this Diagram diagram, bool useStandardLibrary) => new StringBuilder() - .BuildHeader(diagram, useStandardLibrary) + public static string ToPumlString(this Diagram diagram) => new StringBuilder() + .BuildHeader(diagram) .BuildBody(diagram) .BuildFooter(diagram) .ToString(); - private static StringBuilder BuildHeader(this StringBuilder stream, Diagram diagram, bool useStandardLibrary) + private static StringBuilder BuildHeader(this StringBuilder stream, Diagram diagram) { - var path = GetPumlFilePath(diagram, useStandardLibrary); stream.AppendLine($"@startuml {diagram.Slug()}"); - stream.AppendLine($"!include {path}"); + stream.AppendLine($"!include "); stream.AppendLine(); - BuildStyleSession(stream, diagram); + stream.BuildStyleSession(diagram); if (diagram.LayoutWithLegend && !diagram.ShowLegend) { @@ -68,14 +55,12 @@ private static StringBuilder BuildHeader(this StringBuilder stream, Diagram diag return stream; } - private static StringBuilder BuildStyleSession(this StringBuilder stream, Diagram diagram) + private static void BuildStyleSession(this StringBuilder stream, Diagram diagram) { diagram.Tags?.Items.ToList().ForEach(x => stream.AppendLine(x.Value)); diagram.Style?.Items.ToList().ForEach(x => stream.AppendLine(x.Value)); diagram.BoundaryStyle?.Items.ToList().ForEach(x => stream.AppendLine(x.Value)); diagram.RelTags?.Items.ToList().ForEach(x => stream.AppendLine(x.Value)); - - return stream; } private static StringBuilder BuildBody(this StringBuilder stream, Diagram diagram) @@ -107,16 +92,6 @@ private static StringBuilder BuildFooter(this StringBuilder stream, Diagram diag return stream; } - - private static string GetPumlFilePath(this Diagram diagram, bool useUrlInclude) - { - const string standardLibraryBaseUrl = "https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master"; - var pumlFileName = $"{diagram.Name}.puml"; - - return useUrlInclude - ? $"{standardLibraryBaseUrl}/{pumlFileName}" - : Path.Join(C4SharpDirectory.ResourcesFolderName, pumlFileName); - } } /// @@ -128,7 +103,6 @@ public static partial class PlantumlDiagram /// Create mermaid based on puml content from Diagram /// /// - /// /// public static string ToMermaidString(this Diagram diagram) => new StringBuilder() .AppendLine("```mermaid") diff --git a/src/C4Sharp/Diagrams/Plantuml/PlantumlResources.cs b/src/C4Sharp/Diagrams/Plantuml/PlantumlResources.cs index 1f7a2d9..33fecaa 100644 --- a/src/C4Sharp/Diagrams/Plantuml/PlantumlResources.cs +++ b/src/C4Sharp/Diagrams/Plantuml/PlantumlResources.cs @@ -5,23 +5,6 @@ namespace C4Sharp.Diagrams.Plantuml; internal static class PlantumlResources { - /// - /// Load all C4_Plantuml files - /// - public static void LoadResources(string path) - { - var local = string.IsNullOrEmpty(path) - ? Path.Join(C4SharpDirectory.DirectoryName, C4SharpDirectory.ResourcesFolderName) - : Path.Join(path, C4SharpDirectory.ResourcesFolderName); - - LoadResource(local, "C4.puml"); - LoadResource(local, "C4_Component.puml"); - LoadResource(local, "C4_Container.puml"); - LoadResource(local, "C4_Context.puml"); - LoadResource(local, "C4_Deployment.puml"); - LoadResource(local, "C4_Sequence.puml"); - } - /// /// Load all C4_Plantuml files /// diff --git a/src/C4Sharp/Diagrams/Plantuml/PlantumlStructure.cs b/src/C4Sharp/Diagrams/Plantuml/PlantumlStructure.cs index ada343d..6a46623 100644 --- a/src/C4Sharp/Diagrams/Plantuml/PlantumlStructure.cs +++ b/src/C4Sharp/Diagrams/Plantuml/PlantumlStructure.cs @@ -85,7 +85,7 @@ private static string ToPumlString(this EnterpriseBoundary boundary) private static string ToPumlString(this Component component) { var externalSuffix = GetExternalSuffix(component); - var procedureName = component.ComponentType switch + var procedureName = component.Type switch { ComponentType.Database => $"ComponentDb{externalSuffix}", ComponentType.Queue => $"ComponentQueue{externalSuffix}", diff --git a/src/C4Sharp/Diagrams/Plantuml/Style/BoundaryStyle.cs b/src/C4Sharp/Diagrams/Plantuml/Style/BoundaryStyle.cs index cca9dbf..992d1ef 100644 --- a/src/C4Sharp/Diagrams/Plantuml/Style/BoundaryStyle.cs +++ b/src/C4Sharp/Diagrams/Plantuml/Style/BoundaryStyle.cs @@ -24,33 +24,21 @@ public BoundaryStyle UpdateBoundaryStyle(ElementName elementName, string? bgColo string? borderColor = null, bool shadowing = false, Shape? shape = null, BorderStyle? borderStyle = null, int? borderThickness = null) { - if (elementName is null) - throw new ArgumentNullException(nameof(elementName), $"{nameof(elementName)} is required"); - - var styles = new List(); - styles.Add($"$elementName={elementName.Name}"); - - if (fontColor is not null) - styles.Add($"$bgColor={bgColor}"); - - if (bgColor is not null) - styles.Add($"$fontColor={fontColor}"); - - if (borderColor is not null) - styles.Add($"$borderColor={borderColor}"); - - styles.Add($"$shadowing=\"{shadowing.ToString().ToLower()}\""); - - if (shape is not null) - styles.Add($"$shape={shape.Value}"); - - if (borderStyle is not null) - styles.Add($"$borderStyle={borderStyle.Value}"); - - if (borderThickness is not null) - styles.Add($"$borderThickness={borderThickness}"); - - Items[elementName.Name] = $"UpdateBoundaryStyle({string.Join(",", styles)})"; + string?[] styles = + [ + $"$elementName={elementName.Name}", + fontColor is not null ? $"$fontColor={fontColor}" : null, + bgColor is not null ? $"$bgColor={bgColor}" : null, + borderColor is not null ? $"$borderColor={borderColor}" : null, + $"$shadowing=\"{shadowing.ToString().ToLower()}\"", + shape is not null ? $"$shape={shape.Value}" : null, + borderStyle is not null ? $"$borderStyle={borderStyle.Value}" : null, + borderThickness is not null ? $"$borderThickness={borderThickness}" : null + ]; + + var styleString = string.Join(",", styles.Where(x => x is not null)); + + Items[elementName.Name] = $"UpdateBoundaryStyle({styleString})"; return this; } } \ No newline at end of file diff --git a/src/C4Sharp/Diagrams/Plantuml/Style/ElementStyle.cs b/src/C4Sharp/Diagrams/Plantuml/Style/ElementStyle.cs index f2d8303..b2e8f2f 100644 --- a/src/C4Sharp/Diagrams/Plantuml/Style/ElementStyle.cs +++ b/src/C4Sharp/Diagrams/Plantuml/Style/ElementStyle.cs @@ -24,31 +24,20 @@ public ElementStyle UpdateElementStyle(ElementName elementName, string? bgColor string? borderColor = null, bool shadowing = false, Shape? shape = null, BorderStyle? borderStyle = null, int? borderThickness = null) { - if (elementName is null) - throw new ArgumentNullException(nameof(elementName), $"{nameof(elementName)} is required"); - - var styles = new List(); - if (fontColor is not null) - styles.Add($"$bgColor={bgColor}"); - - if (bgColor is not null) - styles.Add($"$fontColor={fontColor}"); - - if (borderColor is not null) - styles.Add($"$borderColor={borderColor}"); - - styles.Add($"$shadowing=\"{shadowing.ToString().ToLower()}\""); - - if (shape is not null) - styles.Add($"$shape={shape.Value}"); - - if (borderStyle is not null) - styles.Add($"$borderStyle={borderStyle.Value}"); - - if (borderThickness is not null) - styles.Add($"$borderThickness={borderThickness}"); - - Items[elementName.Name] = $"UpdateElementStyle(\"{elementName.Name}\", {string.Join(",", styles)})"; + string?[] styles = + [ + bgColor is not null ? $"$bgColor={bgColor}" : null, + fontColor is not null ? $"$fontColor={fontColor}" : null, + borderColor is not null ? $"$borderColor={borderColor}" : null, + $"$shadowing=\"{shadowing.ToString().ToLower()}\"", + shape is not null ? $"$shape={shape.Value}" : null, + borderStyle is not null ? $"$borderStyle={borderStyle.Value}" : null, + borderThickness is not null ? $"$borderThickness={borderThickness}" : null + ]; + + var styleString = string.Join(",", styles.Where(x => x is not null)); + + Items[elementName.Name] = $"UpdateElementStyle(\"{elementName.Name}\", {styleString})"; return this; } } \ No newline at end of file diff --git a/src/C4Sharp/Elements/Component.cs b/src/C4Sharp/Elements/Component.cs index 60e4095..6bb80fd 100644 --- a/src/C4Sharp/Elements/Component.cs +++ b/src/C4Sharp/Elements/Component.cs @@ -16,66 +16,68 @@ namespace C4Sharp.Elements; public record Component(string Alias, string Label) : Structure(Alias, Label) { public string? Technology { get; init; } - public ComponentType ComponentType { get; init; } = ComponentType.None; + public ComponentType Type { get; init; } = ComponentType.None; public static Component None => new("none", "None"); - - public Component(StructureIdentity alias, string label): this(alias.Value, label) + + public Component(StructureIdentity alias, string label) : this(alias.Value, label) { - ComponentType = ComponentType.None; - } + Type = ComponentType.None; + } - public Component(string alias, string label, string technology): this(alias, label) + public Component(string alias, string label, string technology) : this(alias, label) { Technology = technology; - } + } - public Component(string alias, string label, ComponentType componentType, string technology): this(alias, label, technology) + public Component(string alias, string label, ComponentType type, string technology) : this(alias, label, technology) { - ComponentType = componentType; + Type = type; } - - public Component(string alias, string label, string technology, string description): this(alias, label) + + public Component(string alias, string label, string technology, string description) : this(alias, label) { Technology = technology; Description = description; } - - public Component(string alias, string label, ComponentType componentType, string technology, string description): this(alias, label, technology, description) + + public Component(string alias, string label, ComponentType type, string technology, string description) : this(alias, label, technology, description) { - ComponentType = componentType; - } - - public static Component operator |(Component a, Boundary boundary) => a with{ Boundary = boundary}; - public static Component operator |(Component a, ComponentType b) => a with{ ComponentType = b }; - public static Component operator |(Component a, (string alias, string label) b) => new (b.alias, b.label) + Type = type; + } + + public static Component operator |(Component a, Boundary boundary) => a with { Boundary = boundary }; + public static Component operator |(Component a, ComponentType b) => a with { Type = b }; + + public static Component operator |(Component a, (string alias, string label) b) => new(b.alias, b.label) { Boundary = a.Boundary, - ComponentType = a.ComponentType + Type = a.Type }; - public static Component operator |(Component a, (string alias, string label, string technology) b) => new Component(b.alias, b.label, b.technology) + + public static Component operator |(Component a, (string alias, string label, string technology) b) => new (b.alias, b.label, b.technology) { Boundary = a.Boundary, - ComponentType = a.ComponentType + Type = a.Type }; - public static Component operator |(Component a, (string alias, string label, string technology , string description) b) => new (b.alias, b.label, b.technology, b.description) + + public static Component operator |(Component a, (string alias, string label, string technology, string description) b) => new(b.alias, b.label, b.technology, b.description) { Boundary = a.Boundary, - ComponentType = a.ComponentType - }; - + Type = a.Type + }; } public record Component : Component { - public Component():base(StructureIdentity.New(), typeof(T).ToNamingConvention()) + public Component() : base(StructureIdentity.New(), typeof(T).ToNamingConvention()) { } - public Component(string technology): base(StructureIdentity.New().Value, typeof(T).ToNamingConvention(), technology) + public Component(string technology) : base(StructureIdentity.New().Value, typeof(T).ToNamingConvention(), technology) { } - - public Component(string technology, string description): base(StructureIdentity.New().Value, typeof(T).ToNamingConvention(), technology, description) + + public Component(string technology, string description) : base(StructureIdentity.New().Value, typeof(T).ToNamingConvention(), technology, description) { - } -} + } +} \ No newline at end of file diff --git a/src/C4Sharp/Elements/Relationships/Relationship.cs b/src/C4Sharp/Elements/Relationships/Relationship.cs index e5917cc..037e823 100644 --- a/src/C4Sharp/Elements/Relationships/Relationship.cs +++ b/src/C4Sharp/Elements/Relationships/Relationship.cs @@ -59,7 +59,7 @@ private Relationship(Structure @from, Direction direction, Structure to, string Direction = direction; Protocol = protocol; Position = position; - Tags = Array.Empty(); + Tags = []; } /// @@ -80,7 +80,7 @@ protected Relationship(string @from, Direction direction, string to, string labe Direction = direction; Protocol = protocol; Position = position; - Tags = Array.Empty(); + Tags = []; } /// @@ -107,7 +107,7 @@ public Relationship(Structure @from, Direction direction, Structure to, string l } public Relationship AddTags(params string[] values) => this with { Tags = values }; - public Relationship ClearTags() => this with { Tags = Array.Empty() }; + public Relationship ClearTags() => this with { Tags = [] }; public static Relationship operator |(Relationship a, string value) { diff --git a/src/C4Sharp/Elements/Structure.cs b/src/C4Sharp/Elements/Structure.cs index dddd31d..5cd05a4 100644 --- a/src/C4Sharp/Elements/Structure.cs +++ b/src/C4Sharp/Elements/Structure.cs @@ -23,7 +23,7 @@ public abstract record Structure /// Should be unique /// protected Structure(string alias, string label, string[]? tags = null) => - (Alias, Label, Tags) = (alias, label, tags ?? Array.Empty()); + (Alias, Label, Tags) = (alias, label, tags ?? []); protected Structure(StructureIdentity identity, string label, string[]? tags = null) : this(identity.Value, label, tags) diff --git a/src/C4Sharp/Elements/StructureCollection.cs b/src/C4Sharp/Elements/StructureCollection.cs index 282d213..e1e6397 100644 --- a/src/C4Sharp/Elements/StructureCollection.cs +++ b/src/C4Sharp/Elements/StructureCollection.cs @@ -9,7 +9,7 @@ internal class StructureCollection public void AddRange(IEnumerable structures) { var enumerable = structures as Structure[] ?? structures.ToArray(); - if (!enumerable.Any()) + if (enumerable.Length == 0) { return; } diff --git a/src/C4Sharp/Resources/C4.puml b/src/C4Sharp/Resources/C4.puml deleted file mode 100644 index 3d7e330..0000000 --- a/src/C4Sharp/Resources/C4.puml +++ /dev/null @@ -1,1658 +0,0 @@ -' C4-PlantUML - -' Global pre-settings -' ################################## -' ENABLE_ALL_PLANT_ELEMENTS -' If ENABLE_ALL_PLANT_ELEMENTS is set BEFORE the first C4_* file is loaded, nearly "all" PlantUML elements can be used like -' Component(StorageA, "Storage A ", $baseShape="storage") -' ENABLE_ALL_PLANT_ELEMENTS can be set via -' !ENABLE_ALL_PLANT_ELEMENTS = 1 -' or with additional command line argument -DENABLE_ALL_PLANT_ELEMENTS=1 - -'Version -' ################################## -!function C4Version() - ' 2 spaces and ' are used as unique marker, that the release scripts makes the correct version update - !$c4Version = "2.10.0beta1" - !return $c4Version -!end function - -!procedure C4VersionDetails() -rectangle C4VersionDetailsArea <> [ -| PlantUML | **%version()** | -| C4-PlantUML | **C4Version()** | -] -!end procedure - -' Colors -' ################################## -!$ELEMENT_FONT_COLOR ?= "#FFFFFF" - -!$ARROW_COLOR ?= "#666666" -!$ARROW_FONT_COLOR ?= $ARROW_COLOR - -!$BOUNDARY_COLOR ?= "#444444" -!$BOUNDARY_BG_COLOR ?= "transparent" -!$BOUNDARY_BORDER_STYLE ?= "dashed" - -!$LEGEND_TITLE_COLOR ?= "#000000" -!$LEGEND_FONT_COLOR ?= "#FFFFFF" -!$LEGEND_BG_COLOR ?= "transparent" -!$LEGEND_BORDER_COLOR ?= "transparent" -' %darken(darkkhaki,50), #khaki -!$LEGEND_DARK_COLOR ?= "#66622E" -!$LEGEND_LIGHT_COLOR ?= "#khaki" - -!$SKETCH_BG_COLOR ?= "#EEEBDC" -!$SKETCH_FONT_COLOR ?= "" -!$SKETCH_WARNING_COLOR ?= "red" -!$SKETCH_FONT_NAME ?= "Comic Sans MS" - -' Labels -' ################################## - -!$LEGEND_SHADOW_TEXT ?= "shadow" -!$LEGEND_NO_SHADOW_TEXT ?= "no shadow" -!$LEGEND_NO_FONT_BG_TEXT ?= "last text and back color" -!$LEGEND_NO_FONT_TEXT ?= "last text color" -!$LEGEND_NO_BG_TEXT ?= "last back color" -!$LEGEND_NO_LINE_TEXT ?= "last line color" -!$LEGEND_ROUNDED_BOX ?= "rounded box" -!$LEGEND_EIGHT_SIDED ?= "eight sided" -!$LEGEND_DOTTED_LINE ?= "dotted" -!$LEGEND_DASHED_LINE ?= "dashed" -!$LEGEND_BOLD_LINE ?= "bold" -!$LEGEND_SOLID_LINE ?= "solid" - -!$LEGEND_BOUNDARY ?= "boundary" -' ignore (boundary) transparent atm, that the legend is smaller -' !$LEGEND_BOUNDARY_TRANSPARENT_INCL_COMA ?= "transparent, " -!$LEGEND_BOUNDARY_TRANSPARENT_INCL_COMA ?= "" -' (boundary) dashed should not be ignored atm -!$LEGEND_BOUNDARY_DASHED_INCL_COMA ?= "dashed, " -' !$LEGEND_BOUNDARY_DASHED_INCL_COMA ?= "" - -!$LEGEND_THICKNESS ?= "thickness" - -!$SKETCH_FOOTER_WARNING ?= "Warning:" -!$SKETCH_FOOTER_TEXT ?= "Created for discussion, needs to be validated" - -' Styling -' ################################## - -!$STEREOTYPE_FONT_SIZE ?= 12 -!global $TRANSPARENT_STEREOTYPE_FONT_SIZE = $STEREOTYPE_FONT_SIZE/2 -!$TECHN_FONT_SIZE ?= 12 - -!$ARROW_FONT_SIZE ?= 12 - -!$LEGEND_DETAILS_SMALL_SIZE ?= 10 -!$LEGEND_DETAILS_NORMAL_SIZE ?= 14 -!global $LEGEND_DETAILS_SIZE = $LEGEND_DETAILS_SMALL_SIZE - -' element symbols typically 4 times too big in legend -!$LEGEND_IMAGE_SIZE_FACTOR ?= 0.25 - -!$ROUNDED_BOX_SIZE ?= 25 -!$EIGHT_SIDED_SIZE ?= 18 - -' Default element wrap width (of an element) -!$DEFAULT_WRAP_WIDTH ?= 200 -' Maximum size in pixels, of a message (in a sequence diagram?) -!$MAX_MESSAGE_SIZE ?= 150 -' PlantUML supports no DETERMINISTIC/automatic line breaks of "PlantUML line" (C4 Relationships) -' therefore Rel...() implements an automatic line break based on spaces (like in all other objects). -' If a $type contains \n then these are used (and no automatic space based line breaks are done) -' $REL_TECHN_MAX_CHAR_WIDTH defines the automatic line break position -!$REL_TECHN_MAX_CHAR_WIDTH ?= 35 -!$REL_DESCR_MAX_CHAR_WIDTH ?= 32 - -' internal -' ################################## - -!global $ROUNDED_BOX = "roundedBox" -!global $EIGHT_SIDED = "eightSided" - -!global $DOTTED_LINE = "dotted" -!global $DASHED_LINE = "dashed" -!global $BOLD_LINE = "bold" -' solid is not defined in plantUML, but works as reset of all other styles too -!global $SOLID_LINE = "solid" - -!global $LEGEND_DETAILS_NONE = "none" -!global $LEGEND_DETAILS_NORMAL = "normal" -!global $LEGEND_DETAILS_SMALL = "small" - -skinparam defaultTextAlignment center - -skinparam wrapWidth $DEFAULT_WRAP_WIDTH -skinparam maxMessageSize $MAX_MESSAGE_SIZE - -skinparam LegendFontColor $LEGEND_FONT_COLOR -skinparam LegendBackgroundColor $LEGEND_BG_COLOR -skinparam LegendBorderColor $LEGEND_BORDER_COLOR - -skinparam rectangle<> { - backgroundcolor $LEGEND_BG_COLOR - bordercolor $LEGEND_BORDER_COLOR -} - -skinparam rectangle { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} - -skinparam database { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} - -skinparam queue { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} - -skinparam participant { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} - -skinparam arrow { - Color $ARROW_COLOR - FontColor $ARROW_FONT_COLOR - FontSize $ARROW_FONT_SIZE -} - -skinparam person { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} - -skinparam actor { - StereotypeFontSize $STEREOTYPE_FONT_SIZE - style awesome -} - -!if %variable_exists("ENABLE_ALL_PLANT_ELEMENTS") -skinparam agent { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam artifact { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam boundary { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam card { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam circle { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam cloud { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam collections { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam control { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam entity { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam file { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam folder { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam frame { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam hexagon { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam interface { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam label { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam stack { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam storage { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam usecase { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -skinparam person { - StereotypeFontSize $STEREOTYPE_FONT_SIZE -} -!endif - -' Some boundary skinparams have to be set as package skinparams too (PlantUML uses internal packages) -' UpdateBoundaryStyle() called in boundary section below -skinparam rectangle<> { - StereotypeFontSize $TRANSPARENT_STEREOTYPE_FONT_SIZE - StereotypeFontColor $BOUNDARY_BG_COLOR - BorderStyle $BOUNDARY_BORDER_STYLE -} - -skinparam package { - StereotypeFontSize $TRANSPARENT_STEREOTYPE_FONT_SIZE - StereotypeFontColor $BOUNDARY_BG_COLOR - FontStyle plain - BackgroundColor $BOUNDARY_BG_COLOR -} - -' Legend and Tags -' ################################## -!global $tagDefaultLegend = "" -!global $tagCustomLegend = "" - -' rel specific -!unquoted function $toStereos($tags) - !if (%strlen($tags) == 0) - !return '' - !endif - !$stereos = '' - !$brPos = %strpos($tags, "+") - !while ($brPos >= 0) - !$tag = %substr($tags, 0, $brPos) - !$stereos = $stereos + '<<' + $tag + '>>' -%set_variable_value("$" + $tag + "_LineLegend", %true()) - !$tags = %substr($tags, $brPos+1) - !$brPos = %strpos($tags, "+") - !endwhile - !if (%strlen($tags) > 0) - !$stereos = $stereos + '<<' + $tags + '>>' -%set_variable_value("$" + $tags + "_LineLegend", %true()) - !endif - !return $stereos -!endfunction - -' if $sprite/$techn is an empty argument, try to calculate it via the defined $tag -!unquoted function $toRelArg($arg, $tags, $varPostfix) - !if ($arg > "") - !return $arg - !endif - - !if (%strlen($tags) == 0) - !return $arg - !endif - !$brPos = %strpos($tags, "+") - !while ($brPos >= 0) - !$tag = %substr($tags, 0, $brPos) - !$newArg = %get_variable_value("$" + $tag + $varPostfix) - !if ($newArg > "") - !return $newArg - !endif - !$tags = %substr($tags, $brPos+1) - !$brPos = %strpos($tags, "+") - !endwhile - !if (%strlen($tags) > 0) - !$newArg = %get_variable_value("$" + $tags + $varPostfix) - !if ($newArg > "") - !return $newArg - !endif - !endif - !return $arg -!endfunction - -' element specific (unused are hidden based on mask) -!unquoted function $toStereos($elementType, $tags) - !if (%strlen($tags) == 0) - !$stereos = '<<' + $elementType + '>>' -%set_variable_value("$" + $elementType + "Legend", %true()) - !return $stereos - !endif - !$stereos = '' - !$mask = $resetMask() - !$brPos = %strpos($tags, "+") - !while ($brPos >= 0) - !$tag = %substr($tags, 0, $brPos) - !$stereos = $stereos + '<<' + $tag + '>>' - !$mergedMask = $combineMaskWithTag($mask, $tag) - !if ($mergedMask != $mask) -%set_variable_value("$" + $tag + "Legend", %true()) - !$mask = $mergedMask - !endif - !$tags = %substr($tags, $brPos+1) - !$brPos = %strpos($tags, "+") - !endwhile - !if (%strlen($tags) > 0) - !$stereos = $stereos + '<<' + $tags + '>>' - !$mergedMask = $combineMaskWithTag($mask, $tags) - !if ($mergedMask != $mask) -%set_variable_value("$" + $tags + "Legend", %true()) - !$mask = $mergedMask - !endif - !endif - ' has to be last, otherwise PlantUML overwrites all tag specific skinparams - !$stereos = $stereos + '<<' + $elementType + '>>' - !$mergedMask = $combineMaskWithTag($mask, $elementType) - !if ($mergedMask != $mask) -%set_variable_value("$" + $elementType + "Legend", %true()) - !$mask = $mergedMask - !endif - !return $stereos -!endfunction - -' if $sprite/$techn is an empty argument, try to calculate it via the defined $tag -!unquoted function $toElementArg($arg, $tags, $varPostfix, $elementType) - !if ($arg > "") - !return $arg - !endif - - !if (%strlen($tags) == 0) - !$newArg = %get_variable_value("$" + $elementType + $varPostfix) - !if ($newArg > "") - !return $newArg - !else - !return $arg - !endif - !endif - !$brPos = %strpos($tags, "+") - !while ($brPos >= 0) - !$tag = %substr($tags, 0, $brPos) - !$newArg = %get_variable_value("$" + $tag + $varPostfix) - !if ($newArg > "") - !return $newArg - !endif - !$tags = %substr($tags, $brPos+1) - !$brPos = %strpos($tags, "+") - !endwhile - !if (%strlen($tags) > 0) - !$newArg = %get_variable_value("$" + $tags + $varPostfix) - !if ($newArg > "") - !return $newArg - !endif - !$newArg = %get_variable_value("$" + $elementType + $varPostfix) - !if ($newArg > "") - !return $newArg - !endif - !endif - !return $arg -!endfunction - -' if $value is empty try to load it via variable, optional can it store the calculated value -!function $restoreEmpty($elementType, $property, $value, $store) - !$var = "$" + $elementType + "Restore" + $property - !if ($value == "") - !$value = %get_variable_value($var) - !elseif ($store) - %set_variable_value($var, $value) - !endif - !return $value -!endfunction - -' clear the restore property -!function $clearRestore($elementType, $property) - !$var = "$" + $elementType + "Restore" + $property - %set_variable_value($var, "") - !return "" -!endfunction - -!function $elementTagSkinparams($element, $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $borderStyle, $borderThickness) - !$elementSkin = "skinparam " + $element + "<<" + $tagStereo + ">> {" + %newline() - !if ($fontColor != "") - !if (%strpos($tagStereo, "boundary") < 0) - !$elementSkin = $elementSkin + " StereotypeFontColor " + $fontColor + %newline() - !endif - !$elementSkin = $elementSkin + " FontColor " + $fontColor + %newline() - !endif - !if ($bgColor != "") - !$elementSkin = $elementSkin + " BackgroundColor " + $bgColor + %newline() - !endif - !if ($borderColor != "") - !$elementSkin = $elementSkin + " BorderColor " + $borderColor+ %newline() - !endif - !if ($shadowing == "true") - !$elementSkin = $elementSkin + " Shadowing<<" + $tagStereo + ">> " + "true" + %newline() - !endif - !if ($shadowing == "false") - !$elementSkin = $elementSkin + " Shadowing<<" + $tagStereo + ">> " + "false" + %newline() - !endif - ' only rectangle supports shape(d corners), define both skinparam that overlays are working - !if ($shape != "" && $element == "rectangle") - !if ($shape == $ROUNDED_BOX) - !$elementSkin = $elementSkin + " RoundCorner " + $ROUNDED_BOX_SIZE+ %newline() - !$elementSkin = $elementSkin + " DiagonalCorner " + "0" + %newline() - !elseif ($shape == $EIGHT_SIDED) - !$elementSkin = $elementSkin + " RoundCorner " + "0" + %newline() - !$elementSkin = $elementSkin + " DiagonalCorner " + $EIGHT_SIDED_SIZE+ %newline() - !endif - !endif - !if ($borderStyle != "") - !$elementSkin = $elementSkin + " BorderStyle " + $borderStyle + %newline() - !endif - !if ($borderThickness != "") - !$elementSkin = $elementSkin + " BorderThickness " + $borderThickness + %newline() - !endif - !$elementSkin = $elementSkin + "}" + %newline() - !return $elementSkin -!endfunction - -!unquoted procedure $defineSkinparams($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $borderStyle, $borderThickness) - ' only rectangle supports shape(d corners) - !$tagSkin = $elementTagSkinparams("rectangle", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("database", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("queue", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - ' plantuml.jar bug - actor have to be after person - !$tagSkin = $tagSkin + $elementTagSkinparams("person", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - ' actor has style awesome, therefore $fontColor is ignored and text uses $bgColor too - !$tagSkin = $tagSkin + $elementTagSkinparams("actor", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - ' sequence requires participant - !$tagSkin = $tagSkin + $elementTagSkinparams("participant", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("sequencebox", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !if (%strpos($tagStereo, "boundary") >= 0 && $bgColor != "") - !$tagSkin = $tagSkin + "skinparam package<<" + $tagStereo + ">>StereotypeFontColor " + $bgColor + %newline() - !$tagSkin = $tagSkin + "skinparam rectangle<<" + $tagStereo + ">>StereotypeFontColor " + $bgColor + %newline() - !endif - !if %variable_exists("ENABLE_ALL_PLANT_ELEMENTS") - !$tagSkin = $tagSkin + $elementTagSkinparams("agent", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("artifact", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("card", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("cloud", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("collections", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("file", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("folder", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("frame", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("hexagon", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("package", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("stack", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("storage", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("usecase", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - ' elements without background: font uses $bgColor - !$tagSkin = $tagSkin + $elementTagSkinparams("boundary", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("circle", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("control", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("entity", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !$tagSkin = $tagSkin + $elementTagSkinparams("interface", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - ' label uses wrong font color? (should be $bgColor too) - !$tagSkin = $tagSkin + $elementTagSkinparams("label", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness) - !endif -$tagSkin -!endprocedure - -' arrow colors cannot start with # (legend background has to start with #) -!function $colorWithoutHash($c) - !if (%substr($c, 0, 1) == "#") - !$c = %substr($c,1) - !endif - !return $c -!endfunction - -!unquoted procedure $defineRelSkinparams($tagStereo, $textColor, $lineColor, $lineStyle, $lineThickness) - !$elementSkin = "skinparam arrow<<" + $tagStereo + ">> {" + %newline() - !if ($lineColor != "") || ($textColor != "") || ($lineStyle != "") - !$elementSkin = $elementSkin + " Color " - !if ($lineColor != "") - !$elementSkin = $elementSkin + $colorWithoutHash($lineColor) - !endif - !if ($textColor != "") - !$elementSkin = $elementSkin + ";text:" + $colorWithoutHash($textColor) - !endif - !if ($lineStyle != "") - !$elementSkin = $elementSkin + ";line." + $lineStyle - !endif - !$elementSkin = $elementSkin + %newline() - !endif - !if ($lineThickness != "") - !$elementSkin = $elementSkin + " thickness " + $lineThickness + %newline() - !endif - !$elementSkin = $elementSkin + "}" + %newline() -$elementSkin -!endprocedure - -' %is_dark() requires PlantUML version >= 1.2021.6 -!if (%function_exists("%is_dark")) - !$PlantUMLSupportsDynamicLegendColor = %true() -!else - !$PlantUMLSupportsDynamicLegendColor = %false() - !log "dynamic undefined legend colors" requires PlantUML version >= 1.2021.6, therefore only static assigned colors are used -!endif - -!unquoted function $contrastLegend($color) - !if (%is_dark($color)) - !$value = $LEGEND_LIGHT_COLOR - !else - !$value = $LEGEND_DARK_COLOR - !endif - !return $value -!endfunction - -!unquoted function $flatLegend($color) - !if (%is_dark($color)) - !$value = $LEGEND_DARK_COLOR - !else - !$value = $LEGEND_LIGHT_COLOR - !endif - !return $value -!endfunction - -' legend background has to start with # -!function $colorWithHash($c) - !if (%substr($c, 0, 1) != "#") - !$c = "#" + $c - !endif - !return $c -!endfunction - -!function $addMaskFlag($mask, $attr) - !if ($attr == "") - !$mask = $mask + "0" - !else - !$mask = $mask + "1" - !endif - !return $mask -!endfunction - -!function $orFlags($flag1, $flag2) - !if ($flag1 == "0" && $flag2 == "0") - !return "0" - !endif - !return "1" -!endfunction - -!function $tagLegendMask($bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $borderStyle, $borderThickness) - !$mask = "" - !$mask = $addMaskFlag($mask, $bgColor) - !$mask = $addMaskFlag($mask, $fontColor) - !$mask = $addMaskFlag($mask, $borderColor) - !$mask = $addMaskFlag($mask, $shadowing) - !$mask = $addMaskFlag($mask, $shape) - !$mask = $addMaskFlag($mask, $sprite) - !$mask = $addMaskFlag($mask, $borderStyle) - !$mask = $addMaskFlag($mask, $borderThickness) - !return $mask -!endfunction - -!function $resetMask() - !return "00000000" -!endfunction - -!function $combineMasks($mask1, $mask2) - !$mask = "" - !$mask = $mask + $orFlags(%substr($mask1, 0, 1), %substr($mask2, 0, 1)) - !$mask = $mask + $orFlags(%substr($mask1, 1, 1), %substr($mask2, 1, 1)) - !$mask = $mask + $orFlags(%substr($mask1, 2, 1), %substr($mask2, 2, 1)) - !$mask = $mask + $orFlags(%substr($mask1, 3, 1), %substr($mask2, 3, 1)) - !$mask = $mask + $orFlags(%substr($mask1, 4, 1), %substr($mask2, 4, 1)) - !$mask = $mask + $orFlags(%substr($mask1, 5, 1), %substr($mask2, 5, 1)) - !$mask = $mask + $orFlags(%substr($mask1, 6, 1), %substr($mask2, 6, 1)) - !$mask = $mask + $orFlags(%substr($mask1, 7, 1), %substr($mask2, 7, 1)) - !return $mask -!endfunction - -!function $combineMaskWithTag($mask1, $tag) - !$mask2 = %get_variable_value("$" + $tag+ "LegendMask") - !if ($mask2 == "") - ' !log combineMaskWithTag $mask1, $tag, ... only $mask1 - !return $mask1 - !endif - - ' !log combineMaskWithTag $mask1, $tag, $mask2 ... $combineMasks($mask1, $mask2) - !return $combineMasks($mask1, $mask2) -!endfunction - -' element symbols typically 4 times too big in legend -!function $smallVersionSprite($sprite) - ' ,scale= ... has to be first (...,color=black,scale=0.25... is invalid too) - !if (%strpos($sprite, "=") < 0) - !if (%substr($sprite, 0, 4) == "img:") - !$smallSprite = $sprite + "{scale=" + $LEGEND_IMAGE_SIZE_FACTOR + "}" - !else - !$smallSprite = $sprite + ",scale=" + $LEGEND_IMAGE_SIZE_FACTOR - !endif - !else - !$smallSprite = $sprite - !endif - !return $smallSprite -!endfunction - -' format sprite that it can be used in diagram -!function $getSprite($sprite) - ' if it starts with & it's a OpenIconic, details see https://useiconic.com/open/ - ' if it starts with img: it's an image, details see https://plantuml.com/creole - !if (%substr($sprite, 0, 1) != "&" && %substr($sprite, 0, 4) != "img:") - !$formatted = "<$" + $sprite + ">" - !else - !$formatted = "<" + $sprite + ">" - !endif - !return $formatted -!endfunction - -!function $setTagLegendVariables($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $legendText, $legendSprite, $borderStyle, $borderThickness) - !$bg = $bgColor - !$fo = $fontColor - !$bo = $borderColor - - !if ($fo == "") - !if ($bg != "") -!if ($PlantUMLSupportsDynamicLegendColor) - !$fo = $contrastLegend($bg) -!else - !$fo = $LEGEND_DARK_COLOR -!endif - !else - !if ($bo == "") - !$fo = $LEGEND_DARK_COLOR - !$bg = $LEGEND_LIGHT_COLOR - !else -!if ($PlantUMLSupportsDynamicLegendColor) - !$fo = $flatLegend($bo) - !$bg = $contrastLegend($bo) -!else - !$fo = $LEGEND_DARK_COLOR - !$bg = $LEGEND_LIGHT_COLOR -!endif - !endif - !endif - !else - !if ($bg == "") -!if ($PlantUMLSupportsDynamicLegendColor) - !$bg = $contrastLegend($fo) -!else - !$bg = $LEGEND_LIGHT_COLOR -!endif - !endif - !endif - - !if ($bo == "") - !$bo = $bg - !endif - - !$tagEntry = "|" - !$tagDetails = "(" - !$tagEntry = $tagEntry + "<" + $colorWithHash($bg) +">" - ' ..white rectangle - !$tagEntry = $tagEntry + " " - !$tagEntry = $tagEntry + "" - !if ($legendSprite != "") - !$tagEntry = $tagEntry + $getSprite($legendSprite) + " " - !endif - - !$isBoundary = 0 - !if ($legendText == "") - !if (%strpos($tagStereo, "boundary") >= 0) - !if ($tagStereo == "boundary") - !$isBoundary = 1 - !$tagEntry = $tagEntry + " " + $LEGEND_BOUNDARY + " " - !else - ' if contains/ends with _boundary remove _boundary and add "boundary (dashed)" - !$pos = %strpos($tagStereo, "_boundary") - !if ($pos > 0) - !$isBoundary = 1 - !$tagEntry = $tagEntry + " " + %substr($tagStereo, 0 ,$pos) + " " +$LEGEND_BOUNDARY + " " - !endif - !endif - !endif - !if ($isBoundary == 0) - !$tagEntry = $tagEntry + " " + $tagStereo + " " - !endif - - !if ($isBoundary == 1 && ($bgColor == "#00000000" || %lower($bgColor) == "transparent")) - !$tagDetails = $tagDetails + $LEGEND_BOUNDARY_TRANSPARENT_INCL_COMA - !endif - !if ($shadowing == "true") - !$tagDetails = $tagDetails + $LEGEND_SHADOW_TEXT + ", " - !endif - !if ($shadowing == "false") - !$tagDetails = $tagDetails + $LEGEND_NO_SHADOW_TEXT + ", " - !endif - !if ($shape == $ROUNDED_BOX) - !$tagDetails = $tagDetails + $LEGEND_ROUNDED_BOX + ", " - !endif - !if ($shape == $EIGHT_SIDED) - !$tagDetails = $tagDetails + $LEGEND_EIGHT_SIDED + ", " - !endif - !if ($fontColor == "" && $bgColor == "") - !$tagDetails = $tagDetails + $LEGEND_NO_FONT_BG_TEXT + ", " - !else - !if ($fontColor == "") - !$tagDetails = $tagDetails + $LEGEND_NO_FONT_TEXT + ", " - !endif - !if ($bgColor == "") - !$tagDetails = $tagDetails + $LEGEND_NO_BG_TEXT + ", " - !endif - !endif - !if ($borderStyle != "") - !if ($borderStyle == $DOTTED_LINE) - !$tagDetails = $tagDetails + $LEGEND_DOTTED_LINE + ", " - !elseif ($borderStyle == $DASHED_LINE) - !if ($isBoundary == 1) - !$tagDetails = $tagDetails + $LEGEND_BOUNDARY_DASHED_INCL_COMA - !else - !$tagDetails = $tagDetails + $LEGEND_DASHED_LINE + ", " - !endif - !elseif ($borderStyle == $BOLD_LINE) - !$tagDetails = $tagDetails + $LEGEND_BOLD_LINE + ", " - !elseif ($borderStyle == $SOLID_LINE) - !$tagDetails = $tagDetails + $LEGEND_SOLID_LINE + ", " - !else - !$tagDetails = $tagDetails + $lineStyle + ", " - !endif - !endif - !if ($borderThickness != "") - !$tagDetails = $tagDetails + $LEGEND_THICKNESS + " " + $borderThickness + ", " - !endif - !if ($tagDetails=="(" || $tagDetails=="(, ") - !$tagDetails = "" - !else - !$tagDetails = %substr($tagDetails, 0, %strlen($tagDetails)-2) - !$tagDetails = $tagDetails + ")" - !endif - !else - !$brPos = %strpos($legendText, "\n") - !if ($brPos > 0) - !$tagEntry = $tagEntry + %substr($legendText, 0, $brPos) + " " - !$details = %substr($legendText, $brPos + 2) - !if ($details=="") - !$tagDetails = "" - !else - !$tagDetails = $tagDetails + $details + ")" - !endif - !else - !$tagEntry = $tagEntry + " " + $legendText + " " - !$tagDetails = "" - !endif - !endif - - !$tagDetails = $tagDetails + " " - !$tagDetails = $tagDetails + "|" -%set_variable_value("$" + $tagStereo + "LegendEntry", $tagEntry) -%set_variable_value("$" + $tagStereo + "LegendDetails", $tagDetails) - !return $tagEntry -!endfunction - -!function $setTagRelLegendVariables($tagStereo, $textColor, $lineColor, $lineStyle, $legendText, $legendSprite, $lineThickness) - !$tc = $textColor - !$lc = $lineColor - - !if ($tc == "") - !if ($PlantUMLSupportsDynamicLegendColor) - !$tc = $flatLegend($ARROW_FONT_COLOR) - !else - !$tc = $LEGEND_DARK_COLOR - !endif - !endif - !if ($lc == "") - !if ($PlantUMLSupportsDynamicLegendColor) - !$lc = $flatLegend($ARROW_COLOR) - !else - !$lc = $LEGEND_DARK_COLOR - !endif - !endif - - !$tagEntry = "|" - !$tagDetails = "(" - ' ..white line - !$tagEntry = $tagEntry + " " - !$tagEntry = $tagEntry + "" - !if ($legendSprite != "") - !$tagEntry = $tagEntry + $getSprite($legendSprite) + " " - !endif - !if ($legendText == "") - !$tagEntry = $tagEntry + " " + $tagStereo + " " - !if ($textColor == "") - !$tagDetails = $tagDetails + $LEGEND_NO_FONT_TEXT + ", " - !endif - !if ($lineColor == "") - !$tagDetails = $tagDetails + $LEGEND_NO_LINE_TEXT + ", " - !endif - !if ($lineStyle != "") - !if ($lineStyle == $DOTTED_LINE) - !$tagDetails = $tagDetails + $LEGEND_DOTTED_LINE + ", " - !elseif ($lineStyle == $DASHED_LINE) - !$tagDetails = $tagDetails + $LEGEND_DASHED_LINE + ", " - !elseif ($lineStyle == $BOLD_LINE) - !$tagDetails = $tagDetails + $LEGEND_BOLD_LINE + ", " - !else - !$tagDetails = $tagDetails + $lineStyle + ", " - !endif - !endif - !if ($lineThickness != "") - !$tagDetails = $tagDetails + $LEGEND_THICKNESS + " " + $lineThickness + ", " - !endif - !if ($tagDetails=="(") - !$tagDetails = "" - !else - !$tagDetails = %substr($tagDetails, 0, %strlen($tagDetails)-2) - !$tagDetails = $tagDetails + ")" - !endif - !else - !$brPos = %strpos($legendText, "\n") - !if ($brPos > 0) - !$tagEntry = $tagEntry + " " + %substr($legendText, 0, $brPos) + " " - !$details = %substr($legendText, $brPos + 2) - !if ($details=="") - !$tagDetails = "" - !else - !$tagDetails = $tagDetails + $details + ")" - !endif - !else - !$tagEntry = $tagEntry + " " + $legendText + " " - !$tagDetails = "" - !endif - !endif - - !$tagDetails = $tagDetails + " " - !$tagDetails = $tagDetails + "|" -%set_variable_value("$" + $tagStereo + "_LineLegendEntry", $tagEntry) -%set_variable_value("$" + $tagStereo + "_LineLegendDetails", $tagDetails) - !return $tagEntry -!endfunction - -!unquoted procedure $addTagToLegend($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $legendText="", $legendSprite="", $borderStyle="", $borderThickness="") -'' if a combined element tag is defined (e.g. "v1.0&v1.1") then it is typically a merged color, -'' like a new $fontColor="#fdae61" therefore it should be added to the legend -'' and the & combined tags will be not removed -' !if (%strpos($tagStereo, "&") < 0) - !$dummyAlreadyVariables = $setTagLegendVariables($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $legendText, $legendSprite, $borderStyle, $borderThickness) - !$tagCustomLegend = $tagCustomLegend + $tagStereo + "\n" - !$tagMask = $tagLegendMask( $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $borderStyle, $borderThickness) -%set_variable_value("$" + $tagStereo + "LegendMask", $tagMask) -' !endif -!endprocedure - -!unquoted procedure $addRelTagToLegend($tagStereo, $textColor="", $lineColor="", $lineStyle="", $legendText="", $legendSprite="", $lineThickness="") -'' Arrows have a bug with stereotype/skinparams and cannot combine text colors of one stereotype -'' and the line color of another stereotype. Therefore the text color of one tag and the line color -'' of another tag have to be combined via a "workaround" tag ("v1.0&v1.1"). -'' This workaround tag could be theoretically removed in the legend but after that there would -'' be an inconsistency between the element tags and the rel tags and therefore -'' & combined workaround tags are not removed too (and in unlikely cases the color itself could be changed) -' !if (%strpos($tagStereo, "&") < 0) - !$dummyAlreadyVariables = $setTagRelLegendVariables($tagStereo, $textColor, $lineColor, $lineStyle, $legendText, $legendSprite, $lineThickness) - !$tagCustomLegend = $tagCustomLegend + $tagStereo + "_Line\n" -' !endif -!endprocedure - -!procedure $showActiveLegendEntries($allDefined) - !$brPos = %strpos($allDefined, "\n") - !while ($brPos >= 0) - !$tagStereo = %substr($allDefined, 0, $brPos) - !$allDefined = %substr($allDefined, $brPos+2) - !$brPos = %strpos($allDefined, "\n") - !if (%variable_exists("$" + $tagStereo + "Legend")) - ' is part of legendDetails - !$part1 = %get_variable_value("$" + $tagStereo + "LegendEntry") - !$partSize = "" - !$part2 = %get_variable_value("$" + $tagStereo + "LegendDetails") - !$line = $part1 + $partSize + $part2 -$line - !endif - !endwhile - !if (%strlen($allDefined) > 0) - !$tagStereo = $allDefined - !if (%variable_exists("$" + $tagStereo + "Legend")) - ' is part of legendDetails - !$part1 = %get_variable_value("$" + $tagStereo + "LegendEntry") - !$partSize = "" - !$part2 = %get_variable_value("$" + $tagStereo + "LegendDetails") - !$line = $part1 + $partSize + $part2 -$line - !endif - !endif -!endprocedure - -!function RoundedBoxShape() -!return $ROUNDED_BOX -!endfunction - -!function EightSidedShape() -!return $EIGHT_SIDED -!endfunction - -!function DottedLine() -!return $DOTTED_LINE -!endfunction - -!function DashedLine() -!return $DASHED_LINE -!endfunction - -!function BoldLine() -!return $BOLD_LINE -!endfunction - -!function SolidLine() -!return $SOLID_LINE -!endfunction - -' used by new defined tags -!unquoted procedure AddElementTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="", $borderStyle="", $borderThickness="") -$defineSkinparams($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $borderStyle, $borderThickness) - !if ($sprite!="") -%set_variable_value("$" + $tagStereo + "ElementTagSprite", $sprite) - !if ($legendSprite == "") - !$legendSprite = $smallVersionSprite($sprite) - !endif - !endif - !if ($techn != "") -%set_variable_value("$" + $tagStereo + "ElementTagTechn", $techn) - !endif -$addTagToLegend($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure - -!unquoted procedure $addElementTagInclReuse($elementName, $tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="", $borderStyle="", $borderThickness="") - !$bgColor=$restoreEmpty($elementName, "bgColor", $bgColor, %false()) - !$fontColor=$restoreEmpty($elementName, "fontColor", $fontColor, %false()) - !$borderColor=$restoreEmpty($elementName, "borderColor", $borderColor, %false()) - !$shadowing=$restoreEmpty($elementName, "shadowing", $shadowing, %false()) - !$shape=$restoreEmpty($elementName, "shape", $shape, %false()) - !$sprite=$restoreEmpty($elementName, "sprite", $sprite, %false()) - !$techn=$restoreEmpty($elementName, "techn", $techn, %false()) - ' new style should has its own legend text - ' !$legendText=$restoreEmpty($elementName, "legendText", $legendText, %false()) - !$legendSprite=$restoreEmpty($elementName, "legendSprite", $legendSprite, %false()) - !$borderStyle=$restoreEmpty($elementName, "borderStyle", $borderStyle, %false()) - !$borderThickness=$restoreEmpty($elementName, "borderThickness", $borderThickness, %false()) - - AddElementTag($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $techn, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure - -' used by new defined rel tags -!unquoted procedure AddRelTag($tagStereo, $textColor="", $lineColor="", $lineStyle="", $sprite="", $techn="", $legendText="", $legendSprite="", $lineThickness="") -$defineRelSkinparams($tagStereo, $textColor, $lineColor, $lineStyle, $lineThickness) - !if ($sprite != "") -%set_variable_value("$" + $tagStereo + "RelTagSprite", $sprite) - !if ($legendSprite == "") - ' relation symbols typically 1:1 no additional scale required - !$legendSprite = $sprite - !endif - !endif - !if ($techn != "") -%set_variable_value("$" + $tagStereo + "RelTagTechn", $techn) - !endif -$addRelTagToLegend($tagStereo, $textColor, $lineColor, $lineStyle, $legendText, $legendSprite, $lineThickness) -!endprocedure - -' update the style of existing elements like person, ... -!unquoted procedure UpdateElementStyle($elementName, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="", $borderStyle="", $borderThickness="") -!$bgColor=$restoreEmpty($elementName, "bgColor", $bgColor, %true()) -!$fontColor=$restoreEmpty($elementName, "fontColor", $fontColor, %true()) -!$borderColor=$restoreEmpty($elementName, "borderColor", $borderColor, %true()) -!$shadowing=$restoreEmpty($elementName, "shadowing", $shadowing, %true()) -!$shape=$restoreEmpty($elementName, "shape", $shape, %true()) -!$sprite=$restoreEmpty($elementName, "sprite", $sprite, %true()) -!$techn=$restoreEmpty($elementName, "techn", $techn, %true()) -!$legendText=$restoreEmpty($elementName, "legendText", $legendText, %true()) -!$legendSprite=$restoreEmpty($elementName, "legendSprite", $legendSprite, %true()) -!$borderStyle=$restoreEmpty($elementName, "borderStyle", $borderStyle, %true()) -!$borderThickness=$restoreEmpty($elementName, "borderThickness", $borderThickness, %true()) - -$defineSkinparams($elementName, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $borderStyle, $borderThickness) - !if ($sprite != "") -%set_variable_value("$" + $elementName + "ElementTagSprite", $sprite) - !if ($legendSprite == "") - !$legendSprite = $smallVersionSprite($sprite) - !endif - !endif - !if ($techn != "") -%set_variable_value("$" + $elementName + "ElementTagTechn", $techn) - !endif - !$dummyAlreadyVariables = $setTagLegendVariables($elementName, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $legendText, $legendSprite, $borderStyle, $borderThickness) - ' default tags sets at least bgColor and fontColor - !$tagMask = $tagLegendMask("CHANGED", "CHANGED", $borderColor, $shadowing, $shape, $sprite, $borderStyle, $borderThickness) -%set_variable_value("$" + $elementName + "LegendMask", $tagMask) -!endprocedure - -/' @deprecated in favor of UpdateElementStyle '/ -!unquoted procedure UpdateSkinparamsAndLegendEntry($elementName, $bgColor="", $fontColor="", $borderColor="", $shadowing="") -UpdateElementStyle($elementName, $bgColor, $fontColor, $borderColor, $shadowing) -!endprocedure - -' update the style of default relation, it has to set both properties (combined statement not working) -!unquoted procedure UpdateRelStyle($textColor, $lineColor) - !$elementSkin = "skinparam arrow {" + %newline() - !$elementSkin = $elementSkin + " Color " + $lineColor + %newline() - !$elementSkin = $elementSkin + " FontColor " + $textColor + %newline() - !$elementSkin = $elementSkin + "}" + %newline() -$elementSkin -!endprocedure - -' tags/stereotypes have to be delimited with \n -!unquoted procedure SetDefaultLegendEntries($tagStereoEntries) - !$tagDefaultLegend = $tagStereoEntries -!endprocedure - -' Links -' ################################## - -!function $getLink($link) - !if ($link != "") - !return "[[" + $link + "]]" - !else - !return "" - !endif -!endfunction - -' Line breaks -' ################################## - -!unquoted function $breakText($text, $usedNewLine, $widthStr="-1") -!$width = %intval($widthStr) -!$multiLine = "" -!if (%strpos($text, "\n") >= 0) - !while (%strpos($text, "\n") >= 0) - !$brPos = %strpos($text, "\n") - !if ($brPos > 0) - !$multiLine = $multiLine + %substr($text, 0, $brPos) + $usedNewLine - !else - ' non breaking change that newLine breaks with formats can be used with \n\n - !$multiLine = $multiLine + "" + $usedNewLine - !endif - !$text = %substr($text, $brPos+2) - !if (%strlen($text) == 0) - !$text = "" - !endif - !endwhile -!else - !while ($width>0 && %strlen($text) > $width) - !$brPos = $width - !while ($brPos > 0 && %substr($text, $brPos, 1) != ' ') - !$brPos = $brPos - 1 - !endwhile - - !if ($brPos < 1) - !$brPos = %strpos($text, " ") - !else - !endif - - !if ($brPos > 0) - !$multiLine = $multiLine + %substr($text, 0, $brPos) + $usedNewLine - !$text = %substr($text, $brPos + 1) - !else - !$multiLine = $multiLine+ $text - !$text = "" - !endif - !endwhile -!endif -!if (%strlen($text) > 0) - !$multiLine = $multiLine + $text -!endif -!return $multiLine -!endfunction - -!unquoted function $breakLabel($text) -!$usedNewLine = "\n== " -!$multiLine = $breakText($text, $usedNewLine) -!return $multiLine -!endfunction - -!unquoted function $breakDescr($text, $widthStr) - !$usedNewLine = "\n" - !return $breakText($text, $usedNewLine, $widthStr) -!endfunction - -' $breakTechn() supports //...//; $breakNode() in C4_Deployment supports no //....// -!unquoted function $breakTechn($text, $widthStr) - !$usedNewLine = '//\n//' - !return $breakText($text, $usedNewLine, $widthStr) -!endfunction - -' Element base layout -' ################################## - -!function $getElementBase($label, $techn, $descr, $sprite) - !$element = "" - !if ($sprite != "") - !$element = $element + $getSprite($sprite) - !if ($label != "") - !$element = $element + '\n' - !endif - !endif - !if ($label != "") - !$element = $element + '== ' + $breakLabel($label) - !else - !$element = $element + '.' - !endif - !if ($techn != "") - !$element = $element + '\n//[' + $breakTechn($techn, '-1') + ']//' - !endif - !if ($descr != "") - !$element = $element + '\n\n' + $descr - !endif - !return $element -!endfunction - -!function $getElementLine($umlShape, $elementType, $alias, $label, $techn, $descr, $sprite, $tags, $link) - !$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", $elementType) - !$techn=$toElementArg($techn, $tags, "ElementTagTechn", $elementType) - !$baseProp = $getElementBase($label, $techn, $descr, $sprite) + $getProps() - !$stereo = $toStereos($elementType,$tags) - !$calcLink = $getLink($link) - - !$line = $umlShape + " " + %chr(34) + $baseProp + %chr(34) +" " + $stereo + " as " + $alias + $calcLink - !return $line -!endfunction - -' Element properties -' ################################## - -' collect all defined properties as table rows -!global $propTable = "" -!global $propTableCaption = "" -!global $propColCaption = "=" - -!unquoted function SetPropertyHeader($col1Name, $col2Name, $col3Name = "", $col4Name = "") - !$propColCaption = "" - !$propTableCaption = "|= " + $col1Name + " |= " + $col2Name + " |" - !if ($col3Name != "") - !$propTableCaption = $propTableCaption + "= " + $col3Name + " |" - !endif - !if ($col4Name != "") - !$propTableCaption = $propTableCaption + "= " + $col4Name + " |" - !endif - !return "" -!endfunction - -!unquoted function WithoutPropertyHeader() - !$propTableCaption = "" - !$propColCaption = "=" - !return "" -!endfunction - -!unquoted function AddProperty($col1, $col2, $col3 = "", $col4 = "") - !if ($propTable == "") - !if ($propTableCaption != "") - !$propTable = $propTableCaption + "\n" - !endif - !else - !$propTable = $propTable + "\n" - !endif - !$propTable = $propTable + "| " + $col1 + " |" + $propColCaption + " " + $col2 + " |" - !if ($col3 != "") - !$propTable = $propTable + " " + $col3 + " |" - !endif - !if ($col4 != "") - !$propTable = $propTable + " " + $col4 + " |" - !endif - !return "" -!endfunction - -!unquoted function $getProps($alignedNL = "\n") - !if ($propTable != "") - !$retTable = $alignedNL + $propTable - !$propTable = "" - !return $retTable - !endif - !return "" -!endfunction - -!unquoted function $getProps_L() - !return $getProps("\l") -!endfunction - -!unquoted function $getProps_R() - !return $getProps("\r") -!endfunction - -SetPropertyHeader("Property","Value") - -' Layout -' ################################## - -!function $getLegendDetailsSize($detailsFormat) - !if $detailsFormat == $LEGEND_DETAILS_NONE - !$size = 0 - !elseif $detailsFormat == $LEGEND_DETAILS_SMALL - !$size = $LEGEND_DETAILS_SMALL_SIZE - !else - !$size = $LEGEND_DETAILS_NORMAL_SIZE - !endif - !return $size -!endfunction - -!procedure $getHideStereotype($hideStereotype) -!if ($hideStereotype == "true") -hide stereotype -!endif -!endprocedure - -!procedure $getLegendTable($detailsFormat) -!global $LEGEND_DETAILS_SIZE = $getLegendDetailsSize($detailsFormat) -<$colorWithHash(transparent),$colorWithHash(transparent)>|**Legend** | -$showActiveLegendEntries($tagDefaultLegend) -$showActiveLegendEntries($tagCustomLegend) -!endprocedure - -!procedure $getLegendArea($areaAlias, $hideStereotype, $details) -$getHideStereotype($hideStereotype) -rectangle $areaAlias<> [ -$getLegendTable($details) -] -!endprocedure - -!procedure HIDE_STEREOTYPE() -hide stereotype -!endprocedure - -!unquoted procedure SET_SKETCH_STYLE($bgColor="_dont_change_", $fontColor="_dont_change_", $warningColor="_dont_change_", $fontName="_dont_change_", $footerWarning="_dont_change_", $footerText="_dont_change_") -!if $bgColor != "_dont_change_" - !global $SKETCH_BG_COLOR = $bgColor -!endif -!if $fontColor != "_dont_change_" - !global $SKETCH_FONT_COLOR = $fontColor -!endif -!if $warningColor != "_dont_change_" - !global $SKETCH_WARNING_COLOR = $warningColor -!endif -!if $fontName != "_dont_change_" - !global $SKETCH_FONT_NAME = $fontName -!endif -!if $footerWarning != "_dont_change_" - !global $SKETCH_FOOTER_WARNING = $footerWarning -!endif -!if $footerText != "_dont_change_" - !global $SKETCH_FOOTER_TEXT = $footerText -!endif -!endprocedure - -!procedure LAYOUT_AS_SKETCH() - skinparam handwritten true -!if $SKETCH_BG_COLOR > "" - skinparam backgroundColor $SKETCH_BG_COLOR -!endif -!if $SKETCH_FONT_COLOR > "" - skinparam footer { - FontColor $SKETCH_FONT_COLOR - } - !if $ARROW_COLOR == "#666666" - !global $ARROW_COLOR = $SKETCH_FONT_COLOR - !global $ARROW_FONT_COLOR = $SKETCH_FONT_COLOR - skinparam arrow { - Color $ARROW_COLOR - FontColor $ARROW_FONT_COLOR - } - !endif - !if $BOUNDARY_COLOR == "#444444" - !global $BOUNDARY_COLOR = $SKETCH_FONT_COLOR - skinparam rectangle<> { - FontColor $BOUNDARY_COLOR - BorderColor $BOUNDARY_COLOR - } - !endif -!endif -!if $SKETCH_FONT_NAMES > "" - skinparam defaultFontName $SKETCH_FONT_NAME -!endif -!if $SKETCH_FOOTER_WARNING > "" || $SKETCH_FOOTER_TEXT > "" - !$line = "footer "+ $SKETCH_FOOTER_WARNING + " " + $SKETCH_FOOTER_TEXT - $line -!endif -!endprocedure - -!global $fix_direction=%false() - -!function $down($start,$end) -!if ($fix_direction) -!return $start+"RIGHT"+$end -!else -!return $start+"DOWN"+$end -!endif -!endfunction - -!function $up($start,$end) -!if ($fix_direction) -!return $start+"LEFT"+$end -!else -!return $start+"UP"+$end -!endif -!endfunction - -!function $left($start,$end) -!if ($fix_direction) -!return $start+"UP"+$end -!else -!return $start+"LEFT"+$end -!endif -!endfunction - -!function $right($start,$end) -!if ($fix_direction) -!return $start+"DOWN"+$end -!else -!return $start+"RIGHT"+$end -!endif -!endfunction - -!procedure LAYOUT_TOP_DOWN() -!global $fix_direction=%false() -top to bottom direction -!endprocedure - -!procedure LAYOUT_LEFT_RIGHT() -!global $fix_direction = %false() -left to right direction -!endprocedure - -!procedure LAYOUT_LANDSCAPE() -!global $fix_direction = %true() -left to right direction -!endprocedure - -' legend details can displayed as Normal(), Small(), None() -!function None() -!return $LEGEND_DETAILS_NONE -!endfunction - -!function Normal() -!return $LEGEND_DETAILS_NORMAL -!endfunction - -!function Small() -!return $LEGEND_DETAILS_SMALL -!endfunction - -' has to be last call in diagram -!unquoted procedure SHOW_LEGEND($hideStereotype="true", $details=Small()) -$getHideStereotype($hideStereotype) -legend right -$getLegendTable($details) -endlegend -!endprocedure - -/' @deprecated in favor of SHOW_LEGEND '/ -!unquoted procedure SHOW_DYNAMIC_LEGEND($hideStereotype="true") -SHOW_LEGEND($hideStereotype) -!endprocedure - -' legend is reserved and cannot be uses as alias of SHOW_FLOATING_LEGEND() therefore -' LEGEND() is introduced. It returns the default name of the floating alias "floating_legend_alias" -' and can be used in the Lay_Distance() calls -!function LEGEND() -!return "floating_legend_alias" -!endfunction - -' enables that legend can be located in drawing area of the diagram. It has to be last call in diagram followed by Lay_Distance() -!unquoted procedure SHOW_FLOATING_LEGEND($alias=LEGEND(), $hideStereotype="true", $details=Small()) -$getLegendArea($alias, $hideStereotype, $details) -!endprocedure - -' Boundaries -' ################################## - -!unquoted procedure UpdateBoundaryStyle($elementName="", $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $type="", $legendText="", $borderStyle="", $borderThickness="") - !if ($elementName != "") - !$elementBoundary = $elementName + '_boundary' - UpdateElementStyle($elementBoundary, $bgColor, $fontColor, $borderColor, $shadowing, $shape, "", $type, $legendText, "", $borderStyle, $borderThickness) - !else - UpdateElementStyle("boundary", $bgColor, $fontColor, $borderColor, $shadowing, $shape, "", $type, $legendText, "", $borderStyle, $borderThickness) - ' simulate color inheritance - UpdateBoundaryStyle("enterprise", $bgColor, $fontColor, $borderColor, $shadowing, $shape, "Enterprise", "", $borderStyle, $borderThickness) - UpdateBoundaryStyle("system", $bgColor, $fontColor, $borderColor, $shadowing, $shape, "System", "", $borderStyle, $borderThickness) - UpdateBoundaryStyle("container", $bgColor, $fontColor, $borderColor, $shadowing, $shape, "Container", "", $borderStyle, $borderThickness) - !endif -!endprocedure - -!unquoted procedure AddBoundaryTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $type="", $legendText="", $borderStyle="", $borderThickness="") - !$tagBoundary = $tagStereo + '_boundary' - AddElementTag($tagBoundary, $bgColor, $fontColor, $borderColor, $shadowing, $shape, "", $type, $legendText, "", $borderStyle, $borderThickness) -!endprocedure - -' add _boundary to all tags that short tag version can be used -!unquoted function $addBoundaryPostfix($tags) - !if (%strlen($tags) == 0) - !return '' - !endif - !$boundaryTags = '' - !$brPos = %strpos($tags, "+") - !while ($brPos >= 0) - !$tag = %substr($tags, 0, $brPos) - !$boundaryTags = $boundaryTags + $tag + '_boundary+' - !$tags = %substr($tags, $brPos+1) - !$brPos = %strpos($tags, "+") - !endwhile - !if (%strlen($tags) > 0) - !$boundaryTags = $boundaryTags + $tags + '_boundary' - !endif - !return $boundaryTags -!endfunction - -!function $getBoundary($label, $type) - !if ($type == "") - !return '== ' + $breakLabel($label) - !endif - !if (type != "") - !return '== ' + $breakLabel($label) + '\n[' + $type + ']' - !endif -!endfunction - -!unquoted procedure Boundary($alias, $label, $type="", $tags="", $link="") -!$boundaryTags = $addBoundaryPostfix($tags) -' nodes $type reuses $techn definition of $boundaryTags -!$type=$toElementArg($type, $boundaryTags, "ElementTagTechn", "boundary") -rectangle "$getBoundary($label, $type)" $toStereos("boundary", $boundaryTags) as $alias $getLink($link) -!endprocedure - -' Boundary Styling -UpdateBoundaryStyle("", $bgColor=$BOUNDARY_BG_COLOR, $fontColor=$BOUNDARY_COLOR, $borderColor=$BOUNDARY_COLOR, $borderStyle=DashedLine()) - -' Index -' ################################## - -' Dynamic/Sequence diagram supports (automatically) numbered interactions: -' preferred function calls -' (Uppercase) LastIndex(): return the last used index (function which can be used as argument) -' (Uppercase) Index($offset=1): returns current index and calculates next index (function which can be used as argument) -' (Uppercase) SetIndex($new_index): returns new set index and calculates next index (function which can be used as argument) - -' old procedures calls -' (lowercase) increment($offset=1): increase current index (procedure which has no direct output) -' (lowercase) setIndex($new_index): set the new index (procedure which has no direct output) - -!$lastIndex = 0 -!$index = 1 - -!procedure increment($offset=1) - !$lastIndex = $index - !$index = $index + $offset -!endprocedure - -!procedure setIndex($new_index) - !$lastIndex = $index - !$index = $new_index -!endprocedure - -!function Index($offset=1) - !$lastIndex = $index - !$index = $lastIndex + $offset - !return $lastIndex -!endfunction - -!function LastIndex() - !return $lastIndex -!endfunction - -!function SetIndex($new_index, $offset=1) - !$lastIndex = $new_index - !$index = $new_index + $offset - !return $lastIndex -!endfunction - -!unquoted function $getPrefix($index) - !if ($index == "") - !$pre = Index() + ": " - !else - !$pre = $index + ": " - !endif - !return $pre -!endfunction - -' Relationship -' ################################## - -!function $getRel($direction, $alias1, $alias2, $label, $techn, $descr, $sprite, $tags, $link) - !$sprite = $toRelArg($sprite, $tags, "RelTagSprite") - !$techn = $toRelArg($techn, $tags, "RelTagTechn") - !$rel = $alias1 + ' ' + $direction + ' ' + $alias2 - !if ($tags != "") - !$rel = $rel + ' ' + $toStereos($tags) - !endif - !$rel = $rel + ' : ' - !if ($link != "") - !$rel = $rel + '**[[' + $link + ' ' - !endif - !if ($sprite != "") - !$rel = $rel + $getSprite($sprite) - !if ($label != "") - !$rel = $rel + ' ' - !endif - !endif - !if ($link != "") - !$usedNewLine = ']]**\n**[[' + $link + ' ' - ' if sprite and label is empty than the link url is shown (otherwise link cannot be activated at all) - !$rel = $rel + $breakText($label, $usedNewLine) + ']]**' - !else - !if ($label != "") - !$usedNewLine = '**\n**' - !$rel = $rel + '**' + $breakText($label, $usedNewLine) + '**' - !else - !$rel = $rel + '.' - !endif - !endif - !if ($techn != "") - ' line break is not deterministic, calculate it - !$rel = $rel + '\n//[' + $breakTechn($techn, $REL_TECHN_MAX_CHAR_WIDTH) + ']//' - !endif - !if ($descr != "") - ' line break is not deterministic, calculate it - !$rel = $rel + '\n\n' + $breakDescr($descr, $REL_DESCR_MAX_CHAR_WIDTH) - !endif - !$prop = $getProps() - !if ($prop != "") - ' reuse table - !$rel = $rel + $prop - !endif - !return $rel -!endfunction - -!unquoted procedure Rel_($alias1, $alias2, $label, $direction) -$getRel($direction, $alias1, $alias2, $label, "", "", "", "", "") -!endprocedure -!unquoted procedure Rel_($alias1, $alias2, $label, $techn, $direction) -$getRel($direction, $alias1, $alias2, $label, $techn, "", "", "", "") -!endprocedure - -!unquoted procedure Rel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure BiRel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_Back($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<--", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure BiRel_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_Back_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_D($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($down("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Down($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($down("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure BiRel_D($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($down("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure BiRel_Down($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($down("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_U($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($up("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Up($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($up("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure BiRel_U($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($up("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure BiRel_Up($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($up("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_L($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($left("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Left($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($left("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure BiRel_L($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($left("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure BiRel_Left($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($left("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_R($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($right("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Right($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($right("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure BiRel_R($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($right("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure BiRel_Right($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($right("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -' Layout Helpers -' ################################## - -!function $getHiddenLine($distance) - !return '-[hidden]' + %substr('------------', 0, %intval($distance) + 1) -!endfunction - -!unquoted procedure Lay_D($from, $to) -$from -[hidden]D- $to -!endprocedure -!unquoted procedure Lay_Down($from, $to) -$from -[hidden]D- $to -!endprocedure - -!unquoted procedure Lay_U($from, $to) -$from -[hidden]U- $to -!endprocedure -!unquoted procedure Lay_Up($from, $to) -$from -[hidden]U- $to -!endprocedure - -!unquoted procedure Lay_R($from, $to) -$from -[hidden]R- $to -!endprocedure -!unquoted procedure Lay_Right($from, $to) -$from -[hidden]R- $to -!endprocedure - -!unquoted procedure Lay_L($from, $to) -$from -[hidden]L- $to -!endprocedure -!unquoted procedure Lay_Left($from, $to) -$from -[hidden]L- $to -!endprocedure - -' PlantUML bug: lines which does "not match" with the orientation/direction of the diagram -' use the same length therefore the method offers no direction at all. -' If a direction is required the Lay_...() methods can be used -!unquoted procedure Lay_Distance($from, $to, $distance="0") -$from $getHiddenLine($distance) $to -!endprocedure diff --git a/src/C4Sharp/Resources/C4_Component.puml b/src/C4Sharp/Resources/C4_Component.puml deleted file mode 100644 index a4137d6..0000000 --- a/src/C4Sharp/Resources/C4_Component.puml +++ /dev/null @@ -1,83 +0,0 @@ -' convert it with additional command line argument -DRELATIVE_INCLUDE="relative/absolute" to use locally -!if %variable_exists("RELATIVE_INCLUDE") - !include ./C4_Container.puml -!else - !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml -!endif - -' Scope: A single container. -' Primary elements: Components within the container in scope. -' Supporting elements: Containers (within the software system in scope) plus people and software systems directly connected to the components. -' Intended audience: Software architects and developers. - -' Colors -' ################################## - -!$COMPONENT_FONT_COLOR ?= "#000000" -!$COMPONENT_BG_COLOR ?= "#85BBF0" -!$COMPONENT_BORDER_COLOR ?= "#78A8D8" - -!$EXTERNAL_COMPONENT_FONT_COLOR ?= $COMPONENT_FONT_COLOR -!$EXTERNAL_COMPONENT_BG_COLOR ?= "#CCCCCC" -!$EXTERNAL_COMPONENT_BORDER_COLOR ?= "#BFBFBF" - -' Styling -' ################################## - -UpdateElementStyle("component", $COMPONENT_BG_COLOR, $COMPONENT_FONT_COLOR, $COMPONENT_BORDER_COLOR, false) -UpdateElementStyle("external_component", $EXTERNAL_COMPONENT_BG_COLOR, $EXTERNAL_COMPONENT_FONT_COLOR, $EXTERNAL_COMPONENT_BORDER_COLOR, false) - -' shortcuts with default colors -!unquoted procedure AddComponentTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="", $borderStyle="", $borderThickness="") - $addElementTagInclReuse("component", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $techn, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure -!unquoted procedure AddExternalComponentTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="", $borderStyle="", $borderThickness="") - $addElementTagInclReuse("external_component", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $techn, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure - -' Layout -' ################################## - -SetDefaultLegendEntries("person\nsystem\ncontainer\ncomponent\nexternal_person\nexternal_system\nexternal_container\nexternal_component\nenterprise_boundary\nsystem_boundary\ncontainer_boundary\nboundary") - -!procedure LAYOUT_WITH_LEGEND() -hide stereotype -legend right -|**Legend** | -|<$PERSON_BG_COLOR> person | -|<$SYSTEM_BG_COLOR> system | -|<$CONTAINER_BG_COLOR> container | -|<$COMPONENT_BG_COLOR> component | -|<$EXTERNAL_PERSON_BG_COLOR> external person | -|<$EXTERNAL_SYSTEM_BG_COLOR> external system | -|<$EXTERNAL_CONTAINER_BG_COLOR> external container | -|<$EXTERNAL_COMPONENT_BG_COLOR> external component | -endlegend -!endprocedure - -' Elements -' ################################## - -!unquoted procedure Component($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle") - $getElementLine($baseShape, "component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ComponentDb($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getElementLine("database", "component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ComponentQueue($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getElementLine("queue", "component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Component_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle") - $getElementLine($baseShape, "external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ComponentDb_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getElementLine("database", "external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ComponentQueue_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getElementLine("queue", "external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure diff --git a/src/C4Sharp/Resources/C4_Container.puml b/src/C4Sharp/Resources/C4_Container.puml deleted file mode 100644 index bccd6fd..0000000 --- a/src/C4Sharp/Resources/C4_Container.puml +++ /dev/null @@ -1,103 +0,0 @@ -' convert it with additional command line argument -DRELATIVE_INCLUDE="relative/absolute" to use locally -!if %variable_exists("RELATIVE_INCLUDE") - !include ./C4_Context.puml -!else - !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml -!endif - -' Scope: A single software system. -' Primary elements: Containers within the software system in scope. -' Supporting elements: People and software systems directly connected to the containers. -' Intended audience: Technical people inside and outside of the software development team; including software architects, developers and operations/support staff. - -' Colors -' ################################## - -!$CONTAINER_FONT_COLOR ?= $ELEMENT_FONT_COLOR -!$CONTAINER_BG_COLOR ?= "#438DD5" -!$CONTAINER_BORDER_COLOR ?= "#3C7FC0" - -!$CONTAINER_BOUNDARY_COLOR ?= $BOUNDARY_COLOR -!$CONTAINER_BOUNDARY_BG_COLOR ?= $BOUNDARY_BG_COLOR -!$CONTAINER_BOUNDARY_BORDER_STYLE ?= $BOUNDARY_BORDER_STYLE - -!$EXTERNAL_CONTAINER_FONT_COLOR ?= $ELEMENT_FONT_COLOR -!$EXTERNAL_CONTAINER_BG_COLOR ?= "#B3B3B3" -!$EXTERNAL_CONTAINER_BORDER_COLOR ?= "#A6A6A6" - -' Styling -' ################################## -UpdateElementStyle("container", $CONTAINER_BG_COLOR, $CONTAINER_FONT_COLOR, $CONTAINER_BORDER_COLOR, false) -UpdateElementStyle("external_container", $EXTERNAL_CONTAINER_BG_COLOR, $EXTERNAL_CONTAINER_FONT_COLOR, $EXTERNAL_CONTAINER_BORDER_COLOR, false) - -UpdateBoundaryStyle("container", $bgColor=$CONTAINER_BOUNDARY_BG_COLOR, $fontColor=$CONTAINER_BOUNDARY_COLOR, $borderColor=$CONTAINER_BOUNDARY_COLOR, $type="Container", $shadowing="false") - -' shortcuts with default colors -!unquoted procedure AddContainerTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="", $borderStyle="", $borderThickness="") - $addElementTagInclReuse("container", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $techn, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure -!unquoted procedure AddExternalContainerTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="", $borderStyle="", $borderThickness="") - $addElementTagInclReuse("external_container", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $techn, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure - -!unquoted procedure UpdateContainerBoundaryStyle($bgColor=$CONTAINER_BOUNDARY_BG_COLOR, $fontColor=$CONTAINER_BOUNDARY_COLOR, $borderColor=$CONTAINER_BOUNDARY_COLOR, $shadowing="", $shape="", $type="Container", $legendText="", $borderStyle="", $borderThickness="") - UpdateBoundaryStyle("container", $bgColor, $fontColor, $borderColor, $shadowing, $shape, $type, $legendText, $borderStyle, $borderThickness) -!endprocedure - -' Layout -' ################################## - -SetDefaultLegendEntries("person\nsystem\ncontainer\nexternal_person\nexternal_system\nexternal_container\nenterprise_boundary\nsystem_boundary\ncontainer_boundary\nboundary") - -!procedure LAYOUT_WITH_LEGEND() -hide stereotype -legend right -|**Legend** | -|<$PERSON_BG_COLOR> person | -|<$SYSTEM_BG_COLOR> system | -|<$CONTAINER_BG_COLOR> container | -|<$EXTERNAL_PERSON_BG_COLOR> external person | -|<$EXTERNAL_SYSTEM_BG_COLOR> external system | -|<$EXTERNAL_CONTAINER_BG_COLOR> external container | -endlegend -!endprocedure - -' Elements -' ################################## - -!unquoted procedure Container($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle") - $getElementLine($baseShape , "container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ContainerDb($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getElementLine("database", "container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ContainerQueue($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getElementLine("queue", "container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Container_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle") - $getElementLine($baseShape , "external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ContainerDb_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getElementLine("database", "external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ContainerQueue_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getElementLine("queue", "external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -' Boundaries -' ################################## - -!unquoted procedure Container_Boundary($alias, $label, $tags="", $link="") - !if ($tags != "") - !$allTags = $tags + '+container' - !else - !$allTags = 'container' - !endif - ' $type defined via $tag style - Boundary($alias, $label, "", $allTags, $link) -!endprocedure diff --git a/src/C4Sharp/Resources/C4_Context.puml b/src/C4Sharp/Resources/C4_Context.puml deleted file mode 100644 index 71b2574..0000000 --- a/src/C4Sharp/Resources/C4_Context.puml +++ /dev/null @@ -1,434 +0,0 @@ -' convert it with additional command line argument -DRELATIVE_INCLUDE="relative/absolute" to use locally -!if %variable_exists("RELATIVE_INCLUDE") - !include ./C4.puml -!else - !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4.puml -!endif - -' Scope: A single software system. -' Primary elements: The software system in scope. -' Supporting elements: People and software systems directly connected to the software system in scope. -' Intended audience: Everybody, both technical and non-technical people, inside and outside of the software development team. - -' Colors -' ################################## - -!$PERSON_FONT_COLOR ?= $ELEMENT_FONT_COLOR -!$PERSON_BG_COLOR ?= "#08427B" -!$PERSON_BORDER_COLOR ?= "#073B6F" - -!$EXTERNAL_PERSON_FONT_COLOR ?= $ELEMENT_FONT_COLOR -!$EXTERNAL_PERSON_BG_COLOR ?= "#686868" -!$EXTERNAL_PERSON_BORDER_COLOR ?= "#8A8A8A" - -!$SYSTEM_FONT_COLOR ?= $ELEMENT_FONT_COLOR -!$SYSTEM_BG_COLOR ?= "#1168BD" -!$SYSTEM_BORDER_COLOR ?= "#3C7FC0" - -!$SYSTEM_BOUNDARY_COLOR ?= $BOUNDARY_COLOR -!$SYSTEM_BOUNDARY_BG_COLOR ?= $BOUNDARY_BG_COLOR -!$SYSTEM_BOUNDARY_BORDER_STYLE ?= $BOUNDARY_BORDER_STYLE - -!$EXTERNAL_SYSTEM_FONT_COLOR ?= $ELEMENT_FONT_COLOR -!$EXTERNAL_SYSTEM_BG_COLOR ?= "#999999" -!$EXTERNAL_SYSTEM_BORDER_COLOR ?= "#8A8A8A" - -!$ENTERPRISE_BOUNDARY_COLOR ?= $BOUNDARY_COLOR -!$ENTERPRISE_BOUNDARY_BG_COLOR ?= $BOUNDARY_BG_COLOR -!$ENTERPRISE_BOUNDARY_BORDER_STYLE ?= $BOUNDARY_BORDER_STYLE - -' Styling -' ################################## - -UpdateElementStyle("person", $PERSON_BG_COLOR, $PERSON_FONT_COLOR, $PERSON_BORDER_COLOR, false) -UpdateElementStyle("external_person", $EXTERNAL_PERSON_BG_COLOR, $EXTERNAL_PERSON_FONT_COLOR, $EXTERNAL_PERSON_BORDER_COLOR, false) -UpdateElementStyle("system", $SYSTEM_BG_COLOR, $SYSTEM_FONT_COLOR, $SYSTEM_BORDER_COLOR, false) -UpdateElementStyle("external_system", $EXTERNAL_SYSTEM_BG_COLOR, $EXTERNAL_SYSTEM_FONT_COLOR, $EXTERNAL_SYSTEM_BORDER_COLOR, false) - -UpdateBoundaryStyle("system", $bgColor=$SYSTEM_BOUNDARY_BG_COLOR, $fontColor=$SYSTEM_BOUNDARY_COLOR, $borderColor=$SYSTEM_BOUNDARY_COLOR, $type="System", $shadowing="false") -UpdateBoundaryStyle("enterprise", $bgColor=$ENTERPRISE_BOUNDARY_BG_COLOR, $fontColor=$ENTERPRISE_BOUNDARY_COLOR, $borderColor=$ENTERPRISE_BOUNDARY_COLOR, $type="Enterprise", $shadowing="false") - -' shortcuts with default colors -!unquoted procedure AddPersonTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $legendText="", $legendSprite="", $type="", $borderStyle="", $borderThickness="") - $addElementTagInclReuse("person", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $type, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure -!unquoted procedure AddExternalPersonTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $legendText="", $legendSprite="", $type="", $borderStyle="", $borderThickness="") - $addElementTagInclReuse("external_person", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $type, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure -!unquoted procedure AddSystemTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $legendText="", $legendSprite="", $type="", $borderStyle="", $borderThickness="") - $addElementTagInclReuse("system", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $type, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure -!unquoted procedure AddExternalSystemTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $legendText="", $legendSprite="", $type="", $borderStyle="", $borderThickness="") - $addElementTagInclReuse("external_system", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $type, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure - -!unquoted procedure UpdateEnterpriseBoundaryStyle($bgColor=$ENTERPRISE_BOUNDARY_BG_COLOR, $fontColor=$ENTERPRISE_BOUNDARY_COLOR, $borderColor=$ENTERPRISE_BOUNDARY_COLOR, $shadowing="", $shape="", $type="Enterprise", $legendText="", $borderStyle="", $borderThickness="") - UpdateBoundaryStyle("enterprise", $bgColor, $fontColor, $borderColor, $shadowing, $shape, $type, $legendText, $borderStyle, $borderThickness) -!endprocedure -!unquoted procedure UpdateSystemBoundaryStyle($bgColor=$SYSTEM_BOUNDARY_BG_COLOR, $fontColor=$SYSTEM_BOUNDARY_COLOR, $borderColor=$SYSTEM_BOUNDARY_COLOR, $shadowing="", $shape="", $type="System", $legendText="", $borderStyle="", $borderThickness="") - UpdateBoundaryStyle("system", $bgColor, $fontColor, $borderColor, $shadowing, $shape, $type, $legendText, $borderStyle, $borderThickness) -!endprocedure - -' Sprites -' ################################## - -sprite $person [48x48/16] { -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -0000000000000000000049BCCA7200000000000000000000 -0000000000000000006EFFFFFFFFB3000000000000000000 -00000000000000001CFFFFFFFFFFFF700000000000000000 -0000000000000001EFFFFFFFFFFFFFF80000000000000000 -000000000000000CFFFFFFFFFFFFFFFF6000000000000000 -000000000000007FFFFFFFFFFFFFFFFFF100000000000000 -00000000000001FFFFFFFFFFFFFFFFFFF900000000000000 -00000000000006FFFFFFFFFFFFFFFFFFFF00000000000000 -0000000000000BFFFFFFFFFFFFFFFFFFFF40000000000000 -0000000000000EFFFFFFFFFFFFFFFFFFFF70000000000000 -0000000000000FFFFFFFFFFFFFFFFFFFFF80000000000000 -0000000000000FFFFFFFFFFFFFFFFFFFFF80000000000000 -0000000000000DFFFFFFFFFFFFFFFFFFFF60000000000000 -0000000000000AFFFFFFFFFFFFFFFFFFFF40000000000000 -00000000000006FFFFFFFFFFFFFFFFFFFE00000000000000 -00000000000000EFFFFFFFFFFFFFFFFFF800000000000000 -000000000000007FFFFFFFFFFFFFFFFFF100000000000000 -000000000000000BFFFFFFFFFFFFFFFF5000000000000000 -0000000000000001DFFFFFFFFFFFFFF70000000000000000 -00000000000000000BFFFFFFFFFFFF500000000000000000 -0000000000000000005DFFFFFFFFA1000000000000000000 -0000000000000000000037ABB96100000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000025788300000000005886410000000000000 -000000000007DFFFFFFD9643347BFFFFFFFB400000000000 -0000000004EFFFFFFFFFFFFFFFFFFFFFFFFFFB1000000000 -000000007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFD200000000 -00000006FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE10000000 -0000003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0000000 -000000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5000000 -000003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD000000 -000009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF200000 -00000DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF600000 -00000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF800000 -00001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA00000 -00001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB00000 -00001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB00000 -00001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB00000 -00001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA00000 -00000EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF700000 -000006FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE100000 -0000008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD3000000 -000000014555555555555555555555555555555300000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -} - -sprite $person2 [48x48/16] { -0000000000000000000049BCCA7200000000000000000000 -0000000000000000006EFFFFFFFFB3000000000000000000 -00000000000000001CFFFFFFFFFFFF700000000000000000 -0000000000000001EFFFFFFFFFFFFFF80000000000000000 -000000000000000CFFFFFFFFFFFFFFFF6000000000000000 -000000000000007FFFFFFFFFFFFFFFFFF100000000000000 -00000000000001FFFFFFFFFFFFFFFFFFF900000000000000 -00000000000006FFFFFFFFFFFFFFFFFFFF00000000000000 -0000000000000BFFFFFFFFFFFFFFFFFFFF40000000000000 -0000000000000EFFFFFFFFFFFFFFFFFFFF70000000000000 -0000000000000FFFFFFFFFFFFFFFFFFFFF80000000000000 -0000000000000FFFFFFFFFFFFFFFFFFFFF80000000000000 -0000000000000DFFFFFFFFFFFFFFFFFFFF60000000000000 -0000000000000AFFFFFFFFFFFFFFFFFFFF40000000000000 -00000000000006FFFFFFFFFFFFFFFFFFFE00000000000000 -00000000000000EFFFFFFFFFFFFFFFFFF800000000000000 -000000000000007FFFFFFFFFFFFFFFFFF100000000000000 -000000000000000BFFFFFFFFFFFFFFFF5000000000000000 -0000000000000001DFFFFFFFFFFFFFF70000000000000000 -00000000000000000BFFFFFFFFFFFF500000000000000000 -0000000000000000005DFFFFFFFFA1000000000000000000 -0000000000000000000037ABB96100000000000000000000 -000000000002578888300000000005888864100000000000 -0000000007DFFFFFFFFD9643347BFFFFFFFFFB4000000000 -00000004EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB10000000 -0000007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD2000000 -000006FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE100000 -00003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB00000 -0000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF50000 -0003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0000 -0009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2000 -000DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6000 -000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB000 -001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB000 -001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB000 -001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA000 -000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -000DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6000 -0009FFFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFFF2000 -0003FFFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFFD0000 -0000BFFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFF50000 -00003FFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFB00000 -000006FFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFE100000 -0000007FFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFD2000000 -00000004EFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFB10000000 -0000000007DF8FFFFFFFFFFFFFFFFFFFFFF8FB4000000000 -000000000002578888888888888888888864100000000000 -} - -sprite $robot [48x48/16] { -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000005BFFFFFFFFFFFFFFFFFFFFFE9100000000000 -0000000000AFFFFFFFFFFFFFFFFFFFFFFFFFE30000000000 -0000000007FFFFFFFFFFFFFFFFFFFFFFFFFFFE1000000000 -000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000000000 -000000004FFFFFFFFFFFFFFFFFFFFFFFFFFFFFC000000000 -000000005FFFFFFFFFFFFFFFFFFFFFFFFFFFFFD000000000 -000000005FFFFFFFFFFFFFFFFFFFFFFFFFFFFFE000000000 -000000005FFFFFFFFFFFFFFFFFFFFFFFFFFFFFE000000000 -000699405FFFFFFC427FFFFFFFFFC427FFFFFFE009982000 -008FFF705FFFFFE10006FFFFFFFE00007FFFFFE00FFFF100 -00CFFF705FFFFFA00001FFFFFFF900002FFFFFE00FFFF500 -00DFFF705FFFFFB00002FFFFFFFA00003FFFFFE00FFFF500 -00DFFF705FFFFFF4000AFFFFFFFF3000BFFFFFE00FFFF500 -00DFFF705FFFFFFFA8DFFFFFFFFFFA8DFFFFFFE00FFFF500 -00DFFF705FFFFFFFFFFFFFFFFFFFFFFFFFFFFFE00FFFF500 -00DFFF705FFFFFFFFFFFFFFFFFFFFFFFFFFFFFE00FFFF500 -00DFFF705FFFFFFFFFFFFFFFFFFFFFFFFFFFFFE00FFFF500 -00DFFF705FFFFFFFFFFFFFFFFFFFFFFFFFFFFFE00FFFF500 -00DFFF705FFFFFFFFFFFFFFFFFFFFFFFFFFFFFE00FFFF500 -00CFFF705FFFFFF87777777777777777CFFFFFE00FFFF500 -008FFF705FFFFFF100000000000000009FFFFFE00FFFF100 -000699405FFFFFF76666666666666666CFFFFFE009982000 -000000005FFFFFFFFFFFFFFFFFFFFFFFFFFFFFE000000000 -000000005FFFFFFFFFFFFFFFFFFFFFFFFFFFFFE000000000 -000000004FFFFFFFFFFFFFFFFFFFFFFFFFFFFFC000000000 -000000000EFFFFFFFFFFFFFFFFFFFFFFFFFFFF7000000000 -0000000005FFFFFFFFFFFFFFFFFFFFFFFFFFFD0000000000 -00000000004CFFFFFFFFFFFFFFFFFFFFFFFF910000000000 -000000000000011111111111111111111110000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -} - -sprite $robot2 [48x48/16] { -000000000000000088888888888888880000000000000000 -000000000000000AFFFFFFFFFFFFFFFFA000000000000000 -00000000000000CFFFFFFFFFFFFFFFFFFC00000000000000 -00000000000004EFFFFFFFFFFFFFFFFFFE40000000000000 -0000000000000AFFFFFFFFFFFFFFFFFFFFA0000000000000 -00000000000008FFFFFFFFFFFFFFFFFFFF80000000000000 -00000000000008FFFFFFFFFFFFFFFFFFFF80000000000000 -00000000000008FFFFFFFFFFFFFFFFFFFF80000000000000 -00000000000888FFFFFFFFFFFFFFFFFFFF88800000000000 -00000000008FF8FFFFFFFFFFFFFFFFFFFF8FF80000000000 -00000000008FF8FFFFFFFFFFFFFFFFFFFF8FF80000000000 -00000000008FF8FFFFFFFFFFFFFFFFFFFF8FF80000000000 -00000000008FF8FFFFFFFFFFFFFFFFFFFF8FF80000000000 -00000000008FF8FFFFFFFFFFFFFFFFFFFF8FF80000000000 -00000000008FF8FFFFFFFFFFFFFFFFFFFF8FF80000000000 -00000000000888FFFFFFFFFFFFFFFFFFFF88800000000000 -00000000000008FFFFFFFFFFFFFFFFFFFF80000000000000 -00000000000008FFFFFFFFFFFFFFFFFFFF80000000000000 -00000000000008FFFFFFFFFFFFFFFFFFFF80000000000000 -00000000000008FFFFFFFFFFFFFFFFFFFF80000000000000 -00000000000008FFFFFFFFFFFFFFFFFFFF80000000000000 -00000000000004CFFFFFFFFFFFFFFFFFFC40000000000000 -000000488888848CFFFFFFFFFFFFFFFFC848888884000000 -00000CFFFFFFFFC888888888888888888CFFFFFFFFC00000 -00008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF80000 -0000CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -0008FFFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFFF8000 -0008FFFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFFF8000 -0008FFFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFFF8000 -0008FFFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFFF8000 -0000CFFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFFC0000 -00008FFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFF80000 -00000CFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFC00000 -000000488887578888888888888888888864688884000000 -000000000000000000000000000000000000000000000000 -} - -' Layout -' ################################## - -SetDefaultLegendEntries("person\nsystem\nexternal_person\nexternal_system\nenterprise_boundary\nsystem_boundary\nboundary") - -!procedure LAYOUT_WITH_LEGEND() -hide stereotype -legend right -|**Legend** | -|<$PERSON_BG_COLOR> person | -|<$SYSTEM_BG_COLOR> system| -|<$EXTERNAL_PERSON_BG_COLOR> external person | -|<$EXTERNAL_SYSTEM_BG_COLOR> external system | -endlegend -!endprocedure - -!global $defaultPersonSprite = "person" -!$dummy = $restoreEmpty("person", "sprite", $defaultPersonSprite, %true()) -UpdateElementStyle("person") -' workaround of plantuml.jar bug - person overwrites external_person setting -!$dummy = $restoreEmpty("external_person", "sprite", $defaultPersonSprite, %true()) -UpdateElementStyle("external_person") -!global $portraitPerson = "false" - -!procedure $clearPersonRestore() - !$dummy = $clearRestore("person", "sprite") - !$dummy = $clearRestore("person", "legendSprite") - %set_variable_value("$" + "person" + "ElementTagSprite", "") - UpdateElementStyle("person") - ' workaround of plantuml.jar bug - person overwrites external_person setting - !$dummy = $clearRestore("external_person", "sprite") - !$dummy = $clearRestore("external_person", "legendSprite") - %set_variable_value("$" + "external_person" + "ElementTagSprite", "") - UpdateElementStyle("external_person") -!endprocedure - -!procedure HIDE_PERSON_SPRITE() - !$defaultPersonSprite = "" - !$portraitPerson = "false" - $clearPersonRestore() -!endprocedure - -!unquoted procedure SHOW_PERSON_SPRITE($sprite="") - !if ($sprite == "") - !$defaultPersonSprite = "person" - !else - !$defaultPersonSprite = $sprite - !endif - !$dummy = $restoreEmpty("person", "sprite", $defaultPersonSprite, %true()) - UpdateElementStyle("person") - ' workaround of plantuml.jar bug - person overwrites external_person setting - !$dummy = $restoreEmpty("external_person", "sprite", $defaultPersonSprite, %true()) - UpdateElementStyle("external_person") - !$portraitPerson = "false" -!endprocedure - -!unquoted procedure SHOW_PERSON_PORTRAIT() - !$defaultPersonSprite = "" - !$portraitPerson = "portrait" - $clearPersonRestore() -!endprocedure - -!unquoted procedure SHOW_PERSON_OUTLINE() - !$defaultPersonSprite = "" - !$portraitPerson = "outline" - $clearPersonRestore() -!endprocedure - -' Elements -' ################################## - -!function $getPerson($label, $type, $descr, $sprite) - !if ($sprite == "") && ($defaultPersonSprite != "") - !$sprite = $defaultPersonSprite - !endif - !return $getElementBase($label, $type, $descr, $sprite) -!endfunction - -!unquoted procedure Person($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "person") -' $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "person") -!if ($portraitPerson == "portrait") && ($sprite == "") -actor "$getPerson($label, $type, $descr, $sprite)$getProps()" $toStereos("person", $tags) as $alias $getLink($link) -!elseif ($portraitPerson == "outline") && ($sprite == "") -person "$getPerson($label, $type, $descr, $sprite)$getProps()" $toStereos("person", $tags) as $alias $getLink($link) -!else -rectangle "$getPerson($label, $type, $descr, $sprite)$getProps()" $toStereos("person", $tags) as $alias $getLink($link) -!endif -!endprocedure - -!unquoted procedure Person_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_person") -' $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "external_person") -!if ($portraitPerson == "portrait") && ($sprite == "") -actor "$getPerson($label, $type, $descr, $sprite)$getProps()" $toStereos("external_person", $tags) as $alias $getLink($link) -!elseif ($portraitPerson == "outline") && ($sprite == "") -person "$getPerson($label, $type, $descr, $sprite)$getProps()" $toStereos("external_person", $tags) as $alias $getLink($link) -!else -rectangle "$getPerson($label, $type, $descr, $sprite)$getProps()" $toStereos("external_person", $tags) as $alias $getLink($link) -!endif -!endprocedure - -!unquoted procedure System($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="", $baseShape="rectangle") - ' $type reuses $techn definition of $tags - $getElementLine($baseShape, "system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure SystemDb($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getElementLine("database", "system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure SystemQueue($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getElementLine("queue", "system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure System_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="", $baseShape="rectangle") - ' $type reuses $techn definition of $tags - $getElementLine($baseShape , "external_system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure SystemDb_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getElementLine("database", "external_system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure SystemQueue_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getElementLine("queue", "external_system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -' Boundaries -' ################################## - -!unquoted procedure Enterprise_Boundary($alias, $label, $tags="", $link="") - !if ($tags != "") - !$allTags = $tags + '+enterprise' - !else - !$allTags = 'enterprise' - !endif - ' $type defined via $tag style - Boundary($alias, $label, "", $allTags, $link) -!endprocedure - -!unquoted procedure System_Boundary($alias, $label, $tags="", $link="") - !if ($tags != "") - !$allTags = $tags + '+system' - !else - !$allTags = 'system' - !endif - ' $type defined via $tag style - Boundary($alias, $label, "", $allTags, $link) -!endprocedure diff --git a/src/C4Sharp/Resources/C4_Deployment.puml b/src/C4Sharp/Resources/C4_Deployment.puml deleted file mode 100644 index afc9945..0000000 --- a/src/C4Sharp/Resources/C4_Deployment.puml +++ /dev/null @@ -1,140 +0,0 @@ -' convert it with additional command line argument -DRELATIVE_INCLUDE="relative/absolute" to use locally -!if %variable_exists("RELATIVE_INCLUDE") - !include ./C4_Container.puml -!else - !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml -!endif - -' Colors -' ################################## - -!$NODE_FONT_COLOR ?= "#000000" -!$NODE_BG_COLOR ?= "#FFFFFF" -!$NODE_BORDER_COLOR ?= "#A2A2A2" - -' Styling -' ################################## - -' PlantUML supports no automatic line breaks of "PlantUML containers" (C4 Deployment_Node is a "PlantUML container") -' therefore (Deployment_)Node() implements an automatic line break based on spaces (like in all other objects). -' If a $type contains \n then these are used (and no automatic space based line breaks are done) -' $NODE_TYPE_MAX_CHAR_WIDTH defines the automatic line break position -!$NODE_TYPE_MAX_CHAR_WIDTH ?= 35 -!$NODE_DESCR_MAX_CHAR_WIDTH ?= 32 - -UpdateElementStyle("node", $bgColor=$NODE_BG_COLOR, $fontColor=$NODE_FONT_COLOR, $borderColor=$NODE_BORDER_COLOR, false) -skinparam rectangle<> { - FontStyle normal -} - -' shortcuts with default colors -' node specific: $techn is only used in old scripts, new scripts uses $type ($techn has to remain, it could be called via named argument) -!unquoted procedure AddNodeTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $type="", $legendText="", $legendSprite="", $techn="", $borderStyle="", $borderThickness="") - !$type=$type+$techn - $addElementTagInclReuse("node", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $type, $legendText, $legendSprite, $borderStyle, $borderThickness) -!endprocedure - -' Layout -' ################################## - -' comment if node should not be added to legend. No calculated legend extension required -SetDefaultLegendEntries("person\nsystem\ncontainer\nexternal_person\nexternal_system\nexternal_container\nnode\nenterprise_boundary\nsystem_boundary\ncontainer_boundary\nboundary") - -' Line breaks -' ################################## - -' $breakTechn() in C4 supports //...//; $breakNode() in C4_Deployment supports no //....// -!unquoted function $breakNode($text, $widthStr) - !$usedNewLine = '\n' - !return $breakText($text, $usedNewLine, $widthStr) -!endfunction - -' Elements -' ################################## - -!function $getNode($label, $type, $descr, $sprite) - !$nodeText = "" - !if ($sprite != "") - !$nodeText = $nodeText + $getSprite($sprite) + '\n' - !endif - !$nodeText = $nodeText + '== ' + $breakText($label, "\n== ") - !if ($type != "") - !$nodeText = $nodeText + '\n[' + $breakNode($type, $NODE_TYPE_MAX_CHAR_WIDTH) + ']' - !endif - !if ($descr != "") - !$nodeText = $nodeText + '\n\n' + $breakDescr($descr, $NODE_DESCR_MAX_CHAR_WIDTH) - !endif - !return $nodeText -!endfunction - -!function $getNode_L($label, $type, $descr, $sprite) - !$nodeText = "" - !if ($sprite != "") - !$nodeText = $nodeText + $getSprite($sprite) + '\l' - !endif - !$nodeText = $nodeText + '== ' + $breakText($label, "\l== ") - !if ($type != "") - !$nodeText = $nodeText + '\l[' + $breakNode($type, $NODE_TYPE_MAX_CHAR_WIDTH) + ']' - !endif - !if ($descr != "") - !$nodeText = $nodeText + '\l\l' + $breakDescr($descr, $NODE_DESCR_MAX_CHAR_WIDTH) - !endif - !return $nodeText -!endfunction - -!function $getNode_R($label, $type, $descr, $sprite) - !$nodeText = "" - !if ($sprite != "") - !$nodeText = $nodeText + $getSprite($sprite) + '\r' - !endif - !$nodeText = $nodeText + '== ' + $breakText($label, "\r== ") - !if ($type != "") - !$nodeText = $nodeText + '\r[' + $breakNode($type, $NODE_TYPE_MAX_CHAR_WIDTH) + ']' - !endif - !if ($descr != "") - !$nodeText = $nodeText + '\r\r' + $breakDescr($descr, $NODE_DESCR_MAX_CHAR_WIDTH) - !endif - !return $nodeText -!endfunction - -!unquoted procedure Deployment_Node($alias, $label, $type="", $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "node") -' nodes $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "node") -rectangle "$getNode($label, $type, $descr, $sprite)$getProps()" $toStereos("node",$tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure Deployment_Node_L($alias, $label, $type="", $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "node") -' nodes $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "node") -rectangle "$getNode_L($label, $type, $descr, $sprite)$getProps_L()" $toStereos("node",$tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure Deployment_Node_R($alias, $label, $type="", $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "node") -' nodes $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "node") -rectangle "$getNode_R($label, $type, $descr, $sprite)$getProps_R()" $toStereos("node",$tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure Node($alias, $label, $type="", $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "node") -' nodes $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "node") -rectangle "$getNode($label, $type, $descr, $sprite)$getProps()" $toStereos("node",$tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure Node_L($alias, $label, $type="", $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "node") -' nodes $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "node") -rectangle "$getNode_L($label, $type, $descr, $sprite)$getProps_L()" $toStereos("node",$tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure Node_R($alias, $label, $type="", $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "node") -' nodes $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "node") -rectangle "$getNode_R($label, $type, $descr, $sprite)$getProps_R()" $toStereos("node",$tags) as $alias $getLink($link) -!endprocedure diff --git a/src/C4Sharp/Resources/C4_Dynamic.puml b/src/C4Sharp/Resources/C4_Dynamic.puml deleted file mode 100644 index f12cb86..0000000 --- a/src/C4Sharp/Resources/C4_Dynamic.puml +++ /dev/null @@ -1,165 +0,0 @@ -' convert it with additional command line argument -DRELATIVE_INCLUDE="relative/absolute" to use locally -!if %variable_exists("RELATIVE_INCLUDE") - !include ./C4_Component.puml -!else - !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml -!endif - -' Scope: Interactions in an enterprise, software system or container. -' Primary and supporting elements: Depends on the diagram scope - -' enterprise - people and software systems Related to the enterprise in scope -' software system - see system context or container diagrams, -' container - see component diagram. -' Intended audience: Technical and non-technical people, inside and outside of the software development team. - -' Dynamic diagram introduces (automatically) numbered interactions: -' (lowercase) increment($offset=1): increase current index (procedure which has no direct output) -' (lowercase) setIndex($new_index): set the new index (procedure which has no direct output) -' -' (Uppercase) LastIndex(): return the last used index (function which can be used as argument) -' (Uppercase) Index($offset=1): returns current index and calculates next index (function which can be used as argument) -' (Uppercase) SetIndex($new_index): returns new set index and calculates next index (function which can be used as argument) - -' Relationship override -' ################################## - -' Relationship -' ################################## - -!unquoted procedure Rel_($e_index, $alias1, $alias2, $label, $direction) -$getRel($direction, $alias1, $alias2, $e_index + ": " + $label, "", "", "", "", "") -!endprocedure -!unquoted procedure Rel_($e_index, $alias1, $alias2, $label, $techn, $direction) -$getRel($direction, $alias1, $alias2, $e_index + ": " + $label, $techn, "", "", "", "") -!endprocedure - -' all RelIndex... calls are outdated, Rel(..., $index=...) calls should be used !!!! - -' first Rel() supports the $index argument too; second Rel() overwrites C4.puml definition -!unquoted procedure Rel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="") -!$pre = $getPrefix($index) -$getRel("-->>", $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -Rel($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "") -!endprocedure -!unquoted procedure RelIndex($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-->>", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_Back($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="") -!$pre = $getPrefix($index) -$getRel("<<--", $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Back($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -Rel_Back($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "") -!endprocedure -!unquoted procedure RelIndex_Back($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<--", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="") -!$pre = $getPrefix($index) -$getRel("->>", $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -Rel_Neighbor($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "") -!endprocedure -!unquoted procedure RelIndex_Neighbor($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("->>", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_Back_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="") -!$pre = $getPrefix($index) -$getRel("<<-", $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Back_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -Rel_Back_Neighbor($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "") -!endprocedure -!unquoted procedure RelIndex_Back_Neighbor($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_D($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="") -!$pre = $getPrefix($index) -$getRel($down("-","->>"), $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_D($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -Rel_D($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "") -!endprocedure -!unquoted procedure Rel_Down($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="") -!$pre = $getPrefix($index) -$getRel($down("-","->>"), $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Down($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -Rel_Down($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "") -!endprocedure -!unquoted procedure RelIndex_D($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($down("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure RelIndex_Down($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($down("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_U($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="") -!$pre = $getPrefix($index) -$getRel($up("-","->>"), $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_U($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -Rel_U($from, $to, $label, $techn, $descr, $sprite, $tags, $link=, "") -!endprocedure -!unquoted procedure Rel_Up($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="") -!$pre = $getPrefix($index) -$getRel($up("-","->>"), $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Up($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -Rel_Up($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "") -!endprocedure -!unquoted procedure RelIndex_U($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($up("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure RelIndex_Up($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($up("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_L($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="") -!$pre = $getPrefix($index) -$getRel($left("-","->>"), $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_L($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -Rel_L($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "") -!endprocedure -!unquoted procedure Rel_Left($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="") -!$pre = $getPrefix($index) -$getRel($left("-","->>"), $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Left($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -Rel_Left($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "") -!endprocedure -!unquoted procedure RelIndex_L($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($left("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure RelIndex_Left($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($left("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_R($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="") -!$pre = $getPrefix($index) -$getRel($right("-","->>"), $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_R($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -Rel_R($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "") -!endprocedure -!unquoted procedure Rel_Right($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="") -!$pre = $getPrefix($index) -$getRel($right("-","->>"), $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Right($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -Rel_Right($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "") -!endprocedure -!unquoted procedure RelIndex_R($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($right("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure RelIndex_Right($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($right("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure diff --git a/src/C4Sharp/Resources/C4_Sequence.puml b/src/C4Sharp/Resources/C4_Sequence.puml deleted file mode 100644 index ee40694..0000000 --- a/src/C4Sharp/Resources/C4_Sequence.puml +++ /dev/null @@ -1,398 +0,0 @@ -' convert it with additional command line argument -DRELATIVE_INCLUDE="relative/absolute" to use locally -!if %variable_exists("RELATIVE_INCLUDE") - !include ./C4_Component.puml -!else - !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml -!endif - -' Scope: Interactions in an enterprise, software system or container. -' Primary and supporting elements: Depends on the diagram scope - -' enterprise - people and software systems Related to the enterprise in scope -' software system - see system context or container diagrams, -' container - see component diagram. -' Intended audience: Technical and non-technical people, inside and outside of the software development team. - -' Sequence diagram introduces (automatically) numbered interactions: -' (lowercase) increment($offset=1): increase current index (procedure which has no direct output) -' (lowercase) setIndex($new_index): set the new index (procedure which has no direct output) -' -' (Uppercase) LastIndex(): return the last used index (function which can be used as argument) -' (Uppercase) Index($offset=1): returns current index and calculates next index (function which can be used as argument) -' (Uppercase) SetIndex($new_index): returns new set index and calculates next index (function which can be used as argument) - -' enables multi-level boxes -!pragma teoz true - - -' Legend redefintion -' ################################## -' sequence has no dashed boxes -!if ($LEGEND_DASHED_BOUNDARY == "dashed") - !$LEGEND_DASHED_BOUNDARY = "" -!endif -!if ($LEGEND_DASHED_TRANSPARENT_BOUNDARY == "dashed") - !$LEGEND_DASHED_TRANSPARENT_BOUNDARY = "" -!endif -UpdateBoundaryStyle("", $bgColor=$BOUNDARY_BG_COLOR, $fontColor=$BOUNDARY_COLOR, $borderColor=$BOUNDARY_COLOR) -UpdateBoundaryStyle("enterprise", $bgColor=$ENTERPRISE_BOUNDARY_BG_COLOR, $fontColor=$ENTERPRISE_BOUNDARY_COLOR, $borderColor=$ENTERPRISE_BOUNDARY_COLOR, $type="Enterprise") -UpdateBoundaryStyle("system", $bgColor=$SYSTEM_BOUNDARY_BG_COLOR, $fontColor=$SYSTEM_BOUNDARY_COLOR, $borderColor=$SYSTEM_BOUNDARY_COLOR, $type="System") -UpdateBoundaryStyle("container", $bgColor=$CONTAINER_BOUNDARY_BG_COLOR, $fontColor=$CONTAINER_BOUNDARY_COLOR, $borderColor=$CONTAINER_BOUNDARY_COLOR, $type="Container") - -' Styling and Layout -' ################################## - -!global $display_element_description = %false() - -' typically the element/participant descriptions are not displayed in a sequence diagram, but it can be activated with this call -!unquoted procedure SHOW_ELEMENT_DESCRIPTIONS($show="true") -!if ($show == "true") - !global $display_element_description = %true() -!else - !global $display_element_description = %false() -!endif -!endprocedure - -' typically the foot boxes descriptions are not displayed in a sequence diagram, but it can be activated with this call -!unquoted procedure SHOW_FOOT_BOXES($show="true") -!if ($show == "true") - show footbox -!else - hide footbox -!endif -!endprocedure - -!global $show_index = %false() -' All relation specific (default) ordinary index numbers can be shown with this call -!unquoted procedure SHOW_INDEX($show="true") -!if ($show == "true") - !global $show_index = %true() -!else - !global $show_index = %false() -!endif -!endprocedure - -' ======= if no theme is defined hide foot box and activate C4_blue styles -!if (%variable_exists("$THEME")) -!else -' $BOUNDARY_BG_COLOR... have to be defined in theme itself that it can be used in styles,... -' (no default values which are defined in C4.puml) -' If skinparams and styles are defined with concrete values no variables are required -!$BOUNDARY_BG_COLOR ?= "transparent" -!$BOUNDARY_COLOR ?= "#444444" -!$ARROW_COLOR ?= "#666666" - -' replace transparent with concrete background that it can be used as font color too -!if ($BOUNDARY_BG_COLOR == "transparent") - !$SEQUENCE_BG_COLOR = white -!else - !$SEQUENCE_BG_COLOR = $BOUNDARY_BG_COLOR -!endif - -' "C4 styled" default is no foot boxes -hide footbox -' "C4 styled" default is that lifeline is arrow color -skinparam SequenceLifelineBorderColor $ARROW_COLOR - -skinparam SequenceGroupBodyBackgroundColor $SEQUENCE_BG_COLOR -skinparam SequenceGroupFontColor $BOUNDARY_COLOR -skinparam SequenceGroupBackgroundColor $BOUNDARY_COLOR -skinparam SequenceGroupHeaderFontColor $SEQUENCE_BG_COLOR -skinparam SequenceGroupBorderColor $BOUNDARY_COLOR - -skinparam SequenceReferenceBackgroundColor $SEQUENCE_BG_COLOR -skinparam SequenceReferenceFontColor $BOUNDARY_COLOR -skinparam SequenceReferenceHeaderBackgroundColor $BOUNDARY_COLOR -' VIA STYLE -' skinparam SequenceReferenceHeaderFontColor $SEQUENCE_BG_COLOR - -skinparam SequenceReferenceBorderColor $BOUNDARY_COLOR - -skinparam SequenceDividerBackgroundColor $SEQUENCE_BG_COLOR -skinparam SequenceDividerFontColor $BOUNDARY_COLOR -skinparam SequenceDividerBorderColor $BOUNDARY_COLOR - -' VIA STYLE -' skinparam SequenceDelayFontColor green - -!endif -' ======= if no theme is defined hide foot box and activate C4_blue styles - -' Elements redefinition -' ################################## - -' all elements have to be displayed as participant -' participants requires ` %newline()` instead of `\n` - -!unquoted function $breakWithNewline($text, $lineEnd, $lineStart, $widthStr="-1") -!$width = %intval($widthStr) -!$multiLine = "" -!if (%strpos($text, "\n") >= 0) - !while (%strpos($text, "\n") >= 0) - !$brPos = %strpos($text, "\n") - !if ($brPos > 0) - !$multiLine = $multiLine + %substr($text, 0, $brPos) + $lineEnd + %newline() + $lineStart - !else - ' non breaking change that newLine breaks with formats can be used with \n\n - !$multiLine = $multiLine + "" + $lineEnd + %newline() + $lineStart - !endif - !$text = %substr($text, $brPos+2) - !if (%strlen($text) == 0) - !$text = "" - !endif - !endwhile -!else - !while ($width>0 && %strlen($text) > $width) - !$brPos = $width - !while ($brPos > 0 && %substr($text, $brPos, 1) != ' ') - !$brPos = $brPos - 1 - !endwhile - - !if ($brPos < 1) - !$brPos = %strpos($text, " ") - !else - !endif - - !if ($brPos > 0) - !$multiLine = $multiLine + %substr($text, 0, $brPos) + $lineEnd + %newline() + $lineStart - !$text = %substr($text, $brPos + 1) - !else - !$multiLine = $multiLine+ $text - !$text = "" - !endif - !endwhile -!endif -!if (%strlen($text) > 0) - !$multiLine = $multiLine + $text -!endif -!return $multiLine -!endfunction - -!unquoted function $breakNewLineLabel($text) -!$multiLine = $breakWithNewline($text, "", "==") -!return $multiLine -!endfunction - -!unquoted function $breakNewLineDescr($text) - !return $breakWithNewline($text, "", "", $REL_DESCR_MAX_CHAR_WIDTH) -!endfunction - -!unquoted function $breakNewLineTechn($text) - !$lineStart = "//" - !$lineEnd = '//' - !return $breakWithNewline($text, $lineStart, $lineEnd, $REL_TECHN_MAX_CHAR_WIDTH) -!endfunction - -' description is not displayed (size too big, line breaks not supported) -' properties are not displayed in sequence diagram (size would be too big) -' $breakLabel() not required by participant -!procedure $getParticipant($elementType, $alias, $label, $techn, $descr, $sprite, $tags, $link) - !$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", $elementType) - !$techn=$toElementArg($techn, $tags, "ElementTagTechn", $elementType) - !$stereo = $toStereos($elementType,$tags) - !$calcLabel = "== " + $breakNewLineLabel($label) - !$calcTech = "//[" + $breakNewLineTechn($techn) + "]//" - !$calcDescr = $breakNewLineDescr($descr) - !$calcLink = $getLink($link) - -participant $alias $stereo $calcLink [ -!if ($sprite != "") -$getSprite($sprite) -!endif -!if ($label != "") -$calcLabel -!endif -!if ($techn != "") -$calcTech -!endif -!if ($display_element_description == %true() && $descr != "") - -$calcDescr -!endif -] -!endprocedure - - -!unquoted procedure Person($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getParticipant("person", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Person_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getParticipant("external_person", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure System($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="", $baseShape="rectangle") - ' $type reuses $techn definition of $tags - $getParticipant("system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure SystemDb($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getParticipant("system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure SystemQueue($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getParticipant("system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure System_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="", $baseShape="rectangle") - ' $type reuses $techn definition of $tags - $getParticipant("external_system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure SystemDb_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getParticipant("external_system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure SystemQueue_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="") - ' $type reuses $techn definition of $tags - $getParticipant("external_system", $alias, $label, $type, $descr, $sprite, $tags, $link) -!endprocedure - - - -!unquoted procedure Container($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle") - $getParticipant("container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ContainerDb($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getParticipant("container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ContainerQueue($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getParticipant("container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Container_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle") - $getParticipant("external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ContainerDb_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getParticipant("external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ContainerQueue_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getParticipant("external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - - - -!unquoted procedure Component($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle") - $getParticipant("component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ComponentDb($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getParticipant("component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ComponentQueue($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getParticipant("component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Component_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle") - $getParticipant("external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ComponentDb_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getParticipant("external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure ComponentQueue_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="") - $getParticipant("external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - - -' Boundary redefinition -' ################################## - -' all boundaries have to be displayed as box and -' !!! important changes: without { at the end; and boundary ends with Boundary_End() instead of } - -' alias ignored -' $breakLabel() not required by participant - -!unquoted procedure Boundary($alias, $label, $type="", $tags="", $link="") -!$boundaryTags = $addBoundaryPostfix($tags) -' nodes $type reuses $techn definition of $boundaryTags -!$type=$toElementArg($type, $boundaryTags, "ElementTagTechn", "boundary") -!if ($link != "") - !$usedNewLine = ']]\n== [[' + $link + ' ' - !$labelType = '== [[' + $link + ' ' + $breakText($label, $usedNewLine) + ']]' -!else - !$usedNewLine = '\n== ' - !$labelType = $breakText($label, $usedNewLine) -!endif -!if (type != "") - !$labelType = $labelType + '\n[' + $type + ']' -!endif -box "$labelType" $toStereos("boundary", $boundaryTags) -!endprocedure - -!procedure Boundary_End() -end box -!endprocedure - -!unquoted procedure Enterprise_Boundary($alias, $label, $tags="", $link="") - !if ($tags != "") - !$allTags = $tags + '+enterprise' - !else - !$allTags = 'enterprise' - !endif - ' $type defined via $tag style - Boundary($alias, $label, "", $allTags, $link) -!endprocedure - -!unquoted procedure System_Boundary($alias, $label, $tags="", $link="") - !if ($tags != "") - !$allTags = $tags + '+system' - !else - !$allTags = 'system' - !endif - ' $type defined via $tag style - Boundary($alias, $label, "", $allTags, $link) -!endprocedure - -!unquoted procedure Container_Boundary($alias, $label, $tags="", $link="") - !if ($tags != "") - !$allTags = $tags + '+container' - !else - !$allTags = 'container' - !endif - ' $type defined via $tag style - Boundary($alias, $label, "", $allTags, $link) -!endprocedure - -' Relationship (redefinition) -' ################################## - -' only Rel is supported in sequence diagram - -' first Rel() supports the $index and $rel argument too; second Rel() overwrites C4.puml definition -' don't add empty lines in procedure otherwise & calls are not working anymore '& a -> b: call' are not working anymore -!unquoted procedure Rel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="", $rel="") - !if ($show_index == %true()) - !$pre = $getPrefix($index) - !else - !$pre = "" - !endif - !if ($rel == "") - !$rel = "->" - !endif -$getRel($rel, $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -Rel($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "", "") -!endprocedure \ No newline at end of file