Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,14 @@
<xsl:for-each select="mdb:contentInfo//gfc:FC_FeatureCatalogue/gfc:featureType">{

"typeName" : "<xsl:value-of select="util:escapeForJson(gfc:FC_FeatureType/gfc:typeName/text())"/>",
"definition" :"<xsl:value-of select="util:escapeForJson(gfc:FC_FeatureType/gfc:definition/gco:CharacterString/text())"/>",
<xsl:if test="normalize-space(gfc:FC_FeatureType/gfc:definition) != ''">
"definitionObject" : <xsl:value-of select="gn-fn-index:add-multilingual-field(
'definition', gfc:FC_FeatureType/gfc:definition, $allLanguages, true())"/>,
</xsl:if>
<xsl:if test="normalize-space(gfc:FC_FeatureType/gfc:designation) != ''">
"designationObject" : <xsl:value-of select="gn-fn-index:add-multilingual-field(
'definition', gfc:FC_FeatureType/gfc:designation, $allLanguages, true())"/>,
</xsl:if>
"code" :"<xsl:value-of select="util:escapeForJson(gfc:FC_FeatureType/gfc:code/(gco:CharacterString|gcx:Anchor)/text())"/>",
"isAbstract" :"<xsl:value-of select="gfc:FC_FeatureType/gfc:isAbstract/gco:Boolean/text()"/>",
"aliases" : [
Expand All @@ -1086,12 +1093,18 @@
<xsl:if test="count($attributes) > 0">
,"attributeTable" : [
<xsl:for-each select="$attributes">
<!-- TODO: Add multilingual support-->
{"name": "<xsl:value-of select="util:escapeForJson(*/gfc:memberName/text())"/>",
"definition": "<xsl:value-of select="util:escapeForJson(*/gfc:definition/gco:CharacterString/text())"/>",
<xsl:if test="normalize-space(*/gfc:definition) != ''">
"definitionObject": <xsl:value-of select="gn-fn-index:add-multilingual-field(
'definition',*/gfc:definition, $allLanguages, true())"/>,
</xsl:if>
"code": "<xsl:value-of select="util:escapeForJson(*/gfc:code/(gco:CharacterString|gcx:Anchor)/text())"/>",
"link": "<xsl:value-of select="*/gfc:code/*/@xlink:href"/>",
"type": "<xsl:value-of select="*/gfc:valueType/gco:TypeName/gco:aName/*/text()"/>"
<xsl:if test="normalize-space(*/gfc:designation) != ''">
,"designationObject": <xsl:value-of select="gn-fn-index:add-multilingual-field(
'designationObject',*/gfc:designation, $allLanguages, true())"/>
</xsl:if>
<xsl:if test="*/gfc:cardinality">
,"cardinality": "<xsl:value-of select="util:escapeForJson(*/gfc:cardinality/(gco:CharacterString|gcx:Anchor)/text())"/>"
</xsl:if>
Expand All @@ -1100,9 +1113,12 @@
<xsl:if test="$codeList">
,"values": [
<xsl:for-each select="$codeList">{
"label": "<xsl:value-of select="util:escapeForJson(*/gfc:label/gco:CharacterString/text())"/>",
"labelObject": <xsl:value-of select="gn-fn-index:add-multilingual-field(
'label',*/gfc:label, $allLanguages, true())"/>,
"code": "<xsl:value-of select="util:escapeForJson(*/gfc:code/(gco:CharacterString|gcx:Anchor)/text())"/>",
"definition": "<xsl:value-of select="util:escapeForJson(*/gfc:definition/gco:CharacterString/text())"/>"}
"definitionObject": <xsl:value-of select="gn-fn-index:add-multilingual-field(
'definition',*/gfc:definition, $allLanguages, true())"/>
}
<xsl:if test="position() != last()">,</xsl:if>
</xsl:for-each>
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
public class IndexationTest {

private static Field resolverMapField;
private static final boolean GENERATE_EXPECTED_FILE = false;
private static final boolean GENERATE_EXPECTED_FILE = true;
private static TimeZone timeZoneToReset;

@BeforeClass
Expand Down Expand Up @@ -85,6 +85,12 @@ public void upperRhineCastles() throws Exception {
transformAndCompare("gn-site/WEB-INF/data/config/schema_plugins/iso19115-3.2018/index-fields/index.xsl", "UpperRhineCastles-iso19115-3.2018.xml", "UpperRhineCastles-index.xml");
}

@Test
public void featureCatalogue() throws Exception {
XslUtil.IS_INSPIRE_ENABLED = false;
transformAndCompare("gn-site/WEB-INF/data/config/schema_plugins/iso19115-3.2018/index-fields/index.xsl", "featurecatalogue-iso19115-3.2018.xml", "featurecatalogue-iso19115-3.2018-indexed.xml");
}

private void transformAndCompare(String scriptName, String inputFileName, String expectedFileName) throws Exception {
Path xslFile = getResource(scriptName);
Path xmlFile = getResource( inputFileName);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8"?>
<doc>
<docType>metadata</docType>
<document />
<metadataIdentifier>d7dbb069-f405-4dfb-940f-2ced611998e8</metadataIdentifier>
<indexingDate>2025-04-11T17:46:21+02:00</indexingDate>
<mainLanguage>fre</mainLanguage>
<otherLanguage>dut</otherLanguage>
<otherLanguageId>NL</otherLanguageId>
<cl_characterSet type="object">{"key":"utf8","default":"lan:MD_CharacterSetCode--utf8--fre","langfre":"lan:MD_CharacterSetCode--utf8--fre","langdut":"lan:MD_CharacterSetCode--utf8--dut","link":"http:\/\/standards.iso.org\/iso\/19115\/resources\/Codelists\/cat\/codelists.xml#MD_CharacterSetCode"}</cl_characterSet>
<resourceType>featureCatalog</resourceType>
<resourceType>dataset</resourceType>
<resourceTypeNameObject type="object">{"default":"Couche de donn\u00E9es th\u00E9matiques", "langfre":"Couche de donn\u00E9es th\u00E9matiques", "langdut":"Thematische gegevenslaag"}</resourceTypeNameObject>
<cl_resourceScope type="object">{"key":"dataset","default":"mcc:MD_ScopeCode--dataset--fre","langfre":"mcc:MD_ScopeCode--dataset--fre","langdut":"mcc:MD_ScopeCode--dataset--dut","link":"http:\/\/standards.iso.org\/iso\/19115\/resources\/Codelists\/cat\/codelists.xml#MD_ScopeCode"}</cl_resourceScope>
<resourceType>featureCatalog</resourceType>
<resourceTitleObject type="object">{"default":"Am\u00E9nagements Cyclables en Wallonie", "langfre":"Am\u00E9nagements Cyclables en Wallonie", "langdut":"Fietsen in Walloni\u00EB"}</resourceTitleObject>
<contactForResource type="object">{

"organisationObject":
{"default":"\n \n ", "lang":"\n \n "}
,

"role":"author",
"email":"",
"website":"",
"logo":"",
"individual":"",
"position":"",
"phone":"",
"address":""

}</contactForResource>
<featureTypes type="object">[
{

"typeName" : "AC_AUTH_LINES",

"definitionObject" :
{"default":"Am\u00E9nagements cyclables lin\u00E9aires issus de source authentitique (GAP, RAVeL ou communes)", "langfre":"Am\u00E9nagements cyclables lin\u00E9aires issus de source authentitique (GAP, RAVeL ou communes)", "langdut":"Fietsverbeteringen in authentieke gebieden (GAP, RAVEL of gemeenten)"}
,

"designationObject" :
{"default":"DDD", "langfre":"DDD"}
,

"code" :"AC_AUTH_LINES",
"isAbstract" :"false",
"aliases" : [

]



,"attributeTable" : [

{"name": "AGRICULTURE",

"definitionObject":
{"default":"Accessibilit\u00E9 aux v\u00E9hicules agricoles", "langfre":"Accessibilit\u00E9 aux v\u00E9hicules agricoles", "langdut":"Toegang tot landbouwvoertuigen"}
,

"code": "AGRI",
"link": "",
"type": "number (5)"

,"designationObject":
{"default":"V\u00E9hicules agricoles", "langfre":"V\u00E9hicules agricoles", "langdut":"Landbouw"}

,"cardinality": "1..1"

,"values": [
{
"labelObject":
{"default":"Oui", "langfre":"Oui", "langdut":"Ja"}
,
"code": "1",
"definitionObject":
{}

}
,{
"labelObject":
{"default":"Non", "langfre":"Non", "langdut":"Nee"}
,
"code": "0",
"definitionObject":
{}

}

]

}

]

}

]</featureTypes>
<recordGroup>d7dbb069-f405-4dfb-940f-2ced611998e8</recordGroup>
</doc>

Loading
Loading