1
|
import {Component, Input} from '@angular/core';
|
2
|
import {Observable} from 'rxjs/Observable';
|
3
|
import { Router } from '@angular/router';
|
4
|
import {OpenaireProperties, ErrorCodes} from '../utils/properties/openaireProperties';
|
5
|
import { Meta} from '../../angular2-meta';
|
6
|
|
7
|
|
8
|
@Component({
|
9
|
selector: 'deposit',
|
10
|
template: `
|
11
|
<div class="container uk-margin-top">
|
12
|
<div class="page-header" >
|
13
|
<h2>Deposit {{requestFor}}</h2>
|
14
|
</div>
|
15
|
|
16
|
<div>
|
17
|
<p>
|
18
|
<i>
|
19
|
Are you a grant recipient from the following: H2020; FP7 with SC39; or ERC?
|
20
|
</i>
|
21
|
Then you are required to publish in
|
22
|
<a href="{{openAccess}}" target="_blank">open access (<i class="uk-icon-external-link"></i>)</a>.
|
23
|
One way to do this is to deposit your {{requestFor}} into an
|
24
|
<a href="{{openAccessRepo}}" target="_blank">open access repository (<i class="uk-icon-external-link"></i>)</a>.
|
25
|
</p>
|
26
|
<p>
|
27
|
Click the following to find more information:
|
28
|
<a href="{{fp7Guidlines}}" target="_blank">FP7 guidelines (<i class="uk-icon-external-link"></i>)</a>,
|
29
|
<a href="{{h2020Guidlines}}" target="_blank">H2020 guidelines (<i class="uk-icon-external-link"></i>)</a>,
|
30
|
<a href="{{ercGuidlines}}" target="_blank">ERC guidelines (<i class="uk-icon-external-link"></i>)</a> OR
|
31
|
<a href="{{helpdesk}}" target="_blank">ask a question (<i class="uk-icon-external-link"></i>)</a> to OpenAIRE’s national representative.
|
32
|
</p>
|
33
|
|
34
|
<h3>Locate data provider via your institution</h3>
|
35
|
|
36
|
<form class= "">
|
37
|
<entities-autocomplete fieldId="organization" (click)="warningMessage = ''" [entityType]="'organization'" [depositType]=compatibility [selectedValue]=selectedId [showSelected]=true
|
38
|
[placeHolderMessage] = "'Search for Organizations'" [title] = "'Organizations'" [multipleSelections]=false
|
39
|
(selectedValueChanged)="valueChanged($event)">
|
40
|
</entities-autocomplete>
|
41
|
<button class=" uk-button uk-button-default" type="submit" (click)="organizationSelected(selectedId)" >
|
42
|
Locate
|
43
|
</button>
|
44
|
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">{{warningMessage}}</div>
|
45
|
</form>
|
46
|
</div>
|
47
|
</div>
|
48
|
`
|
49
|
})
|
50
|
|
51
|
export class DepositComponent {
|
52
|
@Input() keyword: string='';
|
53
|
public openAccess: string;
|
54
|
public openAccessRepo: string;
|
55
|
public fp7Guidlines: string;
|
56
|
public h2020Guidlines: string;
|
57
|
public ercGuidlines: string;
|
58
|
public helpdesk: string;
|
59
|
@Input() compatibility: string = '';
|
60
|
@Input() requestFor: string = "Publications";
|
61
|
|
62
|
public status: number;
|
63
|
public errorCodes:ErrorCodes = new ErrorCodes();
|
64
|
public selectedId: string = "";
|
65
|
public warningMessage: string = "";
|
66
|
|
67
|
constructor (private _router: Router, private _meta: Meta) {
|
68
|
|
69
|
this.openAccess = OpenaireProperties.getOpenAccess();
|
70
|
this.openAccessRepo = OpenaireProperties.getOpenAccessRepo();
|
71
|
this.fp7Guidlines = OpenaireProperties.getFP7Guidlines();
|
72
|
this.h2020Guidlines = OpenaireProperties.getH2020Guidlines();
|
73
|
this.ercGuidlines = OpenaireProperties.getERCGuidlines();
|
74
|
this.helpdesk = OpenaireProperties.getHelpdesk();
|
75
|
this.updateTitle("Deposit "+this.requestFor);
|
76
|
this.updateDescription("Openaire, repositories, open access, data provider, compatibility, organization, deposit "+ this.requestFor);
|
77
|
}
|
78
|
updateDescription(description:string){
|
79
|
this._meta.updateMeta("description", description);
|
80
|
this._meta.updateMeta("og:description", description);
|
81
|
}
|
82
|
updateTitle(title:string){
|
83
|
var _suffix ="| OpenAIRE";
|
84
|
var _title = ((title.length> 50 ) ?title.substring(0,50):title) + _suffix;
|
85
|
this._meta.setTitle(_title );
|
86
|
this._meta.updateMeta("og:title",_title);
|
87
|
}
|
88
|
|
89
|
|
90
|
organizationSelected(id: string) {
|
91
|
console.info("organization selected");
|
92
|
if(id && id.length > 0){
|
93
|
if(this.requestFor == "Publications") {
|
94
|
this._router.navigate( ['participate/deposit-publications-result'], { queryParams: { "organizationId": id } } );
|
95
|
} else if(this.requestFor == "Research Data") {
|
96
|
this._router.navigate( ['participate/deposit-datasets-result'], { queryParams: { "organizationId": id } } );
|
97
|
}
|
98
|
} else {
|
99
|
this.warningMessage = "No organization selected";
|
100
|
}
|
101
|
}
|
102
|
|
103
|
valueChanged($event){
|
104
|
this.selectedId = $event.value;
|
105
|
}
|
106
|
}
|