master #59

Closed
claudio.atzori wants to merge 3221 commits from master into stable_ids
1 changed files with 16 additions and 7 deletions
Showing only changes of commit 699736addc - Show all commits

View File

@ -137,13 +137,22 @@ public class ConversionUtils {
protected static List<OaBrokerTypedValue> allResultPids(final Result result) { protected static List<OaBrokerTypedValue> allResultPids(final Result result) {
final Map<String, StructuredProperty> map = new HashMap<>(); final Map<String, StructuredProperty> map = new HashMap<>();
result.getPid().forEach(sp -> map.put(sp.getValue(), sp));
result.getInstance().forEach(i -> { if (result.getPid() != null) {
i.getPid().forEach(sp -> map.put(sp.getValue(), sp)); result.getPid().forEach(sp -> map.put(sp.getValue(), sp));
i.getAlternateIdentifier().forEach(sp -> map.put(sp.getValue(), sp)); }
});
final List<OaBrokerTypedValue> pids = mappedList(map.values(), ConversionUtils::oafPidToBrokerPid); if (result.getInstance() != null) {
return pids; result.getInstance().forEach(i -> {
if (i.getPid() != null) {
i.getPid().forEach(sp -> map.put(sp.getValue(), sp));
}
if (i.getAlternateIdentifier() != null) {
i.getAlternateIdentifier().forEach(sp -> map.put(sp.getValue(), sp));
}
});
}
return mappedList(map.values(), ConversionUtils::oafPidToBrokerPid);
} }
public static String cleanOpenaireId(final String id) { public static String cleanOpenaireId(final String id) {