Revision 46078
Added by Argiro Kokogiannaki over 7 years ago
modules/uoa-services-portal/trunk/portal-2/src/app/utils/properties/openaireProperties.ts | ||
---|---|---|
25 | 25 |
public static searchLinkToAdvancedPeople = "search/advanced/people"; |
26 | 26 |
|
27 | 27 |
//http://beta.services.openaire.eu:8480/search/ |
28 |
//http://rudie.di.uoa.gr:6081/dnet-functionality-services-2.0.0-SNAPSHOT |
|
28 | 29 |
// Services - APIs |
29 | 30 |
|
30 | 31 |
private static metricsAPIURL = "http://vatopedi.di.uoa.gr:8080/stats/"; |
... | ... | |
37 | 38 |
|
38 | 39 |
// private static searchAPIURL = " http://beta.services.openaire.eu/search/v2/api/"; |
39 | 40 |
// private searchAPIURL = "http://beta.services.openaire.eu:8480/search/rest/v2.0/api/"; |
40 |
private static searchAPIURL = "http://rudie.di.uoa.gr:6081/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
|
|
41 |
private static searchAPIURL = "http://beta.services.openaire.eu:8480/search/rest/v2/api/";
|
|
41 | 42 |
//"http://scoobydoo.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/"; |
42 | 43 |
|
43 | 44 |
// private static searchAPIURLLAst = " http://beta.services.openaire.eu/search/v2/api/"; |
44 |
private static searchAPIURLLAst = "http://rudie.di.uoa.gr:6081/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
|
|
45 |
private static searchAPIURLLAst = "http://beta.services.openaire.eu:8480/search/rest/v2/api/";
|
|
45 | 46 |
//private static searchAPIURLLAst = "http://scoobydoo.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/"; |
46 | 47 |
//private static searchAPIURLLAst = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/"; |
47 | 48 |
|
48 | 49 |
// private static searchResourcesAPIURL = " http://beta.services.openaire.eu/search/v2/api/resources"; |
49 |
private static searchResourcesAPIURL = "http://rudie.di.uoa.gr:6081/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/resources";
|
|
50 |
private static searchResourcesAPIURL = "http://beta.services.openaire.eu:8480/search/rest/v2/api/resources";
|
|
50 | 51 |
|
51 | 52 |
//private static searchServiveURL = "http://astero.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/"; |
52 |
private static searchServiveURL = "http://rudie.di.uoa.gr:6081/dnet-functionality-services-2.0.0-SNAPSHOT/rest/";
|
|
53 |
private static searchServiveURL = "http://beta.services.openaire.eu:8480/search/rest/";
|
|
53 | 54 |
// private static searchServiveURL = "http://services.openaire.eu:8380/search/"; |
54 | 55 |
// private static searchServiveURL = "http://beta.services.openaire.eu:8480/search/"; |
55 | 56 |
|
56 |
private static csvAPIURL = "http://rudie.di.uoa.gr:6081/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";//publications?format=csv
|
|
57 |
private static csvAPIURL = "http://beta.services.openaire.eu:8480/search/rest/v2/api/";//publications?format=csv
|
|
57 | 58 |
|
58 | 59 |
private static searchCrossrefAPIURL = "http://api.crossref.org/works"; |
59 | 60 |
private static searchDataciteAPIURL = "https://search.datacite.org/api"; |
modules/uoa-services-portal/trunk/portal-2/src/app/utils/entitiesAutoComplete/entitiesAutoComplete.module.ts | ||
---|---|---|
3 | 3 |
import { FormsModule } from '@angular/forms'; |
4 | 4 |
|
5 | 5 |
import {EntitiesAutocompleteComponent} from './entitiesAutoComplete.component'; |
6 |
import {EntitiesSearchService} from './entitySearch.service';
|
|
6 |
import {EntitySearchServiceModule} from './entitySearchService.module';
|
|
7 | 7 |
|
8 | 8 |
|
9 | 9 |
@NgModule({ |
10 | 10 |
imports: [ |
11 |
CommonModule, FormsModule |
|
11 |
CommonModule, FormsModule, EntitySearchServiceModule
|
|
12 | 12 |
], |
13 | 13 |
declarations: [ |
14 | 14 |
EntitiesAutocompleteComponent |
... | ... | |
16 | 16 |
exports: [ |
17 | 17 |
EntitiesAutocompleteComponent |
18 | 18 |
], |
19 |
providers:[ EntitiesSearchService]
|
|
19 |
providers:[ ] |
|
20 | 20 |
}) |
21 | 21 |
export class EntitiesAutocompleteModule { } |
modules/uoa-services-portal/trunk/portal-2/src/app/utils/entitiesAutoComplete/entitySearch.service.ts | ||
---|---|---|
139 | 139 |
} else { |
140 | 140 |
value.label = resData['title']; |
141 | 141 |
} |
142 |
if(oafEntityType=="oaf:result"){ |
|
143 |
value.label = value.label.content; |
|
144 |
value.result = resData; |
|
145 |
} |
|
142 | 146 |
}else if(resData["fullname"]){ |
143 | 147 |
if(Array.isArray(resData["fullname"])) { |
144 | 148 |
value.label = resData["fullname"][0]; |
... | ... | |
169 | 173 |
value.projectName = value.label; |
170 | 174 |
value.endDate = null; |
171 | 175 |
value.startDate = null; |
176 |
value.funderId = resData['fundingtree']['funder']['id']; |
|
177 |
value.funderName = resData['fundingtree']['funder']['shortname']; |
|
172 | 178 |
if(resData.hasOwnProperty("startdate")) { |
173 | 179 |
value.startDate = resData.startdate.split('-')[0]; |
174 | 180 |
} |
... | ... | |
177 | 183 |
} |
178 | 184 |
|
179 | 185 |
} |
186 |
console.info("add:"+value.label+" "+value.id); |
|
187 |
|
|
180 | 188 |
array.push(value); |
181 | 189 |
} |
182 | 190 |
console.info("Parsing results.... Size:"+array.length); |
modules/uoa-services-portal/trunk/portal-2/src/app/utils/entitiesAutoComplete/entitySearchService.module.ts | ||
---|---|---|
1 |
import { NgModule } from '@angular/core'; |
|
2 |
import { CommonModule } from '@angular/common'; |
|
3 |
import { FormsModule } from '@angular/forms'; |
|
4 |
|
|
5 |
import {EntitiesSearchService} from './entitySearch.service'; |
|
6 |
|
|
7 |
|
|
8 |
@NgModule({ |
|
9 |
imports: [ |
|
10 |
CommonModule, FormsModule |
|
11 |
], |
|
12 |
declarations: [ |
|
13 |
], |
|
14 |
exports: [ |
|
15 |
], |
|
16 |
providers:[ EntitiesSearchService] |
|
17 |
}) |
|
18 |
export class EntitySearchServiceModule { } |
modules/uoa-services-portal/trunk/portal-2/src/app/services/searchDatasets.service.ts | ||
---|---|---|
39 | 39 |
}) |
40 | 40 |
.map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "dataset")]); |
41 | 41 |
} |
42 |
searchDatasetById (id: string ):any { |
|
43 |
|
|
44 |
let url = OpenaireProperties.getSearchAPIURLLast()+"datasets/"+id+"?format=json"; |
|
45 |
let key = url+"-searchById"; |
|
46 |
if (this._cache.has(key)) { |
|
47 |
return Observable.of(this._cache.get(key)).map(res => this.parseResults(res)); |
|
48 |
} |
|
49 |
|
|
50 |
return this.http.get(url) |
|
51 |
.map(res => <any> res.json()) |
|
52 |
.do(res => { |
|
53 |
this._cache.set(key, res); |
|
54 |
}) |
|
55 |
.map(res => this.parseResults(res)); |
|
56 |
} |
|
42 | 57 |
searchDatasetsByDois (DOIs: string[], refineParams:string, page: number, size: number, refineFields:string[] ):any { |
43 | 58 |
let link = OpenaireProperties.getSearchAPIURLLast()+"datasets"; |
44 | 59 |
let url = link+"?"; |
modules/uoa-services-portal/trunk/portal-2/src/app/services/searchPublications.service.ts | ||
---|---|---|
42 | 42 |
}) |
43 | 43 |
.map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "publication")]); |
44 | 44 |
} |
45 |
searchPublicationById (id: string ):any { |
|
45 | 46 |
|
47 |
let url = OpenaireProperties.getSearchAPIURLLast()+"publications/"+id+"?format=json"; |
|
48 |
let key =url+"-searchById"; |
|
49 |
if (this._cache.has(key)) { |
|
50 |
return Observable.of(this._cache.get(key)).map(res => this.parseResults(res)); |
|
51 |
} |
|
52 |
return this.http.get(url) |
|
53 |
.map(res => <any> res.json()) |
|
54 |
.do(res => { |
|
55 |
this._cache.set(key, res); |
|
56 |
}) |
|
57 |
.map(res => this.parseResults(res)); |
|
58 |
} |
|
59 |
|
|
46 | 60 |
searchAggregators (params: string, refineParams:string, page: number, size: number ):any { |
47 | 61 |
|
48 | 62 |
let link = OpenaireProperties.getSearchAPIURLLast()+"publications"; |
modules/uoa-services-portal/trunk/portal-2/src/app/claims/claim-utils/claimDataset.component.ts | ||
---|---|---|
65 | 65 |
<button class="uk-button uk-align-right" *ngIf="!isSelected(result.id)" |
66 | 66 |
(click)="add(result, result.id, 'dataset', 'openaire', result['title'].name, result['title'].url, result.year, result['title'].accessMode)"> <i aria-hidden="true" class= "uk-icon-plus clickable"></i></button> |
67 | 67 |
</div> |
68 |
<span *ngIf="result.publisher" class="uk-article-meta">Publisher: {{result.publisher}}</span><span *ngIf="(result.year)">({{result.year}})</span> |
|
68 |
<span *ngIf="result.publisher" class="uk-article-meta">Publisher: {{result.publisher}}</span><span *ngIf="(result.year)" class="uk-article-meta">({{result.year}})</span>
|
|
69 | 69 |
<div *ngIf="result.authors" class="uk-article-meta">Authors: <span *ngFor="let author of result.authors let i = index">{{author.name}}{{(i < (result.authors.length-1))?"; ":""}}</span></div> |
70 | 70 |
|
71 | 71 |
</li> |
modules/uoa-services-portal/trunk/portal-2/src/app/claims/claim-utils/claimPublication.component.ts | ||
---|---|---|
332 | 332 |
var result: ClaimResult ; |
333 | 333 |
if(itemSource == 'crossref'){ |
334 | 334 |
date = (date == null) ? null : date.substring(0,10); |
335 |
result = {id: id, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate: this.nextDate, date}; |
|
335 |
result = {id: id, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate: this.nextDate, date: date};
|
|
336 | 336 |
}else if (itemSource == 'orcid'){ |
337 | 337 |
date = (date == null) ? null : date + "-01.-01" |
338 |
result = {id:id, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate: this.nextDate, date}; |
|
338 |
result = {id:id, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate: this.nextDate, date: date};
|
|
339 | 339 |
}else if (itemSource == 'openaire'){ |
340 | 340 |
//TODO put right access rights |
341 |
result = {id:id, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: accessMode, embargoEndDate: null, date}; |
|
341 |
result = {id:id, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: accessMode, embargoEndDate: null, date: date};
|
|
342 | 342 |
|
343 | 343 |
} |
344 | 344 |
console.info("Added result:"+result.date); |
modules/uoa-services-portal/trunk/portal-2/src/app/claims/linking/linkingGeneric.module.ts | ||
---|---|---|
16 | 16 |
|
17 | 17 |
import {LinkingHomeComponent} from './linkingHome.component'; |
18 | 18 |
import {LinkingGenericComponent} from './linkingGeneric.component'; |
19 |
import {EntitySearchServiceModule} from '../../utils/entitiesAutoComplete/entitySearchService.module'; |
|
20 |
import {PublicationsServiceModule} from '../../services/publicationsService.module'; |
|
21 |
import {DatasetsServiceModule} from '../../services/datasetsService.module'; |
|
19 | 22 |
|
20 |
|
|
21 | 23 |
@NgModule({ |
22 | 24 |
imports: [ |
23 | 25 |
SharedModule, SelectedProjectsModule, SelectedContextsModule, |
24 |
SelectedPublicationsModule, SelectedDatasetsModule, // SelectedResultsModule,
|
|
25 |
ClaimProjectModule, |
|
26 |
ClaimResultModule, ClaimContextModule, InsertClaimsModule, BulkClaimModule
|
|
26 |
SelectedPublicationsModule, SelectedDatasetsModule, |
|
27 |
ClaimProjectModule, ClaimResultModule, ClaimContextModule, InsertClaimsModule, BulkClaimModule,
|
|
28 |
EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule
|
|
27 | 29 |
], |
28 | 30 |
declarations: [ |
29 | 31 |
LinkingHomeComponent, LinkingGenericComponent |
modules/uoa-services-portal/trunk/portal-2/src/app/claims/linking/selected/selectedDatasets.component.ts | ||
---|---|---|
20 | 20 |
<div class="row"> |
21 | 21 |
|
22 | 22 |
<div [ngClass]="showAccessRights?'col-md-8':'col-md-12'"> |
23 |
<span *ngIf="showAccessRights" (click)="removeDataset(dataset)" aria-hidden="true" class="btn "><i class="uk-icon-remove"></i></span> |
|
24 |
<a *ngIf="dataset.url" target="_blank" class="uk-icon-external-link" href="{{dataset.url}}" >{{dataset.title}}</a> |
|
25 |
<span *ngIf="!dataset.url" >{{dataset.title}}</span> |
|
26 |
<span *ngIf="dataset.date" >({{dataset.date.substring(0,4)}})</span> |
|
27 |
<span *ngIf="!showAccessRights" (click)="removeDataset(dataset)" aria-hidden="true" class="btn "><i class="uk-icon-remove"></i></span> |
|
23 |
<div> |
|
24 |
<span *ngIf="showAccessRights" (click)="removeDataset(dataset)" aria-hidden="true" class="btn "><i class="uk-icon-remove"></i></span> |
|
25 |
<a *ngIf="dataset.url" target="_blank" href="{{dataset.url}}" >{{dataset.title}}</a> |
|
26 |
<span *ngIf="!dataset.url" >{{dataset.title}}</span> |
|
27 |
<span *ngIf="!showAccessRights" (click)="removeDataset(dataset)" aria-hidden="true" class="uk-button"><i class="uk-icon-remove"></i></span> |
|
28 |
</div> |
|
29 |
<span *ngIf="dataset.result.publisher" class="uk-article-meta">Publisher: {{dataset.result.publisher}}</span><span *ngIf="dataset.date" class="uk-article-meta">({{dataset.date.substring(0,4)}})</span> |
|
30 |
<div *ngIf="dataset.result.authors" class="uk-article-meta">Authors: <span *ngFor="let author of dataset.result.authors let i = index">{{author.name}}{{(i < (dataset.result.authors.length-1))?"; ":""}}</span></div> |
|
31 |
<div *ngIf="dataset.result.creator" class="uk-article-meta">Authors: <span *ngFor="let author of dataset.result.creator let i = index">{{author}}{{(i < (dataset.result.creator.length-1))?"; ":""}}</span></div> |
|
32 |
|
|
28 | 33 |
</div> |
29 | 34 |
<div class = "col-md-4"> |
30 | 35 |
<span *ngIf="showAccessRights && dataset.source != 'openaire'" class="dropdown"> |
modules/uoa-services-portal/trunk/portal-2/src/app/claims/linking/selected/selectedPublications.component.ts | ||
---|---|---|
18 | 18 |
<div> |
19 | 19 |
<span *ngIf="showAccessRights" (click)="removePublication(pub)" aria-hidden="true" class="uk-button"><i class="uk-icon-remove"></i></span> |
20 | 20 |
<a *ngIf="pub.url" target="_blank" href="{{pub.url}}" >{{pub.title}}</a> |
21 |
<span *ngIf="!pub.url" >{{pub.title}}</span><span *ngIf="pub.date" class="uk-article-meta" >({{pub.date.substring(0,4)}})</span>
|
|
21 |
<span *ngIf="!pub.url" >{{pub.title}}</span> |
|
22 | 22 |
<span *ngIf="!showAccessRights" (click)="removePublication(pub)" aria-hidden="true" class="uk-button "><i class="uk-icon-remove"></i></span> |
23 | 23 |
</div> |
24 | 24 |
<!-- Crossref --> |
25 |
<span *ngIf="pub.result.publisher" class="uk-article-meta">Publisher: {{pub.result.publisher}}</span> |
|
25 |
<span *ngIf="pub.result.publisher" class="uk-article-meta">Publisher: {{pub.result.publisher}}</span><span *ngIf="pub.date" class="uk-article-meta" >({{pub.date.substring(0,4)}})</span>
|
|
26 | 26 |
<div *ngIf="pub.result.author && pub.result.author.length > 0" class="uk-article-meta">Authors: <span *ngFor="let author of pub.result.author let i = index">{{author.family}} {{author.given}}{{(i < (pub.result.author.length-1))?"; ":""}}</span></div> |
27 | 27 |
<div *ngIf="pub.result.editor && pub.result.editor.length" class="uk-article-meta">Editors: <span *ngFor="let author of pub.result.editor let i = index">{{author.family}} {{author.given}}{{(i < (pub.result.editor.length-1))?"; ":""}}</span></div> |
28 | 28 |
|
modules/uoa-services-portal/trunk/portal-2/src/app/claims/linking/linkingGeneric.component.ts | ||
---|---|---|
1 | 1 |
import {Component, Input} from '@angular/core'; |
2 | 2 |
import {Observable} from 'rxjs/Observable'; |
3 |
import { Router } from '@angular/router'; |
|
3 |
import {ActivatedRoute, Router} from '@angular/router'; |
|
4 |
import {EntitiesSearchService} from '../../utils/entitiesAutoComplete/entitySearch.service'; |
|
5 |
import {ClaimProject, ClaimResult} from '../claim-utils/claimEntities.class'; |
|
6 |
import {SearchPublicationsService} from '../../services/searchPublications.service'; |
|
7 |
import {SearchDatasetsService} from '../../services/searchDatasets.service'; |
|
4 | 8 |
|
5 | 9 |
@Component({ |
6 | 10 |
selector: 'linking-generic', |
7 |
//providers: [MdRadioDispatcher], |
|
8 | 11 |
template: ` |
9 | 12 |
<div class="container uk-margin-top"> |
10 | 13 |
<div class="page-header"> |
... | ... | |
38 | 41 |
<div *ngIf=" show == 'context'" class="uk-width-1-1" > |
39 | 42 |
<claim-contexts [selectedList]="contexts" > </claim-contexts> |
40 | 43 |
</div> |
41 |
<!-- <div *ngIf=" show == 'claim'" > |
|
42 |
<claim-insert [contexts]="contexts" [publications]="publications" [datasets]="datasets" [projects]="projects" ></claim-insert> |
|
43 |
</div>--> |
|
44 |
|
|
44 | 45 |
<div [class]="( show=='result' && !bulkMode)?'uk-width-small-1-1 uk-width-medium-1-2 uk-width-large-1-2 ':'uk-width-small-1-1 uk-width-medium-1-1 uk-width-large-1-1 uk-margin-top uk-grid'"> |
45 | 46 |
<div [class]="( show=='result' && !bulkMode)?'uk-width-small-1-1 uk-width-medium-1-1 uk-width-large-1-1 ':'uk-width-small-1-1 uk-width-medium-1-2 uk-width-large-1-2 uk-width-xlarge-1-2 '"> |
46 | 47 |
<claim-selected-contexts [contexts]="contexts" [show]="show" |
... | ... | |
50 | 51 |
<claim-selected-projects [projects]="projects" [show]="show" |
51 | 52 |
(showChange)="showChange($event)" > </claim-selected-projects> |
52 | 53 |
</div> |
53 |
<!---claim-selected-results [datasets]="datasets" [publications]="publications" [show]="show" |
|
54 |
(showChange)="showChange($event)" [linkToResults]="(bulkMode)?false:true" > </claim-selected-results--> |
|
54 |
|
|
55 | 55 |
<div [class]="( show=='result' && !bulkMode)?'uk-width-small-1-1 uk-width-medium-1-1 uk-width-large-1-1 ':'uk-width-small-1-1 uk-width-medium-1-2 uk-width-large-1-2 uk-width-xlarge-1-2'"> |
56 | 56 |
<claim-selected-publications [publications]="publications" [linkToResults]="(bulkMode)?false:true" [bulkMode]="bulkMode"> |
57 | 57 |
</claim-selected-publications> |
... | ... | |
63 | 63 |
</div> |
64 | 64 |
</div> |
65 | 65 |
<div *ngIf=" show == 'claim' " class="uk-width-small-1-1 uk-width-medium-1-1 uk-width-large-1-1 uk-grid"> |
66 |
<!--claim-selected [contexts]="contexts" [publications]="publications" [datasets]="datasets" [projects]="projects" [show]="show" |
|
67 |
(showChange)="showChange($event)" (publicationsChange)="publicationsChange($event)" [showAccessRights]="'true'" [bulkMode]="bulkMode" |
|
68 |
[linkToResults]="(bulkMode)?false:true" > </claim-selected--> |
|
66 |
|
|
69 | 67 |
<div class="uk-width-small-1-1 uk-width-medium-1-2 uk-width-large-1-2 uk-width-xlarge-1-2"> |
70 | 68 |
<claim-selected-contexts [contexts]="contexts" [show]="show" (showChange)="showChange($event)" > </claim-selected-contexts> |
71 | 69 |
</div> |
72 | 70 |
<div class="uk-width-small-1-1 uk-width-medium-1-2 uk-width-large-1-2 uk-width-xlarge-1-2"> |
73 | 71 |
<claim-selected-projects [projects]="projects" [show]="show" |
74 | 72 |
(showChange)="showChange($event)" > </claim-selected-projects> |
75 |
<!-- Bulk Mode Results (publicationsChange)="publicationsChanged($event)" --> |
|
76 |
</div> |
|
73 |
</div> |
|
77 | 74 |
|
78 | 75 |
<bulk-claim *ngIf=" bulkMode " [publications]="publications" > </bulk-claim> |
79 | 76 |
<div class="uk-width-small-1-1 uk-width-medium-1-2 uk-width-large-1-2 uk-width-xlarge-1-2"> |
... | ... | |
86 | 83 |
[linkToResults]="(bulkMode)?false:true" [bulkMode]="bulkMode"> |
87 | 84 |
</claim-selected-datasets> |
88 | 85 |
</div> |
89 |
<!--claim-selected-results [datasets]="datasets" [publications]="publications" [show]="show" |
|
90 |
(showChange)="showChange($event)" [linkToResults]="(bulkMode)?false:true" [showAccessRights]=true [bulkMode]="bulkMode" > |
|
91 |
</claim-selected-results--> |
|
86 |
|
|
92 | 87 |
<div class="uk-width-1-1 "> |
93 | 88 |
<claim-insert [contexts]="contexts" [publications]="publications" [datasets]="datasets" [projects]="projects" [show] = "show" |
94 | 89 |
(showChange)="showChange($event)" ></claim-insert> |
95 | 90 |
</div> |
96 | 91 |
</div> |
97 |
<!--nav> |
|
98 |
<ul *ngIf="show != 'home'" class="pager"> |
|
99 |
<li class="previous" (click)="prev()"><a ><span aria-hidden="true">←</span> Previous</a></li> |
|
100 |
<li class="next" *ngIf="show != 'claim'" (click)="next()" ><a >Next <span aria-hidden="true">→</span></a></li> |
|
101 |
</ul> |
|
102 |
</nav--> |
|
92 |
|
|
103 | 93 |
<ul *ngIf="show != 'home'" class="uk-pagination"> |
104 | 94 |
<li class="uk-pagination-previous" (click)="prev()"><a><i class="uk-icon-angle-left"></i> Previous</a></li> |
105 | 95 |
<li class="uk-pagination-next" *ngIf="show != 'claim'" (click)="next()"><a>Next <i class="uk-icon-angle-right"></i></a></li> |
... | ... | |
111 | 101 |
` |
112 | 102 |
|
113 | 103 |
}) |
114 |
//[(ngModel)]="date" |
|
115 | 104 |
export class LinkingGenericComponent { |
116 |
constructor ( private _router: Router) { |
|
117 |
} |
|
105 |
|
|
118 | 106 |
@Input() bulkMode: boolean = false; |
119 | 107 |
sourceType:string; |
120 | 108 |
targetType:string; |
... | ... | |
124 | 112 |
publications=[]; |
125 | 113 |
datasets=[]; |
126 | 114 |
show = "home"; |
127 |
searchType="publication"; //publication or dataset |
|
128 | 115 |
date='8-6-2016'; |
129 | 116 |
keyword: string = ""; |
130 | 117 |
linkType:string ="project"; // link type (selected in home page) : project, context, software, etc |
131 |
ngOnInit() { |
|
118 |
/* Parameters for inline linking */ |
|
119 |
id:string = null; //entity id |
|
120 |
type:string = null; // entity type (publication or dataset) |
|
121 |
linkTo:string = null; // entity type (project or context) |
|
122 |
entityTypes=["dataset", "publication", "project","context"]; |
|
123 |
sub:any =null; |
|
124 |
constructor ( private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService, private publicationsSearch:SearchPublicationsService, private datasetsSearch:SearchDatasetsService) { |
|
132 | 125 |
|
133 | 126 |
} |
127 |
ngOnInit() { |
|
128 |
this.sub = this.route.queryParams.subscribe(params => { |
|
129 |
this.id = params['id']; |
|
130 |
this.type = params['type']; |
|
131 |
this.linkTo = params['linkTo']; |
|
132 |
if(this.type!=null && this.linkTo!=null){ |
|
133 |
this.type = (this.entityTypes.indexOf(this.type) != -1)? this.type:'publication'; |
|
134 |
this.linkTo = (this.entityTypes.indexOf(this.linkTo) != -1 || this.linkTo == "result")? this.linkTo:'project'; |
|
135 |
this.show = this.linkTo; |
|
136 |
this.linkType = (this.type == "project")?"project":this.linkTo; |
|
137 |
this.addSelected(this.id,this.type); |
|
138 |
} |
|
139 |
|
|
140 |
}); |
|
141 |
} |
|
142 |
addSelected(id:string,type:string){ |
|
143 |
if(type == "project"){ |
|
144 |
this.sub = this.entitySearch.fetchByType(id,type).subscribe( |
|
145 |
data => { |
|
146 |
console.log(data); |
|
147 |
var item =data[0]; |
|
148 |
var project: ClaimProject = { funderId: item.funderId,funderName: item.funderName, projectId: id, projectName: item.projectName , projectAcronym: item.projectAcronym, startDate: item.startDate, endDate: item.endDate }; |
|
149 |
this.projects.push( project); |
|
150 |
|
|
151 |
}, |
|
152 |
err => console.log("An error occured")); |
|
153 |
}else if(type == "publication"){ |
|
154 |
this.sub = this.publicationsSearch.searchPublicationById(id).subscribe( |
|
155 |
data => { |
|
156 |
var item =data[0]; |
|
157 |
|
|
158 |
var result: ClaimResult = {id: id, type :type, source : "openaire", title: item['title'].name, url: item['title'].url, result: item, accessRights:item['title'].accessMode, embargoEndDate: null, date: item.year}; |
|
159 |
this.publications.push( result); |
|
160 |
}, |
|
161 |
err => console.log("An error occured")); |
|
162 |
}else if(type == "dataset"){ |
|
163 |
this.sub = this.datasetsSearch.searchDatasetById(id).subscribe( |
|
164 |
data => { |
|
165 |
var item =data[0]; |
|
166 |
console.log(item); |
|
167 |
var result: ClaimResult = {id: id, type :type, source : "openaire", title: item['title'].name, url: item['title'].url, result: item, accessRights:item['title'].accessMode, embargoEndDate: null, date: item.year}; |
|
168 |
this.datasets.push( result); |
|
169 |
}, |
|
170 |
err => console.log("An error occured")); |
|
171 |
} |
|
172 |
|
|
173 |
} |
|
134 | 174 |
next(){ |
135 | 175 |
|
136 | 176 |
if((this.show == 'project' || this.show == 'context' || this.show == 'software')){ |
... | ... | |
150 | 190 |
}else if(this.show == 'context' || this.show == 'project' || this.show == 'software' ){ |
151 | 191 |
this.show='home'; |
152 | 192 |
} else if(this.show == 'claim'){ |
153 |
// this.show='result'; |
|
154 | 193 |
if(!this.bulkMode){ |
155 | 194 |
this.show='result'; |
156 | 195 |
}else{ |
... | ... | |
162 | 201 |
this._router.navigate( ['Search', { keyword: term }] ); |
163 | 202 |
} |
164 | 203 |
|
165 |
search() { |
|
166 |
if(this.searchType == 'publication' ){ |
|
167 |
this.show="publication"; |
|
168 |
}else{ |
|
169 |
this.show="dataset"; |
|
170 |
} |
|
171 | 204 |
|
172 |
} |
|
173 |
|
|
174 | 205 |
sourceTypeChange($event) { |
175 | 206 |
this.sourceType=$event.value; |
176 | 207 |
console.log($event.value); |
... | ... | |
179 | 210 |
this.targetType=$event.value; |
180 | 211 |
console.log($event.value); |
181 | 212 |
} |
182 |
// contextsChange($event) { |
|
183 |
// this.contexts=$event.value; |
|
184 |
// console.log($event.value); |
|
185 |
// } |
|
213 |
|
|
186 | 214 |
publicationsChange($event) { |
187 | 215 |
this.publications=$event.value; |
188 | 216 |
} |
... | ... | |
192 | 220 |
projectsChange($event) { |
193 | 221 |
this.projects=$event.value; |
194 | 222 |
} |
195 |
typeChanged(type:string) { |
|
196 |
this.searchType = type; |
|
197 |
} |
|
223 |
|
|
198 | 224 |
linkTypeChange($event) { |
199 | 225 |
this.linkType =$event.value; |
200 | 226 |
this.show=$event.value; |
227 |
} |
|
201 | 228 |
|
202 |
} |
|
203 | 229 |
showChange($event) { |
204 | 230 |
this.show=$event.value; |
205 | 231 |
this.showChangedType($event.value); |
232 |
} |
|
206 | 233 |
|
207 |
|
|
208 |
} |
|
209 | 234 |
showChangedType(type:string) { |
210 | 235 |
this.show=type; |
211 | 236 |
if(this.show == 'project' || this.show == 'context' || this.show == 'software'){ |
212 | 237 |
this.linkType = this.show; |
213 | 238 |
} |
214 |
|
|
215 |
|
|
216 | 239 |
} |
240 |
|
|
217 | 241 |
} |
modules/uoa-services-portal/trunk/portal-2/src/app/landingPages/dataset/dataset.component.html | ||
---|---|---|
1 | 1 |
<div class="uk-container uk-margin-top dataset"> |
2 | 2 |
<!--div class="container-header" --> |
3 |
|
|
3 |
|
|
4 | 4 |
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" role="alert">{{warningMessage}}</div> |
5 | 5 |
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div> |
6 | 6 |
|
... | ... | |
157 | 157 |
</li> |
158 | 158 |
|
159 | 159 |
|
160 |
<li *ngIf="datasetInfo.fundedByProjects != undefined">
|
|
160 |
<li >
|
|
161 | 161 |
<dl class="uk-description-list-line functionsSection" > |
162 | 162 |
<dt class="title">Funded By</dt> |
163 | 163 |
<dd |
... | ... | |
178 | 178 |
</mark> |
179 | 179 |
</a> |
180 | 180 |
</dd> |
181 |
<dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','project'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> Add links to projects</a></dd> |
|
181 | 182 |
</dl> |
182 |
<dl class="uk-description-list-line functionsSection" *ngIf="datasetInfo.fundedByProjects == undefined"> |
|
183 |
<dt class="title">Funded By</dt> |
|
184 |
</dl> |
|
185 | 183 |
|
184 |
|
|
186 | 185 |
</li> |
187 |
<li *ngIf="datasetInfo.contexts != undefined">
|
|
186 |
<li >
|
|
188 | 187 |
<dl class="uk-description-list-line functionsSection" > |
189 | 188 |
<dt class="title">Related to </dt> |
190 | 189 |
<dd class="line" *ngFor="let item of datasetInfo.contexts"> |
... | ... | |
199 | 198 |
<span *ngIf="item['labelConcept'] != null">: {{item['labelConcept']}}</span> |
200 | 199 |
</mark> |
201 | 200 |
</dd> |
201 |
<dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','context'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> Add links to contexts</a></dd> |
|
202 | 202 |
</dl> |
203 |
<dl class="uk-description-list-line functionsSection" *ngIf="datasetInfo.contexts == undefined"> |
|
204 |
<dt class="title">Related to </dt> |
|
205 |
</dl> |
|
203 |
|
|
206 | 204 |
</li> |
207 | 205 |
</ul> |
208 | 206 |
</div> |
modules/uoa-services-portal/trunk/portal-2/src/app/landingPages/dataset/dataset.component.ts | ||
---|---|---|
4 | 4 |
import {DatasetInfo} from '../../utils/entities/datasetInfo'; |
5 | 5 |
import {ActivatedRoute} from '@angular/router'; |
6 | 6 |
import {OpenaireProperties} from '../../utils/properties/openaireProperties' |
7 |
import {RouterHelper} from '../../utils/routerHelper.class'; |
|
7 | 8 |
|
8 | 9 |
@Component({ |
9 | 10 |
selector: 'dataset', |
... | ... | |
28 | 29 |
|
29 | 30 |
public warningMessage = ""; |
30 | 31 |
public errorMessage = ""; |
32 |
public routerHelper:RouterHelper = new RouterHelper(); |
|
31 | 33 |
|
32 | 34 |
constructor (private _datasetService: DatasetService, private route: ActivatedRoute) {} |
33 | 35 |
|
modules/uoa-services-portal/trunk/portal-2/src/app/landingPages/dataset/dataset.module.ts | ||
---|---|---|
3 | 3 |
import { CommonModule } from '@angular/common'; |
4 | 4 |
import { FormsModule } from '@angular/forms'; |
5 | 5 |
import { SharedModule } from '../../shared/shared.module'; |
6 |
import { RouterModule } from '@angular/router'; |
|
6 | 7 |
|
7 | 8 |
import { DatasetService} from './dataset.service'; |
8 | 9 |
import { DatasetComponent } from './dataset.component'; |
... | ... | |
17 | 18 |
@NgModule({ |
18 | 19 |
imports: [ |
19 | 20 |
//MaterialModule.forRoot(), |
20 |
CommonModule, FormsModule,SharedModule, LandingModule, |
|
21 |
CommonModule, FormsModule,SharedModule, RouterModule, LandingModule,
|
|
21 | 22 |
ResultLandingModule, DatasetRoutingModule, MetricsModule, IFrameModule, AltMetricsModule |
22 | 23 |
], |
23 | 24 |
declarations: [ |
modules/uoa-services-portal/trunk/portal-2/src/app/landingPages/project/project.module.ts | ||
---|---|---|
2 | 2 |
import { NgModule} from '@angular/core'; |
3 | 3 |
import { CommonModule } from '@angular/common'; |
4 | 4 |
import { FormsModule } from '@angular/forms'; |
5 |
import { RouterModule } from '@angular/router'; |
|
5 | 6 |
|
6 | 7 |
import { ProjectServiceModule} from './projectService.module'; |
7 | 8 |
// import {HtmlProgressReportService} from './htmlProgressReport.service'; |
... | ... | |
18 | 19 |
|
19 | 20 |
@NgModule({ |
20 | 21 |
imports: [ |
21 |
CommonModule, FormsModule, LandingModule, |
|
22 |
CommonModule, FormsModule, RouterModule, LandingModule,
|
|
22 | 23 |
ProjectRoutingModule, |
23 | 24 |
SearchResultsModule, IFrameModule, MetricsModule, ReportsServiceModule, PublicationsServiceModule, DatasetsServiceModule, ProjectServiceModule |
24 | 25 |
], |
modules/uoa-services-portal/trunk/portal-2/src/app/landingPages/project/project.component.html | ||
---|---|---|
191 | 191 |
<span class="uk-icon-download">{{projectInfo.funder}} progress report (CSV)</span> |
192 | 192 |
</span> |
193 | 193 |
</li> |
194 |
|
|
195 | 194 |
<li> |
195 |
<a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[projectId,'project','result'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> |
|
196 |
Link to research results |
|
197 |
</a> |
|
198 |
</li> |
|
199 |
<li> |
|
196 | 200 |
<a href="/deposit-publications"> |
197 | 201 |
Deposit Publications |
198 | 202 |
</a> |
modules/uoa-services-portal/trunk/portal-2/src/app/landingPages/project/project.component.ts | ||
---|---|---|
3 | 3 |
import {ActivatedRoute, Params} from '@angular/router'; |
4 | 4 |
import {ProjectService} from './project.service'; |
5 | 5 |
import {ProjectInfo} from '../../utils/entities/projectInfo'; |
6 |
import {RouterHelper} from '../../utils/routerHelper.class'; |
|
6 | 7 |
|
7 | 8 |
|
8 | 9 |
import { FetchPublications } from '../../utils/fetchEntitiesClasses/fetchPublications.class'; |
... | ... | |
49 | 50 |
public linkToSearchPublications = ""; |
50 | 51 |
public fetchDatasets : FetchDatasets; |
51 | 52 |
public linkToSearchDatasets = ""; |
53 |
public routerHelper:RouterHelper = new RouterHelper(); |
|
52 | 54 |
|
53 | 55 |
constructor (private _projectService: ProjectService, |
54 | 56 |
private route: ActivatedRoute, |
modules/uoa-services-portal/trunk/portal-2/src/app/landingPages/publication/publication.component.ts | ||
---|---|---|
4 | 4 |
import {PublicationInfo} from '../../utils/entities/publicationInfo'; |
5 | 5 |
import {ActivatedRoute} from '@angular/router'; |
6 | 6 |
import {OpenaireProperties} from '../../utils/properties/openaireProperties'; |
7 |
import {RouterHelper} from '../../utils/routerHelper.class'; |
|
7 | 8 |
|
8 | 9 |
@Component({ |
9 | 10 |
selector: 'publication', |
... | ... | |
40 | 41 |
|
41 | 42 |
public warningMessage = ""; |
42 | 43 |
public errorMessage = ""; |
43 |
|
|
44 |
public routerHelper:RouterHelper = new RouterHelper(); |
|
44 | 45 |
constructor (private _publicationService: PublicationService, |
45 | 46 |
private route: ActivatedRoute) {} |
46 | 47 |
|
modules/uoa-services-portal/trunk/portal-2/src/app/landingPages/publication/publication.module.ts | ||
---|---|---|
3 | 3 |
import { CommonModule } from '@angular/common'; |
4 | 4 |
import { FormsModule } from '@angular/forms'; |
5 | 5 |
import { SharedModule } from '../../shared/shared.module'; |
6 |
import { RouterModule } from '@angular/router'; |
|
6 | 7 |
|
7 | 8 |
import { PublicationService} from './publication.service'; |
8 | 9 |
import { PublicationComponent } from './publication.component'; |
... | ... | |
17 | 18 |
|
18 | 19 |
@NgModule({ |
19 | 20 |
imports: [ |
20 |
CommonModule, FormsModule, LandingModule,SharedModule, |
|
21 |
CommonModule, FormsModule, LandingModule,SharedModule, RouterModule,
|
|
21 | 22 |
ResultLandingModule, PublicationRoutingModule, IFrameModule, MetricsModule, AltMetricsModule |
22 | 23 |
], |
23 | 24 |
declarations: [ |
modules/uoa-services-portal/trunk/portal-2/src/app/landingPages/publication/publication.component.html | ||
---|---|---|
360 | 360 |
View more |
361 | 361 |
</a> |
362 | 362 |
</dd> |
363 |
<dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','project'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> Add links to projects</a></dd> |
|
363 | 364 |
</dl> |
364 | 365 |
|
365 | 366 |
</li> |
366 |
<li *ngIf="publicationInfo.contexts != undefined">
|
|
367 |
<li > |
|
367 | 368 |
<dl class="uk-description-list-line" > |
368 | 369 |
<dt class="title">Related to</dt> |
369 | 370 |
<dd class="line" *ngFor="let item of publicationInfo.contexts"> |
... | ... | |
378 | 379 |
<span *ngIf="item['labelConcept'] != null">: {{item['labelConcept']}}</span> |
379 | 380 |
</mark> |
380 | 381 |
</dd> |
382 |
<dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','context'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> Add links to contexts</a></dd> |
|
381 | 383 |
</dl> |
382 | 384 |
|
383 | 385 |
</li> |
modules/uoa-services-portal/trunk/portal-2/src/server.routes.ts | ||
---|---|---|
15 | 15 |
'search/find/people','search/find/publications','search/find/projects','search/find/datasets','search/find/dataproviders','search/find/organizations', |
16 | 16 |
'search/advanced/people','search/advanced/publications','search/advanced/projects','search/advanced/datasets','search/advanced/dataproviders','search/advanced/organizations', |
17 | 17 |
'deposit-publications','deposit-datasets','deposit-publications-result','deposit-datasets-result', |
18 |
'search/data-providers','search/entity-registries', 'login', |
|
18 |
'search/data-providers','search/entity-registries', |
|
19 |
'claims','myclaims','linking', 'bulk-linking', |
|
19 | 20 |
'test', |
20 |
'error' |
|
21 |
'error', 'login'
|
|
21 | 22 |
|
22 | 23 |
]; |
Also available in: Unified diff
enable inline linking from landing pages pubs/data -> contexts/ projects, project -> pubs/data