Newer
Older
import { Injectable } from '@angular/core';
import { Store } from '@ngrx/store';
import { Observable } from 'rxjs';
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
import { CoreState } from '../core.reducers';
import { DataService } from './data.service';
import { RequestService } from './request.service';
import { HALEndpointService } from '../shared/hal-endpoint.service';
import { ObjectCacheService } from '../cache/object-cache.service';
import { MetadataSchema } from '../metadata/metadataschema.model';
Kristof De Langhe
committed
import { NormalizedObjectBuildService } from '../cache/builders/normalized-object-build.service';
import { HttpClient } from '@angular/common/http';
import { NotificationsService } from '../../shared/notifications/notifications.service';
import { ChangeAnalyzer } from './change-analyzer';
import { DefaultChangeAnalyzer } from './default-change-analyzer.service';
/* tslint:disable:max-classes-per-file */
class DataServiceImpl extends DataService<MetadataSchema> {
protected linkPath = 'metadataschemas';
protected forceBypassCache = false;
constructor(
protected requestService: RequestService,
protected rdbService: RemoteDataBuildService,
protected dataBuildService: NormalizedObjectBuildService,
protected store: Store<CoreState>,
protected objectCache: ObjectCacheService,
protected halService: HALEndpointService,
protected notificationsService: NotificationsService,
protected http: HttpClient,
protected comparator: ChangeAnalyzer<MetadataSchema>) {
super();
}
getBrowseEndpoint(options: FindAllOptions = {}, linkPath: string = this.linkPath): Observable<string> {
return this.halService.getEndpoint(linkPath);
}
}
/**
* A service responsible for fetching/sending data from/to the REST API on the metadataschemas endpoint
*/
export class MetadataSchemaDataService {
private dataService: DataServiceImpl;
constructor(
protected requestService: RequestService,
protected rdbService: RemoteDataBuildService,
protected store: Store<CoreState>,
protected halService: HALEndpointService,
Kristof De Langhe
committed
protected objectCache: ObjectCacheService,
protected comparator: DefaultChangeAnalyzer<MetadataSchema>,
Kristof De Langhe
committed
protected dataBuildService: NormalizedObjectBuildService,
protected http: HttpClient,
protected notificationsService: NotificationsService) {
this.dataService = new DataServiceImpl(requestService, rdbService, dataBuildService, null, objectCache, halService, notificationsService, http, comparator);