Commits
lotte authored 200b29f6f8a Merge
5 5 | import { CoreState } from '../core.reducers'; |
6 6 | |
7 7 | import { DataService } from './data.service'; |
8 8 | import { RequestService } from './request.service'; |
9 9 | import { HALEndpointService } from '../shared/hal-endpoint.service'; |
10 10 | import { FindAllOptions } from './request.models'; |
11 11 | import { ObjectCacheService } from '../cache/object-cache.service'; |
12 12 | import { NormalizedObjectBuildService } from '../cache/builders/normalized-object-build.service'; |
13 13 | import { HttpClient } from '@angular/common/http'; |
14 14 | import { NotificationsService } from '../../shared/notifications/notifications.service'; |
15 + | import { ChangeAnalyzer } from './change-analyzer'; |
15 16 | import { DefaultChangeAnalyzer } from './default-change-analyzer.service'; |
16 17 | import { MetadataSchema } from '../metadata/metadata-schema.model'; |
17 18 | |
19 + | /* tslint:disable:max-classes-per-file */ |
20 + | class DataServiceImpl extends DataService<MetadataSchema> { |
21 + | protected linkPath = 'metadataschemas'; |
22 + | protected forceBypassCache = false; |
23 + | |
24 + | constructor( |
25 + | protected requestService: RequestService, |
26 + | protected rdbService: RemoteDataBuildService, |
27 + | protected dataBuildService: NormalizedObjectBuildService, |
28 + | protected store: Store<CoreState>, |
29 + | protected objectCache: ObjectCacheService, |
30 + | protected halService: HALEndpointService, |
31 + | protected notificationsService: NotificationsService, |
32 + | protected http: HttpClient, |
33 + | protected comparator: ChangeAnalyzer<MetadataSchema>) { |
34 + | super(); |
35 + | } |
36 + | |
37 + | getBrowseEndpoint(options: FindAllOptions = {}, linkPath: string = this.linkPath): Observable<string> { |
38 + | return this.halService.getEndpoint(linkPath); |
39 + | } |
40 + | } |
41 + | |
18 42 | /** |
19 43 | * A service responsible for fetching/sending data from/to the REST API on the metadataschemas endpoint |
20 44 | */ |
21 45 | @Injectable() |
22 - | export class MetadataSchemaDataService extends DataService<MetadataSchema> { |
23 - | protected linkPath = 'metadataschemas'; |
24 - | protected forceBypassCache = false; |
46 + | export class MetadataSchemaDataService { |
47 + | private dataService: DataServiceImpl; |
25 48 | |
26 49 | constructor( |
27 50 | protected requestService: RequestService, |
28 51 | protected rdbService: RemoteDataBuildService, |
29 52 | protected store: Store<CoreState>, |
30 53 | protected halService: HALEndpointService, |
31 54 | protected objectCache: ObjectCacheService, |
32 55 | protected comparator: DefaultChangeAnalyzer<MetadataSchema>, |
33 56 | protected dataBuildService: NormalizedObjectBuildService, |
34 57 | protected http: HttpClient, |
35 58 | protected notificationsService: NotificationsService) { |
36 - | super(); |
37 - | } |
38 - | |
39 - | /** |
40 - | * Get the endpoint for browsing metadataschemas |
41 - | * @param {FindAllOptions} options |
42 - | * @returns {Observable<string>} |
43 - | */ |
44 - | public getBrowseEndpoint(options: FindAllOptions = {}, linkPath: string = this.linkPath): Observable<string> { |
45 - | |
46 - | return null; |
59 + | this.dataService = new DataServiceImpl(requestService, rdbService, dataBuildService, null, objectCache, halService, notificationsService, http, comparator); |
47 60 | } |
48 - | |
49 61 | } |