import { Injectable } from '@angular/core'; import { Store } from '@ngrx/store'; import { Observable } from 'rxjs'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { NormalizedDSpaceObject } from '../cache/models/normalized-dspace-object.model'; import { CoreState } from '../core.reducers'; import { DSpaceObject } from '../shared/dspace-object.model'; import { HALEndpointService } from '../shared/hal-endpoint.service'; import { DataService } from './data.service'; import { RemoteData } from './remote-data'; import { RequestService } from './request.service'; import { FindAllOptions } from './request.models'; import { ObjectCacheService } from '../cache/object-cache.service'; import { AuthService } from '../auth/auth.service'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { HttpClient } from '@angular/common/http'; /* tslint:disable:max-classes-per-file */ class DataServiceImpl extends DataService { protected linkPath = 'dso'; constructor( protected requestService: RequestService, protected rdbService: RemoteDataBuildService, protected store: Store, protected objectCache: ObjectCacheService, protected halService: HALEndpointService, protected authService: AuthService, protected notificationsService: NotificationsService, protected http: HttpClient) { super(); } getBrowseEndpoint(options: FindAllOptions = {}, linkPath: string = this.linkPath): Observable { return this.halService.getEndpoint(linkPath); } getFindByIDHref(endpoint, resourceID): string { return endpoint.replace(/\{\?uuid\}/,`?uuid=${resourceID}`); } } @Injectable() export class DSpaceObjectDataService { protected linkPath = 'dso'; private dataService: DataServiceImpl; constructor( protected requestService: RequestService, protected rdbService: RemoteDataBuildService, protected objectCache: ObjectCacheService, protected halService: HALEndpointService, protected authService: AuthService, protected notificationsService: NotificationsService, protected http: HttpClient) { this.dataService = new DataServiceImpl(requestService, rdbService, null, objectCache, halService, authService, notificationsService, http); } findById(uuid: string): Observable> { return this.dataService.findById(uuid); } }