diff --git a/landingPages/publication/publication.service.ts b/landingPages/publication/publication.service.ts index 1461d6e6..2e975d91 100644 --- a/landingPages/publication/publication.service.ts +++ b/landingPages/publication/publication.service.ts @@ -356,10 +356,11 @@ export class PublicationService { getOpenCitations(id: string, properties:EnvProperties) { //https://services.openaire.eu/opencitations/getCitations?id=doajarticles::2634200c24772ee8f10232d3e184ec65 - let url = /*properties.searchAPIURLLAst*/ "https://services.openaire.eu/opencitations/getCitations?id=" + id; + let url = properties.openCitationsAPIURL+id;// "https://services.openaire.eu/opencitations/getCitations?id=" + id; let key = url; - return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) + //return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) + return this.http.get(url) .map(res => res.json()) .map(res => [res['total'], this.parseOpenCitations(res['results'])]); } @@ -376,31 +377,33 @@ export class PublicationService { let citation: {"url": string, "title": string, "year": string, "doi": string, "authors": string[]} = {"url": "", "title": "", "year": "", "doi": "", "authors": []}; - citation.url = openCitation.id; - citation.title = openCitation.title; - //citation.type = openCitation.type; - citation.year = (openCitation.pubDate && (openCitation.pubDate).indexOf('-') !== -1)?openCitation.pubDate.split('-')[0]:openCitation.pubDate; - citation.doi = openCitation.doi; + if(openCitation) { + citation.url = openCitation.id; + citation.title = openCitation.title; + //citation.type = openCitation.type; + citation.year = (openCitation.pubDate && (openCitation.pubDate).indexOf('-') !== -1)?openCitation.pubDate.split('-')[0]:openCitation.pubDate; + citation.doi = openCitation.doi; - let authorsLength = Array.isArray(openCitation.authors) ? openCitation.authors.length : 1; - for(let i=0; i