import 'rxjs/add/operator/map'; import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { HostConfiguration } from './../../app.constants'; import { BaseHttpService } from '../../utilities/cite-http-service-module/base-http.service'; import { Observable } from 'rxjs/Observable'; import { ExternalSourcesItemModel } from '../../models/external-sources/ExternalSourcesItemModel'; @Injectable() export class ExternalSourcesService { private actionUrl: string; private headers: HttpHeaders; constructor(private http: BaseHttpService) { this.actionUrl = HostConfiguration.Server + 'external/'; this.headers = new HttpHeaders(); this.headers = this.headers.set('Content-Type', 'application/json'); this.headers = this.headers.set('Accept', 'application/json'); } public searchDatasetRegistry(like: string): Observable { return this.http.get(this.actionUrl + "registries" + "?query=" + like, { headers: this.headers }); } public searchDatasetRepository(like: string): Observable { return this.http.get(this.actionUrl + "datarepos" + "?query=" + like, { headers: this.headers }); } public searchDatasetService(like: string): Observable { return this.http.get(this.actionUrl + "services" + "?query=" + like, { headers: this.headers }); } public searchDMPResearchers(like: string): Observable { return this.http.get(this.actionUrl + "researchers" + "?query=" + like, { headers: this.headers }); } public searchDMPOrganizations(like: string): Observable { return this.http.get(this.actionUrl + "organisations" + "?query=" + like, { headers: this.headers }); } }