Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tviegut committed Oct 24, 2024
1 parent 8f73a13 commit 552fe9c
Show file tree
Hide file tree
Showing 6 changed files with 1,265 additions and 334 deletions.
24 changes: 18 additions & 6 deletions CIMToolPlugin/builders/builders.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,28 @@
"datetime": "2024-09-20T00:00:00Z",
"ext": "rdfs-501ed2-beta.rdfs"
},
"puml-t2b": {
"puml-rdfs-t2b": {
"type": "TEXT",
"style": "puml-t2b",
"style": "puml-rdfs-t2b",
"datetime": "2024-09-30T00:00:00Z",
"ext": "t2b.puml"
"ext": "rdfs-t2b.puml"
},
"puml-l2r": {
"puml-rdfs-l2r": {
"type": "TEXT",
"style": "puml-l2r",
"style": "puml-rdfs-l2r",
"datetime": "2024-09-30T00:00:00Z",
"ext": "l2r.puml"
"ext": "rdfs-l2r.puml"
},
"puml-xsd-t2b": {
"type": "TEXT",
"style": "puml-xsd-t2b",
"datetime": "2024-10-23T00:00:00Z",
"ext": "xsd-t2b.puml"
},
"puml-xsd-l2r": {
"type": "TEXT",
"style": "puml-xsd-l2r",
"datetime": "2024-10-23T00:00:00Z",
"ext": "xsd-l2r.puml"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
<list begin="{concat('skinparam class ', '&#123;')}" indent=" " delim="" end="{'&#125;'}">
<xsl:choose>
<xsl:when test="$enableDarkMode">
<item>StereotypeFontColor #FFFFFF</item>
<!-- Concrete classes <<concrete-style>> definition -->
<item>' Concrete classes style definition</item>
<item>BackgroundColor<xsl:value-of select="'&lt;&lt;concrete-style&gt;&gt; '"/> #3e3e3e</item>
Expand Down Expand Up @@ -198,7 +197,7 @@
<item>Font Bold</item>
</list>
<item>' Add a note towards the upper left corner of the diagram</item>
<list begin="note as InfoNote #lightyellow" indent=" " delim="" end="end note">
<list begin="note as {$envelope} #lightyellow" indent=" " delim="" end="end note">
<item>Profile: <xsl:value-of select="$envelope"/></item>
<item>Namespace: <xsl:value-of select="$baseURI"/></item>
<xsl:if test="$copyright-single-line and $copyright-single-line != ''">
Expand Down Expand Up @@ -272,7 +271,7 @@
</xsl:template>

<xsl:template match="a:CompoundType">
<xsl:if test="not(hideCompounds) and not(@hideInDiagrams = 'true')">
<xsl:if test="not($hideCompounds) and not(@hideInDiagrams = 'true')">
<xsl:variable name="className" select="substring-after(@baseClass, '#')"/>
<xsl:variable name="stereotypes"><xsl:call-template name="stereotypes"/></xsl:variable>
<xsl:variable name="colorStyle" select="'&lt;&lt;compound-style&gt;&gt;'"/>
Expand Down Expand Up @@ -398,7 +397,7 @@
</xsl:variable>
<xsl:variable name="targetCardinality">
<xsl:choose>
<xsl:when test="not(@minCOccurs = '') and not(@maxOccurs = '')"><xsl:call-template name="association-cardinality"/></xsl:when>
<xsl:when test="not(@minOccurs = '') and not(@maxOccurs = '')"><xsl:call-template name="association-cardinality"/></xsl:when>
<xsl:otherwise><xsl:text></xsl:text></xsl:otherwise>
</xsl:choose>
</xsl:variable>
Expand All @@ -425,11 +424,20 @@
<!-- If none of the below four types of elements is defined as a top level class for $targetClass then it means that the class has
not yet been pulled into the profile and therefore should be flagged as an error (i.e. expressed as class in pink) -->
<xsl:if test="not(//a:ComplexType[@name = $targetClass]|//a:Root[@name = $targetClass]|//a:CompoundType[@name = $targetClass]|//a:EnumeratedType[@name = $targetClass]|//a:PrimitiveType[@name = $targetClass])">
<xsl:variable name="stereotype">
<xsl:choose>
<xsl:when test="a:Stereotype[contains(., '#enumeration')]"><xsl:value-of select="'&lt;&lt;enumeration&gt;&gt;'"/></xsl:when>
<xsl:when test="a:Stereotype[contains(., '#cimdatatype')]"><xsl:value-of select="'&lt;&lt;cimdatatype&gt;&gt;'"/></xsl:when>
<xsl:when test="a:Stereotype[contains(., '#compound')]"><xsl:value-of select="'&lt;&lt;compound&gt;&gt;'"/></xsl:when>
<xsl:when test="a:Stereotype[contains(., '#primitive')]"><xsl:value-of select="'&lt;&lt;primitive&gt;&gt;'"/></xsl:when>
<xsl:otherwise><xsl:text></xsl:text></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<item>&#xD;&#xA;</item> <!-- CR/LF -->
<list begin="" indent="" delim="" end="">
<item>' This abstract indicates an "orphan" reference on an invalid Reference/Instance that must be fixed in the profile</item>
<item>' We highlight it by generating a color indicating it is invalid and that the user should add in the orphaned type</item>
<list begin="{concat('abstract class ', $targetClass, ' &lt;&lt;error-style&gt;&gt; ', (if (a:Stereotype[contains(., '#enumeration')]) then '&lt;&lt;enumeration&gt;&gt; &lt;&lt;error-style&gt;&gt; ' else ''), $stereotypes, ' &#123;')}" indent=" " delim="" end="{concat('&#125;', '&#xD;', '&#xA;')}">
<list begin="{concat('abstract class ', $targetClass, ' &lt;&lt;error-style&gt;&gt; ', (if (not($stereotype = null)) then $stereotype else ''), $stereotypes, ' &#123;')}" indent=" " delim="" end="{concat('&#125;', '&#xD;', '&#xA;')}">
<item>' nothing to generate</item>
</list>
</list>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
<list begin="{concat('skinparam class ', '&#123;')}" indent=" " delim="" end="{'&#125;'}">
<xsl:choose>
<xsl:when test="$enableDarkMode">
<item>StereotypeFontColor #FFFFFF</item>
<!-- Concrete classes <<concrete-style>> definition -->
<item>' Concrete classes style definition</item>
<item>BackgroundColor<xsl:value-of select="'&lt;&lt;concrete-style&gt;&gt; '"/> #3e3e3e</item>
Expand Down Expand Up @@ -198,7 +197,7 @@
<item>Font Bold</item>
</list>
<item>' Add a note towards the upper left corner of the diagram</item>
<list begin="note as InfoNote #lightyellow" indent=" " delim="" end="end note">
<list begin="note as {$envelope} #lightyellow" indent=" " delim="" end="end note">
<item>Profile: <xsl:value-of select="$envelope"/></item>
<item>Namespace: <xsl:value-of select="$baseURI"/></item>
<xsl:if test="$copyright-single-line and $copyright-single-line != ''">
Expand Down Expand Up @@ -272,7 +271,7 @@
</xsl:template>

<xsl:template match="a:CompoundType">
<xsl:if test="not(hideCompounds) and not(@hideInDiagrams = 'true')">
<xsl:if test="not($hideCompounds) and not(@hideInDiagrams = 'true')">
<xsl:variable name="className" select="substring-after(@baseClass, '#')"/>
<xsl:variable name="stereotypes"><xsl:call-template name="stereotypes"/></xsl:variable>
<xsl:variable name="colorStyle" select="'&lt;&lt;compound-style&gt;&gt;'"/>
Expand Down Expand Up @@ -398,7 +397,7 @@
</xsl:variable>
<xsl:variable name="targetCardinality">
<xsl:choose>
<xsl:when test="not(@minCOccurs = '') and not(@maxOccurs = '')"><xsl:call-template name="association-cardinality"/></xsl:when>
<xsl:when test="not(@minOccurs = '') and not(@maxOccurs = '')"><xsl:call-template name="association-cardinality"/></xsl:when>
<xsl:otherwise><xsl:text></xsl:text></xsl:otherwise>
</xsl:choose>
</xsl:variable>
Expand All @@ -425,11 +424,20 @@
<!-- If none of the below four types of elements is defined as a top level class for $targetClass then it means that the class has
not yet been pulled into the profile and therefore should be flagged as an error (i.e. expressed as class in pink) -->
<xsl:if test="not(//a:ComplexType[@name = $targetClass]|//a:Root[@name = $targetClass]|//a:CompoundType[@name = $targetClass]|//a:EnumeratedType[@name = $targetClass]|//a:PrimitiveType[@name = $targetClass])">
<xsl:variable name="stereotype">
<xsl:choose>
<xsl:when test="a:Stereotype[contains(., '#enumeration')]"><xsl:value-of select="'&lt;&lt;enumeration&gt;&gt;'"/></xsl:when>
<xsl:when test="a:Stereotype[contains(., '#cimdatatype')]"><xsl:value-of select="'&lt;&lt;cimdatatype&gt;&gt;'"/></xsl:when>
<xsl:when test="a:Stereotype[contains(., '#compound')]"><xsl:value-of select="'&lt;&lt;compound&gt;&gt;'"/></xsl:when>
<xsl:when test="a:Stereotype[contains(., '#primitive')]"><xsl:value-of select="'&lt;&lt;primitive&gt;&gt;'"/></xsl:when>
<xsl:otherwise><xsl:text></xsl:text></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<item>&#xD;&#xA;</item> <!-- CR/LF -->
<list begin="" indent="" delim="" end="">
<item>' This abstract indicates an "orphan" reference on an invalid Reference/Instance that must be fixed in the profile</item>
<item>' We highlight it by generating a color indicating it is invalid and that the user should add in the orphaned type</item>
<list begin="{concat('abstract class ', $targetClass, ' &lt;&lt;error-style&gt;&gt; ', (if (a:Stereotype[contains(., '#enumeration')]) then '&lt;&lt;enumeration&gt;&gt; &lt;&lt;error-style&gt;&gt; ' else ''), $stereotypes, ' &#123;')}" indent=" " delim="" end="{concat('&#125;', '&#xD;', '&#xA;')}">
<list begin="{concat('abstract class ', $targetClass, ' &lt;&lt;error-style&gt;&gt; ', (if (not($stereotype = null)) then $stereotype else ''), $stereotypes, ' &#123;')}" indent=" " delim="" end="{concat('&#125;', '&#xD;', '&#xA;')}">
<item>' nothing to generate</item>
</list>
</list>
Expand Down
Loading

0 comments on commit 552fe9c

Please sign in to comment.