1
|
import {Injectable} from '@angular/core';
|
2
|
import {Http, Response, Headers} from '@angular/http';
|
3
|
import {Observable} from 'rxjs/Observable';
|
4
|
import {OpenaireProperties} from '../properties/openaireProperties';
|
5
|
import 'rxjs/add/operator/mapTo';
|
6
|
import 'rxjs/add/observable/of';
|
7
|
// import 'rxjs/add/operator/do';
|
8
|
// import 'rxjs/add/operator/share';
|
9
|
import { mapTo } from 'rxjs/operators';
|
10
|
|
11
|
@Injectable()
|
12
|
export class ConfigurationService {
|
13
|
constructor(private http: Http ) {}
|
14
|
|
15
|
isEntityEnabled(entity: string){
|
16
|
console.log("isEntityEnabled: "+entity);
|
17
|
let url = "isEntityEnabled-"+entity;
|
18
|
|
19
|
// if(entity == "publication" || entity == "dataset" || entity == "datasource"){
|
20
|
// return Observable.of(new Object()).mapTo(false);
|
21
|
// }
|
22
|
// return Observable.of(new Object()).mapTo(true);
|
23
|
return this.http.get("http://duffy.di.uoa.gr:8080/uoa-admin-tools/page")
|
24
|
.map(res => true);
|
25
|
}
|
26
|
isPageEnabled(router: string){
|
27
|
let url = "isPageEnabled-"+router;
|
28
|
|
29
|
// if(router == "search/journals" ){
|
30
|
//
|
31
|
// return Observable.of(new Object()).mapTo(false);
|
32
|
// }
|
33
|
return this.http.get("http://duffy.di.uoa.gr:8080/uoa-admin-tools/page")
|
34
|
.map(res => true);
|
35
|
}
|
36
|
getMainPageContent(){
|
37
|
return this.http.get("http://duffy.di.uoa.gr:8080/uoa-admin-tools/page")
|
38
|
.map(res => true);
|
39
|
}
|
40
|
getSpecialAnouncementContent(){
|
41
|
return this.http.get("http://duffy.di.uoa.gr:8080/uoa-admin-tools/page")
|
42
|
.map(res => "");
|
43
|
}
|
44
|
getHelpPageContent(router:string){
|
45
|
return this.http.get("http://duffy.di.uoa.gr:8080/uoa-admin-tools/page")
|
46
|
.map(res => true);
|
47
|
}
|
48
|
private handleError (error: Response) {
|
49
|
// in a real world app, we may send the error to some remote logging infrastructure
|
50
|
// instead of just logging it to the console
|
51
|
console.log(error);
|
52
|
return this.http.get("http://duffy.di.uoa.gr:8080/uoa-admin-tools/page")
|
53
|
.map(res => true);
|
54
|
}
|
55
|
|
56
|
|
57
|
}
|