1
0

Cache redesign part 2

This commit is contained in:
Art Lowel
2021-01-20 14:34:08 +01:00
parent 64ba6293c9
commit c66de4fe91
155 changed files with 1610 additions and 1637 deletions

View File

@@ -43,17 +43,20 @@ export class SubmissionObjectDataService {
/**
* Retrieve a submission object based on its ID.
*
* @param id The identifier of a submission object
* @param reRequestOnStale Whether or not the request should automatically be re-requested after
* the response becomes stale
* @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved
* @param id The identifier of a submission object
* @param useCachedVersionIfAvailable If this is true, the request will only be sent if there's
* no valid cached version. Defaults to true
* @param reRequestOnStale Whether or not the request should automatically be re-
* requested after the response becomes stale
* @param linksToFollow List of {@link FollowLinkConfig} that indicate which
* {@link HALLink}s should be automatically resolved
*/
findById(id: string, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig<SubmissionObject>[]): Observable<RemoteData<SubmissionObject>> {
findById(id: string, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig<SubmissionObject>[]): Observable<RemoteData<SubmissionObject>> {
switch (this.submissionService.getSubmissionScope()) {
case SubmissionScopeType.WorkspaceItem:
return this.workspaceitemDataService.findById(id, reRequestOnStale,...linksToFollow);
return this.workspaceitemDataService.findById(id, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow);
case SubmissionScopeType.WorkflowItem:
return this.workflowItemDataService.findById(id, reRequestOnStale,...linksToFollow);
return this.workflowItemDataService.findById(id, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow);
default:
const now = new Date().getTime();
return observableOf(new RemoteData(