remove normalized models part 1

This commit is contained in:
Art Lowel
2020-02-13 09:53:52 +01:00
parent bffae34fcc
commit 07998a8c08
137 changed files with 1323 additions and 1444 deletions

View File

@@ -1,8 +1,9 @@
import { autoserialize, autoserializeAs, deserialize, inheritSerialization } from 'cerialize';
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 } from '../cache/builders/build-decorators';
import { link, resourceType } from '../cache/builders/build-decorators';
import { PaginatedList } from '../data/paginated-list';
import { RemoteData } from '../data/remote-data';
import { Bundle } from './bundle.model';
@@ -20,46 +21,45 @@ import { ITEM } from './item.resource-type';
/**
* Class representing a DSpace Item
*/
@resourceType(Item.type)
@inheritSerialization(DSpaceObject)
export class Item extends DSpaceObject {
static type = ITEM;
/**
* A string representing the unique handle of this Item
*/
@autoserialize
handle: string;
/**
* The Date of the last modification of this Item
*/
@deserialize
lastModified: Date;
/**
* A boolean representing if this Item is currently archived or not
*/
@autoserializeAs(Boolean, 'inArchive')
isArchived: boolean;
/**
* A boolean representing if this Item is currently discoverable or not
*/
@autoserializeAs(Boolean, 'discoverable')
isDiscoverable: boolean;
/**
* A boolean representing if this Item is currently withdrawn or not
*/
@autoserializeAs(Boolean, 'withdrawn')
isWithdrawn: boolean;
/**
* The Collection that owns this Item
* The HALLinks for this Item
*/
@link(COLLECTION)
owningCollection: Observable<RemoteData<Collection>>;
@link(BUNDLE, true)
bundles: Observable<RemoteData<PaginatedList<Bundle>>>;
@link(RELATIONSHIP)
relationships?: Observable<RemoteData<PaginatedList<Relationship>>>;
@deserialize
_links: {
mappedCollections: HALLink;
relationships: HALLink;
@@ -69,6 +69,27 @@ export class Item extends DSpaceObject {
self: HALLink;
};
/**
* The owning Collection for this Item
* Will be undefined unless the owningCollection HALLink has been resolved.
*/
@link(COLLECTION)
owningCollection?: Observable<RemoteData<Collection>>;
/**
* The list of Bundles inside this Item
* Will be undefined unless the bundles HALLink has been resolved.
*/
@link(BUNDLE, true)
bundles?: Observable<RemoteData<PaginatedList<Bundle>>>;
/**
* The list of Relationships this Item has with others
* Will be undefined unless the relationships HALLink has been resolved.
*/
@link(RELATIONSHIP)
relationships?: Observable<RemoteData<PaginatedList<Relationship>>>;
/**
* Method that returns as which type of object this object should be rendered
*/