Skip to content

Commit

Permalink
fix : csw server not ignoring failures
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas committed Dec 18, 2024
1 parent 345569d commit 116c6a7
Showing 1 changed file with 12 additions and 11 deletions.
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

0 comments on commit 116c6a7

Please sign in to comment.