mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
switch to typedObject decorator, which no longer needs explict type param
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { autoserialize, deserialize, deserializeAs } from 'cerialize';
|
||||
import { Observable } from 'rxjs';
|
||||
import { link, resourceType } from '../../cache/builders/build-decorators';
|
||||
import { link, typedObject } from '../../cache/builders/build-decorators';
|
||||
import { IDToUUIDSerializer } from '../../cache/id-to-uuid-serializer';
|
||||
import { CacheableObject } from '../../cache/object-cache.reducer';
|
||||
import { RemoteData } from '../../data/remote-data';
|
||||
@@ -16,7 +16,7 @@ import { AuthTokenInfo } from './auth-token-info.model';
|
||||
/**
|
||||
* Object that represents the authenticated status of a user
|
||||
*/
|
||||
@resourceType(AuthStatus.type)
|
||||
@typedObject
|
||||
export class AuthStatus implements CacheableObject {
|
||||
static type = AUTH_STATUS;
|
||||
|
||||
|
19
src/app/core/cache/builders/build-decorators.ts
vendored
19
src/app/core/cache/builders/build-decorators.ts
vendored
@@ -1,12 +1,11 @@
|
||||
import 'reflect-metadata';
|
||||
import { hasNoValue, hasValue } from '../../../shared/empty.util';
|
||||
import { DataService } from '../../data/data.service';
|
||||
import { PaginatedList } from '../../data/paginated-list';
|
||||
|
||||
import { GenericConstructor } from '../../shared/generic-constructor';
|
||||
import { HALResource } from '../../shared/hal-resource.model';
|
||||
import { CacheableObject, TypedObject } from '../object-cache.reducer';
|
||||
import { ResourceType } from '../../shared/resource-type';
|
||||
import { CacheableObject, TypedObject } from '../object-cache.reducer';
|
||||
|
||||
const resolvedLinkKey = Symbol('resolvedLink');
|
||||
|
||||
@@ -17,12 +16,10 @@ const linkMap = new Map();
|
||||
|
||||
/**
|
||||
* Decorator function to map a ResourceType to its class
|
||||
* @param value The ResourceType to map
|
||||
* @param target The contructor of the typed class to map
|
||||
*/
|
||||
export function resourceType(value: ResourceType) {
|
||||
return function decorator(objectConstructor: GenericConstructor<TypedObject>) {
|
||||
typeMap.set(value.value, objectConstructor);
|
||||
}
|
||||
export function typedObject(target: typeof TypedObject) {
|
||||
typeMap.set(target.type.value, target);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,14 +71,6 @@ export function resolvedLink<T extends DataService<any>, K extends keyof T>(prov
|
||||
};
|
||||
}
|
||||
|
||||
export function getResolvedLinkMetadata(target: any, propertyKey: string) {
|
||||
return Reflect.getMetadata(resolvedLinkKey, target, propertyKey);
|
||||
}
|
||||
|
||||
export function getResolvedLinks(target: any) {
|
||||
return resolvedLinkMap.get(target);
|
||||
}
|
||||
|
||||
export class LinkDefinition<T extends HALResource> {
|
||||
resourceType: ResourceType;
|
||||
isList = false;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { autoserialize, deserialize } from 'cerialize';
|
||||
import { resourceType } from '../../cache/builders/build-decorators';
|
||||
import { typedObject } from '../../cache/builders/build-decorators';
|
||||
import { PaginatedList } from '../../data/paginated-list';
|
||||
import { HALLink } from '../../shared/hal-link.model';
|
||||
import { ResourceType } from '../../shared/resource-type';
|
||||
@@ -9,7 +9,7 @@ import { ConfigObject } from './config.model';
|
||||
/**
|
||||
* Class for the configuration describing the submission
|
||||
*/
|
||||
@resourceType(SubmissionDefinitionModel.type)
|
||||
@typedObject
|
||||
export class SubmissionDefinitionModel extends ConfigObject {
|
||||
static type = new ResourceType('submissiondefinition');
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
import { inheritSerialization } from 'cerialize';
|
||||
import { resourceType } from '../../cache/builders/build-decorators';
|
||||
import { typedObject } from '../../cache/builders/build-decorators';
|
||||
import { SubmissionDefinitionModel } from './config-submission-definition.model';
|
||||
import { ResourceType } from '../../shared/resource-type';
|
||||
|
||||
@resourceType(SubmissionDefinitionsModel.type)
|
||||
@typedObject
|
||||
@inheritSerialization(SubmissionDefinitionModel)
|
||||
export class SubmissionDefinitionsModel extends SubmissionDefinitionModel {
|
||||
static type = new ResourceType('submissiondefinitions');
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { autoserialize, inheritSerialization } from 'cerialize';
|
||||
import { resourceType } from '../../cache/builders/build-decorators';
|
||||
import { typedObject } from '../../cache/builders/build-decorators';
|
||||
import { ConfigObject } from './config.model';
|
||||
import { FormFieldModel } from '../../../shared/form/builder/models/form-field.model';
|
||||
import { ResourceType } from '../../shared/resource-type';
|
||||
@@ -14,7 +14,7 @@ export interface FormRowModel {
|
||||
/**
|
||||
* A model class for a NormalizedObject.
|
||||
*/
|
||||
@resourceType(SubmissionFormModel.type)
|
||||
@typedObject
|
||||
@inheritSerialization(ConfigObject)
|
||||
export class SubmissionFormModel extends ConfigObject {
|
||||
static type = new ResourceType('submissionform');
|
||||
|
@@ -1,12 +1,12 @@
|
||||
import { inheritSerialization } from 'cerialize';
|
||||
import { resourceType } from '../../cache/builders/build-decorators';
|
||||
import { typedObject } from '../../cache/builders/build-decorators';
|
||||
import { SubmissionFormModel } from './config-submission-form.model';
|
||||
import { ResourceType } from '../../shared/resource-type';
|
||||
|
||||
/**
|
||||
* A model class for a NormalizedObject.
|
||||
*/
|
||||
@resourceType(SubmissionFormsModel.type)
|
||||
@typedObject
|
||||
@inheritSerialization(SubmissionFormModel)
|
||||
export class SubmissionFormsModel extends SubmissionFormModel {
|
||||
static type = new ResourceType('submissionforms');
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { autoserialize, deserialize } from 'cerialize';
|
||||
import { SectionsType } from '../../../submission/sections/sections-type';
|
||||
import { resourceType } from '../../cache/builders/build-decorators';
|
||||
import { typedObject } from '../../cache/builders/build-decorators';
|
||||
import { HALLink } from '../../shared/hal-link.model';
|
||||
import { ResourceType } from '../../shared/resource-type';
|
||||
import { ConfigObject } from './config.model';
|
||||
@@ -13,7 +13,7 @@ export interface SubmissionSectionVisibility {
|
||||
other: any
|
||||
}
|
||||
|
||||
@resourceType(SubmissionSectionModel.type)
|
||||
@typedObject
|
||||
export class SubmissionSectionModel extends ConfigObject {
|
||||
static type = new ResourceType('submissionsection');
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
import { inheritSerialization } from 'cerialize';
|
||||
import { resourceType } from '../../cache/builders/build-decorators';
|
||||
import { typedObject } from '../../cache/builders/build-decorators';
|
||||
import { SubmissionSectionModel } from './config-submission-section.model';
|
||||
import { ResourceType } from '../../shared/resource-type';
|
||||
|
||||
@resourceType(SubmissionSectionsModel.type)
|
||||
@typedObject
|
||||
@inheritSerialization(SubmissionSectionModel)
|
||||
export class SubmissionSectionsModel extends SubmissionSectionModel {
|
||||
static type = new ResourceType('submissionsections');
|
||||
|
@@ -1,11 +1,11 @@
|
||||
import { autoserialize } from 'cerialize';
|
||||
import { resourceType } from '../../cache/builders/build-decorators';
|
||||
import { typedObject } from '../../cache/builders/build-decorators';
|
||||
import { ConfigObject } from './config.model';
|
||||
import { AccessConditionOption } from './config-access-condition-option.model';
|
||||
import { SubmissionFormsModel } from './config-submission-forms.model';
|
||||
import { ResourceType } from '../../shared/resource-type';
|
||||
|
||||
@resourceType(SubmissionUploadsModel.type)
|
||||
@typedObject
|
||||
export class SubmissionUploadsModel extends ConfigObject {
|
||||
static type = new ResourceType('submissionupload');
|
||||
/**
|
||||
|
@@ -111,10 +111,10 @@ export abstract class BaseResponseParsingService {
|
||||
protected deserialize<ObjectDomain>(obj): any {
|
||||
const type: string = obj.type;
|
||||
if (hasValue(type)) {
|
||||
const normObjConstructor = getClassForType(type) as GenericConstructor<ObjectDomain>;
|
||||
const objConstructor = getClassForType(type) as GenericConstructor<ObjectDomain>;
|
||||
|
||||
if (hasValue(normObjConstructor)) {
|
||||
const serializer = new this.serializerConstructor(normObjConstructor);
|
||||
if (hasValue(objConstructor)) {
|
||||
const serializer = new this.serializerConstructor(objConstructor);
|
||||
return serializer.deserialize(obj);
|
||||
} else {
|
||||
return null;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { autoserialize, deserialize, inheritSerialization } from 'cerialize';
|
||||
import { Observable } from 'rxjs';
|
||||
import { link, resourceType } from '../../cache/builders/build-decorators';
|
||||
import { link, typedObject } from '../../cache/builders/build-decorators';
|
||||
import { PaginatedList } from '../../data/paginated-list';
|
||||
import { RemoteData } from '../../data/remote-data';
|
||||
|
||||
@@ -10,7 +10,7 @@ import { EPERSON } from './eperson.resource-type';
|
||||
import { Group } from './group.model';
|
||||
import { GROUP } from './group.resource-type';
|
||||
|
||||
@resourceType(EPerson.type)
|
||||
@typedObject
|
||||
@inheritSerialization(DSpaceObject)
|
||||
export class EPerson extends DSpaceObject {
|
||||
static type = EPERSON;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { autoserialize, deserialize, inheritSerialization } from 'cerialize';
|
||||
import { Observable } from 'rxjs';
|
||||
import { link, resourceType } from '../../cache/builders/build-decorators';
|
||||
import { link, typedObject } from '../../cache/builders/build-decorators';
|
||||
import { PaginatedList } from '../../data/paginated-list';
|
||||
import { RemoteData } from '../../data/remote-data';
|
||||
|
||||
@@ -8,7 +8,7 @@ import { DSpaceObject } from '../../shared/dspace-object.model';
|
||||
import { HALLink } from '../../shared/hal-link.model';
|
||||
import { GROUP } from './group.resource-type';
|
||||
|
||||
@resourceType(Group.type)
|
||||
@typedObject
|
||||
@inheritSerialization(DSpaceObject)
|
||||
export class Group extends DSpaceObject {
|
||||
static type = GROUP;
|
||||
|
@@ -2,7 +2,7 @@ import { autoserialize, deserialize, inheritSerialization } from 'cerialize';
|
||||
import { isNotEmpty } from '../../../shared/empty.util';
|
||||
import { PLACEHOLDER_PARENT_METADATA } from '../../../shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model';
|
||||
import { OtherInformation } from '../../../shared/form/builder/models/form-field-metadata-value.model';
|
||||
import { resourceType } from '../../cache/builders/build-decorators';
|
||||
import { typedObject } from '../../cache/builders/build-decorators';
|
||||
import { HALLink } from '../../shared/hal-link.model';
|
||||
import { MetadataValueInterface } from '../../shared/metadata.models';
|
||||
import { AUTHORITY_VALUE } from './authority.resource-type';
|
||||
@@ -11,7 +11,7 @@ import { IntegrationModel } from './integration.model';
|
||||
/**
|
||||
* Class representing an authority object
|
||||
*/
|
||||
@resourceType(AuthorityValue.type)
|
||||
@typedObject
|
||||
@inheritSerialization(IntegrationModel)
|
||||
export class AuthorityValue extends IntegrationModel implements MetadataValueInterface {
|
||||
static type = AUTHORITY_VALUE;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { autoserialize, deserialize } from 'cerialize';
|
||||
import { isNotEmpty } from '../../shared/empty.util';
|
||||
import { ListableObject } from '../../shared/object-collection/shared/listable-object.model';
|
||||
import { link, resourceType } from '../cache/builders/build-decorators';
|
||||
import { link, typedObject } from '../cache/builders/build-decorators';
|
||||
import { GenericConstructor } from '../shared/generic-constructor';
|
||||
import { HALLink } from '../shared/hal-link.model';
|
||||
import { HALResource } from '../shared/hal-resource.model';
|
||||
@@ -13,7 +13,7 @@ import { MetadataSchema } from './metadata-schema.model';
|
||||
/**
|
||||
* Class the represents a metadata field
|
||||
*/
|
||||
@resourceType(MetadataField.type)
|
||||
@typedObject
|
||||
export class MetadataField extends ListableObject implements HALResource {
|
||||
static type = METADATA_FIELD;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { autoserialize, deserialize } from 'cerialize';
|
||||
import { ListableObject } from '../../shared/object-collection/shared/listable-object.model';
|
||||
import { resourceType } from '../cache/builders/build-decorators';
|
||||
import { typedObject } from '../cache/builders/build-decorators';
|
||||
import { GenericConstructor } from '../shared/generic-constructor';
|
||||
import { HALLink } from '../shared/hal-link.model';
|
||||
import { HALResource } from '../shared/hal-resource.model';
|
||||
@@ -11,7 +11,7 @@ import { METADATA_SCHEMA } from './metadata-schema.resource-type';
|
||||
/**
|
||||
* Class that represents a metadata schema
|
||||
*/
|
||||
@resourceType(MetadataSchema.type)
|
||||
@typedObject
|
||||
export class MetadataSchema extends ListableObject implements HALResource {
|
||||
static type = METADATA_SCHEMA;
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { autoserialize, deserialize } from 'cerialize';
|
||||
import { resourceType } from '../cache/builders/build-decorators';
|
||||
import { typedObject } from '../cache/builders/build-decorators';
|
||||
import { MetadataField } from '../metadata/metadata-field.model';
|
||||
import { METADATA_FIELD } from '../metadata/metadata-field.resource-type';
|
||||
import { HALLink } from '../shared/hal-link.model';
|
||||
@@ -10,7 +10,7 @@ import { excludeFromEquals } from '../utilities/equals.decorators';
|
||||
/**
|
||||
* Class that represents a response with a registry's metadata fields
|
||||
*/
|
||||
@resourceType(RegistryMetadatafieldsResponse.type)
|
||||
@typedObject
|
||||
export class RegistryMetadatafieldsResponse {
|
||||
static type = METADATA_FIELD;
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { autoserialize, deserialize, deserializeAs } from 'cerialize';
|
||||
import { resourceType } from '../cache/builders/build-decorators';
|
||||
import { typedObject } from '../cache/builders/build-decorators';
|
||||
import { IDToUUIDSerializer } from '../cache/id-to-uuid-serializer';
|
||||
import { CacheableObject } from '../cache/object-cache.reducer';
|
||||
import { excludeFromEquals } from '../utilities/equals.decorators';
|
||||
@@ -11,7 +11,7 @@ import { ResourceType } from './resource-type';
|
||||
/**
|
||||
* Model class for a Bitstream Format
|
||||
*/
|
||||
@resourceType(BitstreamFormat.type)
|
||||
@typedObject
|
||||
export class BitstreamFormat implements CacheableObject {
|
||||
static type = BITSTREAM_FORMAT;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { autoserialize, deserialize, inheritSerialization } from 'cerialize';
|
||||
import { Observable } from 'rxjs';
|
||||
import { link, resourceType } from '../cache/builders/build-decorators';
|
||||
import { link, typedObject } from '../cache/builders/build-decorators';
|
||||
import { RemoteData } from '../data/remote-data';
|
||||
import { BitstreamFormat } from './bitstream-format.model';
|
||||
import { BITSTREAM_FORMAT } from './bitstream-format.resource-type';
|
||||
@@ -9,7 +9,7 @@ import { DSpaceObject } from './dspace-object.model';
|
||||
import { HALLink } from './hal-link.model';
|
||||
import { HALResource } from './hal-resource.model';
|
||||
|
||||
@resourceType(Bitstream.type)
|
||||
@typedObject
|
||||
@inheritSerialization(DSpaceObject)
|
||||
export class Bitstream extends DSpaceObject implements HALResource {
|
||||
static type = BITSTREAM;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { autoserialize, autoserializeAs, deserialize } from 'cerialize';
|
||||
import { resourceType } from '../cache/builders/build-decorators';
|
||||
import { typedObject } from '../cache/builders/build-decorators';
|
||||
import { TypedObject } from '../cache/object-cache.reducer';
|
||||
import { excludeFromEquals } from '../utilities/equals.decorators';
|
||||
import { BROWSE_DEFINITION } from './browse-definition.resource-type';
|
||||
@@ -7,7 +7,7 @@ import { HALLink } from './hal-link.model';
|
||||
import { ResourceType } from './resource-type';
|
||||
import { SortOption } from './sort-option.model';
|
||||
|
||||
@resourceType(BrowseDefinition.type)
|
||||
@typedObject
|
||||
export class BrowseDefinition implements TypedObject {
|
||||
static type = BROWSE_DEFINITION;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { autoserialize, autoserializeAs, deserialize } from 'cerialize';
|
||||
import { ListableObject } from '../../shared/object-collection/shared/listable-object.model';
|
||||
import { resourceType } from '../cache/builders/build-decorators';
|
||||
import { typedObject } from '../cache/builders/build-decorators';
|
||||
import { TypedObject } from '../cache/object-cache.reducer';
|
||||
import { excludeFromEquals } from '../utilities/equals.decorators';
|
||||
import { BROWSE_ENTRY } from './browse-entry.resource-type';
|
||||
@@ -11,7 +11,7 @@ import { ResourceType } from './resource-type';
|
||||
/**
|
||||
* Class object representing a browse entry
|
||||
*/
|
||||
@resourceType(BrowseEntry.type)
|
||||
@typedObject
|
||||
export class BrowseEntry extends ListableObject implements TypedObject {
|
||||
static type = BROWSE_ENTRY;
|
||||
|
||||
|
@@ -1,10 +1,10 @@
|
||||
import { deserialize, inheritSerialization } from 'cerialize';
|
||||
import { resourceType } from '../cache/builders/build-decorators';
|
||||
import { typedObject } from '../cache/builders/build-decorators';
|
||||
import { BUNDLE } from './bundle.resource-type';
|
||||
import { DSpaceObject } from './dspace-object.model';
|
||||
import { HALLink } from './hal-link.model';
|
||||
|
||||
@resourceType(Bundle.type)
|
||||
@typedObject
|
||||
@inheritSerialization(DSpaceObject)
|
||||
export class Bundle extends DSpaceObject {
|
||||
static type = BUNDLE;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { autoserialize, deserialize, inheritSerialization } from 'cerialize';
|
||||
import { Observable } from 'rxjs';
|
||||
import { link, resourceType } from '../cache/builders/build-decorators';
|
||||
import { link, typedObject } from '../cache/builders/build-decorators';
|
||||
import { PaginatedList } from '../data/paginated-list';
|
||||
import { RemoteData } from '../data/remote-data';
|
||||
import { Bitstream } from './bitstream.model';
|
||||
@@ -13,7 +13,7 @@ import { LICENSE } from './license.resource-type';
|
||||
import { ResourcePolicy } from './resource-policy.model';
|
||||
import { RESOURCE_POLICY } from './resource-policy.resource-type';
|
||||
|
||||
@resourceType(Collection.type)
|
||||
@typedObject
|
||||
@inheritSerialization(DSpaceObject)
|
||||
export class Collection extends DSpaceObject {
|
||||
static type = COLLECTION;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { autoserialize, deserialize, inheritSerialization } from 'cerialize';
|
||||
import { Observable } from 'rxjs';
|
||||
import { link, resourceType } from '../cache/builders/build-decorators';
|
||||
import { link, typedObject } from '../cache/builders/build-decorators';
|
||||
import { PaginatedList } from '../data/paginated-list';
|
||||
import { RemoteData } from '../data/remote-data';
|
||||
import { Bitstream } from './bitstream.model';
|
||||
@@ -11,7 +11,7 @@ import { COMMUNITY } from './community.resource-type';
|
||||
import { DSpaceObject } from './dspace-object.model';
|
||||
import { HALLink } from './hal-link.model';
|
||||
|
||||
@resourceType(Community.type)
|
||||
@typedObject
|
||||
@inheritSerialization(DSpaceObject)
|
||||
export class Community extends DSpaceObject {
|
||||
static type = COMMUNITY;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { autoserialize, autoserializeAs, deserialize, deserializeAs } from 'cerialize';
|
||||
import { hasNoValue, isUndefined } from '../../shared/empty.util';
|
||||
import { ListableObject } from '../../shared/object-collection/shared/listable-object.model';
|
||||
import { resourceType } from '../cache/builders/build-decorators';
|
||||
import { typedObject } from '../cache/builders/build-decorators';
|
||||
import { CacheableObject } from '../cache/object-cache.reducer';
|
||||
import { excludeFromEquals } from '../utilities/equals.decorators';
|
||||
import { DSPACE_OBJECT } from './dspace-object.resource-type';
|
||||
@@ -20,7 +20,7 @@ import { ResourceType } from './resource-type';
|
||||
/**
|
||||
* An abstract model class for a DSpaceObject.
|
||||
*/
|
||||
@resourceType(DSpaceObject.type)
|
||||
@typedObject
|
||||
export class DSpaceObject extends ListableObject implements CacheableObject {
|
||||
/**
|
||||
* A string representing the kind of DSpaceObject, e.g. community, item, …
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { autoserialize, autoserializeAs, deserialize } from 'cerialize';
|
||||
import { ListableObject } from '../../shared/object-collection/shared/listable-object.model';
|
||||
import { resourceType } from '../cache/builders/build-decorators';
|
||||
import { typedObject } from '../cache/builders/build-decorators';
|
||||
import { excludeFromEquals } from '../utilities/equals.decorators';
|
||||
import { EXTERNAL_SOURCE_ENTRY } from './external-source-entry.resource-type';
|
||||
import { GenericConstructor } from './generic-constructor';
|
||||
@@ -11,7 +11,7 @@ import { ResourceType } from './resource-type';
|
||||
/**
|
||||
* Model class for a single entry from an external source
|
||||
*/
|
||||
@resourceType(ExternalSourceEntry.type)
|
||||
@typedObject
|
||||
export class ExternalSourceEntry extends ListableObject {
|
||||
static type = EXTERNAL_SOURCE_ENTRY;
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { autoserialize, deserialize, inheritSerialization } from 'cerialize';
|
||||
import { resourceType } from '../cache/builders/build-decorators';
|
||||
import { typedObject } from '../cache/builders/build-decorators';
|
||||
import { CacheableObject } from '../cache/object-cache.reducer';
|
||||
import { excludeFromEquals } from '../utilities/equals.decorators';
|
||||
import { EXTERNAL_SOURCE } from './external-source.resource-type';
|
||||
@@ -9,7 +9,7 @@ import { ResourceType } from './resource-type';
|
||||
/**
|
||||
* Model class for an external source
|
||||
*/
|
||||
@resourceType(ExternalSource.type)
|
||||
@typedObject
|
||||
export class ExternalSource extends CacheableObject {
|
||||
static type = EXTERNAL_SOURCE;
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { autoserialize, deserialize, deserializeAs } from 'cerialize';
|
||||
import { resourceType } from '../../cache/builders/build-decorators';
|
||||
import { typedObject } from '../../cache/builders/build-decorators';
|
||||
import { IDToUUIDSerializer } from '../../cache/id-to-uuid-serializer';
|
||||
import { CacheableObject } from '../../cache/object-cache.reducer';
|
||||
import { excludeFromEquals } from '../../utilities/equals.decorators';
|
||||
@@ -10,7 +10,7 @@ import { ITEM_TYPE } from './item-type.resource-type';
|
||||
/**
|
||||
* Describes a type of Item
|
||||
*/
|
||||
@resourceType(ItemType.type)
|
||||
@typedObject
|
||||
export class ItemType implements CacheableObject {
|
||||
static type = ITEM_TYPE;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { autoserialize, deserialize, deserializeAs } from 'cerialize';
|
||||
import { Observable } from 'rxjs';
|
||||
import { link, resourceType } from '../../cache/builders/build-decorators';
|
||||
import { link, typedObject } from '../../cache/builders/build-decorators';
|
||||
import { IDToUUIDSerializer } from '../../cache/id-to-uuid-serializer';
|
||||
import { CacheableObject } from '../../cache/object-cache.reducer';
|
||||
import { RemoteData } from '../../data/remote-data';
|
||||
@@ -14,7 +14,7 @@ import { RELATIONSHIP_TYPE } from './relationship-type.resource-type';
|
||||
/**
|
||||
* Describes a type of Relationship between multiple possible Items
|
||||
*/
|
||||
@resourceType(RelationshipType.type)
|
||||
@typedObject
|
||||
export class RelationshipType implements CacheableObject {
|
||||
static type = RELATIONSHIP_TYPE;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { autoserialize, deserialize, serialize, deserializeAs } from 'cerialize';
|
||||
import { Observable } from 'rxjs';
|
||||
import { link, resourceType } from '../../cache/builders/build-decorators';
|
||||
import { link, typedObject } from '../../cache/builders/build-decorators';
|
||||
import { IDToUUIDSerializer } from '../../cache/id-to-uuid-serializer';
|
||||
import { CacheableObject } from '../../cache/object-cache.reducer';
|
||||
import { RemoteData } from '../../data/remote-data';
|
||||
@@ -16,7 +16,7 @@ import { RELATIONSHIP } from './relationship.resource-type';
|
||||
/**
|
||||
* Describes a Relationship between two Items
|
||||
*/
|
||||
@resourceType(Relationship.type)
|
||||
@typedObject
|
||||
export class Relationship implements CacheableObject {
|
||||
static type = RELATIONSHIP;
|
||||
|
||||
|
@@ -3,7 +3,7 @@ import { Observable } from 'rxjs/internal/Observable';
|
||||
import { isEmpty } from '../../shared/empty.util';
|
||||
import { DEFAULT_ENTITY_TYPE } from '../../shared/metadata-representation/metadata-representation.decorator';
|
||||
import { ListableObject } from '../../shared/object-collection/shared/listable-object.model';
|
||||
import { link, resourceType } from '../cache/builders/build-decorators';
|
||||
import { link, typedObject } from '../cache/builders/build-decorators';
|
||||
import { PaginatedList } from '../data/paginated-list';
|
||||
import { RemoteData } from '../data/remote-data';
|
||||
import { Bundle } from './bundle.model';
|
||||
@@ -21,7 +21,7 @@ import { ITEM } from './item.resource-type';
|
||||
/**
|
||||
* Class representing a DSpace Item
|
||||
*/
|
||||
@resourceType(Item.type)
|
||||
@typedObject
|
||||
@inheritSerialization(DSpaceObject)
|
||||
export class Item extends DSpaceObject {
|
||||
static type = ITEM;
|
||||
|
@@ -1,9 +1,9 @@
|
||||
import { autoserialize, inheritSerialization } from 'cerialize';
|
||||
import { resourceType } from '../cache/builders/build-decorators';
|
||||
import { typedObject } from '../cache/builders/build-decorators';
|
||||
import { DSpaceObject } from './dspace-object.model';
|
||||
import { LICENSE } from './license.resource-type';
|
||||
|
||||
@resourceType(License.type)
|
||||
@typedObject
|
||||
@inheritSerialization(DSpaceObject)
|
||||
export class License extends DSpaceObject {
|
||||
static type = LICENSE;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { autoserialize, deserialize, deserializeAs } from 'cerialize';
|
||||
import { resourceType } from '../cache/builders/build-decorators';
|
||||
import { typedObject } from '../cache/builders/build-decorators';
|
||||
import { IDToUUIDSerializer } from '../cache/id-to-uuid-serializer';
|
||||
import { ActionType } from '../cache/models/action-type.model';
|
||||
import { CacheableObject } from '../cache/object-cache.reducer';
|
||||
@@ -11,7 +11,7 @@ import { ResourceType } from './resource-type';
|
||||
/**
|
||||
* Model class for a Resource Policy
|
||||
*/
|
||||
@resourceType(ResourcePolicy.type)
|
||||
@typedObject
|
||||
export class ResourcePolicy implements CacheableObject {
|
||||
static type = RESOURCE_POLICY;
|
||||
|
||||
|
@@ -1,12 +1,12 @@
|
||||
import { inheritSerialization } from 'cerialize';
|
||||
import { resourceType } from '../cache/builders/build-decorators';
|
||||
import { typedObject } from '../cache/builders/build-decorators';
|
||||
import { DSpaceObject } from './dspace-object.model';
|
||||
import { SITE } from './site.resource-type';
|
||||
|
||||
/**
|
||||
* Model class for the Site object
|
||||
*/
|
||||
@resourceType(Site.type)
|
||||
@typedObject
|
||||
@inheritSerialization(DSpaceObject)
|
||||
export class Site extends DSpaceObject {
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { deserializeAs, inheritSerialization } from 'cerialize';
|
||||
import { inheritLinkAnnotations, resourceType } from '../../cache/builders/build-decorators';
|
||||
import { inheritLinkAnnotations, typedObject } from '../../cache/builders/build-decorators';
|
||||
import { IDToUUIDSerializer } from '../../cache/id-to-uuid-serializer';
|
||||
import { WORKFLOWITEM } from '../../eperson/models/workflowitem.resource-type';
|
||||
import { SubmissionObject } from './submission-object.model';
|
||||
@@ -7,7 +7,7 @@ import { SubmissionObject } from './submission-object.model';
|
||||
/**
|
||||
* A model class for a WorkflowItem.
|
||||
*/
|
||||
@resourceType(WorkflowItem.type)
|
||||
@typedObject
|
||||
@inheritSerialization(SubmissionObject)
|
||||
@inheritLinkAnnotations(SubmissionObject)
|
||||
export class WorkflowItem extends SubmissionObject {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { deserializeAs, inheritSerialization } from 'cerialize';
|
||||
import { inheritLinkAnnotations, resourceType } from '../../cache/builders/build-decorators';
|
||||
import { inheritLinkAnnotations, typedObject } from '../../cache/builders/build-decorators';
|
||||
import { IDToUUIDSerializer } from '../../cache/id-to-uuid-serializer';
|
||||
import { DSpaceObject } from '../../shared/dspace-object.model';
|
||||
import { SubmissionObject } from './submission-object.model';
|
||||
@@ -8,7 +8,7 @@ import { ResourceType } from '../../shared/resource-type';
|
||||
/**
|
||||
* A model class for a WorkspaceItem.
|
||||
*/
|
||||
@resourceType(WorkspaceItem.type)
|
||||
@typedObject
|
||||
@inheritSerialization(SubmissionObject)
|
||||
@inheritLinkAnnotations(SubmissionObject)
|
||||
export class WorkspaceItem extends SubmissionObject {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { inheritSerialization } from 'cerialize';
|
||||
import { resourceType } from '../../cache/builders/build-decorators';
|
||||
import { typedObject } from '../../cache/builders/build-decorators';
|
||||
import { DSpaceObject } from '../../shared/dspace-object.model';
|
||||
import { CLAIMED_TASK } from './claimed-task-object.resource-type';
|
||||
import { TaskObject } from './task-object.model';
|
||||
@@ -7,7 +7,7 @@ import { TaskObject } from './task-object.model';
|
||||
/**
|
||||
* A model class for a ClaimedTask.
|
||||
*/
|
||||
@resourceType(ClaimedTask.type)
|
||||
@typedObject
|
||||
@inheritSerialization(DSpaceObject)
|
||||
export class ClaimedTask extends TaskObject {
|
||||
static type = CLAIMED_TASK;
|
||||
|
@@ -1,12 +1,12 @@
|
||||
import { inheritSerialization } from 'cerialize';
|
||||
import { resourceType } from '../../cache/builders/build-decorators';
|
||||
import { typedObject } from '../../cache/builders/build-decorators';
|
||||
import { POOL_TASK } from './pool-task-object.resource-type';
|
||||
import { TaskObject } from './task-object.model';
|
||||
|
||||
/**
|
||||
* A model class for a PoolTask.
|
||||
*/
|
||||
@resourceType(PoolTask.type)
|
||||
@typedObject
|
||||
@inheritSerialization(TaskObject)
|
||||
export class PoolTask extends TaskObject {
|
||||
static type = POOL_TASK;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { autoserialize, deserialize, inheritSerialization } from 'cerialize';
|
||||
import { Observable } from 'rxjs';
|
||||
import { link, resourceType } from '../../cache/builders/build-decorators';
|
||||
import { link, typedObject } from '../../cache/builders/build-decorators';
|
||||
|
||||
import { CacheableObject } from '../../cache/object-cache.reducer';
|
||||
import { RemoteData } from '../../data/remote-data';
|
||||
@@ -16,7 +16,7 @@ import { TASK_OBJECT } from './task-object.resource-type';
|
||||
/**
|
||||
* An abstract model class for a TaskObject.
|
||||
*/
|
||||
@resourceType(TaskObject.type)
|
||||
@typedObject
|
||||
@inheritSerialization(DSpaceObject)
|
||||
export class TaskObject extends DSpaceObject implements CacheableObject {
|
||||
static type = TASK_OBJECT;
|
||||
|
Reference in New Issue
Block a user