Added getters for Remote data.

This commit is contained in:
Nikolaos Laskaris 2017-10-18 19:08:21 +03:00
parent eced040f8d
commit b950bf4ebc
1 changed files with 53 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import {DataModel} from '../entities/DataModel';
import {Project} from '../entities/model/project';
import {LoginComponent} from '../../app/login/login-page';
import { TokenService, TokenProvider } from './token.service';
import {RestBase} from './rest-base';
import 'rxjs/Rx';
import './../../assets/xml2json.min.js';
@ -16,6 +17,7 @@ declare var X2JS: any;
@Injectable()
export class ServerService {
xml2jsonOBJ: any;
//fetchURL: string = 'http://dl010.madgik.di.uoa.gr:8080/dmp-backend/rest/DMP/a868dbbb-ee37-4ce6-81c8-27048e0599a9';
//fetchURL: string = 'http://dl010.madgik.di.uoa.gr:8080/dmp-backend/rest/DMP/a71a6a92-5c23-40d7-ab87-e30bc860f5a4';//include rules!
@ -32,11 +34,61 @@ export class ServerService {
//data: any;
constructor(private httpClient: HttpClient, private tokenService: TokenService) { //private http: Http
constructor(private httpClient: HttpClient, private tokenService: TokenService, private restBase: RestBase) { //private http: Http
this.xml2jsonOBJ = new X2JS();
}
listDatasetIDs(){
return this.restBase.get("dataset");
}
getAllDatasets(){
return this.restBase.get("getAllDatasets");
}
getAllDatasetIDs(datasetId: string){
return this.restBase.get("dataset/"+datasetId);
}
getAllDmps(){
return this.restBase.get("dmp/getAll");
}
listDmpsLabelID(){
return this.restBase.get("dmp/listDMPLabelID");
}
getDmp(dmpid : string){
return this.restBase.get("dmps/"+dmpid);
}
listDmpIDs(){
return this.restBase.get("dmps");
}
listProjectIDs(){
return this.restBase.get("projects");
}
getAllProjects(){
return this.restBase.get("project/getAll");
}
getProject(projectID : string){
return this.restBase.get("projects/"+projectID);
}
listProjectsLabelID(){
return this.restBase.get("project/listAllLabelIDs");
}
getData() {
//let headers = new HttpHeaders();