Skip to content

Commit

Permalink
Indexing / Store nilReason attribute value instead of only withheld. …
Browse files Browse the repository at this point in the history
…Add nilReason for links (and not only contact).
  • Loading branch information
fxprunayre committed Jun 6, 2023
1 parent 0764c53 commit 8de81d5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,9 @@
"descriptionObject": <xsl:value-of select="gn-fn-index:add-multilingual-field(
'description', description/*, $allLanguages)"/>,
</xsl:if>
<xsl:if test="nilReason">
"nilReason": "<xsl:value-of select="nilReason"/>",
</xsl:if>
"applicationProfile": "<xsl:value-of select="gn-fn-index:json-escape(
applicationProfile/text())"/>"
}
Expand Down Expand Up @@ -1179,6 +1182,9 @@
"descriptionObject": <xsl:value-of select="gn-fn-index:add-multilingual-field(
'description', cit:description, $allLanguages)"/>,
</xsl:if>
<xsl:if test="../@gco:nilReason">
"nilReason": "<xsl:value-of select="../@gco:nilReason"/>",
</xsl:if>
"function":"<xsl:value-of select="cit:function/cit:CI_OnLineFunctionCode/@codeListValue"/>",
"applicationProfile":"<xsl:value-of select="gn-fn-index:json-escape(cit:applicationProfile/gco:CharacterString/text())"/>",
"group": <xsl:value-of select="$transferGroup"/>
Expand Down Expand Up @@ -1331,9 +1337,6 @@
<xsl:variable name="identifiers"
select=".//cit:partyIdentifier/*"/>


<xsl:variable name="hasWithheld" select="@gco:nilReason = 'withheld'" as="xs:boolean" />

<xsl:element name="contact{$fieldSuffix}">
<!-- TODO: Can be multilingual -->
<xsl:attribute name="type" select="'object'"/>{
Expand All @@ -1349,8 +1352,8 @@
"position":"<xsl:value-of select="gn-fn-index:json-escape($positionName)"/>",
"phone":"<xsl:value-of select="gn-fn-index:json-escape($phone)"/>",
"address":"<xsl:value-of select="gn-fn-index:json-escape($address)"/>"
<xsl:if test="$hasWithheld">
,"nilReason": "withheld"
<xsl:if test="@gco:nilReason">
,"nilReason": "<xsl:value-of select="@gco:nilReason"/>"
</xsl:if>
<xsl:if test="count($identifiers) > 0">
,"identifiers":[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@
<protocol><xsl:value-of select="$docType/@protocol"/></protocol>
<function><xsl:value-of select="$docType/@function"/></function>
<type><xsl:value-of select="$docType/@type"/></type>
<xsl:if test="$forIndexing and ../../../@gco:nilReason">
<nilReason><xsl:value-of select="../../../@gco:nilReason"/></nilReason>
</xsl:if>
</item>
</xsl:for-each>
</xsl:for-each>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ Ce schéma est également composé des normes :
the information. When filtered the element is
preserved but with no content in.
-->
<filter xpath=".//*[@gco:nilReason='withheld']"
<filter xpath=".//*[@gco:nilReason = 'withheld']"
jsonpath="$.*[?(@.nilReason == 'withheld')]"
ifNotOperation="editing">
<keepMarkedElement gco:nilReason="withheld"/>
Expand All @@ -159,8 +159,4 @@ Ce schéma est également composé des normes :
<filter xpath=".//mrd:onLine[starts-with(*/cit:protocol/gco:CharacterString, 'OGC:WMS')]"
ifNotOperation="dynamic"/>
</filters>

<!--<withheldElements>
<withheld esFieldName="contact" xpath="//mdb:contact"/>
</withheldElements>-->
</schema>
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,9 @@
"descriptionObject": <xsl:value-of select="gn-fn-index:add-multilingual-field(
'description', gmd:description, $allLanguages)"/>,
</xsl:if>
<xsl:if test="../@gco:nilReason">
"nilReason": "<xsl:value-of select="../@gco:nilReason"/>",
</xsl:if>
"function":"<xsl:value-of select="gmd:function/gmd:CI_OnLineFunctionCode/@codeListValue"/>",
"applicationProfile":"<xsl:value-of select="gn-fn-index:json-escape(gmd:applicationProfile/gco:CharacterString/text())"/>",
"group": <xsl:value-of select="$transferGroup"/>
Expand Down Expand Up @@ -1193,8 +1196,6 @@
$roleField, $organisationName, $languages)"/>
</xsl:if>

<xsl:variable name="hasWithheld" select="@gco:nilReason = 'withheld'" as="xs:boolean" />

<xsl:element name="contact{$fieldSuffix}">
<xsl:attribute name="type" select="'object'"/>{
<xsl:if test="$organisationName">
Expand All @@ -1209,8 +1210,8 @@
"position":"<xsl:value-of select="gn-fn-index:json-escape($positionName)"/>",
"phone":"<xsl:value-of select="gn-fn-index:json-escape($phone[1])"/>",
"address":"<xsl:value-of select="gn-fn-index:json-escape($address)"/>"
<xsl:if test="$hasWithheld">
,"nilReason": "withheld"
<xsl:if test="@gco:nilReason">
,"nilReason": "<xsl:value-of select="@gco:nilReason"/>"
</xsl:if>
}
</xsl:element>
Expand Down

0 comments on commit 8de81d5

Please sign in to comment.