diff --git a/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/simpleurl/Harvester.java b/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/simpleurl/Harvester.java index 254fac91f84..2c2cbf052f3 100644 --- a/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/simpleurl/Harvester.java +++ b/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/simpleurl/Harvester.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ArrayNode; import com.google.common.annotations.VisibleForTesting; import com.google.common.io.CharStreams; import jeeves.server.context.ServiceContext; @@ -208,7 +209,17 @@ public HarvestResult harvest(Logger log) throws Exception { private void collectRecordsFromJson(JsonNode jsonObj, Map uuids, Aligner aligner) { - JsonNode nodes = jsonObj.at(params.loopElement); + JsonNode nodes = null; + if (".".equals(params.loopElement)) { + ObjectMapper objectMapper = new ObjectMapper(); + ArrayNode jsonNodes = objectMapper.createArrayNode(); + jsonNodes.add(jsonObj); + nodes = jsonNodes; + } else { + nodes = jsonObj.at(params.loopElement); + } + + log.debug(String.format("%d records found in JSON response.", nodes.size())); nodes.forEach(jsonRecord -> { diff --git a/schemas/iso19115-3.2018/src/test/resources/zenodo.xml b/schemas/iso19115-3.2018/src/test/resources/zenodo.xml index 8de6fbea78a..40d60339e8b 100644 --- a/schemas/iso19115-3.2018/src/test/resources/zenodo.xml +++ b/schemas/iso19115-3.2018/src/test/resources/zenodo.xml @@ -9,8 +9,7 @@ xmlns:mrd="http://standards.iso.org/iso/19115/-3/mrd/1.0" xmlns:mri="http://standards.iso.org/iso/19115/-3/mri/1.0" xmlns:mrl="http://standards.iso.org/iso/19115/-3/mrl/2.0" - xmlns:xlink="http://www.w3.org/1999/xlink" -> + xmlns:xlink="http://www.w3.org/1999/xlink"> @@ -51,7 +50,7 @@ - Guillaume + Guillaume Maze @@ -83,7 +82,7 @@ - Kevin + Kevin Balem @@ -158,11 +157,11 @@ <p>Argo is a real-time global ocean in situ observing system. It provides thousands of highly accurate ocean measurements every day. The Argo dataset has now accumulated more than 2.3 million vertical ocean profiles and accessing it for scientific analysis remains a challenge.</p> <p>The - Argo expert community, focused on delivering a curated dataset of the best scientific quality - possible, has never provided its user base with a Python software package to easily access and manipulate Argo - measurements: the argopy software aims to fill this gap. <strong>The argopy software can be used to - easily fetch and manipulate measurements from Argo floats</strong>. It is dedicated to scientists - without knowledge of the Argo data management system but is also designed to accommodate expert requirements.</p> + Argo expert community, focused on delivering a curated dataset of the best scientific quality possible, has + never provided its user base with a Python software package to easily access and manipulate Argo measurements: + the argopy software aims to fill this gap. <strong>The argopy software can be used to easily fetch and + manipulate measurements from Argo floats</strong>. It is dedicated to scientists without knowledge of + the Argo data management system but is also designed to accommodate expert requirements.</p> @@ -180,7 +179,7 @@ - Guillaume + Guillaume Maze @@ -213,7 +212,7 @@ - Kevin + Kevin Balem @@ -246,7 +245,7 @@ - Tyler + Tyler Tucker @@ -279,7 +278,7 @@ - Filipe + Filipe Fernandes