adding key property in the prefilling model as the identifier of the prefilling repository
This commit is contained in:
parent
1715463422
commit
dd6a2a0df7
|
@ -363,7 +363,7 @@ public class RemoteFetcher {
|
|||
Results remainingResults = optionalResults.orElseGet(Results::new);
|
||||
remainingResults.getResults().addAll(results.getResults());
|
||||
|
||||
return remainingResults.getResults().stream().peek(x -> x.put("tag", tag)).collect(Collectors.toList());
|
||||
return remainingResults.getResults().stream().peek(x -> x.put("tag", tag)).peek(x -> x.put("key", key)).collect(Collectors.toList());
|
||||
}
|
||||
else {
|
||||
return new LinkedList<>();
|
||||
|
|
|
@ -6,6 +6,7 @@ public class Prefilling {
|
|||
private String pid;
|
||||
private String name;
|
||||
private Map<String, Object> data;
|
||||
private String key;
|
||||
private String tag;
|
||||
|
||||
public String getPid() {
|
||||
|
@ -32,6 +33,14 @@ public class Prefilling {
|
|||
this.data = data;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
return tag;
|
||||
}
|
||||
|
|
|
@ -1203,7 +1203,7 @@ but not
|
|||
<prefillingSearch>
|
||||
<urlConfig>
|
||||
<key>zenodo</key>
|
||||
<label>zenodo</label>
|
||||
<label>Zenodo</label>
|
||||
<ordinal>1</ordinal>
|
||||
<type>External</type>
|
||||
<url>https://zenodo.org/api/records/?page={page}&size={pageSize}&q=title:"{like}" doi:"{like}" conceptdoi:"{like}"</url>
|
||||
|
@ -1264,7 +1264,7 @@ but not
|
|||
<prefillingSearch>
|
||||
<urlConfig>
|
||||
<key>openaire</key>
|
||||
<label>openaire</label>
|
||||
<label>Openaire</label>
|
||||
<ordinal>1</ordinal>
|
||||
<type>External</type>
|
||||
<url>https://services.openaire.eu/search/v2/api/datasets/?q={like}&page={page}&size={pageSize}&format=json</url>
|
||||
|
|
|
@ -2,5 +2,6 @@ export interface Prefilling {
|
|||
pid: string;
|
||||
name: string;
|
||||
data: any;
|
||||
key: string;
|
||||
tag: string;
|
||||
}
|
||||
|
|
|
@ -69,13 +69,13 @@ export class PrefillDatasetComponent extends BaseComponent implements OnInit {
|
|||
next() {
|
||||
if(this.isPrefilled) {
|
||||
if(this.prefillForm.get('prefill').value.data == null) {
|
||||
this.prefillingService.getPrefillingDataset(this.prefillForm.get('prefill').value.pid, this.prefillForm.get('profile').value.id, this.prefillForm.get('prefill').value.tag).subscribe(wizard => {
|
||||
this.prefillingService.getPrefillingDataset(this.prefillForm.get('prefill').value.pid, this.prefillForm.get('profile').value.id, this.prefillForm.get('prefill').value.key).subscribe(wizard => {
|
||||
wizard.profile = this.prefillForm.get('profile').value;
|
||||
this.closeDialog(wizard);
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.prefillingService.getPrefillingDatasetUsingData(this.prefillForm.get('prefill').value.data, this.prefillForm.get('profile').value.id, this.prefillForm.get('prefill').value.tag).subscribe(wizard => {
|
||||
this.prefillingService.getPrefillingDatasetUsingData(this.prefillForm.get('prefill').value.data, this.prefillForm.get('profile').value.id, this.prefillForm.get('prefill').value.key).subscribe(wizard => {
|
||||
wizard.profile = this.prefillForm.get('profile').value;
|
||||
this.closeDialog(wizard);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue