From 9c9149f49395b5f721ff3fdb74299e1ce653204e Mon Sep 17 00:00:00 2001 From: milanmajchrak Date: Wed, 27 Sep 2023 14:52:40 +0200 Subject: [PATCH] Resolved conflicts --- .../data/metadata-bitstream-data.service.ts | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/app/core/data/metadata-bitstream-data.service.ts b/src/app/core/data/metadata-bitstream-data.service.ts index 7e583eb99bf..55144566192 100644 --- a/src/app/core/data/metadata-bitstream-data.service.ts +++ b/src/app/core/data/metadata-bitstream-data.service.ts @@ -1,6 +1,5 @@ import { Injectable } from '@angular/core'; import { hasValue } from '../../shared/empty.util'; -import { PaginatedList } from './paginated-list.model'; import { RemoteData } from './remote-data'; import { RequestService } from './request.service'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; @@ -8,31 +7,33 @@ import { HALEndpointService } from '../shared/hal-endpoint.service'; import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; import { Observable } from 'rxjs'; import { RequestParam } from '../cache/models/request-param.model'; -import { NoContent } from '../shared/NoContent.model'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { ObjectCacheService } from '../cache/object-cache.service'; import { METADATA_BITSTREAM } from '../metadata/metadata-bitstream.resource-type'; -import { FindListOptions } from './request.models'; -import { dataService } from '../cache/builders/build-decorators'; import { MetadataBitstream } from '../metadata/metadata-bitstream.model'; -import { DataService } from './data.service'; import { HttpClient } from '@angular/common/http'; import { Store } from '@ngrx/store'; -import { CoreState } from '../core.reducers'; import { ChangeAnalyzer } from './change-analyzer'; -import { tap } from 'rxjs/operators'; +import { IdentifiableDataService } from './base/identifiable-data.service'; +import { SearchData, SearchDataImpl } from './base/search-data'; +import { CoreState } from '../core-state.model'; +import { dataService } from './base/data-service.decorator'; +import { FindListOptions } from './find-list-options.model'; +import { linkName } from './clarin/clarin-license-data.service'; +import { PaginatedList } from './paginated-list.model'; /** * A service responsible for fetching/sending data from/to the REST API on the metadatafields endpoint */ @Injectable() @dataService(METADATA_BITSTREAM) -export class MetadataBitstreamDataService extends DataService { +export class MetadataBitstreamDataService extends IdentifiableDataService implements SearchData { protected store: Store; protected http: HttpClient; protected comparator: ChangeAnalyzer; protected linkPath = 'metadatabitstreams'; protected searchByHandleLinkPath = 'byHandle'; + private searchData: SearchData; constructor( protected requestService: RequestService, @@ -41,7 +42,8 @@ export class MetadataBitstreamDataService extends DataService protected halService: HALEndpointService, protected notificationsService: NotificationsService ) { - super(); + super(linkName, requestService, rdbService, objectCache, halService, undefined); + this.searchData = new SearchDataImpl(this.linkPath, requestService, rdbService, objectCache, halService, this.responseMsToLive); } /** @@ -79,4 +81,8 @@ export class MetadataBitstreamDataService extends DataService ...linksToFollow ); } + + searchBy(searchMethod: string, options?: FindListOptions, useCachedVersionIfAvailable?: boolean, reRequestOnStale?: boolean, ...linksToFollow: FollowLinkConfig[]): Observable>> { + return this.searchData.searchBy(searchMethod, options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow); + } }