mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-11 12:03:03 +00:00
Merge branch 'rest-relationships' into w2p-40416_simple-item-page
Conflicts: src/app/core/cache/models/normalized-item.model.ts src/app/core/shared/item.model.ts
This commit is contained in:
@@ -102,6 +102,7 @@
|
|||||||
"morgan": "1.7.0",
|
"morgan": "1.7.0",
|
||||||
"ng2-translate": "4.2.0",
|
"ng2-translate": "4.2.0",
|
||||||
"preboot": "4.5.2",
|
"preboot": "4.5.2",
|
||||||
|
"reflect-metadata": "^0.1.10",
|
||||||
"rxjs": "5.0.0-beta.12",
|
"rxjs": "5.0.0-beta.12",
|
||||||
"ts-md5": "^1.2.0",
|
"ts-md5": "^1.2.0",
|
||||||
"webfontloader": "1.6.27",
|
"webfontloader": "1.6.27",
|
||||||
@@ -159,7 +160,6 @@
|
|||||||
"protractor": "~4.0.14",
|
"protractor": "~4.0.14",
|
||||||
"protractor-istanbul-plugin": "~2.0.0",
|
"protractor-istanbul-plugin": "~2.0.0",
|
||||||
"raw-loader": "0.5.1",
|
"raw-loader": "0.5.1",
|
||||||
"reflect-metadata": "0.1.8",
|
|
||||||
"rimraf": "2.5.4",
|
"rimraf": "2.5.4",
|
||||||
"rollup": "0.37.0",
|
"rollup": "0.37.0",
|
||||||
"rollup-plugin-commonjs": "6.0.0",
|
"rollup-plugin-commonjs": "6.0.0",
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
|
import "reflect-metadata";
|
||||||
import { GenericConstructor } from "../../shared/generic-constructor";
|
import { GenericConstructor } from "../../shared/generic-constructor";
|
||||||
import { CacheableObject } from "../object-cache.reducer";
|
import { CacheableObject } from "../object-cache.reducer";
|
||||||
|
import { NormalizedDSOType } from "../models/normalized-dspace-object-type";
|
||||||
|
|
||||||
const mapsToMetadataKey = Symbol("mapsTo");
|
const mapsToMetadataKey = Symbol("mapsTo");
|
||||||
const relationshipKey = Symbol("relationship");
|
const relationshipKey = Symbol("relationship");
|
||||||
@@ -14,7 +16,7 @@ export const getMapsTo = function(target: any) {
|
|||||||
return Reflect.getOwnMetadata(mapsToMetadataKey, target);
|
return Reflect.getOwnMetadata(mapsToMetadataKey, target);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const relationship = function(value: any): any {
|
export const relationship = function(value: NormalizedDSOType): any {
|
||||||
return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {
|
return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {
|
||||||
if (!target || !propertyKey) {
|
if (!target || !propertyKey) {
|
||||||
return;
|
return;
|
||||||
|
@@ -13,6 +13,7 @@ import { Observable } from "rxjs/Observable";
|
|||||||
import { RemoteData } from "../../data/remote-data";
|
import { RemoteData } from "../../data/remote-data";
|
||||||
import { GenericConstructor } from "../../shared/generic-constructor";
|
import { GenericConstructor } from "../../shared/generic-constructor";
|
||||||
import { getMapsTo, getResourceType, getRelationships } from "./build-decorators";
|
import { getMapsTo, getResourceType, getRelationships } from "./build-decorators";
|
||||||
|
import { NormalizedDSOFactory } from "../models/normalized-dspace-object-factory";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class RemoteDataBuildService {
|
export class RemoteDataBuildService {
|
||||||
@@ -45,13 +46,13 @@ export class RemoteDataBuildService {
|
|||||||
|
|
||||||
const payload =
|
const payload =
|
||||||
Observable.race(
|
Observable.race(
|
||||||
this.objectCache.getBySelfLink<TNormalized>(href),
|
this.objectCache.getBySelfLink<TNormalized>(href, normalizedType),
|
||||||
responseCacheObs
|
responseCacheObs
|
||||||
.filter((entry: ResponseCacheEntry) => hasValue(entry) && entry.response.isSuccessful)
|
.filter((entry: ResponseCacheEntry) => hasValue(entry) && entry.response.isSuccessful)
|
||||||
.map((entry: ResponseCacheEntry) => (<SuccessResponse> entry.response).resourceUUIDs)
|
.map((entry: ResponseCacheEntry) => (<SuccessResponse> entry.response).resourceUUIDs)
|
||||||
.flatMap((resourceUUIDs: Array<string>) => {
|
.flatMap((resourceUUIDs: Array<string>) => {
|
||||||
if (isNotEmpty(resourceUUIDs)) {
|
if (isNotEmpty(resourceUUIDs)) {
|
||||||
return this.objectCache.get(resourceUUIDs[0]);
|
return this.objectCache.get(resourceUUIDs[0], normalizedType);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return Observable.of(undefined);
|
return Observable.of(undefined);
|
||||||
@@ -95,7 +96,7 @@ export class RemoteDataBuildService {
|
|||||||
.filter((entry: ResponseCacheEntry) => hasValue(entry) && entry.response.isSuccessful)
|
.filter((entry: ResponseCacheEntry) => hasValue(entry) && entry.response.isSuccessful)
|
||||||
.map((entry: ResponseCacheEntry) => (<SuccessResponse> entry.response).resourceUUIDs)
|
.map((entry: ResponseCacheEntry) => (<SuccessResponse> entry.response).resourceUUIDs)
|
||||||
.flatMap((resourceUUIDs: Array<string>) => {
|
.flatMap((resourceUUIDs: Array<string>) => {
|
||||||
return this.objectCache.getList(resourceUUIDs)
|
return this.objectCache.getList(resourceUUIDs, normalizedType)
|
||||||
.map((normList: TNormalized[]) => {
|
.map((normList: TNormalized[]) => {
|
||||||
return normList.map((normalized: TNormalized) => {
|
return normList.map((normalized: TNormalized) => {
|
||||||
return this.build<TNormalized, TDomain>(normalized);
|
return this.build<TNormalized, TDomain>(normalized);
|
||||||
@@ -123,32 +124,33 @@ export class RemoteDataBuildService {
|
|||||||
relationships.forEach((relationship: string) => {
|
relationships.forEach((relationship: string) => {
|
||||||
if (hasValue(normalized[relationship])) {
|
if (hasValue(normalized[relationship])) {
|
||||||
const resourceType = getResourceType(normalized, relationship);
|
const resourceType = getResourceType(normalized, relationship);
|
||||||
|
const resourceConstructor = NormalizedDSOFactory.getConstructor(resourceType);
|
||||||
if (Array.isArray(normalized[relationship])) {
|
if (Array.isArray(normalized[relationship])) {
|
||||||
// without the setTimeout, the actions inside requestService.configure
|
// without the setTimeout, the actions inside requestService.configure
|
||||||
// are dispatched, but sometimes don't arrive. I'm unsure why atm.
|
// are dispatched, but sometimes don't arrive. I'm unsure why atm.
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
normalized[relationship].forEach((href: string) => {
|
normalized[relationship].forEach((href: string) => {
|
||||||
this.requestService.configure(href, resourceType)
|
this.requestService.configure(href, resourceConstructor)
|
||||||
});
|
});
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
links[relationship] = normalized[relationship].map((href: string) => {
|
links[relationship] = normalized[relationship].map((href: string) => {
|
||||||
return this.buildSingle(href, resourceType);
|
return this.buildSingle(href, resourceConstructor);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// without the setTimeout, the actions inside requestService.configure
|
// without the setTimeout, the actions inside requestService.configure
|
||||||
// are dispatched, but sometimes don't arrive. I'm unsure why atm.
|
// are dispatched, but sometimes don't arrive. I'm unsure why atm.
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.requestService.configure(normalized[relationship], resourceType);
|
this.requestService.configure(normalized[relationship], resourceConstructor);
|
||||||
},0);
|
},0);
|
||||||
|
|
||||||
links[relationship] = this.buildSingle(normalized[relationship], resourceType);
|
links[relationship] = this.buildSingle(normalized[relationship], resourceConstructor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const constructor = getMapsTo(normalized.constructor);
|
const domainModel = getMapsTo(normalized.constructor);
|
||||||
return Object.assign(new constructor(), normalized, links);
|
return Object.assign(new domainModel(), normalized, links);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@ import { autoserialize, inheritSerialization } from "cerialize";
|
|||||||
import { NormalizedDSpaceObject } from "./normalized-dspace-object.model";
|
import { NormalizedDSpaceObject } from "./normalized-dspace-object.model";
|
||||||
import { Bundle } from "../../shared/bundle.model";
|
import { Bundle } from "../../shared/bundle.model";
|
||||||
import { mapsTo, relationship } from "../builders/build-decorators";
|
import { mapsTo, relationship } from "../builders/build-decorators";
|
||||||
import { NormalizedBitstream } from "./normalized-bitstream.model";
|
import { NormalizedDSOType } from "./normalized-dspace-object-type";
|
||||||
|
|
||||||
@mapsTo(Bundle)
|
@mapsTo(Bundle)
|
||||||
@inheritSerialization(NormalizedDSpaceObject)
|
@inheritSerialization(NormalizedDSpaceObject)
|
||||||
@@ -11,7 +11,7 @@ export class NormalizedBundle extends NormalizedDSpaceObject {
|
|||||||
* The primary bitstream of this Bundle
|
* The primary bitstream of this Bundle
|
||||||
*/
|
*/
|
||||||
@autoserialize
|
@autoserialize
|
||||||
@relationship(NormalizedBitstream)
|
@relationship(NormalizedDSOType.NormalizedBitstream)
|
||||||
primaryBitstream: string;
|
primaryBitstream: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,6 +25,6 @@ export class NormalizedBundle extends NormalizedDSpaceObject {
|
|||||||
owner: string;
|
owner: string;
|
||||||
|
|
||||||
@autoserialize
|
@autoserialize
|
||||||
@relationship(NormalizedBitstream)
|
@relationship(NormalizedDSOType.NormalizedBitstream)
|
||||||
bitstreams: Array<string>;
|
bitstreams: Array<string>;
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@ import { autoserialize, inheritSerialization, autoserializeAs } from "cerialize"
|
|||||||
import { NormalizedDSpaceObject } from "./normalized-dspace-object.model";
|
import { NormalizedDSpaceObject } from "./normalized-dspace-object.model";
|
||||||
import { Collection } from "../../shared/collection.model";
|
import { Collection } from "../../shared/collection.model";
|
||||||
import { mapsTo, relationship } from "../builders/build-decorators";
|
import { mapsTo, relationship } from "../builders/build-decorators";
|
||||||
import { NormalizedItem } from "./normalized-item.model";
|
import { NormalizedDSOType } from "./normalized-dspace-object-type";
|
||||||
|
|
||||||
@mapsTo(Collection)
|
@mapsTo(Collection)
|
||||||
@inheritSerialization(NormalizedDSpaceObject)
|
@inheritSerialization(NormalizedDSpaceObject)
|
||||||
@@ -30,7 +30,7 @@ export class NormalizedCollection extends NormalizedDSpaceObject {
|
|||||||
owner: string;
|
owner: string;
|
||||||
|
|
||||||
@autoserialize
|
@autoserialize
|
||||||
@relationship(NormalizedItem)
|
@relationship(NormalizedDSOType.NormalizedItem)
|
||||||
items: Array<string>;
|
items: Array<string>;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
29
src/app/core/cache/models/normalized-dspace-object-factory.ts
vendored
Normal file
29
src/app/core/cache/models/normalized-dspace-object-factory.ts
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import { NormalizedDSpaceObject } from "./normalized-dspace-object.model";
|
||||||
|
import { NormalizedBitstream } from "./normalized-bitstream.model";
|
||||||
|
import { NormalizedBundle } from "./normalized-bundle.model";
|
||||||
|
import { NormalizedItem } from "./normalized-item.model";
|
||||||
|
import { NormalizedCollection } from "./normalized-collection.model";
|
||||||
|
import { GenericConstructor } from "../../shared/generic-constructor";
|
||||||
|
import { NormalizedDSOType } from "./normalized-dspace-object-type";
|
||||||
|
|
||||||
|
export class NormalizedDSOFactory {
|
||||||
|
public static getConstructor(type: NormalizedDSOType): GenericConstructor<NormalizedDSpaceObject> {
|
||||||
|
switch (type) {
|
||||||
|
case NormalizedDSOType.NormalizedBitstream: {
|
||||||
|
return NormalizedBitstream
|
||||||
|
}
|
||||||
|
case NormalizedDSOType.NormalizedBundle: {
|
||||||
|
return NormalizedBundle
|
||||||
|
}
|
||||||
|
case NormalizedDSOType.NormalizedItem: {
|
||||||
|
return NormalizedItem
|
||||||
|
}
|
||||||
|
case NormalizedDSOType.NormalizedCollection: {
|
||||||
|
return NormalizedCollection
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
6
src/app/core/cache/models/normalized-dspace-object-type.ts
vendored
Normal file
6
src/app/core/cache/models/normalized-dspace-object-type.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export enum NormalizedDSOType {
|
||||||
|
NormalizedBitstream,
|
||||||
|
NormalizedBundle,
|
||||||
|
NormalizedItem,
|
||||||
|
NormalizedCollection
|
||||||
|
}
|
@@ -2,8 +2,7 @@ import { inheritSerialization, autoserialize } from "cerialize";
|
|||||||
import { NormalizedDSpaceObject } from "./normalized-dspace-object.model";
|
import { NormalizedDSpaceObject } from "./normalized-dspace-object.model";
|
||||||
import { Item } from "../../shared/item.model";
|
import { Item } from "../../shared/item.model";
|
||||||
import { mapsTo, relationship } from "../builders/build-decorators";
|
import { mapsTo, relationship } from "../builders/build-decorators";
|
||||||
import { NormalizedBundle } from "./normalized-bundle.model";
|
import { NormalizedDSOType } from "./normalized-dspace-object-type";
|
||||||
import { NormalizedCollection } from "./normalized-collection.model";
|
|
||||||
|
|
||||||
@mapsTo(Item)
|
@mapsTo(Item)
|
||||||
@inheritSerialization(NormalizedDSpaceObject)
|
@inheritSerialization(NormalizedDSpaceObject)
|
||||||
@@ -34,7 +33,7 @@ export class NormalizedItem extends NormalizedDSpaceObject {
|
|||||||
* An array of Collections that are direct parents of this Item
|
* An array of Collections that are direct parents of this Item
|
||||||
*/
|
*/
|
||||||
@autoserialize
|
@autoserialize
|
||||||
@relationship(NormalizedCollection)
|
@relationship(NormalizedDSOType.NormalizedCollection)
|
||||||
parents: Array<string>;
|
parents: Array<string>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -43,6 +42,6 @@ export class NormalizedItem extends NormalizedDSpaceObject {
|
|||||||
owner: string;
|
owner: string;
|
||||||
|
|
||||||
@autoserialize
|
@autoserialize
|
||||||
@relationship(NormalizedBundle)
|
@relationship(NormalizedDSOType.NormalizedBundle)
|
||||||
bundles: Array<string>;
|
bundles: Array<string>;
|
||||||
}
|
}
|
||||||
|
@@ -65,8 +65,6 @@ describe("ObjectCacheService", () => {
|
|||||||
service.get(uuid).take(1).subscribe(o => testObj = o);
|
service.get(uuid).take(1).subscribe(o => testObj = o);
|
||||||
expect(testObj.uuid).toBe(uuid);
|
expect(testObj.uuid).toBe(uuid);
|
||||||
expect(testObj.foo).toBe("bar");
|
expect(testObj.foo).toBe("bar");
|
||||||
// this only works if testObj is an instance of TestClass
|
|
||||||
expect(testObj.test()).toBe("bar" + uuid);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should not return a cached object that has exceeded its time to live", () => {
|
it("should not return a cached object that has exceeded its time to live", () => {
|
||||||
@@ -87,10 +85,8 @@ describe("ObjectCacheService", () => {
|
|||||||
service.getList([uuid, uuid]).take(1).subscribe(arr => testObjs = arr);
|
service.getList([uuid, uuid]).take(1).subscribe(arr => testObjs = arr);
|
||||||
expect(testObjs[0].uuid).toBe(uuid);
|
expect(testObjs[0].uuid).toBe(uuid);
|
||||||
expect(testObjs[0].foo).toBe("bar");
|
expect(testObjs[0].foo).toBe("bar");
|
||||||
expect(testObjs[0].test()).toBe("bar" + uuid);
|
|
||||||
expect(testObjs[1].uuid).toBe(uuid);
|
expect(testObjs[1].uuid).toBe(uuid);
|
||||||
expect(testObjs[1].foo).toBe("bar");
|
expect(testObjs[1].foo).toBe("bar");
|
||||||
expect(testObjs[1].test()).toBe("bar" + uuid);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
34
src/app/core/cache/object-cache.service.ts
vendored
34
src/app/core/cache/object-cache.service.ts
vendored
@@ -4,6 +4,7 @@ import { ObjectCacheState, ObjectCacheEntry, CacheableObject } from "./object-ca
|
|||||||
import { AddToObjectCacheAction, RemoveFromObjectCacheAction } from "./object-cache.actions";
|
import { AddToObjectCacheAction, RemoveFromObjectCacheAction } from "./object-cache.actions";
|
||||||
import { Observable } from "rxjs";
|
import { Observable } from "rxjs";
|
||||||
import { hasNoValue } from "../../shared/empty.util";
|
import { hasNoValue } from "../../shared/empty.util";
|
||||||
|
import { GenericConstructor } from "../shared/generic-constructor";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service to interact with the object cache
|
* A service to interact with the object cache
|
||||||
@@ -39,34 +40,53 @@ export class ObjectCacheService {
|
|||||||
/**
|
/**
|
||||||
* Get an observable of the object with the specified UUID
|
* Get an observable of the object with the specified UUID
|
||||||
*
|
*
|
||||||
|
* The type needs to be specified as well, in order to turn
|
||||||
|
* the cached plain javascript object in to an instance of
|
||||||
|
* a class.
|
||||||
|
*
|
||||||
|
* e.g. get('c96588c6-72d3-425d-9d47-fa896255a695', Item)
|
||||||
|
*
|
||||||
* @param uuid
|
* @param uuid
|
||||||
* The UUID of the object to get
|
* The UUID of the object to get
|
||||||
|
* @param type
|
||||||
|
* The type of the object to get
|
||||||
* @return Observable<T>
|
* @return Observable<T>
|
||||||
* An observable of the requested object
|
* An observable of the requested object
|
||||||
*/
|
*/
|
||||||
get<T extends CacheableObject>(uuid: string): Observable<T> {
|
get<T extends CacheableObject>(uuid: string, type: GenericConstructor<T>): Observable<T> {
|
||||||
return this.store.select<ObjectCacheEntry>('core', 'cache', 'object', uuid)
|
return this.store.select<ObjectCacheEntry>('core', 'cache', 'object', uuid)
|
||||||
.filter(entry => this.isValid(entry))
|
.filter(entry => this.isValid(entry))
|
||||||
.distinctUntilChanged()
|
.distinctUntilChanged()
|
||||||
.map((entry: ObjectCacheEntry) => <T> entry.data);
|
.map((entry: ObjectCacheEntry) => <T> Object.assign(new type(), entry.data));
|
||||||
}
|
}
|
||||||
|
|
||||||
getBySelfLink<T extends CacheableObject>(href: string): Observable<T> {
|
getBySelfLink<T extends CacheableObject>(href: string, type: GenericConstructor<T>): Observable<T> {
|
||||||
return this.store.select<string>('core', 'index', 'href', href)
|
return this.store.select<string>('core', 'index', 'href', href)
|
||||||
.flatMap((uuid: string) => this.get<T>(uuid))
|
.flatMap((uuid: string) => this.get(uuid, type))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get an observable for an array of objects
|
* Get an observable for an array of objects of the same type
|
||||||
* with the specified UUIDs
|
* with the specified UUIDs
|
||||||
*
|
*
|
||||||
|
* The type needs to be specified as well, in order to turn
|
||||||
|
* the cached plain javascript object in to an instance of
|
||||||
|
* a class.
|
||||||
|
*
|
||||||
|
* e.g. getList([
|
||||||
|
* 'c96588c6-72d3-425d-9d47-fa896255a695',
|
||||||
|
* 'cff860da-cf5f-4fda-b8c9-afb7ec0b2d9e'
|
||||||
|
* ], Collection)
|
||||||
|
*
|
||||||
* @param uuids
|
* @param uuids
|
||||||
* An array of UUIDs of the objects to get
|
* An array of UUIDs of the objects to get
|
||||||
|
* @param type
|
||||||
|
* The type of the objects to get
|
||||||
* @return Observable<Array<T>>
|
* @return Observable<Array<T>>
|
||||||
*/
|
*/
|
||||||
getList<T extends CacheableObject>(uuids: Array<string>): Observable<Array<T>> {
|
getList<T extends CacheableObject>(uuids: Array<string>, type: GenericConstructor<T>): Observable<Array<T>> {
|
||||||
return Observable.combineLatest(
|
return Observable.combineLatest(
|
||||||
uuids.map((id: string) => this.get<T>(id))
|
uuids.map((id: string) => this.get<T>(id, type))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
import { inheritSerialization } from "cerialize";
|
|
||||||
import { DSpaceObject } from "./dspace-object.model";
|
import { DSpaceObject } from "./dspace-object.model";
|
||||||
import { Bitstream } from "./bitstream.model";
|
import { Bitstream } from "./bitstream.model";
|
||||||
import { Item } from "./item.model";
|
import { Item } from "./item.model";
|
||||||
import { RemoteData } from "../data/remote-data";
|
import { RemoteData } from "../data/remote-data";
|
||||||
|
|
||||||
@inheritSerialization(DSpaceObject)
|
|
||||||
export class Bundle extends DSpaceObject {
|
export class Bundle extends DSpaceObject {
|
||||||
/**
|
/**
|
||||||
* The primary bitstream of this Bundle
|
* The primary bitstream of this Bundle
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
import { inheritSerialization, autoserialize, autoserializeAs } from "cerialize";
|
|
||||||
import { DSpaceObject } from "./dspace-object.model";
|
import { DSpaceObject } from "./dspace-object.model";
|
||||||
import { Collection } from "./collection.model";
|
import { Collection } from "./collection.model";
|
||||||
import { RemoteData } from "../data/remote-data";
|
import { RemoteData } from "../data/remote-data";
|
||||||
@@ -6,39 +5,37 @@ import { Bundle } from "./bundle.model";
|
|||||||
import { Bitstream } from "./bitstream.model";
|
import { Bitstream } from "./bitstream.model";
|
||||||
import { Observable } from "rxjs";
|
import { Observable } from "rxjs";
|
||||||
|
|
||||||
@inheritSerialization(DSpaceObject)
|
|
||||||
export class Item extends DSpaceObject {
|
export class Item extends DSpaceObject {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A string representing the unique handle of this Item
|
* A string representing the unique handle of this Item
|
||||||
*/
|
*/
|
||||||
@autoserialize
|
handle: string;
|
||||||
handle: string;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Date of the last modification of this Item
|
* The Date of the last modification of this Item
|
||||||
*/
|
*/
|
||||||
lastModified: Date;
|
lastModified: Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A boolean representing if this Item is currently archived or not
|
* A boolean representing if this Item is currently archived or not
|
||||||
*/
|
*/
|
||||||
isArchived: boolean;
|
isArchived: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A boolean representing if this Item is currently withdrawn or not
|
* A boolean representing if this Item is currently withdrawn or not
|
||||||
*/
|
*/
|
||||||
isWithdrawn: boolean;
|
isWithdrawn: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An array of Collections that are direct parents of this Item
|
* An array of Collections that are direct parents of this Item
|
||||||
*/
|
*/
|
||||||
parents: Array<RemoteData<Collection>>;
|
parents: Array<RemoteData<Collection>>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Collection that owns this Item
|
* The Collection that owns this Item
|
||||||
*/
|
*/
|
||||||
owner: Collection;
|
owner: Collection;
|
||||||
|
|
||||||
bundles: Array<RemoteData<Bundle>>;
|
bundles: Array<RemoteData<Bundle>>;
|
||||||
|
|
||||||
|
2
src/typings.d.ts
vendored
2
src/typings.d.ts
vendored
@@ -78,3 +78,5 @@ declare module "*.json" {
|
|||||||
const value: any;
|
const value: any;
|
||||||
export default value;
|
export default value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare module "reflect-metadata";
|
||||||
|
@@ -4717,9 +4717,9 @@ reflect-metadata@0.1.2:
|
|||||||
version "0.1.2"
|
version "0.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.2.tgz#ea23e5823dc830f292822bd3da9b89fd57bffb03"
|
resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.2.tgz#ea23e5823dc830f292822bd3da9b89fd57bffb03"
|
||||||
|
|
||||||
reflect-metadata@0.1.8, reflect-metadata@^0.1.2:
|
reflect-metadata@^0.1.10, reflect-metadata@^0.1.2:
|
||||||
version "0.1.8"
|
version "0.1.10"
|
||||||
resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.8.tgz#72426d570b60776e3688968bd5ab9537a15cecf6"
|
resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.10.tgz#b4f83704416acad89988c9b15635d47e03b9344a"
|
||||||
|
|
||||||
regenerate@^1.2.1:
|
regenerate@^1.2.1:
|
||||||
version "1.3.2"
|
version "1.3.2"
|
||||||
|
Reference in New Issue
Block a user