From a0465e3776901135c195082947d44c57f0473333 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Prunayre?= Date: Thu, 6 Jun 2024 10:06:22 +0200 Subject: [PATCH] Harvester / ISO19115-3 / Better support missing metadata date info While harvesting, `extract-date-modified.xsl` is used to retrieve last update of the record. If empty, harvester will fail with: ``` [geonetwork.harvester] - Invalid ISO date: java.lang.IllegalArgumentException: Invalid ISO date: at org.fao.geonet.domain.ISODate.parseDate(ISODate.java:426) ~[gn-domain-4.4.5-SNAPSHOT.jar:?] at org.fao.geonet.domain.ISODate.setDateAndTime(ISODate.java:239) ~[gn-domain-4.4.5-SNAPSHOT.jar:?] at org.fao.geonet.domain.ISODate.(ISODate.java:117) ~[gn-domain-4.4.5-SNAPSHOT.jar:?] at org.fao.geonet.kernel.harvest.harvester.simpleurl.Aligner.addMetadata(Aligner.java:237) ~[gn-harvesters-4.4.5-SNAPSHOT.jar:?] at org.fao.geonet.kernel.harvest.harvester.simpleurl.Aligner.lambda$insertOrUpdate$0(Aligner.java:126) ~[gn-harvesters-4.4.5-SNAPSHOT.jar:?] ``` Fallback to now. --- .../iso19115-3.2018/extract-date-modified.xsl | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/extract-date-modified.xsl b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/extract-date-modified.xsl index a6546241b0a..73d8bf5ff4b 100644 --- a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/extract-date-modified.xsl +++ b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/extract-date-modified.xsl @@ -3,27 +3,21 @@ version="2.0" xmlns:cit="http://standards.iso.org/iso/19115/-3/cit/2.0" xmlns:mdb="http://standards.iso.org/iso/19115/-3/mdb/2.0" - xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xs="http://www.w3.org/2001/XMLSchema"> + + - - - - - - - - - - +