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 4cb6fe7dd2..4e119bc62e 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 @@ -55,12 +55,9 @@ import org.fao.geonet.utils.Xml; import org.geotools.xsd.Configuration; import org.geotools.xsd.Parser; -import org.jdom.Attribute; -import org.jdom.Content; -import org.jdom.Element; -import org.jdom.Namespace; import org.opengis.filter.Filter; import org.opengis.filter.capability.FilterCapabilities; +import org.jdom.*; import org.springframework.beans.factory.annotation.Autowired; import org.xml.sax.SAXException; @@ -483,17 +480,20 @@ public Element search(ServiceContext context, int startPos, int maxRecords, AbstractMetadata metadata = metadataUtils.findOne(mdId); String displayLanguage = context.getLanguage(); - Element resultMD = retrieveMetadata(context, metadata.getId() + "", - setName, outSchema, elemNames, typeName, resultType, strategy, displayLanguage); + 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); - 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())); } - } results.setAttribute("numberOfRecordsMatched", Long.toString(numMatches)); diff --git a/georchestra-migration/migration-dev-guide.md b/georchestra-migration/migration-dev-guide.md index 97fd1f2c82..c95fed490b 100644 --- a/georchestra-migration/migration-dev-guide.md +++ b/georchestra-migration/migration-dev-guide.md @@ -26,7 +26,6 @@ All italic folder just have the `pom.xml` change. - common - `ZipUtilTest.java` : In `assertExampleZip` method, assertions which are supposed check folders must check with trailing slash too. - core - - `JeevesContextLoaderListener.java` : remove java 8 runtime exception as we use java 11. - `XslUtil.java`: Implement georchestra header specific code - `config-spring-geonetwork.xml` : Implement `context:property-placeholder` for georchestra's datadir - `src/test/resources/config-spring-geonetwork.xml`: Add GeonetworkDataDirectory bean @@ -34,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* @@ -48,9 +47,7 @@ All italic folder just have the `pom.xml` change. - *events* - **georchestra-integration** - Mandatory, get everything from geOrchestra -- harvesters - - `Harvester.java`: Use parseJDK11 method - - `HarvesterTest.java` : Ignore and assume true Java 8 +- *harvesters* - *healthmonitor* - *index* - *inspire-atom* @@ -60,16 +57,6 @@ All italic folder just have the `pom.xml` change. - *oaipmh* - *release* - schemas - - `src/main/plugin/iso19115-3.2018` - - OGC API features, COG and 3Dtiles added. Differences in files: - - `config/associated-panel/default.json` - - `loc/eng/labels.xml` - - `loc/fre/labels.xml` - - `test/resources/metadata-for-editing.xml` - - `test/resources/metadata-for-editing-light.xml` - - `test/resources/metadata-iso19139-for-editing.xml` - - `src/main/plugin/iso19115-3.2018/config/associated-panel/default.json` : Keep OGC API - Features placeholder - - `src/main/plugin/iso19139/loc` : COG and 3Dtiles added in labels.xml files. - `iso19139/layout/config-editor.xml`: xlinks for contacts reenabled - *schemas-test* - *sde* @@ -101,23 +88,20 @@ All italic folder just have the `pom.xml` change. - `pom.xml`: Keep exclusion of groovy package to avoid two versions of it. - web-ui - `pom.xml`: version to update **and to add to gn-web-ui** - - `RelatedResourcesService.js`: Add 3DTiles - - `CatController.js`: Menu bar accessible and 3DTiles - - `menu-signin.html`: remove the `authenticated` from the `ng-if` in firstul tag. + - `CatController.js`: Menu bar accessible + - `menu-signin.html`: remove the `authenticated` from the `ng-if` in first ul tag. - `src/main/resources/catalog/locales/` - - Add OGC API - Features to i18n files - Get `en-georchestra.json` and `fr-georchestra.json` from georchestra - `src/main/resources/catalog/style/gn-less`: remove position fixed from `.gn-top-bar` to get gn header after georchestra's header. - `gn_admin_default.less`: Same (header position) - `gn_navbar_default.less`: Same (header position) - - `src/main/resources/catalog/views/module.js`: Add 3DTiles - `src/main/resources/catalog/views/georchestra/`: Get files from georchestra - *workers* - *wro4j* - .gitignore - add idea and settings to it - pom.xml - - Implement JDK 11 specific things, add georchestra-integration module, set db-type + - Add georchestra-integration module, set db-type ## Process used