diff --git a/src/app/community/community.component.html b/src/app/community/community.component.html index dc4df8f..f178506 100644 --- a/src/app/community/community.component.html +++ b/src/app/community/community.component.html @@ -44,7 +44,7 @@ -
-
-

{{dataproviderTotal}}

+
+

{{contentProviderTotal}}

content providers

-
--> +
diff --git a/src/app/community/community.component.ts b/src/app/community/community.component.ts index bf830b6..42d7487 100644 --- a/src/app/community/community.component.ts +++ b/src/app/community/community.component.ts @@ -27,6 +27,9 @@ export class CommunityComponent { public publicationTotal = null; public researchDataTotal = null; public softwareTotal = null; + public projectTotal = null; + public contentProviderTotal = null; + public organizationTotal = null; params: any; properties:EnvProperties; @@ -76,6 +79,7 @@ export class CommunityComponent { communityId => { this.communityId = communityId['communityId']; }); + this._communityService.getCommunity('https://dev-openaire.d4science.org/openaire/community/'+this.communityId).subscribe ( community => { this.community = community; @@ -98,6 +102,24 @@ export class CommunityComponent { this.softwareTotal = softwareTotal; }); + this._communityService.countTotal('https://dev-openaire.d4science.org/openaire/community/'+this.communityId+'/projects').subscribe( + projectTotal => { + this.projectTotal = projectTotal; + console.log(projectTotal); + }); + + this._communityService.countTotal('https://dev-openaire.d4science.org/openaire/community/'+this.communityId+'/contentproviders').subscribe( + contentProviderTotal => { + this.contentProviderTotal = contentProviderTotal; + console.log(contentProviderTotal); + }); + + // this._communityService.countTotal('https://dev-openaire.d4science.org/openaire/community/'+this.communityId+'/organizations').subscribe( + // organizationTotal => { + // this.organizationTotal = organizationTotal; + // console.log(organizationTotal); + // }); + 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; diff --git a/src/app/community/community.service.ts b/src/app/community/community.service.ts index ced7b32..80d8af6 100644 --- a/src/app/community/community.service.ts +++ b/src/app/community/community.service.ts @@ -17,14 +17,8 @@ export class CommunityService { return this.http.get(url).map(res => res.json()).map(res => res.total).do(res => {console.log(res)}); } - - countTotal(url:string): any { - let total; - - - - return total; - + countTotal(url:string) { + return this.http.get(url).map(res => res.json()).map(res => res.length); } getResults(url: string) {