diff --git a/src/app/community/community.component.ts b/src/app/community/community.component.ts index 4d846b0..b9d67cf 100644 --- a/src/app/community/community.component.ts +++ b/src/app/community/community.component.ts @@ -71,35 +71,6 @@ export class CommunityComponent { }); - this._communityService.getTotal('http://beta.services.openaire.eu:8480/search/rest/v2/api/publications/count?format=json&fq=communityid=egi').subscribe( - publicationTotal => { - this.publicationTotal = publicationTotal; - }); - - this._communityService.getTotal('http://beta.services.openaire.eu:8480/search/rest/v2/api/datasets/count?format=json&fq=communityid=egi').subscribe( - researchDataTotal => { - this.researchDataTotal = researchDataTotal; - }); - - this._communityService.getTotal('http://beta.services.openaire.eu:8480/search/rest/v2/api/software/count?format=json&fq=communityid=egi').subscribe( - softwareTotal => { - this.softwareTotal = softwareTotal; - }); - - this._communityService.getResults('http://beta.services.openaire.eu:8480/search/rest/v2/api/publications?fq=communityid%20exact%20%22egi%22&sortBy=resultdateofacceptance,descending&format=json&size=5').subscribe( - publicationResults => { - this.publicationResults = publicationResults; - }); - - this._communityService.getResults('http://beta.services.openaire.eu:8480/search/rest/v2/api/datasets?fq=communityid%20exact%20%22egi%22&sortBy=resultdateofacceptance,descending&format=json&size=5').subscribe( - researchDataResults => { - this.researchDataResults = researchDataResults; - }); - - this._communityService.getResults('http://beta.services.openaire.eu:8480/search/rest/v2/api/software?fq=communityid%20exact%20%22egi%22&sortBy=resultdateofacceptance,descending&format=json&size=5').subscribe( - softwareResults => { - this.softwareResults = softwareResults; - }); this.route.queryParams.subscribe( communityId => { @@ -113,6 +84,36 @@ export class CommunityComponent { console.log(communityInfo); }); + this._communityService.getTotal('http://beta.services.openaire.eu:8480/search/rest/v2/api/publications/count?format=json&fq=communityid='+this.communityId).subscribe( + publicationTotal => { + this.publicationTotal = publicationTotal; + }); + + this._communityService.getTotal('http://beta.services.openaire.eu:8480/search/rest/v2/api/datasets/count?format=json&fq=communityid='+this.communityId).subscribe( + researchDataTotal => { + this.researchDataTotal = researchDataTotal; + }); + + this._communityService.getTotal('http://beta.services.openaire.eu:8480/search/rest/v2/api/software/count?format=json&fq=communityid='+this.communityId).subscribe( + softwareTotal => { + this.softwareTotal = softwareTotal; + }); + + this._communityService.getResults('http://beta.services.openaire.eu:8480/search/rest/v2/api/publications?fq=communityid%20exact%20%22'+this.communityId+'%22&sortBy=resultdateofacceptance,descending&format=json&size=5').subscribe( + publicationResults => { + this.publicationResults = publicationResults; + }); + + this._communityService.getResults('http://beta.services.openaire.eu:8480/search/rest/v2/api/datasets?fq=communityid%20exact%20%22'+this.communityId+'%22&sortBy=resultdateofacceptance,descending&format=json&size=5').subscribe( + researchDataResults => { + this.researchDataResults = researchDataResults; + }); + + this._communityService.getResults('http://beta.services.openaire.eu:8480/search/rest/v2/api/software?fq=communityid%20exact%20%22'+this.communityId+'%22&sortBy=resultdateofacceptance,descending&format=json&size=5').subscribe( + softwareResults => { + this.softwareResults = softwareResults; + }); + }