Merge branch 'ui-redesign' of gitlab.eudat.eu:dmp/OpenAIRE-EUDAT-DMP-service-pilot into ui-redesign

This commit is contained in:
apapachristou 2020-09-11 12:19:38 +03:00
commit 5365aa1842
6 changed files with 76 additions and 47 deletions

View File

@ -15,6 +15,8 @@ public class DataFieldsUrlConfiguration {
private String path;
private String host;
private String types;
private String firstName;
private String lastName;
public String getId() {
return id;
@ -94,4 +96,20 @@ public class DataFieldsUrlConfiguration {
public void setTypes(String types) {
this.types = types;
}
@XmlElement(name = "firstName")
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
@XmlElement(name = "lastName")
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}

View File

@ -341,6 +341,17 @@ public class RemoteFetcher {
results = new Results(finalRes,
new HashMap<>(1, 1));
} else if (jsonDataPath.getFieldsUrlConfiguration().getFirstName() != null) {
results = new Results(jsonContext.read(jsonDataPath.getPath()
+ "[" + jsonDataPath.getFieldsUrlConfiguration().getId() + "," + jsonDataPath.getFieldsUrlConfiguration().getFirstName()
+ "," + jsonDataPath.getFieldsUrlConfiguration().getLastName() + "]"),
new HashMap<>(1, 1));
results.getResults().stream().forEach(entry -> {
String name = entry.get(jsonDataPath.getFieldsUrlConfiguration().getFirstName().replace("'", "")) + " " + entry.get(jsonDataPath.getFieldsUrlConfiguration().getLastName().replace("'", ""));
entry.put("name", name);
entry.remove(jsonDataPath.getFieldsUrlConfiguration().getFirstName().replace("'", ""));
entry.remove(jsonDataPath.getFieldsUrlConfiguration().getLastName().replace("'", ""));
});
} else {
results = new Results(jsonContext.read(jsonDataPath.getPath()
+ "[" + jsonDataPath.getFieldsUrlConfiguration().getName() + "," + jsonDataPath.getFieldsUrlConfiguration().getDescription()

View File

@ -697,44 +697,6 @@
</data>
<paginationpath>$['meta']['pagination']['page','pages','count']</paginationpath>
</urlConfig>
<!--<urlConfig>
<key>orcid</key>
<label>ORCID</label>
<ordinal>2</ordinal>
<type>External</type>
<url>https://pub.sandbox.orcid.org/v3.0/search/?q={like}&amp;start={page}&amp;rows={pageSize}</url>
<firstPage>0</firstPage>
<contenttype>application/json; charset=utf-8</contenttype>
<data>
<path>$['result'][*]['orcid-identifier']</path>
<fields>
<id>'id'</id>
<name>'name'</name>
<uri>'uri'</uri>
<path>'path'</path>
<host>'host'</host>
</fields>
<urlConfig>
<key>orcid</key>
<label>ORCID</label>
<ordinal>3</ordinal>
<type>External</type>
<url>https://pub.{host}/v3.0/{path}/personal-details</url>
<firstPage>0</firstPage>
<data>
<parse-class>eu.eudat.models.data.external.orcid.PersonalDetails</parse-class>
<parse-field>name</parse-field>
<merge-fields>
<field>givenNames</field>
<field>familyName</field>
</merge-fields>
<merge-field-name>name</merge-field-name>
</data>
<paginationpath>$['num-found']</paginationpath>
</urlConfig>
</data>
<paginationpath>$['num-found']</paginationpath>
</urlConfig>-->
<urlConfig>
<key>orcid</key>
<label>ORCID</label>
@ -742,15 +704,15 @@
<type>External</type>
<url>https://pub.sandbox.orcid.org/v3.0/expanded-search/?q={like}&amp;start={page}&amp;rows={pageSize}</url>
<firstPage>0</firstPage>
<contenttype>application/vnd.orcid+xml; qs=5;charset=UTF-8</contenttype>
<contenttype>application/json; charset=UTF-8</contenttype>
<data>
<parse-class>eu.eudat.models.data.external.orcid.ExpandedSearch</parse-class>
<parse-field>expandedResults</parse-field>
<merge-fields>
<field>givenNames</field>
<field>familyName</field>
</merge-fields>
<merge-field-name>name</merge-field-name>
<path>$['expanded-result'][*]</path>
<fields>
<id>'orcid-id'</id>
<firstName>'given-names'</firstName>
<lastName>'family-names'</lastName>
<name>'name'</name>
</fields>
</data>
<paginationpath>$['num-found']</paginationpath>
</urlConfig>

View File

@ -223,6 +223,25 @@
</data>
<paginationpath>$['meta']['pagination']['page','pages','count']</paginationpath>
</urlConfig>
<urlConfig>
<key>orcid</key>
<label>ORCID</label>
<ordinal>2</ordinal>
<type>External</type>
<url>https://pub.orcid.org/v3.0/expanded-search/?q={like}&amp;start={page}&amp;rows={pageSize}</url>
<firstPage>0</firstPage>
<contenttype>application/json; charset=UTF-8</contenttype>
<data>
<path>$['expanded-result'][*]</path>
<fields>
<id>'orcid-id'</id>
<firstName>'given-names'</firstName>
<lastName>'family-names'</lastName>
<name>'name'</name>
</fields>
</data>
<paginationpath>$['num-found']</paginationpath>
</urlConfig>
</urls>
<fetchMode>FIRST</fetchMode> <!-- EITHER 'FIRST' OR 'ALL' -->
</researchers>

View File

@ -235,6 +235,25 @@
</data>
<paginationpath>$['meta']['pagination']['page','pages','count']</paginationpath>
</urlConfig>
<urlConfig>
<key>orcid</key>
<label>ORCID</label>
<ordinal>2</ordinal>
<type>External</type>
<url>https://pub.orcid.org/v3.0/expanded-search/?q={like}&amp;start={page}&amp;rows={pageSize}</url>
<firstPage>0</firstPage>
<contenttype>application/json; charset=UTF-8</contenttype>
<data>
<path>$['expanded-result'][*]</path>
<fields>
<id>'orcid-id'</id>
<firstName>'given-names'</firstName>
<lastName>'family-names'</lastName>
<name>'name'</name>
</fields>
</data>
<paginationpath>$['num-found']</paginationpath>
</urlConfig>
</urls>
<fetchMode>FIRST</fetchMode> <!-- EITHER 'FIRST' OR 'ALL' -->
</researchers>

View File

@ -12,7 +12,7 @@
<mat-card-content>
<div>
<div *ngFor="let key of visibleKeys">
<mat-form-field >
<mat-form-field>
<mat-label>{{key}} :</mat-label>
<textarea matInput class="language-area" cdkTextareaAutosize #autosize="cdkTextareaAutosize" [formControl]="formGroup.get(key)">
</textarea>