Revision 50586
Added by Argiro Kokogiannaki about 6 years ago
searchOrcid.service.ts | ||
---|---|---|
3 | 3 |
import {Http, Response} from '@angular/http'; |
4 | 4 |
import { Headers, RequestOptions } from '@angular/http'; |
5 | 5 |
import {Observable} from 'rxjs/Observable'; |
6 |
import {OpenaireProperties} from '../../../utils/properties/openaireProperties';
|
|
6 |
import{EnvProperties} from '../../../utils/properties/env-properties';
|
|
7 | 7 |
import 'rxjs/add/observable/of'; |
8 | 8 |
import 'rxjs/add/operator/do'; |
9 | 9 |
import 'rxjs/add/operator/share'; |
... | ... | |
14 | 14 |
|
15 | 15 |
|
16 | 16 |
searchOrcidAuthor (term: string, authorIds: string[], |
17 |
authorGivenNames: string[], authorFamilyNames: string[]):any { |
|
17 |
authorGivenNames: string[], authorFamilyNames: string[], properties:EnvProperties):any {
|
|
18 | 18 |
console.info("In searchOrcidAuthor: "+term); |
19 | 19 |
|
20 | 20 |
var headers = new Headers(); |
21 | 21 |
headers.append('Accept', 'application/orcid+json'); |
22 | 22 |
|
23 |
let url = OpenaireProperties.getSearchOrcidURL()+term+'/orcid-bio';
|
|
23 |
let url = properties.searchOrcidURL + term+'/orcid-bio';
|
|
24 | 24 |
let key = url; |
25 | 25 |
|
26 | 26 |
return this.http.get(url, { headers: headers }) |
... | ... | |
32 | 32 |
} |
33 | 33 |
|
34 | 34 |
searchOrcidAuthors (term: string, authorIds: string[], |
35 |
authorGivenNames: string[], authorFamilyNames: string[]):any { |
|
35 |
authorGivenNames: string[], authorFamilyNames: string[], properties:EnvProperties):any {
|
|
36 | 36 |
console.info("In search Orcid authors for keyword: "+term); |
37 | 37 |
|
38 | 38 |
var headers = new Headers(); |
39 | 39 |
headers.append('Accept', 'application/orcid+json'); |
40 | 40 |
|
41 |
let url = OpenaireProperties.getSearchOrcidURL()+'search/orcid-bio?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';
|
|
41 |
let url = properties.searchOrcidURL+'search/orcid-bio?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';
|
|
42 | 42 |
let key = url; |
43 | 43 |
|
44 | 44 |
return this.http.get(url, { headers: headers }) |
... | ... | |
47 | 47 |
|
48 | 48 |
} |
49 | 49 |
|
50 |
searchOrcidPublications (id: string):any { |
|
50 |
searchOrcidPublications (id: string, properties:EnvProperties):any {
|
|
51 | 51 |
console.info("In search Orcid publications for author: "+id); |
52 | 52 |
|
53 | 53 |
var headers = new Headers(); |
54 | 54 |
headers.append('Accept', 'application/orcid+json'); |
55 | 55 |
|
56 |
let url = OpenaireProperties.getSearchOrcidURL()+id+'/orcid-works';
|
|
56 |
let url =properties.searchOrcidURL+id+'/orcid-works';
|
|
57 | 57 |
let key = url; |
58 | 58 |
|
59 | 59 |
return this.http.get(url, { headers: headers }) |
Also available in: Unified diff
USe a json file to read properties | replace openaire Properties | parameterize menu (use params, community, ) | parameterize search pages (hide community information)