From 116c6a710cae9f98013ce971180723410dceb16d Mon Sep 17 00:00:00 2001 From: Florian Necas Date: Wed, 18 Dec 2024 11:13:55 +0100 Subject: [PATCH 1/2] fix : csw server not ignoring failures --- .../services/getrecords/SearchController.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/SearchController.java b/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/SearchController.java index 4972ac046e..8ea31d0611 100644 --- a/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/SearchController.java +++ b/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/SearchController.java @@ -53,10 +53,7 @@ import org.fao.geonet.kernel.search.EsSearchManager; import org.fao.geonet.utils.Log; import org.fao.geonet.utils.Xml; -import org.jdom.Attribute; -import org.jdom.Content; -import org.jdom.Element; -import org.jdom.Namespace; +import org.jdom.*; import org.springframework.beans.factory.annotation.Autowired; import java.nio.file.Files; @@ -510,16 +507,20 @@ public Element search(ServiceContext context, int startPos, int maxRecords, AbstractMetadata metadata = metadataUtils.findOne(mdId); String displayLanguage = context.getLanguage(); + try { // The query to retrieve GetRecords, filters by portal. No need to re-check again when retrieving each metadata. - Element resultMD = retrieveMetadata(context, metadata.getId() + "", - setName, outSchema, elemNames, typeName, resultType, strategy, displayLanguage, false); + Element resultMD = retrieveMetadata(context, metadata.getId() + "", + setName, outSchema, elemNames, typeName, resultType, strategy, displayLanguage, false); - if (resultMD != null) { - if (resultType == ResultType.RESULTS) { - results.addContent(resultMD); - } + if (resultMD != null) { + if (resultType == ResultType.RESULTS) { + results.addContent(resultMD); + } - counter++; + counter++; + } + } catch (InvalidParameterValueEx e) { + results.addContent(new Comment(e.getMessage())); } } From f6a79cde2292e409287b6752853968fd04b9046a Mon Sep 17 00:00:00 2001 From: Florian Necas Date: Wed, 18 Dec 2024 11:28:50 +0100 Subject: [PATCH 2/2] fix : add migration dev guide --- georchestra-migration/migration-dev-guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/georchestra-migration/migration-dev-guide.md b/georchestra-migration/migration-dev-guide.md index b690ab58c4..c95fed490b 100644 --- a/georchestra-migration/migration-dev-guide.md +++ b/georchestra-migration/migration-dev-guide.md @@ -33,7 +33,7 @@ All italic folder just have the `pom.xml` change. - csw-server - `CswFilter2Es.java` : Keep `{@}` instead of `%s` until it is fixed upstream (not supporting some CSW request) - `CswFilter2EsTest.java` : Keep `{@}` instead of `%s` - - `SearchController.java` : Keep `{@}` instead of `%s` with StringUtils.replace + - `SearchController.java` : Keep `{@}` instead of `%s` with StringUtils.replace, try/catch around Element resultMD, to avoid csw server to crash [issue core-gn 6940](https://github.com/geonetwork/core-geonetwork/issues/6940) - **docker** - Mandatory, get everything from geOrchestra - *docs*