Fixes bug on not assigning the right "external source provider" on fetched Funders.
This commit is contained in:
parent
f59881d7aa
commit
e0c0f4ec09
|
@ -45,8 +45,12 @@ public class FunderManager {
|
||||||
eu.eudat.models.data.funder.Funder funder = apiContext.getOperationsContext().getBuilderFactory().getBuilder(FunderBuilder.class)
|
eu.eudat.models.data.funder.Funder funder = apiContext.getOperationsContext().getBuilderFactory().getBuilder(FunderBuilder.class)
|
||||||
.reference(externalListingItem.getRemoteId()).label(externalListingItem.getName())
|
.reference(externalListingItem.getRemoteId()).label(externalListingItem.getName())
|
||||||
.status(eu.eudat.data.entities.Funder.Status.fromInteger(0))
|
.status(eu.eudat.data.entities.Funder.Status.fromInteger(0))
|
||||||
.source(externalListingItem.getTag())
|
|
||||||
.build();
|
.build();
|
||||||
|
if (externalListingItem.getSource() != null) {
|
||||||
|
funder.setSource(externalListingItem.getSource());
|
||||||
|
} else {
|
||||||
|
funder.setSource(externalListingItem.getTag());
|
||||||
|
}
|
||||||
|
|
||||||
funders.add(funder);
|
funders.add(funder);
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,7 +141,7 @@ public class RemoteFetcher {
|
||||||
|
|
||||||
private void ifFunderQueryExist(UrlConfiguration urlConfiguration, ExternalUrlCriteria externalUrlCriteria) {
|
private void ifFunderQueryExist(UrlConfiguration urlConfiguration, ExternalUrlCriteria externalUrlCriteria) {
|
||||||
if (urlConfiguration.getFunderQuery() != null) {
|
if (urlConfiguration.getFunderQuery() != null) {
|
||||||
if (externalUrlCriteria.getFunderId() != null) {
|
if (externalUrlCriteria.getFunderId() != null && urlConfiguration.getFunderQuery().startsWith("dmp:")) {
|
||||||
urlConfiguration.setUrl(urlConfiguration.getUrl().replace("{funderQuery}", urlConfiguration.getFunderQuery()));
|
urlConfiguration.setUrl(urlConfiguration.getUrl().replace("{funderQuery}", urlConfiguration.getFunderQuery()));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -13,6 +13,7 @@ public class FundersExternalSourcesModel extends ExternalListingItem<FundersExte
|
||||||
model.setUri(item.get("uri"));
|
model.setUri(item.get("uri"));
|
||||||
model.setName(item.get("name"));
|
model.setName(item.get("name"));
|
||||||
model.setDescription(item.get("description"));
|
model.setDescription(item.get("description"));
|
||||||
|
model.setSource(item.get("source"));
|
||||||
model.setTag(item.get("tag"));
|
model.setTag(item.get("tag"));
|
||||||
this.add(model);
|
this.add(model);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue