Skip to content

Commit de69a18

Browse files
committed
full view: onlineresource linkage with multilingual support & use url when no name
1 parent f30b4b8 commit de69a18

File tree

3 files changed

+177
-6
lines changed

3 files changed

+177
-6
lines changed

schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/formatter/xsl-view/view.xsl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -860,17 +860,21 @@
860860
</xsl:variable>
861861

862862
<xsl:choose>
863-
<xsl:when test="string(*/cit:linkage/*)">
864-
<a href="{*/cit:linkage/*}" target="_blank">
863+
<xsl:when test="string(*/cit:linkage/gco:CharacterString)">
864+
<xsl:variable name="url">
865+
<xsl:apply-templates mode="render-value" select="*/cit:linkage"/>
866+
</xsl:variable>
867+
<a href="{$url}" target="_blank">
865868
<xsl:apply-templates mode="render-value"
866-
select="if (*/cit:name != '') then */cit:name else */cit:linkage"/>
869+
select="if (normalize-space(*/cit:name) != '') then */cit:name else */cit:linkage"/>
867870
</a>
868871
</xsl:when>
869-
<xsl:otherwise>
872+
<xsl:when test="normalize-space(*/cit:name) != ''">
870873
<span>
871-
<xsl:value-of select="if (*/cit:name != '') then */cit:name else */cit:linkage"/>
874+
<xsl:apply-templates mode="render-value" select="*/cit:name"/>
872875
</span>
873-
</xsl:otherwise>
876+
</xsl:when>
877+
<xsl:otherwise/>
874878
</xsl:choose>
875879
<p>
876880
<xsl:value-of select="normalize-space($linkDescription)"/>

schemas/iso19115-3.2018/src/test/resources/UpperRhineCastles-ISO19115-3-full-view-form.xml

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2502,6 +2502,11 @@
25022502
<cit:CI_OnlineResource>
25032503
<cit:linkage xsi:type="lan:PT_FreeText_PropertyType">
25042504
<gco:CharacterString>http://www.georhena.eu</gco:CharacterString>
2505+
<lan:PT_FreeText>
2506+
<lan:textGroup>
2507+
<lan:LocalisedCharacterString locale="#FR">http://www.georhena.eu</lan:LocalisedCharacterString>
2508+
</lan:textGroup>
2509+
</lan:PT_FreeText>
25052510
</cit:linkage>
25062511
<cit:protocol>
25072512
<gco:CharacterString>text/html</gco:CharacterString>
@@ -2573,6 +2578,11 @@
25732578
<cit:CI_OnlineResource>
25742579
<cit:linkage xsi:type="lan:PT_FreeText_PropertyType">
25752580
<gco:CharacterString>http://localhost:8080/geonetwork/srv/api/records/f74f5451-b198-4edf-abdd-a6b6b7caed81</gco:CharacterString>
2581+
<lan:PT_FreeText>
2582+
<lan:textGroup>
2583+
<lan:LocalisedCharacterString locale="#FR">http://localhost:8080/geonetwork/srv/api/records/f74f5451-b198-4edf-abdd-a6b6b7caed81</lan:LocalisedCharacterString>
2584+
</lan:textGroup>
2585+
</lan:PT_FreeText>
25762586
</cit:linkage>
25772587
<cit:function>
25782588
<cit:CI_OnLineFunctionCode codeList="http://standards.iso.org/iso/19115/resources/Codelists/cat/codelists.xml#CI_OnLineFunctionCode" codeListValue="completeMetadata" />
@@ -2627,6 +2637,100 @@
26272637
</cit:dateType>
26282638
</cit:CI_Date>
26292639
</cit:date>
2640+
<cit:onlineResource>
2641+
<cit:CI_OnlineResource>
2642+
<cit:linkage xsi:type="lan:PT_FreeText_PropertyType">
2643+
<gco:CharacterString>www.link_alone_default.de</gco:CharacterString>
2644+
<lan:PT_FreeText>
2645+
<lan:textGroup>
2646+
<lan:LocalisedCharacterString locale="#DE">www.link_alone.de</lan:LocalisedCharacterString>
2647+
</lan:textGroup>
2648+
<lan:textGroup>
2649+
<lan:LocalisedCharacterString locale="#FR">www.link_alone.fr</lan:LocalisedCharacterString>
2650+
</lan:textGroup>
2651+
<lan:textGroup>
2652+
<lan:LocalisedCharacterString locale="#EN">www.link_alone.en</lan:LocalisedCharacterString>
2653+
</lan:textGroup>
2654+
</lan:PT_FreeText>
2655+
</cit:linkage>
2656+
<cit:protocol gco:nilReason="missing">
2657+
<gco:CharacterString/>
2658+
</cit:protocol>
2659+
<cit:name gco:nilReason="missing" xsi:type="lan:PT_FreeText_PropertyType">
2660+
<gco:CharacterString/>
2661+
</cit:name>
2662+
<cit:description gco:nilReason="missing" xsi:type="lan:PT_FreeText_PropertyType">
2663+
<gco:CharacterString/>
2664+
</cit:description>
2665+
<cit:function>
2666+
<cit:CI_OnLineFunctionCode codeList="http://standards.iso.org/iso/19115/resources/Codelists/cat/codelists.xml#CI_OnLineFunctionCode" codeListValue=""/>
2667+
</cit:function>
2668+
</cit:CI_OnlineResource>
2669+
</cit:onlineResource>
2670+
<cit:onlineResource>
2671+
<cit:CI_OnlineResource>
2672+
<cit:linkage xsi:type="lan:PT_FreeText_PropertyType">
2673+
<gco:CharacterString>www.name_and_link_default.de</gco:CharacterString>
2674+
<lan:PT_FreeText>
2675+
<lan:textGroup>
2676+
<lan:LocalisedCharacterString locale="#DE">www.name_and_link.de</lan:LocalisedCharacterString>
2677+
</lan:textGroup>
2678+
<lan:textGroup>
2679+
<lan:LocalisedCharacterString locale="#FR">www.name_and_link.fr</lan:LocalisedCharacterString>
2680+
</lan:textGroup>
2681+
<lan:textGroup>
2682+
<lan:LocalisedCharacterString locale="#EN">www.name_and_link.en</lan:LocalisedCharacterString>
2683+
</lan:textGroup>
2684+
</lan:PT_FreeText>
2685+
</cit:linkage>
2686+
<cit:protocol gco:nilReason="missing">
2687+
<gco:CharacterString/>
2688+
</cit:protocol>
2689+
<cit:name xsi:type="lan:PT_FreeText_PropertyType">
2690+
<gco:CharacterString>name_and_link</gco:CharacterString>
2691+
</cit:name>
2692+
<cit:description gco:nilReason="missing" xsi:type="lan:PT_FreeText_PropertyType">
2693+
<gco:CharacterString/>
2694+
</cit:description>
2695+
<cit:function>
2696+
<cit:CI_OnLineFunctionCode codeList="http://standards.iso.org/iso/19115/resources/Codelists/cat/codelists.xml#CI_OnLineFunctionCode" codeListValue=""/>
2697+
</cit:function>
2698+
</cit:CI_OnlineResource>
2699+
</cit:onlineResource>
2700+
<cit:onlineResource>
2701+
<cit:CI_OnlineResource>
2702+
<cit:linkage xsi:type="lan:PT_FreeText_PropertyType"/>
2703+
<cit:protocol gco:nilReason="missing">
2704+
<gco:CharacterString/>
2705+
</cit:protocol>
2706+
<cit:name xsi:type="lan:PT_FreeText_PropertyType">
2707+
<gco:CharacterString>name_no_linkage</gco:CharacterString>
2708+
</cit:name>
2709+
<cit:description gco:nilReason="missing" xsi:type="lan:PT_FreeText_PropertyType">
2710+
<gco:CharacterString/>
2711+
</cit:description>
2712+
<cit:function>
2713+
<cit:CI_OnLineFunctionCode codeList="http://standards.iso.org/iso/19115/resources/Codelists/cat/codelists.xml#CI_OnLineFunctionCode" codeListValue=""/>
2714+
</cit:function>
2715+
</cit:CI_OnlineResource>
2716+
</cit:onlineResource>
2717+
<cit:onlineResource>
2718+
<cit:CI_OnlineResource>
2719+
<cit:linkage/>
2720+
<cit:protocol gco:nilReason="missing">
2721+
<gco:CharacterString/>
2722+
</cit:protocol>
2723+
<cit:name gco:nilReason="missing" xsi:type="lan:PT_FreeText_PropertyType">
2724+
<gco:CharacterString/>
2725+
</cit:name>
2726+
<cit:description gco:nilReason="missing" xsi:type="lan:PT_FreeText_PropertyType">
2727+
<gco:CharacterString/>
2728+
</cit:description>
2729+
<cit:function>
2730+
<cit:CI_OnLineFunctionCode codeList="http://standards.iso.org/iso/19115/resources/Codelists/cat/codelists.xml#CI_OnLineFunctionCode" codeListValue=""/>
2731+
</cit:function>
2732+
</cit:CI_OnlineResource>
2733+
</cit:onlineResource>
26302734
</cit:CI_Citation>
26312735
</mri:citation>
26322736
<mri:abstract xsi:type="lan:PT_FreeText_PropertyType">
@@ -2730,6 +2834,11 @@
27302834
<cit:CI_OnlineResource>
27312835
<cit:linkage xsi:type="lan:PT_FreeText_PropertyType">
27322836
<gco:CharacterString>https://www.georhena.eu/</gco:CharacterString>
2837+
<lan:PT_FreeText>
2838+
<lan:textGroup>
2839+
<lan:LocalisedCharacterString locale="#FR">https://www.georhena.eu/</lan:LocalisedCharacterString>
2840+
</lan:textGroup>
2841+
</lan:PT_FreeText>
27332842
</cit:linkage>
27342843
<cit:protocol>
27352844
<gco:CharacterString>WWW:LINK-1.0-http--link</gco:CharacterString>
@@ -2800,6 +2909,11 @@
28002909
<cit:CI_OnlineResource>
28012910
<cit:linkage xsi:type="lan:PT_FreeText_PropertyType">
28022911
<gco:CharacterString>https://www.alsace.eu</gco:CharacterString>
2912+
<lan:PT_FreeText>
2913+
<lan:textGroup>
2914+
<lan:LocalisedCharacterString locale="#FR">https://www.alsace.eu</lan:LocalisedCharacterString>
2915+
</lan:textGroup>
2916+
</lan:PT_FreeText>
28032917
</cit:linkage>
28042918
<cit:protocol>
28052919
<gco:CharacterString>WWW:LINK-1.0-http--link</gco:CharacterString>
@@ -3139,6 +3253,11 @@
31393253
<cit:CI_OnlineResource>
31403254
<cit:linkage xsi:type="lan:PT_FreeText_PropertyType">
31413255
<gco:CharacterString>https://geoportal.georhena.eu/geoserver/society/ows</gco:CharacterString>
3256+
<lan:PT_FreeText>
3257+
<lan:textGroup>
3258+
<lan:LocalisedCharacterString locale="#FR">https://geoportal.georhena.eu/geoserver/society/ows</lan:LocalisedCharacterString>
3259+
</lan:textGroup>
3260+
</lan:PT_FreeText>
31423261
</cit:linkage>
31433262
<cit:protocol>
31443263
<gco:CharacterString>OGC:WMS</gco:CharacterString>
@@ -3177,6 +3296,11 @@
31773296
<cit:CI_OnlineResource>
31783297
<cit:linkage xsi:type="lan:PT_FreeText_PropertyType">
31793298
<gco:CharacterString>https://geoportal.georhena.eu/geoserver/society/ows</gco:CharacterString>
3299+
<lan:PT_FreeText>
3300+
<lan:textGroup>
3301+
<lan:LocalisedCharacterString locale="#FR">https://geoportal.georhena.eu/geoserver/society/ows</lan:LocalisedCharacterString>
3302+
</lan:textGroup>
3303+
</lan:PT_FreeText>
31803304
</cit:linkage>
31813305
<cit:protocol>
31823306
<gco:CharacterString>OGC:WFS</gco:CharacterString>
@@ -3215,6 +3339,11 @@
32153339
<cit:CI_OnlineResource>
32163340
<cit:linkage xsi:type="lan:PT_FreeText_PropertyType">
32173341
<gco:CharacterString>https://geoportal.georhena.eu/geoserver/society/ows?request=GetFeature&amp;service=WFS&amp;typeName=chateaux_rhenans&amp;version=1.0.0&amp;outputFormat=SHAPE-ZIP</gco:CharacterString>
3342+
<lan:PT_FreeText>
3343+
<lan:textGroup>
3344+
<lan:LocalisedCharacterString locale="#FR">https://geoportal.georhena.eu/geoserver/society/ows?request=GetFeature&amp;service=WFS&amp;typeName=chateaux_rhenans&amp;version=1.0.0&amp;outputFormat=SHAPE-ZIP</lan:LocalisedCharacterString>
3345+
</lan:textGroup>
3346+
</lan:PT_FreeText>
32183347
</cit:linkage>
32193348
<cit:protocol>
32203349
<gco:CharacterString>WWW:DOWNLOAD-1.0-ftp--download</gco:CharacterString>
@@ -3239,6 +3368,11 @@
32393368
<cit:CI_OnlineResource>
32403369
<cit:linkage xsi:type="lan:PT_FreeText_PropertyType">
32413370
<gco:CharacterString>www.chateaux-rhenans.eu</gco:CharacterString>
3371+
<lan:PT_FreeText>
3372+
<lan:textGroup>
3373+
<lan:LocalisedCharacterString locale="#FR">www.chateaux-rhenans.eu</lan:LocalisedCharacterString>
3374+
</lan:textGroup>
3375+
</lan:PT_FreeText>
32423376
</cit:linkage>
32433377
<cit:protocol>
32443378
<gco:CharacterString>WWW:LINK-1.0-http--link</gco:CharacterString>

schemas/iso19115-3.2018/src/test/resources/UpperRhineCastles-ISO19115-3-full-view.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,39 @@ <h2>cit:CI_Citation</h2>
252252
<span data-gn-humanize-time="2024-07-15">2024-07-15</span>
253253
</dd>
254254
</dl>
255+
<dl class="gn-link">
256+
<dt>cit:onlineResource</dt>
257+
<dd>
258+
<a href="www.link_alone.fr" target="_blank">
259+
<p xmlns:xs="http://www.w3.org/2001/XMLSchema">www.link_alone.fr</p>
260+
</a>
261+
<p />
262+
</dd>
263+
</dl>
264+
<dl class="gn-link">
265+
<dt>cit:onlineResource</dt>
266+
<dd>
267+
<a href="www.name_and_link.fr" target="_blank">
268+
<p xmlns:xs="http://www.w3.org/2001/XMLSchema">name_and_link</p>
269+
</a>
270+
<p />
271+
</dd>
272+
</dl>
273+
<dl class="gn-link">
274+
<dt>cit:onlineResource</dt>
275+
<dd>
276+
<span>
277+
<p xmlns:xs="http://www.w3.org/2001/XMLSchema">name_no_linkage</p>
278+
</span>
279+
<p />
280+
</dd>
281+
</dl>
282+
<dl class="gn-link">
283+
<dt>cit:onlineResource</dt>
284+
<dd>
285+
<p />
286+
</dd>
287+
</dl>
255288
</div>
256289
</div>
257290
<dl class="gn-status">

0 commit comments

Comments
 (0)