From 66a492506f73adfd6eedac543519e089b7a5d267 Mon Sep 17 00:00:00 2001 From: Marten Hogeweg Date: Tue, 26 Nov 2024 07:22:48 -0800 Subject: [PATCH] geonetwork harvest update --- .../CSW_2.0.2_APISO_GeoNetwork_GetRecordByID_Response.xslt | 6 ++++++ .../com/esri/geoportal/harvester/folder/FolderBroker.java | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/geoportal-commons/geoportal-commons-csw-client/src/main/resources/gpt/search/profiles/CSW_2.0.2_APISO_GeoNetwork_GetRecordByID_Response.xslt b/geoportal-commons/geoportal-commons-csw-client/src/main/resources/gpt/search/profiles/CSW_2.0.2_APISO_GeoNetwork_GetRecordByID_Response.xslt index 1e6d966c8..1af542189 100644 --- a/geoportal-commons/geoportal-commons-csw-client/src/main/resources/gpt/search/profiles/CSW_2.0.2_APISO_GeoNetwork_GetRecordByID_Response.xslt +++ b/geoportal-commons/geoportal-commons-csw-client/src/main/resources/gpt/search/profiles/CSW_2.0.2_APISO_GeoNetwork_GetRecordByID_Response.xslt @@ -23,6 +23,12 @@ xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:srv="http://www.isotc211.org/2005/srv" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + + xmlns:gts="http://www.isotc211.org/2005/gts" + xmlns:gml="http://www.opengis.net/gml" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:geonet="http://www.fao.org/geonetwork" + exclude-result-prefixes="csw dct"> diff --git a/geoportal-connectors/geoportal-harvester-folder/src/main/java/com/esri/geoportal/harvester/folder/FolderBroker.java b/geoportal-connectors/geoportal-harvester-folder/src/main/java/com/esri/geoportal/harvester/folder/FolderBroker.java index 5f190c7ab..680c75238 100644 --- a/geoportal-connectors/geoportal-harvester-folder/src/main/java/com/esri/geoportal/harvester/folder/FolderBroker.java +++ b/geoportal-connectors/geoportal-harvester-folder/src/main/java/com/esri/geoportal/harvester/folder/FolderBroker.java @@ -132,8 +132,11 @@ public PublishingStatus publish(DataReference ref) throws DataOutputException { for (MimeType ct: ref.getContentType()) { String extension = MimeTypeUtils.findExtensions(ct).stream().findFirst().orElse(null); if (extension!=null) { - - Path f = generateFileName(ref.getBrokerUri(), ref.getSourceUri(), ref.getTitle() , extension); + String title = ref.getTitle(); + if (title.length() < 1) { + title = ref.getSourceUri().toString().replace(":", "_"); + } + Path f = generateFileName(ref.getBrokerUri(), ref.getSourceUri(), title, extension); boolean created = !Files.exists(f); Files.createDirectories(f.getParent()); try (OutputStream output = Files.newOutputStream(f)) {