connect/src/app/community/community.service.ts

34 lines
1.5 KiB
TypeScript

import { Injectable } from '@angular/core';
import { Http, Response, Headers, RequestOptions } from '@angular/http';
import { Observable } from 'rxjs/Rx';
@Injectable()
export class CommunityService {
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&fq=communityid=egi')
.map(res => <any> res.json()).do(res => {console.log(res)});
}
// Most recent publications
getPublicationsInfo(){
return this.http.get('http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/publications?fq=communityid exact "egi"&sortBy=resultdateofacceptance,descending&format=json')
.map(res => <any> res.json()).map(res => res.results).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 => <any> res.json()).do(res => {console.log(res)});
}
getNumberOfSoftware() {
return this.http.get('http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/software/count?format=json&fq=communityid=egi')
.map(res => <any> res.json()).do(res => {console.log(res)});
}
}