Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into allow_status_on_approved_copy
  • Loading branch information
ianwallen committed Aug 22, 2024
2 parents 237db54 + 4a57a02 commit 10a6b90
Show file tree
Hide file tree
Showing 33 changed files with 322 additions and 167 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ private void checkIndexResponse(BulkResponse bulkItemResponses,
.add("status_text")
.add("coordinateSystem")
.add("identifier")
.add("maintenance")
.add("responsibleParty")
.add("mdLanguage")
.add("otherLanguage")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ private Element retrieveMetadata(String uuid) {

params.getValidate().validate(dataMan, context, response, groupIdVal);
} catch (Exception e) {
log.debug("Ignoring invalid metadata with uuid " + uuid);
log.info("Ignoring invalid metadata with uuid " + uuid);
result.doesNotValidate++;
return null;
}
Expand Down
16 changes: 9 additions & 7 deletions schemas/config-editor.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ Define if this tab is the default one for the view. Only one tab should be the d
<xs:annotation>
<xs:documentation><![CDATA[
The tab key used in URL parameter to activate that tab. The key is also use for the tab label as defined in ``{schema}/loc/{lang}/strings.xml``.
It has to be unique for all views. A good practice is to use same prefix for all tabs in the same view.
It has to be unique for all views. A good practice is to use same prefix for all tabs in the same view.
]]></xs:documentation>
</xs:annotation>
</xs:attribute>
Expand Down Expand Up @@ -1128,9 +1128,11 @@ Note: Only sections with forEach support del attribute.
<section forEach="/gmd:MD_Metadata/gmd:distributionInfo">
<text><h2>Distribution</h2></text>
<section forEach="*/gmd:transferOptions/*/gmd:onLine/gmd:CI_OnlineResource" name="A link">
<field xpath="gmd:linkage"/>
<field xpath="gmd:name" or="name" in="."/>
<section forEach="*/gmd:transferOptions/*/gmd:onLine"
name="A link"
del=".">
<field xpath="*/gmd:linkage"/>
<field xpath="*/gmd:name" or="name" in="."/>
</section>
<text><hr/></text>
</section>
Expand Down Expand Up @@ -2111,9 +2113,9 @@ An autocompletion list based on a thesaurus.
This field facilitates users in selecting a `subtemplate` (also known as xml-snippet) from the catalogue. Subtemplates are mostly used to store contact details,
but can also be used to store snippets of xml having Quality reports, Access constraints, CRS definitions, etc.
`data-insert-modes` can be `text` and/or `xlink` depending on how the subtemplate is encoded.
Contact can be forced to be `xlink` but some other type of subtemplates (eg. DQ report) are usually just simple default values
`data-insert-modes` can be `text` and/or `xlink` depending on how the subtemplate is encoded.
Contact can be forced to be `xlink` but some other type of subtemplates (eg. DQ report) are usually just simple default values
that need to be detailed by editors and in that case `text` mode is recommended. For `xlink`, the XLink resolver needs to be enabled in the admin settings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,24 +553,30 @@
<xsl:template match="mdb:resourceLineage[not(../mdb:dataQualityInfo)]">
<gmd:dataQualityInfo>
<gmd:DQ_DataQuality>
<xsl:apply-templates select="mrl:LI_Lineage/mrl:scope"/>
<gmd:lineage>
<gmd:LI_Lineage>
<xsl:call-template name="writeCharacterStringElement">
<xsl:with-param name="elementName"
select="'gmd:statement'"/>
<xsl:with-param name="nodeWithStringToWrite"
select="mrl:LI_Lineage/mrl:statement"/>
</xsl:call-template>
<xsl:apply-templates select="mrl:LI_Lineage/mrl:processStep"/>
<xsl:apply-templates select="mrl:LI_Lineage/mrl:source"/>
</gmd:LI_Lineage>
</gmd:lineage>
<xsl:if test="mrl:LI_Lineage/mrl:scope">
<gmd:scope>
<gmd:DQ_Scope>
<xsl:apply-templates select="mrl:LI_Lineage/mrl:scope/@*"/>
<xsl:apply-templates select="mrl:LI_Lineage/mrl:scope/mcc:MD_Scope/*"/>
</gmd:DQ_Scope>
</gmd:scope>
</xsl:if>
<gmd:lineage>
<gmd:LI_Lineage>
<xsl:call-template name="writeCharacterStringElement">
<xsl:with-param name="elementName"
select="'gmd:statement'"/>
<xsl:with-param name="nodeWithStringToWrite"
select="mrl:LI_Lineage/mrl:statement"/>
</xsl:call-template>
<xsl:apply-templates select="mrl:LI_Lineage/mrl:processStep"/>
<xsl:apply-templates select="mrl:LI_Lineage/mrl:source"/>
</gmd:LI_Lineage>
</gmd:lineage>
</gmd:DQ_DataQuality>
</gmd:dataQualityInfo>
</xsl:template>


<xsl:template match="mmi:maintenanceDate">
<gmd:dateOfNextUpdate>
<xsl:apply-templates select="cit:CI_Date/cit:date/*"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
xmlns:gcx="http://standards.iso.org/iso/19115/-3/gcx/1.0"
xmlns:gex="http://standards.iso.org/iso/19115/-3/gex/1.0"
xmlns:lan="http://standards.iso.org/iso/19115/-3/lan/1.0"
xmlns:srv="http://standards.iso.org/iso/19115/-3/srv/2.0"
xmlns:srv2="http://standards.iso.org/iso/19115/-3/srv/2.0"
xmlns:mac="http://standards.iso.org/iso/19115/-3/mac/2.0"
xmlns:mas="http://standards.iso.org/iso/19115/-3/mas/1.0"
xmlns:mcc="http://standards.iso.org/iso/19115/-3/mcc/1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,22 @@
</spatialRepresentationType>
</xsl:for-each>

<xsl:for-each select="*:resourceMaintenance/*">
<maintenance type="object">{
"frequency": "<xsl:value-of select="*:maintenanceAndUpdateFrequency/*/@codeListValue"/>"
<xsl:for-each select="*:dateOfNextUpdate[*/text() != '']">
,"nextUpdateDate": "<xsl:value-of select="*/text()"/>"
</xsl:for-each>
<xsl:for-each select="*:userDefinedMaintenanceFrequency[*/text() != '']">
,"userDefinedFrequency": "<xsl:value-of select="*/text()"/>"
</xsl:for-each>
<xsl:for-each select="*:maintenanceNote[*/text() != '']">
,"noteObject":
<xsl:value-of select="gn-fn-index:add-multilingual-field('maintenanceNote', ., $allLanguages, true())"/>
</xsl:for-each>
}</maintenance>
</xsl:for-each>

<xsl:for-each select="mri:resourceConstraints/*">
<xsl:variable name="fieldPrefix" select="local-name()"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:util="java:org.fao.geonet.util.XslUtil"
xmlns:digestUtils="java:org.apache.commons.codec.digest.DigestUtils"
xmlns:exslt="http://exslt.org/common"
xmlns:gn-fn-rel="http://geonetwork-opensource.org/xsl/functions/relations"
version="2.0"
exclude-result-prefixes="#all">
Expand Down Expand Up @@ -110,7 +109,7 @@
<xsl:value-of select="position()"/>
</idx>
<hash>
<xsl:value-of select="digestUtils:md5Hex(string(exslt:node-set(normalize-space(.))))"/>
<xsl:value-of select="digestUtils:md5Hex(normalize-space(.))"/>
</hash>
<url>
<xsl:apply-templates mode="get-iso19139-localized-string"
Expand Down Expand Up @@ -142,7 +141,7 @@
<xsl:value-of select="position()"/>
</idx>
<hash>
<xsl:value-of select="digestUtils:md5Hex(string(exslt:node-set(normalize-space(.))))"/>
<xsl:value-of select="digestUtils:md5Hex(normalize-space(.))"/>
</hash>
<title>
<xsl:apply-templates mode="get-iso19139-localized-string"
Expand Down
22 changes: 18 additions & 4 deletions schemas/iso19139/src/main/plugin/iso19139/index-fields/index.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
xmlns:gn-fn-index="http://geonetwork-opensource.org/xsl/functions/index"
xmlns:index="java:org.fao.geonet.kernel.search.EsSearchManager"
xmlns:digestUtils="java:org.apache.commons.codec.digest.DigestUtils"
xmlns:exslt="http://exslt.org/common"
xmlns:util="java:org.fao.geonet.util.XslUtil"
xmlns:date-util="java:org.fao.geonet.utils.DateUtil"
xmlns:daobs="http://daobs.org"
Expand Down Expand Up @@ -657,6 +656,22 @@
</xsl:for-each>


<xsl:for-each select="gmd:resourceMaintenance/*">
<maintenance type="object">{
"frequency": "<xsl:value-of select="*:maintenanceAndUpdateFrequency/*/@codeListValue"/>"
<xsl:for-each select="gmd:dateOfNextUpdate[*/text() != '']">
,"nextUpdateDate": "<xsl:value-of select="*/text()"/>"
</xsl:for-each>
<xsl:for-each select="gmd:userDefinedMaintenanceFrequency[*/text() != '']">
,"userDefinedFrequency": "<xsl:value-of select="*/text()"/>"
</xsl:for-each>
<xsl:for-each select="gmd:maintenanceNote[*/text() != '']">
,"noteObject":
<xsl:value-of select="gn-fn-index:add-multilingual-field('maintenanceNote', ., $allLanguages, true())"/>
</xsl:for-each>
}</maintenance>
</xsl:for-each>

<xsl:for-each select="gmd:resourceConstraints/*">
<xsl:variable name="fieldPrefix" select="local-name()"/>
<xsl:for-each select="gmd:otherConstraints">
Expand Down Expand Up @@ -1122,8 +1137,7 @@
<xsl:copy-of select="gn-fn-index:add-multilingual-field('orderingInstructions', ., $allLanguages)"/>
</xsl:for-each>

<xsl:for-each select="gmd:transferOptions/*/
gmd:onLine/*[gmd:linkage/gmd:URL != '']">
<xsl:for-each select=".//gmd:onLine/*[gmd:linkage/gmd:URL != '']">

<xsl:variable name="transferGroup"
select="count(ancestor::gmd:transferOptions/preceding-sibling::gmd:transferOptions)"/>
Expand All @@ -1147,7 +1161,7 @@
<atomfeed><xsl:value-of select="gmd:linkage/gmd:URL"/></atomfeed>
</xsl:if>
<link type="object">{
"hash": "<xsl:value-of select="digestUtils:md5Hex(string(exslt:node-set(normalize-space(.))))"/>",
"hash": "<xsl:value-of select="digestUtils:md5Hex(normalize-space(.))"/>",
"idx": <xsl:value-of select="position()"/>,
"protocol":"<xsl:value-of select="util:escapeForJson((gmd:protocol/*/text())[1])"/>",
"mimeType":"<xsl:value-of select="if (*/gmx:MimeFileType)
Expand Down
5 changes: 4 additions & 1 deletion schemas/iso19139/src/main/plugin/iso19139/loc/fre/labels.xml
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,10 @@
n’est pas respectée.
</help>
<condition/>

</element>
<element name="gmd:DQ_EvaluationMethodTypeCode">
<label>Code du type de méthode d'évaluation</label>
<description>Type de méthode d'évaluation d'une mesure de qualité de données identifiée</description>
</element>
<element name="gmd:DQ_FormatConsistency" id="114.0">
<label>Cohérence du format</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,29 @@ Note: It assumes that it will be adding new items in
<!-- Updating the gmd:onLine based on update parameters -->
<!-- Note: first part of the match needs to match the xsl:for-each select from extract-relations.xsl in order to get the position() to match -->
<!-- The unique identifier is marked with resourceIdx which is the position index and resourceHash which is hash code of the current node (combination of url, resource name, and description) -->
<xsl:template
match="*//gmd:MD_DigitalTransferOptions/gmd:onLine
[gmd:CI_OnlineResource[gmd:linkage/gmd:URL!=''] and ($resourceIdx = '' or position() = xs:integer($resourceIdx))]
[($resourceHash != '' or ($updateKey != '' and normalize-space($updateKey) = concat(
<!-- Template to match all gmd:onLine elements -->
<xsl:template match="//gmd:MD_DigitalTransferOptions/gmd:onLine" priority="2">
<!-- Calculate the global position of the current gmd:onLine element -->
<xsl:variable name="position" select="count(//gmd:MD_DigitalTransferOptions/gmd:onLine[current() >> .]) + 1" />

<xsl:choose>
<xsl:when test="gmd:CI_OnlineResource[gmd:linkage/gmd:URL != ''] and
($resourceIdx = '' or $position = xs:integer($resourceIdx)) and
($resourceHash != '' or ($updateKey != '' and normalize-space($updateKey) = concat(
gmd:CI_OnlineResource/gmd:linkage/gmd:URL,
gmd:CI_OnlineResource/gmd:protocol/*,
gmd:CI_OnlineResource/gmd:name/gco:CharacterString)))
and ($resourceHash = '' or digestUtils:md5Hex(string(exslt:node-set(normalize-space(.)))) = $resourceHash)]"
priority="2">
<xsl:call-template name="createOnlineSrc"/>
and ($resourceHash = '' or digestUtils:md5Hex(normalize-space(.)) = $resourceHash)">
<xsl:call-template name="createOnlineSrc"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>


<xsl:template name="createOnlineSrc">
<!-- Add all online source from the target metadata to the
current one -->
Expand Down Expand Up @@ -243,7 +253,7 @@ Note: It assumes that it will be adding new items in
</gmd:URL>
</gmd:linkage>
<gmd:protocol>
<xsl:call-template name="setProtocol"/>
<xsl:call-template name="setProtocol"/>
</gmd:protocol>

<xsl:if test="$applicationProfile != ''">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,25 @@ Stylesheet used to remove a reference to a online resource.
<!-- Remove the gmd:onLine define in url parameter -->
<!-- Note: first part of the match needs to match the xsl:for-each select from extract-relations.xsl in order to get the position() to match -->
<!-- The unique identifier is marked with resourceIdx which is the position index and resourceHash which is hash code of the current node (combination of url, resource name, and description) -->
<xsl:template
match="*//gmd:MD_DigitalTransferOptions/gmd:onLine
[gmd:CI_OnlineResource[gmd:linkage/gmd:URL!=''] and ($resourceIdx = '' or (count(preceding::gmd:onLine) + 1) = xs:integer($resourceIdx))]
[($resourceHash != '' or ($url != null and (normalize-space(gmd:CI_OnlineResource/gmd:linkage/gmd:URL) = $url and normalize-space(gmd:CI_OnlineResource/gmd:name/gco:CharacterString) = normalize-space($name)
<xsl:template match="//gmd:MD_DigitalTransferOptions/gmd:onLine" priority="2">

<!-- Calculate the global position of the current gmd:onLine element -->
<xsl:variable name="position" select="count(//gmd:MD_DigitalTransferOptions/gmd:onLine[current() >> .]) + 1" />

<xsl:if test="not(
gmd:CI_OnlineResource[gmd:linkage/gmd:URL != ''] and
($resourceIdx = '' or $position = xs:integer($resourceIdx)) and
($resourceHash != '' or ($url != null and (normalize-space(gmd:CI_OnlineResource/gmd:linkage/gmd:URL) = $url and normalize-space(gmd:CI_OnlineResource/gmd:name/gco:CharacterString) = normalize-space($name)
or normalize-space(gmd:CI_OnlineResource/gmd:linkage/gmd:URL) = $url and count(gmd:CI_OnlineResource/gmd:name/gmd:PT_FreeText/gmd:textGroup[gmd:LocalisedCharacterString = $name]) > 0
or normalize-space(gmd:CI_OnlineResource/gmd:linkage/gmd:URL) = $url and normalize-space(gmd:CI_OnlineResource/gmd:protocol/*) = 'WWW:DOWNLOAD-1.0-http--download'))
)
and ($resourceHash = '' or digestUtils:md5Hex(string(exslt:node-set(normalize-space(.)))) = $resourceHash)]"
priority="2"/>
and ($resourceHash = '' or digestUtils:md5Hex(normalize-space(.)) = $resourceHash)
)">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:if>
</xsl:template>

<!-- Do a copy of every node and attribute -->
<xsl:template match="@*|node()">
Expand Down
Loading

0 comments on commit 10a6b90

Please sign in to comment.