|
| 1 | +import { Injectable } from '@angular/core'; |
| 2 | +import { ConfigService } from './config.service'; |
| 3 | +import { RequestService } from '../data/request.service'; |
| 4 | +import { HALEndpointService } from '../shared/hal-endpoint.service'; |
| 5 | +import { ObjectCacheService } from '../cache/object-cache.service'; |
| 6 | +import { dataService } from '../cache/builders/build-decorators'; |
| 7 | +import { SUBMISSION_ACCESSES_TYPE } from './models/config-type'; |
| 8 | +import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; |
| 9 | +import { Store } from '@ngrx/store'; |
| 10 | +import { CoreState } from '../core.reducers'; |
| 11 | +import { NotificationsService } from '../../shared/notifications/notifications.service'; |
| 12 | +import { HttpClient } from '@angular/common/http'; |
| 13 | +import { DefaultChangeAnalyzer } from '../data/default-change-analyzer.service'; |
| 14 | +import { ConfigObject } from './models/config.model'; |
| 15 | +import { SubmissionAccessesModel } from './models/config-submission-accesses.model'; |
| 16 | +import { RemoteData } from '../data/remote-data'; |
| 17 | +import { Observable } from 'rxjs'; |
| 18 | +import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; |
| 19 | + |
| 20 | +/** |
| 21 | + * Provides methods to retrieve, from REST server, bitstream access conditions configurations applicable during the submission process. |
| 22 | + */ |
| 23 | +@Injectable() |
| 24 | +@dataService(SUBMISSION_ACCESSES_TYPE) |
| 25 | +export class SubmissionAccessesConfigService extends ConfigService { |
| 26 | + constructor( |
| 27 | + protected requestService: RequestService, |
| 28 | + protected rdbService: RemoteDataBuildService, |
| 29 | + protected store: Store<CoreState>, |
| 30 | + protected objectCache: ObjectCacheService, |
| 31 | + protected halService: HALEndpointService, |
| 32 | + protected notificationsService: NotificationsService, |
| 33 | + protected http: HttpClient, |
| 34 | + protected comparator: DefaultChangeAnalyzer<SubmissionAccessesModel> |
| 35 | + ) { |
| 36 | + super(requestService, rdbService, null, objectCache, halService, notificationsService, http, comparator, 'submissionaccessoptions'); |
| 37 | + } |
| 38 | + |
| 39 | + findByHref(href: string, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow): Observable<RemoteData<SubmissionAccessesModel>> { |
| 40 | + return super.findByHref(href, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow as FollowLinkConfig<ConfigObject>[]) as Observable<RemoteData<SubmissionAccessesModel>>; |
| 41 | + } |
| 42 | +} |
0 commit comments