Add getNumberOfResearchData

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@50449 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
sofia.baltzi 2018-01-29 14:44:50 +00:00
parent 677bfa7be8
commit 08fb7b101b
3 changed files with 17 additions and 6 deletions

View File

@ -18,7 +18,7 @@
</div> </div>
<div> <div>
<div class="uk-card uk-card-default uk-card-small uk-card-body"> <div class="uk-card uk-card-default uk-card-small uk-card-body">
<a><h3 class="uk-card-title">1397</h3> <a><h3 class="uk-card-title">{{res2.total}}</h3>
<p>research data</p></a> <p>research data</p></a>
</div> </div>
</div> </div>

View File

@ -21,6 +21,7 @@ export class CommunityComponent {
public pageTitle = "OpenAIRE" public pageTitle = "OpenAIRE"
public res=[]; public res=[];
public res2=[];
constructor ( constructor (
private route: ActivatedRoute, private route: ActivatedRoute,
@ -54,6 +55,11 @@ export class CommunityComponent {
this.res = res; this.res = res;
console.log(res); console.log(res);
}); });
this._communityService.getNumberOfResearchData().subscribe(
res2 => {
this.res2 = res2;
console.log(res2);
});
} }
public ngOnDestroy() { public ngOnDestroy() {
if(this.piwiksub){ if(this.piwiksub){

View File

@ -6,11 +6,16 @@ import { Observable } from 'rxjs/Rx';
@Injectable() @Injectable()
export class CommunityService { 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 => <any> res.json()).do(res => {console.log(res)});
} }
getNumberOfPublications() { getNumberOfResearchData() {
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 => <any> res.json()).do(res => {console.log(res)}); 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 => <any> res.json()).do(res => {console.log(res)});
}
} }