Added primaryBitstream and bitstreams properties to Bundle model

This commit is contained in:
Giuseppe Digilio
2020-03-30 11:43:38 +02:00
parent 2e94b349f9
commit be8923d572

View File

@@ -1,8 +1,15 @@
import { deserialize, inheritSerialization } from 'cerialize'; import { deserialize, inheritSerialization } from 'cerialize';
import { typedObject } from '../cache/builders/build-decorators';
import { Observable } from 'rxjs';
import { link, typedObject } from '../cache/builders/build-decorators';
import { BUNDLE } from './bundle.resource-type'; import { BUNDLE } from './bundle.resource-type';
import { DSpaceObject } from './dspace-object.model'; import { DSpaceObject } from './dspace-object.model';
import { HALLink } from './hal-link.model'; import { HALLink } from './hal-link.model';
import { RemoteData } from '../data/remote-data';
import { PaginatedList } from '../data/paginated-list';
import { BITSTREAM } from './bitstream.resource-type';
import { Bitstream } from './bitstream.model';
@typedObject @typedObject
@inheritSerialization(DSpaceObject) @inheritSerialization(DSpaceObject)
@@ -17,5 +24,19 @@ export class Bundle extends DSpaceObject {
self: HALLink; self: HALLink;
primaryBitstream: HALLink; primaryBitstream: HALLink;
bitstreams: HALLink; bitstreams: HALLink;
} };
/**
* The primary Bitstream of this Bundle
* Will be undefined unless the primaryBitstream {@link HALLink} has been resolved.
*/
@link(BITSTREAM)
primaryBitstream?: Observable<RemoteData<Bitstream>>;
/**
* The list of Bitstreams that are direct children of this Bundle
* Will be undefined unless the bitstreams {@link HALLink} has been resolved.
*/
@link(BITSTREAM, true)
bitstreams?: Observable<RemoteData<PaginatedList<Bitstream>>>;
} }