Skip to content

Commit

Permalink
Re-published E-Commerce Platform sample
Browse files Browse the repository at this point in the history
  • Loading branch information
SlavaVedernikov committed Sep 10, 2024
1 parent 5167ba7 commit ba2da7f
Show file tree
Hide file tree
Showing 7,077 changed files with 35,204 additions and 30,659 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
64 changes: 44 additions & 20 deletions e-commerce-platform/.c4s/C4.puml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ rectangle C4VersionDetailsArea <<legendArea>> [
!$BOUNDARY_COLOR ?= "#444444"
!$BOUNDARY_BG_COLOR ?= "transparent"
!$BOUNDARY_BORDER_STYLE ?= "dashed"
' boundary symbols written in the same line, typically only 50% of the size in element
!$BOUNDARY_IMAGE_SIZE_FACTOR ?= 0.5
!$BOUNDARY_DESCR_MAX_CHAR_WIDTH ?= 35

!$LEGEND_TITLE_COLOR ?= "#000000"
!$LEGEND_FONT_COLOR ?= "#FFFFFF"
Expand Down Expand Up @@ -469,6 +472,19 @@ skinparam package {
!$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)
' label colors cannot be set via skinparam use additional style
!$tagSkin = $tagSkin + "<style>" + %newline()
' componentDiagram {
!$tagSkin = $tagSkin + " label {" + %newline()
!$tagSkin = $tagSkin + " ." + $tagStereo + " {" + %newline()
!$tagSkin = $tagSkin + " StereotypeFontColor " + $bgColor + %newline()
!$tagSkin = $tagSkin + " Fontcolor " + $bgColor + %newline()
!$tagSkin = $tagSkin + " BackgroundColor " + $bgColor + %newline()
!$tagSkin = $tagSkin + " BorderColor " + $borderColor + %newline()
!$tagSkin = $tagSkin + " }" + %newline()
!$tagSkin = $tagSkin + " }" + %newline()
' }
!$tagSkin = $tagSkin + "</style>" + %newline()
!endif
$tagSkin
!endprocedure
Expand Down Expand Up @@ -595,13 +611,13 @@ $elementSkin
!endfunction

' element symbols typically 4 times too big in legend
!function $smallVersionSprite($sprite)
!function $smallVersionSprite($sprite, $imageScale = $LEGEND_IMAGE_SIZE_FACTOR)
' ,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 + "}"
!$smallSprite = $sprite + "{scale=" + $imageScale + "}"
!else
!$smallSprite = $sprite + ",scale=" + $LEGEND_IMAGE_SIZE_FACTOR
!$smallSprite = $sprite + ",scale=" + $imageScale
!endif
!else
!$smallSprite = $sprite
Expand Down Expand Up @@ -729,7 +745,7 @@ $elementSkin
!elseif ($borderStyle == $SOLID_LINE)
!$tagDetails = $tagDetails + $LEGEND_SOLID_LINE + ", "
!else
!$tagDetails = $tagDetails + $lineStyle + ", "
!$tagDetails = $tagDetails + $borderStyle + ", "
!endif
!endif
!if ($borderThickness != "")
Expand Down Expand Up @@ -1373,22 +1389,22 @@ $getLegendArea($alias, $hideStereotype, $details)
' Boundaries
' ##################################

!unquoted procedure UpdateBoundaryStyle($elementName="", $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $type="", $legendText="", $borderStyle="", $borderThickness="")
!unquoted procedure UpdateBoundaryStyle($elementName="", $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $type="", $legendText="", $borderStyle="", $borderThickness="", $sprite="", $legendSprite="")
!if ($elementName != "")
!$elementBoundary = $elementName + '_boundary'
UpdateElementStyle($elementBoundary, $bgColor, $fontColor, $borderColor, $shadowing, $shape, "", $type, $legendText, "", $borderStyle, $borderThickness)
UpdateElementStyle($elementBoundary, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $type, $legendText, $legendSprite, $borderStyle, $borderThickness)
!else
UpdateElementStyle("boundary", $bgColor, $fontColor, $borderColor, $shadowing, $shape, "", $type, $legendText, "", $borderStyle, $borderThickness)
UpdateElementStyle("boundary", $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $type, $legendText, $legendSprite, $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)
UpdateBoundaryStyle("enterprise", $bgColor, $fontColor, $borderColor, $shadowing, $shape, "Enterprise", "", $borderStyle, $borderThickness, $sprite, $legendSprite)
UpdateBoundaryStyle("system", $bgColor, $fontColor, $borderColor, $shadowing, $shape, "System", "", $borderStyle, $borderThickness, $sprite, $legendSprite)
UpdateBoundaryStyle("container", $bgColor, $fontColor, $borderColor, $shadowing, $shape, "Container", "", $borderStyle, $borderThickness, $sprite, $legendSprite)
!endif
!endprocedure

!unquoted procedure AddBoundaryTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $type="", $legendText="", $borderStyle="", $borderThickness="")
!unquoted procedure AddBoundaryTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $type="", $legendText="", $borderStyle="", $borderThickness="", $sprite="", $legendSprite="")
!$tagBoundary = $tagStereo + '_boundary'
AddElementTag($tagBoundary, $bgColor, $fontColor, $borderColor, $shadowing, $shape, "", $type, $legendText, "", $borderStyle, $borderThickness)
AddElementTag($tagBoundary, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $type, $legendText, $legendSprite, $borderStyle, $borderThickness)
!endprocedure

' add _boundary to all tags that short tag version can be used
Expand All @@ -1410,20 +1426,28 @@ $getLegendArea($alias, $hideStereotype, $details)
!return $boundaryTags
!endfunction

!function $getBoundary($label, $type)
!if ($type == "")
!return '== ' + $breakLabel($label)
!function $getBoundary($label, $type, $descr, $sprite)
!$line = '== '
!if ($sprite != "")
' add sprite in label line that it is more compact
!$line = $line + $getSprite($smallVersionSprite($sprite, $BOUNDARY_IMAGE_SIZE_FACTOR)) + ' '
!endif
!if (type != "")
!return '== ' + $breakLabel($label) + '\n<size:' + $TECHN_FONT_SIZE + '>[' + $type + ']</size>'
!$line = $line + $breakLabel($label)
!if ($type != "")
!$line = $line + '\n<size:' + $TECHN_FONT_SIZE + '>[' + $type + ']</size>'
!endif
!if ($descr != "")
!$line = $line + '\n\n' + $breakDescr($descr, $BOUNDARY_DESCR_MAX_CHAR_WIDTH)
!endif
!return $line
!endfunction

!unquoted procedure Boundary($alias, $label, $type="", $tags="", $link="")
!unquoted procedure Boundary($alias, $label, $type="", $tags="", $link="", $descr = "")
!$boundaryTags = $addBoundaryPostfix($tags)
' nodes $type reuses $techn definition of $boundaryTags
' boundary $type reuses $techn definition of $boundaryTags
!$type=$toElementArg($type, $boundaryTags, "ElementTagTechn", "boundary")
rectangle "$getBoundary($label, $type)" $toStereos("boundary", $boundaryTags) as $alias $getLink($link)
!$sprite=$toElementArg("", $boundaryTags, "ElementTagSprite", "boundary")
rectangle "$getBoundary($label, $type, $descr, $sprite)" $toStereos("boundary", $boundaryTags) as $alias $getLink($link)
!endprocedure

' Boundary Styling
Expand Down
8 changes: 4 additions & 4 deletions e-commerce-platform/.c4s/C4_Container.puml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ UpdateBoundaryStyle("container", $bgColor=$CONTAINER_BOUNDARY_BG_COLOR, $fontCol
$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)
!unquoted procedure UpdateContainerBoundaryStyle($bgColor=$CONTAINER_BOUNDARY_BG_COLOR, $fontColor=$CONTAINER_BOUNDARY_COLOR, $borderColor=$CONTAINER_BOUNDARY_COLOR, $shadowing="", $shape="", $type="Container", $legendText="", $borderStyle="", $borderThickness="", $sprite="", $legendSprite="")
UpdateBoundaryStyle("container", $bgColor, $fontColor, $borderColor, $shadowing, $shape, $type, $legendText, $borderStyle, $borderThickness, $sprite, $legendSprite)
!endprocedure

' Layout
Expand Down Expand Up @@ -92,12 +92,12 @@ endlegend
' Boundaries
' ##################################

!unquoted procedure Container_Boundary($alias, $label, $tags="", $link="")
!unquoted procedure Container_Boundary($alias, $label, $tags="", $link="", $descr = "")
!if ($tags != "")
!$allTags = $tags + '+container'
!else
!$allTags = 'container'
!endif
' $type defined via $tag style
Boundary($alias, $label, "", $allTags, $link)
Boundary($alias, $label, "", $allTags, $link, $descr)
!endprocedure
16 changes: 8 additions & 8 deletions e-commerce-platform/.c4s/C4_Context.puml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ UpdateBoundaryStyle("enterprise", $bgColor=$ENTERPRISE_BOUNDARY_BG_COLOR, $fontC
$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)
!unquoted procedure UpdateEnterpriseBoundaryStyle($bgColor=$ENTERPRISE_BOUNDARY_BG_COLOR, $fontColor=$ENTERPRISE_BOUNDARY_COLOR, $borderColor=$ENTERPRISE_BOUNDARY_COLOR, $shadowing="", $shape="", $type="Enterprise", $legendText="", $borderStyle="", $borderThickness="", $sprite="", $legendSprite="")
UpdateBoundaryStyle("enterprise", $bgColor, $fontColor, $borderColor, $shadowing, $shape, $type, $legendText, $borderStyle, $borderThickness, $sprite, $legendSprite)
!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)
!unquoted procedure UpdateSystemBoundaryStyle($bgColor=$SYSTEM_BOUNDARY_BG_COLOR, $fontColor=$SYSTEM_BOUNDARY_COLOR, $borderColor=$SYSTEM_BOUNDARY_COLOR, $shadowing="", $shape="", $type="System", $legendText="", $borderStyle="", $borderThickness="", $sprite="", $legendSprite="")
UpdateBoundaryStyle("system", $bgColor, $fontColor, $borderColor, $shadowing, $shape, $type, $legendText, $borderStyle, $borderThickness, $sprite, $legendSprite)
!endprocedure

' Sprites
Expand Down Expand Up @@ -413,22 +413,22 @@ rectangle "$getPerson($label, $type, $descr, $sprite)$getProps()" $toStereos("ex
' Boundaries
' ##################################

!unquoted procedure Enterprise_Boundary($alias, $label, $tags="", $link="")
!unquoted procedure Enterprise_Boundary($alias, $label, $tags="", $link="", $descr = "")
!if ($tags != "")
!$allTags = $tags + '+enterprise'
!else
!$allTags = 'enterprise'
!endif
' $type defined via $tag style
Boundary($alias, $label, "", $allTags, $link)
Boundary($alias, $label, "", $allTags, $link, $descr)
!endprocedure

!unquoted procedure System_Boundary($alias, $label, $tags="", $link="")
!unquoted procedure System_Boundary($alias, $label, $tags="", $link="", $descr = "")
!if ($tags != "")
!$allTags = $tags + '+system'
!else
!$allTags = 'system'
!endif
' $type defined via $tag style
Boundary($alias, $label, "", $allTags, $link)
Boundary($alias, $label, "", $allTags, $link, $descr)
!endprocedure
30 changes: 19 additions & 11 deletions e-commerce-platform/.c4s/C4_Sequence.puml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ sequenceDiagram {
!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)
Expand Down Expand Up @@ -324,55 +323,64 @@ $calcDescr
' alias ignored
' $breakLabel() not required by participant

!unquoted procedure Boundary($alias, $label, $type="", $tags="", $link="")
!unquoted procedure Boundary($alias, $label, $type="", $tags="", $link="", $descr = "")
!$boundaryTags = $addBoundaryPostfix($tags)
' nodes $type reuses $techn definition of $boundaryTags
' boundary $type reuses $techn definition of $boundaryTags
!$type=$toElementArg($type, $boundaryTags, "ElementTagTechn", "boundary")
!$sprite=$toElementArg("", $boundaryTags, "ElementTagSprite", "boundary")
!$labelSprite=""
!if ($sprite != "")
' add sprite in label line that it is more compact
!$labelSprite = $getSprite($smallVersionSprite($sprite, $BOUNDARY_IMAGE_SIZE_FACTOR)) + ' '
!endif
!if ($link != "")
!$usedNewLine = ']]\n== [[' + $link + ' '
!$labelType = '== [[' + $link + ' ' + $breakText($label, $usedNewLine) + ']]'
!$labelType = '== [[' + $link + ' ' + $labelSprite + $breakText($label, $usedNewLine) + ']]'
!else
!$usedNewLine = '\n== '
!$labelType = $breakText($label, $usedNewLine)
!$labelType = $labelSprite + $breakText($label, $usedNewLine)
!endif
!if (type != "")
!$labelType = $labelType + '\n<size:' + $TECHN_FONT_SIZE + '>[' + $type + ']</size>'
!endif
!if ($display_element_description == %true() && $descr != "")
!$labelType = $labelType + '\n\n' + $breakDescr($descr, $BOUNDARY_DESCR_MAX_CHAR_WIDTH)
!endif
box "$labelType" $toStereos("boundary", $boundaryTags)
!endprocedure

!procedure Boundary_End()
end box
!endprocedure

!unquoted procedure Enterprise_Boundary($alias, $label, $tags="", $link="")
!unquoted procedure Enterprise_Boundary($alias, $label, $tags="", $link="", $descr = "")
!if ($tags != "")
!$allTags = $tags + '+enterprise'
!else
!$allTags = 'enterprise'
!endif
' $type defined via $tag style
Boundary($alias, $label, "", $allTags, $link)
Boundary($alias, $label, "", $allTags, $link, $descr)
!endprocedure

!unquoted procedure System_Boundary($alias, $label, $tags="", $link="")
!unquoted procedure System_Boundary($alias, $label, $tags="", $link="", $descr = "")
!if ($tags != "")
!$allTags = $tags + '+system'
!else
!$allTags = 'system'
!endif
' $type defined via $tag style
Boundary($alias, $label, "", $allTags, $link)
Boundary($alias, $label, "", $allTags, $link, $descr)
!endprocedure

!unquoted procedure Container_Boundary($alias, $label, $tags="", $link="")
!unquoted procedure Container_Boundary($alias, $label, $tags="", $link="", $descr = "")
!if ($tags != "")
!$allTags = $tags + '+container'
!else
!$allTags = 'container'
!endif
' $type defined via $tag style
Boundary($alias, $label, "", $allTags, $link)
Boundary($alias, $label, "", $allTags, $link, $descr)
!endprocedure

' Relationship (redefinition)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ba2da7f

Please sign in to comment.