Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix : csw server not ignoring failures #310

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()));
}

}
Expand Down
2 changes: 1 addition & 1 deletion georchestra-migration/migration-dev-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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*
Expand Down
Loading