forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* BitstreamChecksum values are fetched and parsed from the BE * Checksum info is showed up. * Added messages and translations. * Added docs and refactored code * Fixed failing tests * Fixed wrong czech translations.
- Loading branch information
1 parent
0484c9d
commit 6be9911
Showing
12 changed files
with
277 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { dataService } from './data/base/data-service.decorator'; | ||
import { BaseDataService } from './data/base/base-data.service'; | ||
import { RequestService } from './data/request.service'; | ||
import { RemoteDataBuildService } from './cache/builders/remote-data-build.service'; | ||
import { Store } from '@ngrx/store'; | ||
import { CoreState } from './core-state.model'; | ||
import { HALEndpointService } from './shared/hal-endpoint.service'; | ||
import { ObjectCacheService } from './cache/object-cache.service'; | ||
import { DefaultChangeAnalyzer } from './data/default-change-analyzer.service'; | ||
import { HttpClient } from '@angular/common/http'; | ||
import { NotificationsService } from '../shared/notifications/notifications.service'; | ||
import { linkName } from './data/clarin/clrua-data.service'; | ||
import { BitstreamChecksum } from './shared/bitstream-checksum.model'; | ||
|
||
/** | ||
* A service responsible for fetching BitstreamChecksum objects from the REST API | ||
*/ | ||
@Injectable() | ||
@dataService(BitstreamChecksum.type) | ||
export class BitstreamChecksumDataService extends BaseDataService<BitstreamChecksum> { | ||
protected linkPath = 'checksum'; | ||
|
||
constructor( | ||
protected requestService: RequestService, | ||
protected rdbService: RemoteDataBuildService, | ||
protected store: Store<CoreState>, | ||
protected halService: HALEndpointService, | ||
protected objectCache: ObjectCacheService, | ||
protected comparator: DefaultChangeAnalyzer<BitstreamChecksum>, | ||
protected http: HttpClient, | ||
protected notificationsService: NotificationsService, | ||
) { | ||
super(linkName, requestService, rdbService, objectCache, halService, undefined); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { BITSTREAM_CHECKSUM } from './bitstream-checksum.resource'; | ||
import { excludeFromEquals } from '../utilities/equals.decorators'; | ||
import { autoserialize, deserialize } from 'cerialize'; | ||
import { ResourceType } from './resource-type'; | ||
import { HALLink } from './hal-link.model'; | ||
import { typedObject } from '../cache/builders/build-decorators'; | ||
import { TypedObject } from '../cache/typed-object.model'; | ||
|
||
|
||
/** | ||
* Model class containing the checksums of a bitstream (local, S3, DB) | ||
*/ | ||
@typedObject | ||
export class BitstreamChecksum extends TypedObject { | ||
/** | ||
* The `bitstreamchecksum` object type. | ||
*/ | ||
static type = BITSTREAM_CHECKSUM; | ||
|
||
/** | ||
* The object type | ||
*/ | ||
@excludeFromEquals | ||
@autoserialize | ||
type: ResourceType; | ||
|
||
/** | ||
* The identifier of this BitstreamChecksum object | ||
*/ | ||
@autoserialize | ||
id: string; | ||
|
||
/** | ||
* The checksum of the active store (local/S3) | ||
*/ | ||
@autoserialize | ||
activeStore: CheckSum; | ||
|
||
/** | ||
* The checksum from the database | ||
*/ | ||
@autoserialize | ||
databaseChecksum: CheckSum; | ||
|
||
/** | ||
* The checksum of the synchronized store (S3, local) | ||
*/ | ||
@autoserialize | ||
synchronizedStore: CheckSum; | ||
|
||
@deserialize | ||
_links: { | ||
self: HALLink | ||
}; | ||
} | ||
|
||
/** | ||
* Model class containing a checksum value and algorithm | ||
*/ | ||
export interface CheckSum { | ||
checkSumAlgorithm: string; | ||
value: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { ResourceType } from './resource-type'; | ||
|
||
/** | ||
* The resource type for BitstreamChecksum | ||
* | ||
* Needs to be in a separate file to prevent circular | ||
* dependencies in webpack. | ||
*/ | ||
export const BITSTREAM_CHECKSUM = new ResourceType('bitstreamchecksum'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.