Production release February 2024 [CONNECT] #34
|
@ -26,9 +26,30 @@ export class SearchOrcidService {
|
||||||
.pipe(map(res => [res['name']['given-names'],
|
.pipe(map(res => [res['name']['given-names'],
|
||||||
res['name']['family-name'],
|
res['name']['family-name'],
|
||||||
res['name']]))
|
res['name']]))
|
||||||
|
|
||||||
.pipe(map(res => SearchOrcidService.parseOrcidAuthor(res, authorIds, authors, addId)));
|
.pipe(map(res => SearchOrcidService.parseOrcidAuthor(res, authorIds, authors, addId)));
|
||||||
}
|
}
|
||||||
|
searchOrcidSingleAuthor(term: string, properties: EnvProperties, addId): any {
|
||||||
|
|
||||||
|
//var headers = new Headers();
|
||||||
|
//headers.append('Accept', 'application/orcid+json');
|
||||||
|
let headers = new HttpHeaders({'Accept': 'application/orcid+json'});
|
||||||
|
|
||||||
|
let url = properties.searchOrcidURL + term + '/record';
|
||||||
|
|
||||||
|
return this.http.get(url, { headers: headers })
|
||||||
|
//.map(res => res.json()['person'])
|
||||||
|
.pipe(map(res => res['person']))
|
||||||
|
.pipe(map(res => [res['name']['given-names'],
|
||||||
|
res['name']['family-name'],
|
||||||
|
res['name']]))
|
||||||
|
|
||||||
|
.pipe(map(res => {
|
||||||
|
let authors = []
|
||||||
|
SearchOrcidService.parseOrcidAuthor(res, [], authors, addId)
|
||||||
|
return authors.length > 0 ? authors[0] : null;
|
||||||
|
}));
|
||||||
|
}
|
||||||
searchOrcidAuthors(term: string,
|
searchOrcidAuthors(term: string,
|
||||||
properties: EnvProperties): any {
|
properties: EnvProperties): any {
|
||||||
|
|
||||||
|
@ -45,6 +66,33 @@ export class SearchOrcidService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
searchOrcidAuthorsNew(term: string,
|
||||||
|
properties: EnvProperties, size = 10): any {
|
||||||
|
let headers = new HttpHeaders({'Accept': 'application/orcid+json'});
|
||||||
|
// let url = properties.searchOrcidURL+'search?defType=edismax&q='+term+'&qf=given-name^1.0+family-name^2.0+other-names^1.0+credit-name^1.0&start=0&rows=10';
|
||||||
|
let url = /*properties.searchOrcidURL +*/ 'https://pub.orcid.org/v3.0/expanded-search?q=' + StringUtils.URIEncode('{!edismax qf="given-and-family-names^50.0 family-name^10.0 given-names^10.0 credit-name^10.0 other-names^5.0 text^1.0" pf="given-and-family-names^50.0" bq="current-institution-affiliation-name:[* TO *]^100.0 past-institution-affiliation-name:[* TO *]^70" mm=1}') + term + '&start=0&rows=' + size;
|
||||||
|
// given-and-family-names^50.0 family-name^10.0 given-names^10.0 credit-name^10.0 other-names^5.0 text^1.0" pf="given-and-family-names^50.0" bq="current-institution-affiliation-name:[* TO *]^100.0 past-institution-affiliation-name:[* TO *]^70" mm=1}
|
||||||
|
// https://pub.orcid.org/v3.0/expanded-search/?q=%7B!edismax%20qf%3D%22given-and-family-names%5E50.0%20family-name%5E10.0%20given-names%5E10.0%20credit-name%5E10.0%20other-names%5E5.0%20text%5E1.0%22%20pf%3D%22given-and-family-names%5E50.0%22%20bq%3D%22current-institution-affiliation-name%3A%5B*%20TO%20*%5D%5E100.0%20past-institution-affiliation-name%3A%5B*%20TO%20*%5D%5E70%22%20mm%3D1%7Dpaolo%20manghi&start=0&rows=50
|
||||||
|
|
||||||
|
//q={!edismax qf="given-and-family-names^50.0 family-name^10.0 given-names^5.0 credit-name^10.0 other-names^5.0 text^1.0" pf="given-and-family-names^50.0" mm=1}alessia bardi&start=0&rows=10
|
||||||
|
let key = url;
|
||||||
|
return this.http.get(url, {headers: headers})
|
||||||
|
.pipe(map(res => res['expanded-result']))
|
||||||
|
.pipe(map(res => {
|
||||||
|
let authors = [];
|
||||||
|
if(res) {
|
||||||
|
for (let auth_result of res) {
|
||||||
|
const author = {};
|
||||||
|
author['id'] = auth_result['orcid-id'];
|
||||||
|
author['authorGivenName'] = auth_result['given-names'];
|
||||||
|
author['authorFamilyName'] = auth_result['family-names'];
|
||||||
|
authors.push(author);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return authors;
|
||||||
|
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
searchOrcidPublications(id: string, properties: EnvProperties, parse: boolean = false): any {
|
searchOrcidPublications(id: string, properties: EnvProperties, parse: boolean = false): any {
|
||||||
let headers = new HttpHeaders({'Accept': 'application/orcid+json'});
|
let headers = new HttpHeaders({'Accept': 'application/orcid+json'});
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
import { NgModule} from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import {SearchOrcidService} from "./searchOrcid.service";
|
||||||
|
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule, FormsModule
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
],
|
||||||
|
providers:[
|
||||||
|
SearchOrcidService
|
||||||
|
],
|
||||||
|
exports: [
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class SearchOrcidServiceModule { }
|
Loading…
Reference in New Issue