Revision 55899
Added by Konstantina Galouni over 5 years ago
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/entities/orpInfo.ts | ||
---|---|---|
2 | 2 |
underCurationMessage: boolean; |
3 | 3 |
title: string; |
4 | 4 |
accessMode: string; |
5 |
authors: string[];
|
|
5 |
authors: {"fullName": string, "orcid": string}[];
|
|
6 | 6 |
date: string; |
7 | 7 |
dateofacceptance: string; |
8 | 8 |
embargoEndDate: string; |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/entities/datasetInfo.ts | ||
---|---|---|
4 | 4 |
title: string; |
5 | 5 |
subtitle: string; |
6 | 6 |
accessMode: string; |
7 |
authors: string[];
|
|
7 |
authors: {"fullName": string, "orcid": string}[];
|
|
8 | 8 |
date: string; |
9 | 9 |
dateofacceptance: string; |
10 | 10 |
embargoEndDate: string; |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/entities/publicationInfo.ts | ||
---|---|---|
3 | 3 |
//title: { "name": string, "url": string, "accessMode": string}; |
4 | 4 |
title: string; |
5 | 5 |
accessMode: string; |
6 |
authors: string[];
|
|
6 |
authors: {"fullName": string, "orcid": string}[];
|
|
7 | 7 |
date: string; |
8 | 8 |
dateofacceptance: string; |
9 | 9 |
embargoEndDate: string; |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/authors/showAuthors.module.ts | ||
---|---|---|
1 |
import { NgModule} from '@angular/core'; |
|
2 |
import { CommonModule } from '@angular/common'; |
|
3 |
import { FormsModule } from '@angular/forms'; |
|
4 |
import { RouterModule } from '@angular/router'; |
|
5 |
|
|
6 |
import {ShowAuthorsComponent} from './showAuthors.component'; |
|
7 |
|
|
8 |
@NgModule({ |
|
9 |
imports: [ |
|
10 |
CommonModule, FormsModule, RouterModule |
|
11 |
], |
|
12 |
declarations: [ |
|
13 |
ShowAuthorsComponent |
|
14 |
], |
|
15 |
providers:[ |
|
16 |
], |
|
17 |
exports: [ |
|
18 |
ShowAuthorsComponent |
|
19 |
] |
|
20 |
}) |
|
21 |
export class ShowAuthorsModule { } |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/claims/claim-utils/claimResultSearchForm.component.ts | ||
---|---|---|
688 | 688 |
result.result = item; |
689 | 689 |
if(item.authors){ |
690 | 690 |
for(var j=0; j<item.authors.length; j++){ |
691 |
result.authors.push(item.authors[j]); |
|
691 |
result.authors.push(item.authors[j]['fullName']);
|
|
692 | 692 |
} |
693 | 693 |
} |
694 | 694 |
|
modules/uoa-services-library/trunk/ng-openaire-library/src/app/claims/directLinking/directLinking.component.html | ||
---|---|---|
47 | 47 |
|
48 | 48 |
<span *ngIf="!displayedResult.url" > {{((displayedResult.title == undefined || displayedResult.title == '')?'[no title available]':displayedResult.title)}}</span> |
49 | 49 |
</div> |
50 |
<div *ngIf="displayedResult.result.authors && displayedResult.result.authors.length >0 " class="uk-article-meta">Authors: <span *ngFor="let author of displayedResult.result.authors.slice(0,10) let i = index">{{author}}{{(i < (displayedResult.result.authors.slice(0,10).length-1))?"; ":""}}{{(i == displayedResult.result.authors.slice(0,10).length-1 && displayedResult.result.authors.length > 10)?"...":""}}</span></div> |
|
50 |
<div *ngIf="displayedResult.result.authors && displayedResult.result.authors.length >0 " class="uk-article-meta">Authors: <span *ngFor="let author of displayedResult.result.authors.slice(0,10) let i = index">{{author.fullName}}{{(i < (displayedResult.result.authors.slice(0,10).length-1))?"; ":""}}{{(i == displayedResult.result.authors.slice(0,10).length-1 && displayedResult.result.authors.length > 10)?"...":""}}</span></div>
|
|
51 | 51 |
|
52 | 52 |
|
53 | 53 |
</div> |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/services/searchDatasets.service.ts | ||
---|---|---|
37 | 37 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
38 | 38 |
.map(res => <any> res.json()) |
39 | 39 |
//.do(res => console.info(res)) |
40 |
.map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "dataset")]); |
|
40 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties),RefineResultsUtils.parse(res['refineResults'],refineFields, "dataset")]);
|
|
41 | 41 |
} |
42 | 42 |
searchDatasetById (id: string , properties:EnvProperties):any { |
43 | 43 |
|
44 | 44 |
let url = properties.searchAPIURLLAst+"datasets/"+id+"?format=json"; |
45 | 45 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
46 | 46 |
.map(res => <any> res.json()) |
47 |
.map(res => this.parseResults(res)); |
|
47 |
.map(res => this.parseResults(res, properties));
|
|
48 | 48 |
} |
49 | 49 |
|
50 | 50 |
searchAggregators (id: string, params: string, refineParams:string, page: number, size: number, properties:EnvProperties ):any { |
... | ... | |
89 | 89 |
.map(res => <any> res.json()) |
90 | 90 |
//.do(res => console.info(res)) |
91 | 91 |
|
92 |
.map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "dataset")]); |
|
92 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties),RefineResultsUtils.parse(res['refineResults'],refineFields, "dataset")]);
|
|
93 | 93 |
} |
94 | 94 |
advancedSearchDatasets (params: string, page: number, size: number, sortBy: string, properties:EnvProperties ):any { |
95 | 95 |
let url = properties.searchResourcesAPIURL; |
... | ... | |
112 | 112 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
113 | 113 |
.map(res => <any> res.json()) |
114 | 114 |
//.do(res => console.info(res)) |
115 |
.map(res => [res['meta'].total, this.parseResults(res['results'])]); |
|
115 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties)]);
|
|
116 | 116 |
} |
117 | 117 |
searchDatasetsForEntity (params: string, page: number, size: number, properties:EnvProperties):any { |
118 | 118 |
let link = properties.searchAPIURLLAst; |
... | ... | |
120 | 120 |
|
121 | 121 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
122 | 122 |
.map(res => <any> res.json()) |
123 |
.map(res => [res['meta'].total, this.parseResults(res['results'])]); |
|
123 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties)]);
|
|
124 | 124 |
} |
125 | 125 |
|
126 | 126 |
searchDatasetsForDataproviders(params: string, page: number, size: number, properties:EnvProperties):any { |
... | ... | |
128 | 128 |
let url = link+params+ "&page="+(page-1)+"&size="+size + "&format=json"; |
129 | 129 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
130 | 130 |
.map(res => <any> res.json()) |
131 |
.map(res => [res['meta'].total, this.parseResults(res['results'])]); |
|
131 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties)]);
|
|
132 | 132 |
} |
133 | 133 |
|
134 |
parseResults(data: any): SearchResult[] { |
|
134 |
parseResults(data: any, properties: EnvProperties): SearchResult[] {
|
|
135 | 135 |
let results: SearchResult[] = []; |
136 | 136 |
|
137 | 137 |
let length = Array.isArray(data) ? data.length : 1; |
... | ... | |
220 | 220 |
|
221 | 221 |
if(resData.hasOwnProperty("creator") && resData['creator'] != null) { |
222 | 222 |
if(result['authors'] == undefined) { |
223 |
result['authors'] = new Array<string>();
|
|
223 |
result['authors'] = new Array<{"fullName": string, "orcid": string}>();
|
|
224 | 224 |
} |
225 | 225 |
|
226 | 226 |
let authors = resData['creator']; |
... | ... | |
228 | 228 |
|
229 | 229 |
for(let i=0; i<length; i++) { |
230 | 230 |
let author = Array.isArray(authors) ? authors[i] : authors; |
231 |
result.authors[author.rank] = author.content; |
|
231 |
if(author) { |
|
232 |
if (author.ORCID && author.ORCID.indexOf(properties.orcidURL) != -1) { |
|
233 |
author.ORCID = author.ORCID.substr(properties.orcidURL.length); |
|
234 |
} |
|
235 |
result['authors'][author.rank] = {"fullName": author.content, "orcid": author.ORCID}; |
|
236 |
} |
|
232 | 237 |
} |
233 | 238 |
result.authors = result.authors.filter(function (item) { |
234 |
return (item != undefined); |
|
239 |
return (item != undefined && item.fullName != undefined);
|
|
235 | 240 |
}); |
236 | 241 |
} |
237 | 242 |
|
modules/uoa-services-library/trunk/ng-openaire-library/src/app/services/searchOrps.service.ts | ||
---|---|---|
37 | 37 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
38 | 38 |
.map(res => <any> res.json()) |
39 | 39 |
//.do(res => console.info(res)) |
40 |
.map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "other")]); |
|
40 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties),RefineResultsUtils.parse(res['refineResults'],refineFields, "other")]);
|
|
41 | 41 |
} |
42 | 42 |
searchOrpById (id: string , properties:EnvProperties):any { |
43 | 43 |
|
... | ... | |
45 | 45 |
|
46 | 46 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
47 | 47 |
.map(res => <any> res.json()) |
48 |
.map(res => this.parseResults(res)); |
|
48 |
.map(res => this.parseResults(res, properties));
|
|
49 | 49 |
} |
50 | 50 |
|
51 | 51 |
searchAggregators (id: string, params: string, refineParams:string, page: number, size: number, properties:EnvProperties ):any { |
... | ... | |
91 | 91 |
.map(res => <any> res.json()) |
92 | 92 |
//.do(res => console.info(res)) |
93 | 93 |
|
94 |
.map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "other")]); |
|
94 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties),RefineResultsUtils.parse(res['refineResults'],refineFields, "other")]);
|
|
95 | 95 |
} |
96 | 96 |
advancedSearchOrps (params: string, page: number, size: number, sortBy: string, properties:EnvProperties ):any { |
97 | 97 |
let url = properties.searchResourcesAPIURL; |
... | ... | |
115 | 115 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
116 | 116 |
.map(res => <any> res.json()) |
117 | 117 |
//.do(res => console.info(res)) |
118 |
.map(res => [res['meta'].total, this.parseResults(res['results'])]); |
|
118 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties)]);
|
|
119 | 119 |
} |
120 | 120 |
searchOrpsForEntity (params: string, page: number, size: number, properties:EnvProperties):any { |
121 | 121 |
let link = properties.searchAPIURLLAst; |
... | ... | |
124 | 124 |
|
125 | 125 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
126 | 126 |
.map(res => <any> res.json()) |
127 |
.map(res => [res['meta'].total, this.parseResults(res['results'])]); |
|
127 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties)]);
|
|
128 | 128 |
} |
129 | 129 |
|
130 | 130 |
searchOrpsForDataproviders(params: string, page: number, size: number, properties:EnvProperties):any { |
... | ... | |
133 | 133 |
let url = link+params+ "&page="+(page-1)+"&size="+size + "&format=json"; |
134 | 134 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
135 | 135 |
.map(res => <any> res.json()) |
136 |
.map(res => [res['meta'].total, this.parseResults(res['results'])]); |
|
136 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties)]);
|
|
137 | 137 |
} |
138 | 138 |
|
139 |
parseResults(data: any): SearchResult[] { |
|
139 |
parseResults(data: any, properties: EnvProperties): SearchResult[] {
|
|
140 | 140 |
let results: SearchResult[] = []; |
141 | 141 |
|
142 | 142 |
let length = Array.isArray(data) ? data.length : 1; |
... | ... | |
225 | 225 |
|
226 | 226 |
if(resData.hasOwnProperty("creator") && resData['creator'] != null) { |
227 | 227 |
if(result['authors'] == undefined) { |
228 |
result['authors'] = new Array<string>();
|
|
228 |
result['authors'] = new Array<{"fullName": string, "orcid": string}>();
|
|
229 | 229 |
} |
230 | 230 |
|
231 | 231 |
let authors = resData['creator']; |
... | ... | |
233 | 233 |
|
234 | 234 |
for(let i=0; i<length; i++) { |
235 | 235 |
let author = Array.isArray(authors) ? authors[i] : authors; |
236 |
result.authors[author.rank] = author.content; |
|
237 |
} |
|
236 |
if(author) { |
|
237 |
if (author.ORCID && author.ORCID.indexOf(properties.orcidURL) != -1) { |
|
238 |
author.ORCID = author.ORCID.substr(properties.orcidURL.length); |
|
239 |
} |
|
240 |
result['authors'][author.rank] = {"fullName": author.content, "orcid": author.ORCID}; |
|
241 |
} } |
|
238 | 242 |
result.authors = result.authors.filter(function (item) { |
239 |
return (item != undefined); |
|
243 |
return (item != undefined && item.fullName != undefined);
|
|
240 | 244 |
}); |
241 | 245 |
} |
242 | 246 |
|
modules/uoa-services-library/trunk/ng-openaire-library/src/app/services/searchSoftware.service.ts | ||
---|---|---|
36 | 36 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
37 | 37 |
.map(res => <any> res.json()) |
38 | 38 |
//.do(res => console.info(res)) |
39 |
.map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "software")]); |
|
39 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties),RefineResultsUtils.parse(res['refineResults'],refineFields, "software")]);
|
|
40 | 40 |
} |
41 | 41 |
searchSoftwareById (id: string, properties:EnvProperties ):any { |
42 | 42 |
|
... | ... | |
45 | 45 |
|
46 | 46 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
47 | 47 |
.map(res => <any> res.json()) |
48 |
.map(res => this.parseResults(res)); |
|
48 |
.map(res => this.parseResults(res, properties));
|
|
49 | 49 |
} |
50 | 50 |
|
51 | 51 |
searchAggregators (id: string, params: string, refineParams:string, page: number, size: number, properties:EnvProperties ):any { |
... | ... | |
88 | 88 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
89 | 89 |
.map(res => <any> res.json()) |
90 | 90 |
//.do(res => console.info(res)) |
91 |
.map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "software")]); |
|
91 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties),RefineResultsUtils.parse(res['refineResults'],refineFields, "software")]);
|
|
92 | 92 |
} |
93 | 93 |
advancedSearchSoftware (params: string, page: number, size: number, sortBy: string, properties:EnvProperties ):any { |
94 | 94 |
let url = properties.searchResourcesAPIURL; |
... | ... | |
111 | 111 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
112 | 112 |
.map(res => <any> res.json()) |
113 | 113 |
//.do(res => console.info(res)) |
114 |
.map(res => [res['meta'].total, this.parseResults(res['results'])]); |
|
114 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties)]);
|
|
115 | 115 |
} |
116 | 116 |
searchSoftwareForEntity (params: string, page: number, size: number, properties:EnvProperties):any { |
117 | 117 |
let link = properties.searchAPIURLLAst; |
... | ... | |
119 | 119 |
|
120 | 120 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
121 | 121 |
.map(res => <any> res.json()) |
122 |
.map(res => [res['meta'].total, this.parseResults(res['results'])]); |
|
122 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties)]);
|
|
123 | 123 |
} |
124 | 124 |
|
125 | 125 |
searchSoftwareForDataproviders(params: string, page: number, size: number, properties:EnvProperties):any { |
... | ... | |
128 | 128 |
|
129 | 129 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
130 | 130 |
.map(res => <any> res.json()) |
131 |
.map(res => [res['meta'].total, this.parseResults(res['results'])]); |
|
131 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties)]);
|
|
132 | 132 |
} |
133 | 133 |
|
134 |
parseResults(data: any): SearchResult[] { |
|
134 |
parseResults(data: any, properties: EnvProperties): SearchResult[] {
|
|
135 | 135 |
let results: SearchResult[] = []; |
136 | 136 |
|
137 | 137 |
let length = Array.isArray(data) ? data.length : 1; |
... | ... | |
237 | 237 |
|
238 | 238 |
if(resData.hasOwnProperty("creator") && resData['creator'] != null) { |
239 | 239 |
if(result['authors'] == undefined) { |
240 |
result['authors'] = new Array<string>();
|
|
240 |
result['authors'] = new Array<{"fullName": string, "orcid": string}>();
|
|
241 | 241 |
} |
242 | 242 |
|
243 | 243 |
let authors = resData['creator']; |
... | ... | |
245 | 245 |
|
246 | 246 |
for(let i=0; i<length; i++) { |
247 | 247 |
let author = Array.isArray(authors) ? authors[i] : authors; |
248 |
result.authors[author.rank] = author.content; |
|
248 |
if(author) { |
|
249 |
if (author.ORCID && author.ORCID.indexOf(properties.orcidURL) != -1) { |
|
250 |
author.ORCID = author.ORCID.substr(properties.orcidURL.length); |
|
251 |
} |
|
252 |
result['authors'][author.rank] = {"fullName": author.content, "orcid": author.ORCID}; |
|
253 |
} |
|
249 | 254 |
} |
250 | 255 |
result.authors = result.authors.filter(function (item) { |
251 |
return (item != undefined); |
|
256 |
return (item != undefined && item.fullName != undefined);
|
|
252 | 257 |
}); |
253 | 258 |
} |
254 | 259 |
|
modules/uoa-services-library/trunk/ng-openaire-library/src/app/services/searchPublications.service.ts | ||
---|---|---|
38 | 38 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
39 | 39 |
.map(res => <any> res.json()) |
40 | 40 |
// .do(res => console.info(res)) |
41 |
.map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "publication")]); |
|
41 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties),RefineResultsUtils.parse(res['refineResults'],refineFields, "publication")]);
|
|
42 | 42 |
} |
43 | 43 |
searchPublicationById (id: string, properties:EnvProperties ):any { |
44 | 44 |
|
... | ... | |
46 | 46 |
|
47 | 47 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
48 | 48 |
.map(res => <any> res.json()) |
49 |
.map(res => this.parseResults(res)); |
|
49 |
.map(res => this.parseResults(res, properties));
|
|
50 | 50 |
} |
51 | 51 |
|
52 | 52 |
searchAggregators (id: string, params: string, refineParams:string, page: number, size: number, properties:EnvProperties ):any { |
... | ... | |
91 | 91 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
92 | 92 |
.map(res => <any> res.json()) |
93 | 93 |
//.do(res => console.info(res)) |
94 |
.map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "publication")]); |
|
94 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties),RefineResultsUtils.parse(res['refineResults'],refineFields, "publication")]);
|
|
95 | 95 |
} |
96 | 96 |
|
97 | 97 |
advancedSearchPublications (params: string, page: number, size: number, sortBy: string, properties:EnvProperties ):any { |
... | ... | |
116 | 116 |
.map(res => <any> res.json()) |
117 | 117 |
//.do(res => console.info(res)) |
118 | 118 |
|
119 |
.map(res => [res['meta'].total, this.parseResults(res['results'])]); |
|
119 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties)]);
|
|
120 | 120 |
} |
121 | 121 |
searchPublicationsForEntity (params: string, page: number, size: number, properties:EnvProperties):any { |
122 | 122 |
let link = properties.searchAPIURLLAst; |
... | ... | |
127 | 127 |
|
128 | 128 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
129 | 129 |
.map(res => <any> res.json()) |
130 |
.map(res => [res['meta'].total, this.parseResults(res['results'])]); |
|
130 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties)]);
|
|
131 | 131 |
} |
132 | 132 |
|
133 | 133 |
searchPublicationsForDataproviders(params: string, page: number, size: number, properties:EnvProperties):any { |
... | ... | |
135 | 135 |
let url = link+params+ "&page="+(page-1)+"&size="+size + "&format=json"; |
136 | 136 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
137 | 137 |
.map(res => <any> res.json()) |
138 |
.map(res => [res['meta'].total, this.parseResults(res['results'])]); |
|
138 |
.map(res => [res['meta'].total, this.parseResults(res['results'], properties)]);
|
|
139 | 139 |
} |
140 | 140 |
/* |
141 | 141 |
searchPublicationsCSV (params: string, refineParams:string, page: number, size: number):any { |
... | ... | |
161 | 161 |
} |
162 | 162 |
*/ |
163 | 163 |
|
164 |
parseResults(data: any): SearchResult[] { |
|
164 |
parseResults(data: any, properties: EnvProperties): SearchResult[] {
|
|
165 | 165 |
let results: SearchResult[] = []; |
166 | 166 |
|
167 | 167 |
let length = Array.isArray(data) ? data.length : 1; |
... | ... | |
256 | 256 |
|
257 | 257 |
if(resData.hasOwnProperty("creator") && resData['creator'] != null) { |
258 | 258 |
if(result['authors'] == undefined) { |
259 |
result['authors'] = new Array<string>();
|
|
259 |
result['authors'] = new Array<{"fullName": string, "orcid": string}>();
|
|
260 | 260 |
} |
261 | 261 |
|
262 | 262 |
let authors = resData['creator']; |
... | ... | |
264 | 264 |
|
265 | 265 |
for(let i=0; i<length; i++) { |
266 | 266 |
let author = Array.isArray(authors) ? authors[i] : authors; |
267 |
result.authors[author.rank] = author.content; |
|
267 |
if(author) { |
|
268 |
if (author.ORCID && author.ORCID.indexOf(properties.orcidURL) != -1) { |
|
269 |
author.ORCID = author.ORCID.substr(properties.orcidURL.length); |
|
270 |
} |
|
271 |
result['authors'][author.rank] = {"fullName": author.content, "orcid": author.ORCID}; |
|
272 |
} |
|
268 | 273 |
} |
269 | 274 |
result.authors = result.authors.filter(function (item) { |
270 |
return (item != undefined); |
|
275 |
return (item != undefined && item.fullName != undefined);
|
|
271 | 276 |
}); |
272 | 277 |
} |
273 | 278 |
|
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/searchResult.component.html | ||
---|---|---|
24 | 24 |
|
25 | 25 |
<span *ngIf="result.title && result.title.sc39" class="uk-label custom-label label-sc39 " title="Special Clause 39">Special Clause 39</span> |
26 | 26 |
<div class="uk-margin-small"> |
27 |
<span *ngIf="result['authors'] != undefined" class="resultsAuthors uk-margin-small-top" style="font-style: italic;"> |
|
28 |
<span *ngFor="let author of result['authors'].slice(0,15)"> |
|
29 |
{{author}}; |
|
30 |
</span> |
|
31 |
<span *ngIf="result['authors'].length > 15">...</span> |
|
32 |
</span> |
|
27 |
<!-- <span *ngIf="result['authors'] != undefined" class="resultsAuthors uk-margin-small-top" style="font-style: italic;">--> |
|
28 |
<!-- <span *ngFor="let author of result['authors'].slice(0,15)">--> |
|
29 |
<!-- {{author}};--> |
|
30 |
<!-- </span>--> |
|
31 |
<!-- <span *ngIf="result['authors'].length > 15">...</span>--> |
|
32 |
<!-- </span>--> |
|
33 |
<showAuthors [authors]="result['authors']" [authorsLimit]=15 [showAll]=false></showAuthors> |
|
33 | 34 |
<span *ngIf="result.year != undefined && result.year != ''"> |
34 | 35 |
({{result.year}}) |
35 | 36 |
</span> |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/tabResult.module.ts | ||
---|---|---|
5 | 5 |
import {SearchResult} from '../../utils/entities/searchResult'; |
6 | 6 |
import {TabResultComponent} from './tabResult.component'; |
7 | 7 |
import {RouterModule} from '@angular/router'; |
8 |
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module"; |
|
8 | 9 |
|
9 | 10 |
@NgModule({ |
10 | 11 |
imports: [ |
11 | 12 |
CommonModule, FormsModule, |
12 |
RouterModule |
|
13 |
RouterModule, ShowAuthorsModule
|
|
13 | 14 |
], |
14 | 15 |
declarations: [ |
15 | 16 |
TabResultComponent, |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/searchResults.module.ts | ||
---|---|---|
8 | 8 |
import {SearchResult} from '../../utils/entities/searchResult'; |
9 | 9 |
import {SearchResultComponent} from './searchResult.component'; |
10 | 10 |
import {ApprovedByCommunityModule} from '../../connect/approvedByCommunity/approved.module'; |
11 |
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module"; |
|
11 | 12 |
|
12 | 13 |
@NgModule({ |
13 | 14 |
imports: [ |
14 | 15 |
CommonModule, FormsModule, |
15 | 16 |
RouterModule, ErrorMessagesModule, |
16 |
ApprovedByCommunityModule |
|
17 |
ApprovedByCommunityModule, |
|
18 |
ShowAuthorsModule |
|
17 | 19 |
], |
18 | 20 |
declarations: [ |
19 | 21 |
SearchResultComponent |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/tabResult.component.html | ||
---|---|---|
46 | 46 |
<span *ngIf="result.country != undefined && result.country != ''" class="uk-label custom-label label-country" title="Country"> {{result.country}}</span> |
47 | 47 |
|
48 | 48 |
<div class="uk-margin-small"> |
49 |
<span *ngIf="result['authors'] != undefined" class="resultsAuthors uk-margin-small-top" style="font-style: italic;"> |
|
50 |
<span *ngFor="let author of result['authors'].slice(0,15)"> |
|
51 |
{{author}}; |
|
52 |
</span> |
|
53 |
<span *ngIf="result['authors'].length > 15">...</span> |
|
54 |
</span> |
|
49 |
<!-- <span *ngIf="result['authors'] != undefined" class="resultsAuthors uk-margin-small-top" style="font-style: italic;">--> |
|
50 |
<!-- <span *ngFor="let author of result['authors'].slice(0,15)">--> |
|
51 |
<!-- {{author}};--> |
|
52 |
<!-- </span>--> |
|
53 |
<!-- <span *ngIf="result['authors'].length > 15">...</span>--> |
|
54 |
<!-- </span>--> |
|
55 |
<showAuthors [authors]="result['authors']" [authorsLimit]=15 [showAll]=false></showAuthors> |
|
55 | 56 |
<span *ngIf="result.year != undefined && result.year != ''"> |
56 | 57 |
({{result.year}}) |
57 | 58 |
</span> |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/orp/orp.component.html | ||
---|---|---|
23 | 23 |
</span> |
24 | 24 |
|
25 | 25 |
<div class= " uk-margin-top"> |
26 |
<showAuthors [authors]="orpInfo.authors" searchPage="orps"></showAuthors>
|
|
26 |
<showAuthors [authors]="orpInfo.authors"></showAuthors> |
|
27 | 27 |
<span *ngIf="orpInfo.date != ''">({{orpInfo.date}})</span> |
28 | 28 |
</div> |
29 | 29 |
|
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/orp/orp.service.ts | ||
---|---|---|
43 | 43 |
res[2], //13 |
44 | 44 |
(res[1]['extraInfo']!= undefined && res[1]['extraInfo']['citations']!= undefined)? res[1]['extraInfo']['citations']['citation']:null, //14 |
45 | 45 |
res[1]['oaf:result']['journal'] //15 |
46 |
]).map(res => this.parseOrpInfo(res)); |
|
46 |
]).map(res => this.parseOrpInfo(res, properties));
|
|
47 | 47 |
} |
48 | 48 |
|
49 | 49 |
private handleError (error: Response) { |
... | ... | |
53 | 53 |
return Observable.throw(error || 'Server error'); |
54 | 54 |
} |
55 | 55 |
|
56 |
parseOrpInfo (data: any):any { |
|
56 |
parseOrpInfo (data: any, properties: EnvProperties):any {
|
|
57 | 57 |
this.orpInfo = new OrpInfo(); |
58 | 58 |
this.orpInfo.record = data[13]; |
59 | 59 |
if(data[0] != null) { |
... | ... | |
169 | 169 |
|
170 | 170 |
if(data[10] != null) { |
171 | 171 |
if(this.orpInfo.authors == undefined) { |
172 |
this.orpInfo.authors = new Array<string>();
|
|
172 |
this.orpInfo.authors = new Array<{"fullName": string, "orcid": string}>();
|
|
173 | 173 |
} |
174 | 174 |
|
175 | 175 |
let authors = data[10]; |
176 | 176 |
let length = Array.isArray(authors) ? authors.length : 1; |
177 |
|
|
177 | 178 |
for(let i=0; i<length; i++) { |
178 | 179 |
let author = Array.isArray(authors) ? authors[i] : authors; |
179 |
this.orpInfo.authors[author.rank] = author.content; |
|
180 |
|
|
180 |
if(author) { |
|
181 |
if (author.ORCID && author.ORCID.indexOf(properties.orcidURL) != -1) { |
|
182 |
author.ORCID = author.ORCID.substr(properties.orcidURL.length); |
|
183 |
} |
|
184 |
this.orpInfo['authors'][author.rank] = {"fullName": author.content, "orcid": author.ORCID}; |
|
185 |
} |
|
181 | 186 |
} |
182 |
|
|
183 | 187 |
this.orpInfo.authors = this.orpInfo.authors.filter(function (item) { |
184 |
return (item != undefined); |
|
188 |
return (item != undefined && item.fullName != undefined);
|
|
185 | 189 |
}); |
186 | 190 |
} |
187 | 191 |
|
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/orp/orp.module.ts | ||
---|---|---|
22 | 22 |
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; |
23 | 23 |
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; |
24 | 24 |
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module'; |
25 |
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module"; |
|
25 | 26 |
|
26 | 27 |
|
27 | 28 |
@NgModule({ |
28 | 29 |
imports: [ |
29 | 30 |
CommonModule, FormsModule, SharedModule, RouterModule, LandingModule, |
30 | 31 |
CiteThisModule, ResultLandingModule, MetricsModule, IFrameModule, PagingModule, |
31 |
AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule |
|
32 |
AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule, |
|
33 |
ShowAuthorsModule |
|
32 | 34 |
], |
33 | 35 |
declarations: [ |
34 | 36 |
OrpComponent |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/dataset/dataset.component.html | ||
---|---|---|
36 | 36 |
</div--> |
37 | 37 |
|
38 | 38 |
<div class= " uk-margin-top"> |
39 |
<showAuthors [authors]="datasetInfo.authors" searchPage="datasets"></showAuthors>
|
|
39 |
<showAuthors [authors]="datasetInfo.authors"></showAuthors> |
|
40 | 40 |
<span *ngIf="datasetInfo.date != ''">({{datasetInfo.date}})</span> |
41 | 41 |
</div> |
42 | 42 |
|
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/dataset/dataset.service.ts | ||
---|---|---|
45 | 45 |
res[2], //13 |
46 | 46 |
(res[1]['extraInfo']!= undefined && res[1]['extraInfo']['citations']!= undefined)? res[1]['extraInfo']['citations']['citation']:null, //14 |
47 | 47 |
res[1]['journal'] //15 |
48 |
]).map(res => this.parseDatasetInfo(res)); |
|
48 |
]).map(res => this.parseDatasetInfo(res, properties));
|
|
49 | 49 |
} |
50 | 50 |
|
51 | 51 |
private handleError (error: Response) { |
... | ... | |
55 | 55 |
return Observable.throw(error || 'Server error'); |
56 | 56 |
} |
57 | 57 |
|
58 |
parseDatasetInfo (data: any):any { |
|
58 |
parseDatasetInfo (data: any, properties: EnvProperties):any {
|
|
59 | 59 |
this.datasetInfo = new DatasetInfo(); |
60 | 60 |
this.datasetInfo.record = data[13]; |
61 | 61 |
// ['result']['metadata']['oaf:entity']['oaf:result'] |
... | ... | |
199 | 199 |
// ['result']['metadata']['oaf:entity']['oaf:result']['creator'] |
200 | 200 |
if(data[10] != null) { |
201 | 201 |
if(this.datasetInfo.authors == undefined) { |
202 |
this.datasetInfo.authors = new Array<string>();
|
|
202 |
this.datasetInfo.authors = new Array<{"fullName": string, "orcid": string}>();
|
|
203 | 203 |
} |
204 | 204 |
|
205 | 205 |
let authors = data[10]; |
206 | 206 |
let length = Array.isArray(authors) ? authors.length : 1; |
207 |
|
|
207 | 208 |
for(let i=0; i<length; i++) { |
208 | 209 |
let author = Array.isArray(authors) ? authors[i] : authors; |
209 |
this.datasetInfo.authors[author.rank] = author.content; |
|
210 |
|
|
210 |
if(author) { |
|
211 |
if (author.ORCID && author.ORCID.indexOf(properties.orcidURL) != -1) { |
|
212 |
author.ORCID = author.ORCID.substr(properties.orcidURL.length); |
|
213 |
} |
|
214 |
this.datasetInfo['authors'][author.rank] = {"fullName": author.content, "orcid": author.ORCID}; |
|
215 |
} |
|
211 | 216 |
} |
212 |
|
|
213 | 217 |
this.datasetInfo.authors = this.datasetInfo.authors.filter(function (item) { |
214 |
return (item != undefined); |
|
218 |
return (item != undefined && item.fullName != undefined);
|
|
215 | 219 |
}); |
216 | 220 |
} |
217 | 221 |
|
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/dataset/dataset.module.ts | ||
---|---|---|
25 | 25 |
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; |
26 | 26 |
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module'; |
27 | 27 |
|
28 |
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module"; |
|
28 | 29 |
|
29 | 30 |
@NgModule({ |
30 | 31 |
imports: [ |
31 | 32 |
//MaterialModule.forRoot(), |
32 | 33 |
CommonModule, FormsModule, SharedModule, RouterModule, LandingModule, |
33 | 34 |
CiteThisModule, ResultLandingModule, MetricsModule, IFrameModule, PagingModule, |
34 |
AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule |
|
35 |
AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule, |
|
36 |
ShowAuthorsModule |
|
35 | 37 |
], |
36 | 38 |
declarations: [ |
37 | 39 |
DatasetComponent |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/publication/publication.module.ts | ||
---|---|---|
23 | 23 |
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module'; |
24 | 24 |
|
25 | 25 |
import {DeletedByInferenceModule} from '../landing-utils/deletedByInference/deletedByInference.module'; |
26 |
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module"; |
|
26 | 27 |
|
27 | 28 |
@NgModule({ |
28 | 29 |
imports: [ |
29 | 30 |
CommonModule, FormsModule, LandingModule, SharedModule, RouterModule, |
30 | 31 |
CiteThisModule, PagingModule, ResultLandingModule, IFrameModule, |
31 | 32 |
MetricsModule, AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule, |
32 |
DeletedByInferenceModule |
|
33 |
DeletedByInferenceModule, ShowAuthorsModule
|
|
33 | 34 |
], |
34 | 35 |
declarations: [ |
35 | 36 |
PublicationComponent |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/publication/publication.component.html | ||
---|---|---|
27 | 27 |
|
28 | 28 |
|
29 | 29 |
<div class= " uk-margin-top"> |
30 |
<showAuthors [authors]="publicationInfo.authors" searchPage="publications"></showAuthors>
|
|
30 |
<showAuthors [authors]="publicationInfo.authors"></showAuthors> |
|
31 | 31 |
<span *ngIf="publicationInfo.date != ''">({{publicationInfo.date}})</span> |
32 | 32 |
</div> |
33 | 33 |
|
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/publication/publication.service.ts | ||
---|---|---|
47 | 47 |
res[2], //14 |
48 | 48 |
res[1]['oaf:result']['country'] //15 |
49 | 49 |
]) |
50 |
.map(res => this.parsePublicationInfo(res)); |
|
50 |
.map(res => this.parsePublicationInfo(res, properties));
|
|
51 | 51 |
} |
52 | 52 |
|
53 | 53 |
private handleError (error: Response) { |
... | ... | |
57 | 57 |
return Observable.throw(error || 'Server error'); |
58 | 58 |
} |
59 | 59 |
|
60 |
parsePublicationInfo (data: any):any { |
|
60 |
parsePublicationInfo (data: any, properties: EnvProperties):any {
|
|
61 | 61 |
this.publicationInfo = new PublicationInfo(); |
62 | 62 |
this.publicationInfo.record = data[14]; |
63 | 63 |
if(data[0] != null) { |
... | ... | |
243 | 243 |
|
244 | 244 |
if(data[13] != null) { |
245 | 245 |
if(this.publicationInfo.authors == undefined) { |
246 |
this.publicationInfo.authors = new Array<string>();
|
|
246 |
this.publicationInfo.authors = new Array<{"fullName": string, "orcid": string}>();
|
|
247 | 247 |
} |
248 | 248 |
|
249 | 249 |
let authors = data[13]; |
... | ... | |
251 | 251 |
|
252 | 252 |
for(let i=0; i<length; i++) { |
253 | 253 |
let author = Array.isArray(authors) ? authors[i] : authors; |
254 |
this.publicationInfo.authors[author.rank] = author.content; |
|
254 |
if(author) { |
|
255 |
if (author.ORCID && author.ORCID.indexOf(properties.orcidURL) != -1) { |
|
256 |
author.ORCID = author.ORCID.substr(properties.orcidURL.length); |
|
257 |
} |
|
258 |
this.publicationInfo['authors'][author.rank] = {"fullName": author.content, "orcid": author.ORCID}; |
|
259 |
} |
|
255 | 260 |
} |
256 | 261 |
this.publicationInfo.authors = this.publicationInfo.authors.filter(function (item) { |
257 |
return (item != undefined); |
|
262 |
return (item != undefined && item.fullName != undefined);
|
|
258 | 263 |
}); |
259 | 264 |
} |
260 | 265 |
|
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/landing-utils/deletedByInference/deletedByInference.service.ts | ||
---|---|---|
28 | 28 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
29 | 29 |
.map(res => <any> res.json()) |
30 | 30 |
.map(res => res['result']['metadata']['oaf:entity']) |
31 |
.map(res => this.parseDeletedByInferencePublications(res)); |
|
31 |
.map(res => this.parseDeletedByInferencePublications(res, properties));
|
|
32 | 32 |
} |
33 | 33 |
|
34 |
parseDeletedByInferencePublications (result: any): DeletedByInferenceResult { |
|
34 |
parseDeletedByInferencePublications (result: any, properties: EnvProperties): DeletedByInferenceResult {
|
|
35 | 35 |
/*title, authors, abstract, List of projects, PIDs, |
36 | 36 |
collectedfrom (link pointing to the download url), access rights*/ |
37 | 37 |
|
... | ... | |
140 | 140 |
|
141 | 141 |
if(result['oaf:result'] && result['oaf:result']['creator']) { |
142 | 142 |
if(publication.authors == undefined) { |
143 |
publication.authors = new Array<string>();
|
|
143 |
publication.authors = new Array<{"fullName": string, "orcid": string}>();
|
|
144 | 144 |
} |
145 | 145 |
|
146 | 146 |
let authors = result['oaf:result']['creator']; |
... | ... | |
148 | 148 |
|
149 | 149 |
for(let i=0; i<length; i++) { |
150 | 150 |
let author = Array.isArray(authors) ? authors[i] : authors; |
151 |
publication.authors[author.rank] = author.content; |
|
151 |
if(author) { |
|
152 |
if (author.ORCID && author.ORCID.indexOf(properties.orcidURL) != -1) { |
|
153 |
author.ORCID = author.ORCID.substr(properties.orcidURL.length); |
|
154 |
} |
|
155 |
publication['authors'][author.rank] = {"fullName": author.content, "orcid": author.ORCID}; |
|
156 |
} |
|
152 | 157 |
} |
153 | 158 |
publication.authors = publication.authors.filter(function (item) { |
154 |
return (item != undefined); |
|
159 |
return (item != undefined && item.fullName != undefined);
|
|
155 | 160 |
}); |
156 | 161 |
} |
157 | 162 |
|
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/landing-utils/deletedByInference/deletedByInference.module.ts | ||
---|---|---|
12 | 12 |
import {PagingModule} from '../../../utils/paging.module'; |
13 | 13 |
|
14 | 14 |
import {ErrorMessagesModule} from '../../../utils/errorMessages.module'; |
15 |
import {ShowAuthorsModule} from "../../../utils/authors/showAuthors.module"; |
|
15 | 16 |
|
16 | 17 |
@NgModule({ |
17 | 18 |
imports: [ |
18 | 19 |
CommonModule, FormsModule, ResultLandingModule, |
19 |
PagingModule, ErrorMessagesModule |
|
20 |
PagingModule, ErrorMessagesModule, ShowAuthorsModule
|
|
20 | 21 |
], |
21 | 22 |
declarations: [ |
22 | 23 |
DeletedByInferenceComponent |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/landing-utils/resultLanding.module.ts | ||
---|---|---|
5 | 5 |
import { RouterModule } from '@angular/router'; |
6 | 6 |
import {PagingModule} from '../../utils/paging.module'; |
7 | 7 |
|
8 |
import {ShowAuthorsComponent} from './showAuthors.component'; |
|
8 |
//import {ShowAuthorsComponent} from './showAuthors.component';
|
|
9 | 9 |
import {ShowIdentifiersComponent} from './showIdentifiers.component'; |
10 | 10 |
import {ShowSubjectsComponent} from './showSubjects.component'; |
11 | 11 |
import {FundedByComponent} from './fundedBy.component'; |
... | ... | |
21 | 21 |
CommonModule, FormsModule, RouterModule, PagingModule, ShowPublisherModule |
22 | 22 |
], |
23 | 23 |
declarations: [ |
24 |
ShowAuthorsComponent,ShowIdentifiersComponent,ShowSubjectsComponent,
|
|
24 |
ShowIdentifiersComponent,ShowSubjectsComponent,
|
|
25 | 25 |
FundedByComponent,PublishedInComponent,AvailableOnComponent,TabTableComponent |
26 | 26 |
], |
27 | 27 |
providers:[ |
28 | 28 |
], |
29 | 29 |
exports: [ |
30 |
ShowAuthorsComponent, ShowIdentifiersComponent, ShowSubjectsComponent,
|
|
30 |
ShowIdentifiersComponent, ShowSubjectsComponent, |
|
31 | 31 |
FundedByComponent, PublishedInComponent, AvailableOnComponent, TabTableComponent, ShowPublisherComponent |
32 | 32 |
] |
33 | 33 |
}) |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/landing-utils/showAuthors.component.ts | ||
---|---|---|
3 | 3 |
import {HelperFunctions} from "../../utils/HelperFunctions.class"; |
4 | 4 |
|
5 | 5 |
@Component({ |
6 |
selector: 'showAuthors', |
|
6 |
selector: 'showAuthors1',
|
|
7 | 7 |
template: ` |
8 | 8 |
<span *ngIf="authors != undefined"> |
9 | 9 |
<div *ngIf="showAll"> |
... | ... | |
40 | 40 |
|
41 | 41 |
}) |
42 | 42 |
|
43 |
export class ShowAuthorsComponent { |
|
43 |
export class ShowAuthorsComponent1 {
|
|
44 | 44 |
@Input() authors: { [key: string]: string }[]; |
45 | 45 |
@Input() searchPage:string ="publications" |
46 | 46 |
|
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/landing-utils/citeThis/citeThis.component.ts | ||
---|---|---|
81 | 81 |
citationData.author = []; |
82 | 82 |
var max_length = (this.result.authors.length > 10)?10:this.result.authors.length; |
83 | 83 |
for (var i =0 ;i < max_length; i++){ |
84 |
if(this.result.authors[i] && this.result.authors[i].indexOf(", ") !== -1){ |
|
85 |
citationData.author.push({given:this.result.authors[i].split(", ")[0], family:this.result.authors[i].split(", ")[1], 'parse-names':true});
|
|
84 |
if(this.result.authors[i] && this.result.authors[i].fullName && this.result.authors[i].fullName.indexOf(", ") !== -1){
|
|
85 |
citationData.author.push({given:this.result.authors[i].fullName.split(", ")[0], family:this.result.authors[i].fullName.split(", ")[1], 'parse-names':true});
|
|
86 | 86 |
}else{ |
87 |
citationData.author.push({given:"", family:this.result.authors[i], 'parse-names':true}); |
|
87 |
citationData.author.push({given:"", family:this.result.authors[i].fullName, 'parse-names':true});
|
|
88 | 88 |
} |
89 | 89 |
// citationData.authors.push(this.result.authors[i]); |
90 | 90 |
} |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/software/software.module.ts | ||
---|---|---|
19 | 19 |
import { FreeGuard } from'../../login/freeGuard.guard'; |
20 | 20 |
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; |
21 | 21 |
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module'; |
22 |
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module"; |
|
22 | 23 |
|
23 | 24 |
@NgModule({ |
24 | 25 |
imports: [ |
25 | 26 |
CommonModule, FormsModule, LandingModule, RouterModule, CiteThisModule, PagingModule, |
26 |
ResultLandingModule, IFrameModule, MetricsModule, AltMetricsModule, Schema2jsonldModule, SEOServiceModule |
|
27 |
ResultLandingModule, IFrameModule, MetricsModule, AltMetricsModule, Schema2jsonldModule, SEOServiceModule, |
|
28 |
ShowAuthorsModule |
|
27 | 29 |
], |
28 | 30 |
declarations: [ |
29 | 31 |
SoftwareComponent |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/software/software.component.html | ||
---|---|---|
33 | 33 |
</div--> |
34 | 34 |
|
35 | 35 |
<div class= " uk-margin-top"> |
36 |
<showAuthors [authors]="softwareInfo.authors" searchPage="software"></showAuthors>
|
|
36 |
<showAuthors [authors]="softwareInfo.authors"></showAuthors> |
|
37 | 37 |
<span *ngIf="softwareInfo.date != ''">({{softwareInfo.date}})</span> |
38 | 38 |
</div> |
39 | 39 |
|
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/software/software.service.ts | ||
---|---|---|
45 | 45 |
res[1]['programmingLanguage'], |
46 | 46 |
res[2], |
47 | 47 |
res[1]['journal'] //15 |
48 |
]).map(res => this.parseSoftwareInfo(res)); |
|
48 |
]).map(res => this.parseSoftwareInfo(res, properties));
|
|
49 | 49 |
} |
50 | 50 |
|
51 | 51 |
private handleError (error: Response) { |
... | ... | |
55 | 55 |
return Observable.throw(error || 'Server error'); |
56 | 56 |
} |
57 | 57 |
|
58 |
parseSoftwareInfo (data: any):any { |
|
58 |
parseSoftwareInfo (data: any, properties: EnvProperties):any {
|
|
59 | 59 |
this.softwareInfo = new SoftwareInfo(); |
60 | 60 |
this.softwareInfo.record = data[14]; |
61 | 61 |
if(data[0] != null) { |
... | ... | |
190 | 190 |
|
191 | 191 |
if(data[10] != null) { |
192 | 192 |
if(this.softwareInfo.authors == undefined) { |
193 |
this.softwareInfo.authors = new Array<string>();
|
|
193 |
this.softwareInfo.authors = new Array<{"fullName": string, "orcid": string}>();
|
|
194 | 194 |
} |
195 | 195 |
|
196 | 196 |
let authors = data[10]; |
... | ... | |
198 | 198 |
|
199 | 199 |
for(let i=0; i<length; i++) { |
200 | 200 |
let author = Array.isArray(authors) ? authors[i] : authors; |
201 |
this.softwareInfo.authors[author.rank] = author.content; |
|
201 |
if(author) { |
|
202 |
if (author.ORCID && author.ORCID.indexOf(properties.orcidURL) != -1) { |
|
203 |
author.ORCID = author.ORCID.substr(properties.orcidURL.length); |
|
204 |
} |
|
205 |
this.softwareInfo['authors'][author.rank] = {"fullName": author.content, "orcid": author.ORCID}; |
|
206 |
} |
|
202 | 207 |
} |
203 |
|
|
204 | 208 |
this.softwareInfo.authors = this.softwareInfo.authors.filter(function (item) { |
205 |
return (item != undefined); |
|
209 |
return (item != undefined && item.fullName != undefined);
|
|
206 | 210 |
}); |
207 | 211 |
} |
208 | 212 |
|
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/entities/deletedByInferenceResult.ts | ||
---|---|---|
4 | 4 |
export class DeletedByInferenceResult { |
5 | 5 |
title: string; |
6 | 6 |
accessMode: string; |
7 |
authors: string[];
|
|
7 |
authors: {"fullName": string, "orcid": string}[];
|
|
8 | 8 |
|
9 | 9 |
date: string; |
10 | 10 |
dateofacceptance: string; |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/entities/searchResult.ts | ||
---|---|---|
11 | 11 |
description: string; |
12 | 12 |
year: string; |
13 | 13 |
embargoEndDate: string; |
14 |
authors: string[];
|
|
14 |
authors: {"fullName": string, "orcid": string}[];
|
|
15 | 15 |
|
16 | 16 |
//datasets & orp: |
17 | 17 |
publisher: string; |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/entities/softwareInfo.ts | ||
---|---|---|
3 | 3 |
//title: { "name": string, "url": string, "accessMode": string}; |
4 | 4 |
title: string; |
5 | 5 |
accessMode: string; |
6 |
authors: string[];
|
|
6 |
authors: {"fullName": string, "orcid": string}[];
|
|
7 | 7 |
date: string; |
8 | 8 |
dateofacceptance: string; |
9 | 9 |
embargoEndDate: string; |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/authors/showAuthors.component.ts | ||
---|---|---|
1 |
import {Component, Input} from '@angular/core'; |
|
2 |
import {ActivatedRoute} from "@angular/router"; |
|
3 |
import {HelperFunctions} from '../HelperFunctions.class'; |
|
4 |
import {RouterHelper} from "../routerHelper.class"; |
|
5 |
import {EnvProperties} from '../properties/env-properties'; |
|
6 |
|
|
7 |
@Component({ |
|
8 |
selector: 'showAuthors', |
|
9 |
template: ` |
|
10 |
<span *ngIf="authors != undefined"> |
|
11 |
<div *ngIf="showAll && numberOfAuthors > authorsLimit"> |
|
12 |
<a (click)="numberOfAuthors = authorsLimit;">View less authors</a> |
|
13 |
</div> |
|
14 |
|
|
15 |
<span *ngFor="let author of authors.slice(0,numberOfAuthors) let i=index"> |
|
16 |
<i *ngIf="!author.orcid || (properties.environment != 'beta' && properties.environment != 'development')">{{author.fullName}}</i |
|
17 |
><a *ngIf="author.orcid && (properties.environment == 'beta' || properties.environment == 'development')"><i>{{author.fullName}}</i></a |
|
18 |
><div *ngIf="author.orcid && (properties.environment == 'beta' || properties.environment == 'development')" class=" default-dropdown uk-margin-remove-top uk-padding-medium" |
|
19 |
uk-dropdown="pos: bottom-left; mode:hover" style="min-width: 70px !important;"> |
|
20 |
<b class="uk-margin-top">{{author.fullName}}</b> |
|
21 |
|
|
22 |
<div> |
|
23 |
<div class="uk-text-muted">ORCID</div> |
|
24 |
<span><code class="uk-padding-small" [id]="'orcid_clipboard_auhtor_'+i">{{author.orcid}}</code></span> |
|
25 |
<span> |
|
26 |
<button [class]="'uk-icon-clipboard uk-button uk-button-primary uk-button-small orcid_clipboard_btn_auhtor_'+i" |
|
27 |
[attr.data-clipboard-target]="'#orcid_clipboard_auhtor_'+i" title="Copy to clipboard"> |
|
28 |
Copy |
|
29 |
</button> |
|
30 |
<a class="uk-button uk-button-primary uk-button-small" title="Visit author in Orcid" |
|
31 |
[href]="properties.orcidURL+author.orcid" target="_blank"> |
|
32 |
Visit |
|
33 |
</a> |
|
34 |
</span> |
|
35 |
</div> |
|
36 |
|
|
37 |
<hr> |
|
38 |
<div class="uk-margin-top"> |
|
39 |
Search <b>{{author.fullName}}</b> by <b>ORCID</b> in OpenAIRE's |
|
40 |
</div> |
|
41 |
<div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right"> |
|
42 |
<a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1" |
|
43 |
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])" routerLinkActive="router-link-active" routerLink="/search/advanced/publications"> |
|
44 |
Publications |
|
45 |
</a> |
|
46 |
</div> |
|
47 |
<div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right"> |
|
48 |
<a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1" |
|
49 |
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])" routerLinkActive="router-link-active" routerLink="/search/advanced/datasets"> |
|
50 |
Research Data |
|
51 |
</a> |
|
52 |
</div> |
|
53 |
<div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right"> |
|
54 |
<a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1" |
|
55 |
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])" routerLinkActive="router-link-active" routerLink="/search/advanced/software"> |
|
56 |
Software |
|
57 |
</a> |
|
58 |
</div> |
|
59 |
<div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right"> |
|
60 |
<a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1" |
|
61 |
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])" routerLinkActive="router-link-active" routerLink="/search/advanced/other"> |
|
62 |
Other Research Products |
|
63 |
</a> |
|
64 |
</div> |
|
65 |
</div |
|
66 |
><span>;</span> |
|
67 |
</span> |
|
68 |
<span *ngIf="numberOfAuthors == authorsLimit && authors.length > authorsLimit"> ... </span> |
|
69 |
<span *ngIf="showAll && numberOfAuthors == authorsLimit && authors.length > authorsLimit"> |
|
70 |
<a (click)="numberOfAuthors = authors.length;"> |
|
71 |
view all {{authors.length | number}} authors |
|
72 |
</a> |
|
73 |
</span> |
|
74 |
<span *ngIf="showAll && numberOfAuthors > authorsLimit"> |
|
75 |
<a (click)="numberOfAuthors = authorsLimit; scroll()">View less authors</a> |
|
76 |
</span> |
|
77 |
</span> |
|
78 |
` |
|
79 |
|
|
80 |
}) |
|
81 |
|
|
82 |
export class ShowAuthorsComponent { |
|
83 |
@Input() authors: {"fullName": string, "orcid": string}[]; |
|
84 |
@Input() authorsLimit: number = 30; |
|
85 |
@Input() showAll: boolean = true; |
|
86 |
|
|
87 |
public numberOfAuthors: number; |
|
88 |
public properties:EnvProperties; |
|
89 |
public routerHelper:RouterHelper = new RouterHelper(); |
|
90 |
|
|
91 |
constructor (private route: ActivatedRoute) {} |
|
92 |
|
|
93 |
ngOnInit() { |
|
94 |
this.route.data.subscribe((data: { envSpecific: EnvProperties }) => { |
|
95 |
this.properties = data.envSpecific; |
|
96 |
}); |
|
97 |
this.numberOfAuthors = this.authorsLimit; |
|
98 |
|
|
99 |
if(typeof window !== 'undefined') { |
|
100 |
let orcid_clipboard; |
|
101 |
let Clipboard; |
|
102 |
Clipboard = require('clipboard'); |
|
103 |
if(this.authors) { |
|
104 |
this.authors.forEach((author, index) => { |
|
105 |
if (author && author.orcid) { |
|
106 |
orcid_clipboard = new Clipboard('.orcid_clipboard_btn_auhtor_' + index); |
|
107 |
} |
|
108 |
}); |
|
109 |
} |
|
110 |
} |
|
111 |
} |
|
112 |
|
|
113 |
public quote(params: string):string { |
|
114 |
return '"'+params+'"'; |
|
115 |
} |
|
116 |
|
|
117 |
public scroll() { |
|
118 |
HelperFunctions.scroll(); |
|
119 |
} |
|
120 |
} |
Also available in: Unified diff
[Trunk | Library]:
1. Create 'authors' folder in 'utils' to show authors, including dropdown with their ORCID information if available (used by landing & search pages).
2. Landing & Search Pages (services): Parse ORCID information of authors (creators) & cut it, if prefix is included.