Skip to content

Commit

Permalink
Geonovum: Tonen van metadata van enumeraties en codelijsten
Browse files Browse the repository at this point in the history
Zie #545

Improvement.
  • Loading branch information
arjan authored and arjan committed Dec 4, 2024
1 parent 7859ce2 commit 652bd8a
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@
<diagram-zoomer>default</diagram-zoomer>
<image-zoomer>default</image-zoomer>

<!--
Moeten codelijsten en enumeraties worden weergegeven als referentielijsten (met hun metadata) of als overzichtje? cf #545
-->
<show-lists-with-metadata>yes</show-lists-with-metadata>

</doc-rules>
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
-->
<diagram-encoding>figure</diagram-encoding>

<!--
Moeten codelijsten en enumeraties worden weergegeven als referentielijsten (met hun metadata) of als overzichtje? cf #545
-->
<show-lists-with-metadata>yes</show-lists-with-metadata>

<doc-rule id="CFG-DOC-ACTUALITEIT" order="300">
<name lang="nl">Actualiteit</name>
<levels>
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/input/MIM/cfg/docrules/MIM11.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@
-->
<identifying-attribute-with-context>no</identifying-attribute-with-context>

<!--
Moeten codelijsten en enumeraties worden weergegeven als referentielijsten (met hun metadata) of als overzichtje? cf #545
-->
<show-lists-with-metadata>no</show-lists-with-metadata>

<image-purpose id="CFG-IMG-OVERVIEW">
<name lang="nl">Overzichtsdiagram</name>
<name lang="en">Overview diagram</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@
<xsl:apply-templates select="($doc-rules//image-zoomer)[last()]" mode="#current"/>
<xsl:apply-templates select="($doc-rules//identifying-attribute-with-context)[last()]" mode="#current"/>
<xsl:apply-templates select="($doc-rules//gegevensgroep-attribute-container)[last()]" mode="#current"/>
<xsl:apply-templates select="($doc-rules//show-lists-with-metadata)[last()]" mode="#current"/>

<xsl:for-each-group select="$doc-rules//doc-rule[name/@lang=($language,'#all')]" group-by="@id">
<xsl:sort select="@order" order="ascending"/>
Expand Down
73 changes: 59 additions & 14 deletions src/main/resources/xsl/OfficeCompiler/Imvert2modeldoc.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<xsl:variable name="lists-to-listing" select="imf:boolean($configuration-docrules-file/lists-to-listing)"/>
<xsl:variable name="reveal-composition-name" select="imf:boolean($configuration-docrules-file/reveal-composition-name)"/>
<xsl:variable name="show-properties" select="($configuration-docrules-file/show-properties,'config')[1]"/>
<xsl:variable name="show-lists-with-metadata" select="imf:boolean(($configuration-docrules-file/show-lists-with-metadata,'no')[1])"/>

<xsl:variable name="has-material-history" select="exists(//imvert:tagged-value[@id = ('CFG-TV-INDICATIONMATERIALHISTORY','CFG-TV-HEEFTTIJDLIJNGELDIGHEID')]/imvert:value[imf:boolean(.)])" as="xs:boolean"/>
<xsl:variable name="has-formal-history" select="exists(//imvert:tagged-value[@id = ('CFG-TV-INDICATIONFORMALHISTORY','CFG-TV-HEEFTTIJDLIJNREGISTRATIE')]/imvert:value[imf:boolean(.)])" as="xs:boolean"/>
Expand Down Expand Up @@ -159,16 +160,28 @@
<section type="OVERVIEW-PRIMITIVEDATATYPE" include="{$include-overview-sections-by-type}">
<xsl:apply-templates select="imvert:class[imvert:stereotype/@id = ('stereotype-name-simpletype')]"/>
</section>
<section type="OVERVIEW-CODELIST" include="{$include-overview-sections-by-type}">
<content>
<xsl:apply-templates select="imvert:class[imvert:stereotype/@id = ('stereotype-name-codelist')]"/>
</content>
</section>
<section type="OVERVIEW-ENUMERATION" include="{$include-overview-sections-by-type}">
<content>
<xsl:apply-templates select="imvert:class[imvert:stereotype/@id = ('stereotype-name-enumeration')]"/>
</content>
</section>
<xsl:choose>
<xsl:when test="$show-lists-with-metadata">
<section type="OVERVIEW-CODELIST" include="{$include-overview-sections-by-type}">
<xsl:apply-templates select="imvert:class[imvert:stereotype/@id = ('stereotype-name-codelist')]"/>
</section>
<section type="OVERVIEW-ENUMERATION" include="{$include-overview-sections-by-type}">
<xsl:apply-templates select="imvert:class[imvert:stereotype/@id = ('stereotype-name-enumeration')]"/>
</section>
</xsl:when>
<xsl:otherwise>
<section type="OVERVIEW-CODELIST" include="{$include-overview-sections-by-type}">
<content>
<xsl:apply-templates select="imvert:class[imvert:stereotype/@id = ('stereotype-name-codelist')]" mode="listoverview"/>
</content>
</section>
<section type="OVERVIEW-ENUMERATION" include="{$include-overview-sections-by-type}">
<content>
<xsl:apply-templates select="imvert:class[imvert:stereotype/@id = ('stereotype-name-enumeration')]" mode="listoverview"/>
</content>
</section>
</xsl:otherwise>
</xsl:choose>
</section>
<section type="DETAILS" include="{$include-detail-section-level}">
<section type="DETAILS-OBJECTTYPE" include="{$include-detail-sections-by-type}">
Expand Down Expand Up @@ -306,7 +319,7 @@
</section>
</xsl:template>

<xsl:template match="imvert:class[imvert:stereotype/@id = ('stereotype-name-enumeration','stereotype-name-codelist')]">
<xsl:template match="imvert:class[imvert:stereotype/@id = ('stereotype-name-enumeration','stereotype-name-codelist')]" mode="listoverview">
<xsl:variable name="naam" select="imf:get-name(.,true())"/>
<part>
<xsl:sequence select="imf:calculate-node-position(.)"/>
Expand All @@ -318,8 +331,38 @@
<xsl:apply-templates select="." mode="type-relations"/>
<xsl:sequence select="imf:create-element('item',imf:get-formatted-tagged-value(.,'CFG-TV-DEFINITION'))"/>
</part>
</xsl:template>

</xsl:template>

<xsl:template match="imvert:class[imvert:stereotype/@id = ('stereotype-name-codelist')]">
<section name="{imf:get-name(.,true())}" type="CODELIST" id="{imf:plugin-get-link-name(.,'global')}" uuid="{imvert:id}">
<xsl:sequence select="imf:calculate-node-position(.)"/>
<xsl:sequence select="imf:create-section-for-diagrams(.)"/>
<content>
<xsl:sequence select="imf:create-parts-cfg(.,'DISPLAY-GLOBAL-CODELIST')"/>
</content>
<!-- hier alle type relaties -->
<xsl:apply-templates select="." mode="type-relations"/>
<!-- hier alle constraints; als ingebedde tabel -->
<xsl:apply-templates select="imvert:constraints" mode="short"/>
<xsl:sequence select="imf:create-toelichting(imf:get-formatted-tagged-value(.,'CFG-TV-DESCRIPTION'))"/>
</section>
</xsl:template>

<xsl:template match="imvert:class[imvert:stereotype/@id = ('stereotype-name-enumeration')]">
<section name="{imf:get-name(.,true())}" type="ENUMERATION" id="{imf:plugin-get-link-name(.,'global')}" uuid="{imvert:id}">
<xsl:sequence select="imf:calculate-node-position(.)"/>
<xsl:sequence select="imf:create-section-for-diagrams(.)"/>
<content>
<xsl:sequence select="imf:create-parts-cfg(.,'DISPLAY-GLOBAL-ENUMERATION')"/>
</content>
<!-- hier alle type relaties -->
<xsl:apply-templates select="." mode="type-relations"/>
<!-- hier alle constraints; als ingebedde tabel -->
<xsl:apply-templates select="imvert:constraints" mode="short"/>
<xsl:sequence select="imf:create-toelichting(imf:get-formatted-tagged-value(.,'CFG-TV-DESCRIPTION'))"/>
</section>
</xsl:template>

<!-- uitzondering: gegevensgroeptype wordt apart getoond. -->
<xsl:template match="imvert:class[imvert:stereotype/@id = ('stereotype-name-composite')]">
<section name="{imf:get-name(.,true())}" type="COMPOSITE" id="{imf:plugin-get-link-name(.,'global')}" uuid="{imvert:id}">
Expand Down Expand Up @@ -455,7 +498,9 @@

<xsl:template match="imvert:attribute" mode="short">
<xsl:variable name="type" select="imf:get-construct-by-id-for-office(imvert:type-id)"/>
<xsl:variable name="global-or-detail" select="if ($type/imvert:stereotype/@id = ('stereotype-name-enumeration','stereotype-name-codelist')) then 'detail' else 'global'"/><!-- https://github.com/Imvertor/Imvertor-Maven/issues/428 -->
<xsl:variable name="global-or-detail" select="
if ($show-lists-with-metadata) then 'global' else
if ($type/imvert:stereotype/@id = ('stereotype-name-enumeration','stereotype-name-codelist')) then 'detail' else 'global'"/><!-- #428, #545 -->
<part>
<xsl:sequence select="imf:calculate-node-position(.)"/>
<xsl:sequence select="imf:create-element('item',imf:create-link(.,'detail',imf:get-name(.,true())))"/>
Expand Down

0 comments on commit 652bd8a

Please sign in to comment.