1 |
51835
|
sofia.balt
|
import {Component, Input} from '@angular/core';
|
2 |
|
|
import {Router} from '@angular/router';
|
3 |
|
|
import {ActivatedRoute} from '@angular/router';
|
4 |
|
|
import {Title, Meta} from '@angular/platform-browser';
|
5 |
50169
|
argiro.kok
|
|
6 |
51835
|
sofia.balt
|
import {Observable} from 'rxjs/Observable';
|
7 |
50169
|
argiro.kok
|
|
8 |
51835
|
sofia.balt
|
import {EnvProperties} from '../../utils/properties/env-properties';
|
9 |
50169
|
argiro.kok
|
|
10 |
51835
|
sofia.balt
|
import {ErrorCodes} from '../../utils/properties/errorCodes';
|
11 |
|
|
|
12 |
|
|
import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
|
13 |
|
|
import {RouterHelper} from '../../utils/routerHelper.class';
|
14 |
|
|
|
15 |
|
|
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
|
16 |
|
|
import {OrganizationService} from '../../services/organization.service';
|
17 |
|
|
import {PiwikService} from '../../utils/piwik/piwik.service';
|
18 |
53740
|
argiro.kok
|
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
|
19 |
51835
|
sofia.balt
|
|
20 |
53973
|
konstantin
|
import {ZenodoInformationClass} from '../utils/zenodoInformation.class';
|
21 |
|
|
|
22 |
50169
|
argiro.kok
|
@Component({
|
23 |
|
|
selector: 'deposit-by-subject-result',
|
24 |
54755
|
konstantin
|
template: `
|
25 |
|
|
<deposit-result [requestFor]="'Research Data'" [piwikSiteId]=piwikSiteId
|
26 |
|
|
[zenodoInformation]="zenodoInformation"
|
27 |
|
|
[subjectResults]="true" [subject]="subject">
|
28 |
|
|
</deposit-result>
|
29 |
|
|
`
|
30 |
|
|
//templateUrl: 'depositBySubjectResult.component.html'
|
31 |
50169
|
argiro.kok
|
})
|
32 |
|
|
|
33 |
|
|
export class DepositBySubjectResultComponent {
|
34 |
51746
|
argiro.kok
|
@Input() piwikSiteId = null;
|
35 |
54755
|
konstantin
|
@Input() zenodoInformation: ZenodoInformationClass;
|
36 |
50169
|
argiro.kok
|
|
37 |
54755
|
konstantin
|
public subject: string = "";
|
38 |
50586
|
argiro.kok
|
properties:EnvProperties;
|
39 |
50169
|
argiro.kok
|
|
40 |
54755
|
konstantin
|
constructor (private route: ActivatedRoute) {}
|
41 |
53973
|
konstantin
|
|
42 |
51835
|
sofia.balt
|
constructor (private _router: Router,
|
43 |
|
|
private route: ActivatedRoute,
|
44 |
|
|
private _searchDataprovidersService: SearchDataprovidersService,
|
45 |
|
|
private _meta: Meta,
|
46 |
|
|
private _title: Title,
|
47 |
53740
|
argiro.kok
|
private _piwikService:PiwikService,
|
48 |
|
|
private seoService: SEOService) {
|
49 |
50169
|
argiro.kok
|
|
50 |
|
|
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
|
51 |
|
|
|
52 |
|
|
this.status = this.errorCodes.LOADING;
|
53 |
|
|
|
54 |
51835
|
sofia.balt
|
var description = "Openaire, repositories, open access, content provider, compatibility, organization, deposit "+ this.requestFor;
|
55 |
|
|
var title = "Deposit "+this.requestFor;
|
56 |
50169
|
argiro.kok
|
|
57 |
51835
|
sofia.balt
|
this.updateTitle(title);
|
58 |
|
|
this.updateDescription(description);
|
59 |
54748
|
argiro.kok
|
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url, false);
|
60 |
53740
|
argiro.kok
|
|
61 |
51835
|
sofia.balt
|
}
|
62 |
50169
|
argiro.kok
|
|
63 |
|
|
ngOnInit() {
|
64 |
50586
|
argiro.kok
|
this.route.data
|
65 |
|
|
.subscribe((data: { envSpecific: EnvProperties }) => {
|
66 |
|
|
this.properties = data.envSpecific;
|
67 |
53740
|
argiro.kok
|
|
68 |
53973
|
konstantin
|
if(!this.zenodoInformation.url) {
|
69 |
|
|
this.zenodoInformation.url = this.properties.zenodo;
|
70 |
|
|
}
|
71 |
|
|
if(!this.zenodoInformation.name) {
|
72 |
|
|
this.zenodoInformation.name = "Zenodo";
|
73 |
|
|
}
|
74 |
50586
|
argiro.kok
|
});
|
75 |
50169
|
argiro.kok
|
}
|
76 |
|
|
}
|