forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcontent-source.model.ts
More file actions
119 lines (103 loc) · 2.98 KB
/
Copy pathcontent-source.model.ts
File metadata and controls
119 lines (103 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import {
autoserializeAs,
deserialize,
deserializeAs,
serializeAs,
} from 'cerialize';
import { typedObject } from '../cache/builders/build-decorators';
import { CacheableObject } from '../cache/cacheable-object.model';
import { excludeFromEquals } from '../utilities/equals.decorators';
import { CONTENT_SOURCE } from './content-source.resource-type';
import { ContentSourceSetSerializer } from './content-source-set-serializer';
import { HALLink } from './hal-link.model';
import { MetadataConfig } from './metadata-config.model';
import { ResourceType } from './resource-type';
/**
* The type of content harvesting used
*/
export enum ContentSourceHarvestType {
None = 'NONE',
Metadata = 'METADATA_ONLY',
MetadataAndRef = 'METADATA_AND_REF',
MetadataAndBitstreams = 'METADATA_AND_BITSTREAMS'
}
/**
* A model class that holds information about the Content Source of a Collection
*/
@typedObject
export class ContentSource extends CacheableObject {
static type = CONTENT_SOURCE;
/**
* The object type
*
* The rest api doesn't provide one, so it's hardcoded here,
* and we need a custom responseparser for ContentSource responses
*/
@excludeFromEquals
type: ResourceType = CONTENT_SOURCE;
/**
* Unique identifier, this is necessary to store the ContentSource in FieldUpdates
* Because the ContentSource coming from the REST API doesn't have a UUID, we're using the selflink
*/
@deserializeAs('self')
uuid: string;
/**
* OAI Provider / Source
*/
@autoserializeAs('oai_source')
oaiSource: string;
/**
* OAI Specific set ID
*/
@deserializeAs(new ContentSourceSetSerializer(), 'oai_set_id')
@serializeAs(new ContentSourceSetSerializer(), 'oai_set_id')
oaiSetId: string;
/**
* The ID of the metadata format used
*/
@autoserializeAs('metadata_config_id')
metadataConfigId: string;
/**
* Type of content being harvested
* Defaults to 'NONE', meaning the collection doesn't harvest its content from an external source
*/
@autoserializeAs('harvest_type')
harvestType = ContentSourceHarvestType.None;
/**
* Whether bitstreams may be fetched from hosts other than the OAI provider
* Initialised to false on purpose: cerialize omits undefined values, so without it the key would never reach the backend
*/
@autoserializeAs('allow_external_urls')
allowExternalUrls = false;
/**
* The available metadata configurations
*/
metadataConfigs: MetadataConfig[];
/**
* The current harvest status
*/
@autoserializeAs('harvest_status')
harvestStatus: string;
/**
* The last's harvest start time
*/
@autoserializeAs('harvest_start_time')
harvestStartTime: string;
/**
* When the collection was last harvested
*/
@autoserializeAs('last_harvested')
lastHarvested: string;
/**
* The current harvest message
*/
@autoserializeAs('harvest_message')
message: string;
/**
* The {@link HALLink}s for this ContentSource
*/
@deserialize
_links: {
self: HALLink
};
}