mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 22:13:02 +00:00
Added services and models
This commit is contained in:
5
src/app/core/tasks/models/claimed-task-object.model.ts
Normal file
5
src/app/core/tasks/models/claimed-task-object.model.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { TaskObject } from './task-object.model';
|
||||
|
||||
export class ClaimedTask extends TaskObject {
|
||||
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
import { NormalizedTaskObject } from './normalized-task-object.model';
|
||||
import { mapsTo, relationship } from '../../cache/builders/build-decorators';
|
||||
import { autoserialize, inheritSerialization } from 'cerialize';
|
||||
import { ClaimedTask } from './claimed-task-object.model';
|
||||
import { ResourceType } from '../../shared/resource-type';
|
||||
|
||||
/**
|
||||
* A model class for a NormalizedClaimedTaskObject.
|
||||
*/
|
||||
@mapsTo(ClaimedTask)
|
||||
@inheritSerialization(NormalizedTaskObject)
|
||||
export class NormalizedClaimedTask extends NormalizedTaskObject {
|
||||
|
||||
/**
|
||||
* The task identifier
|
||||
*/
|
||||
@autoserialize
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* The workflow step
|
||||
*/
|
||||
@autoserialize
|
||||
step: string;
|
||||
|
||||
/**
|
||||
* The task action type
|
||||
*/
|
||||
@autoserialize
|
||||
action: string;
|
||||
|
||||
/**
|
||||
* The workflowitem object whom this task is related
|
||||
*/
|
||||
@autoserialize
|
||||
@relationship(ResourceType.Workflowitem, false)
|
||||
workflowitem: string;
|
||||
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
import { NormalizedTaskObject } from './normalized-task-object.model';
|
||||
import { PoolTask } from './pool-task-object.model';
|
||||
import { autoserialize, inheritSerialization } from 'cerialize';
|
||||
import { mapsTo, relationship } from '../../cache/builders/build-decorators';
|
||||
import { ResourceType } from '../../shared/resource-type';
|
||||
|
||||
/**
|
||||
* A model class for a NormalizedPoolTaskObject.
|
||||
*/
|
||||
@mapsTo(PoolTask)
|
||||
@inheritSerialization(NormalizedTaskObject)
|
||||
export class NormalizedPoolTask extends NormalizedTaskObject {
|
||||
|
||||
/**
|
||||
* The task identifier
|
||||
*/
|
||||
@autoserialize
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* The workflow step
|
||||
*/
|
||||
@autoserialize
|
||||
step: string;
|
||||
|
||||
/**
|
||||
* The task action type
|
||||
*/
|
||||
@autoserialize
|
||||
action: string;
|
||||
|
||||
/**
|
||||
* The workflowitem object whom this task is related
|
||||
*/
|
||||
@autoserialize
|
||||
@relationship(ResourceType.Workflowitem, false)
|
||||
workflowitem: string;
|
||||
}
|
38
src/app/core/tasks/models/normalized-task-object.model.ts
Normal file
38
src/app/core/tasks/models/normalized-task-object.model.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { autoserialize, inheritSerialization } from 'cerialize';
|
||||
import { mapsTo, relationship } from '../../cache/builders/build-decorators';
|
||||
import { ResourceType } from '../../shared/resource-type';
|
||||
import { NormalizedDSpaceObject } from '../../cache/models/normalized-dspace-object.model';
|
||||
import { TaskObject } from './task-object.model';
|
||||
|
||||
/**
|
||||
* An abstract model class for a DSpaceObject.
|
||||
*/
|
||||
@mapsTo(TaskObject)
|
||||
@inheritSerialization(NormalizedDSpaceObject)
|
||||
export abstract class NormalizedTaskObject extends NormalizedDSpaceObject {
|
||||
|
||||
/**
|
||||
* The task identifier
|
||||
*/
|
||||
@autoserialize
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* The workflow step
|
||||
*/
|
||||
@autoserialize
|
||||
step: string;
|
||||
|
||||
/**
|
||||
* The task action type
|
||||
*/
|
||||
@autoserialize
|
||||
action: string;
|
||||
|
||||
/**
|
||||
* The workflowitem object whom this task is related
|
||||
*/
|
||||
@autoserialize
|
||||
@relationship(ResourceType.Workflowitem, false)
|
||||
workflowitem: string;
|
||||
}
|
5
src/app/core/tasks/models/pool-task-object.model.ts
Normal file
5
src/app/core/tasks/models/pool-task-object.model.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { TaskObject } from './task-object.model';
|
||||
|
||||
export class PoolTask extends TaskObject {
|
||||
|
||||
}
|
17
src/app/core/tasks/models/process-task-response.ts
Normal file
17
src/app/core/tasks/models/process-task-response.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { RemoteDataError } from '../../data/remote-data-error';
|
||||
|
||||
/**
|
||||
* A class to represent the data retrieved by after processing a task
|
||||
*/
|
||||
export class ProcessTaskResponse {
|
||||
constructor(
|
||||
private isSuccessful: boolean,
|
||||
public error?: RemoteDataError,
|
||||
public payload?: any
|
||||
) {
|
||||
}
|
||||
|
||||
get hasSucceeded(): boolean {
|
||||
return this.isSuccessful;
|
||||
}
|
||||
}
|
30
src/app/core/tasks/models/task-object.model.ts
Normal file
30
src/app/core/tasks/models/task-object.model.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { CacheableObject } from '../../cache/object-cache.reducer';
|
||||
import { DSpaceObject } from '../../shared/dspace-object.model';
|
||||
import { ListableObject } from '../../../shared/object-collection/shared/listable-object.model';
|
||||
import { RemoteData } from '../../data/remote-data';
|
||||
import { Workflowitem } from '../../submission/models/workflowitem.model';
|
||||
|
||||
export class TaskObject extends DSpaceObject implements CacheableObject, ListableObject {
|
||||
|
||||
/**
|
||||
* The task identifier
|
||||
*/
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* The workflow step
|
||||
*/
|
||||
step: string;
|
||||
|
||||
/**
|
||||
* The task action type
|
||||
*/
|
||||
action: string;
|
||||
|
||||
/**
|
||||
* The workflowitem object whom this task is related
|
||||
*/
|
||||
workflowitem: Observable<RemoteData<Workflowitem>> | Workflowitem;
|
||||
}
|
Reference in New Issue
Block a user