1
|
import {Component, Input} from '@angular/core';
|
2
|
import {ActivatedRoute} from '@angular/router';
|
3
|
import {PiwikHelper} from '../../utils/piwikHelper';
|
4
|
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
5
|
|
6
|
@Component({
|
7
|
selector: 'openaire-search-software',
|
8
|
template: `
|
9
|
|
10
|
<search-software
|
11
|
openaireLink="https://beta.explore.openaire.eu/search/find/software"
|
12
|
[(advancedSearchParameters)]=advancedSearchParameters
|
13
|
[(connectCommunityId)]=connectCommunityId>
|
14
|
</search-software>
|
15
|
`
|
16
|
})
|
17
|
|
18
|
export class OpenaireSearchSoftwareComponent {
|
19
|
advancedSearchParameters:any;
|
20
|
connectCommunityId:string;
|
21
|
piwikSiteId = null;
|
22
|
constructor ( private route: ActivatedRoute) {
|
23
|
var communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname);
|
24
|
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
|
25
|
}
|
26
|
ngOnInit() {
|
27
|
this.route.queryParams.subscribe(data => {
|
28
|
|
29
|
if(data['community'] && data['community']!=""){
|
30
|
this.advancedSearchParameters = {community: data['community'], co: "and"};
|
31
|
var id= decodeURIComponent(data['community']);
|
32
|
this.connectCommunityId = id.slice(1,id.length - 1);
|
33
|
}
|
34
|
});
|
35
|
}
|
36
|
}
|