From 08fb7b101b909b6f6e363d2ffd59b8da5c3040fe Mon Sep 17 00:00:00 2001 From: "sofia.baltzi" Date: Mon, 29 Jan 2018 14:44:50 +0000 Subject: [PATCH] Add getNumberOfResearchData git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@50449 d315682c-612b-4755-9ff5-7f18f6832af3 --- src/app/community/community.component.html | 2 +- src/app/community/community.component.ts | 6 ++++++ src/app/community/community.service.ts | 15 ++++++++++----- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/app/community/community.component.html b/src/app/community/community.component.html index 970c0a6..7cd43ed 100644 --- a/src/app/community/community.component.html +++ b/src/app/community/community.component.html @@ -18,7 +18,7 @@
diff --git a/src/app/community/community.component.ts b/src/app/community/community.component.ts index eacc2a9..afda36d 100644 --- a/src/app/community/community.component.ts +++ b/src/app/community/community.component.ts @@ -21,6 +21,7 @@ export class CommunityComponent { public pageTitle = "OpenAIRE" public res=[]; + public res2=[]; constructor ( private route: ActivatedRoute, @@ -54,6 +55,11 @@ export class CommunityComponent { this.res = res; console.log(res); }); + this._communityService.getNumberOfResearchData().subscribe( + res2 => { + this.res2 = res2; + console.log(res2); + }); } public ngOnDestroy() { if(this.piwiksub){ diff --git a/src/app/community/community.service.ts b/src/app/community/community.service.ts index 02413e4..9913647 100644 --- a/src/app/community/community.service.ts +++ b/src/app/community/community.service.ts @@ -6,11 +6,16 @@ import { Observable } from 'rxjs/Rx'; @Injectable() export class CommunityService { -constructor(private http:Http) { + constructor(private http:Http) { + } + + getNumberOfPublications() { + return this.http.get('http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/publications/count?format=json') + .map(res => res.json()).do(res => {console.log(res)}); } -getNumberOfPublications() { - return this.http.get('http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/publications/count?format=json').map(res => res.json()).do(res => {console.log(res)}); -} - + getNumberOfResearchData() { + return this.http.get('http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/datasets/count?format=json&fq=communityid=egi') + .map(res => res.json()).do(res => {console.log(res)}); + } }