41650: full item page

This commit is contained in:
Lotte Hofstede
2017-05-29 13:48:55 +02:00
parent fbb64a6031
commit 563a8ca66b
34 changed files with 150 additions and 40 deletions

View File

@@ -59,6 +59,29 @@ export class Item extends DSpaceObject {
);
}
/**
* Retrieves the thumbnail for the given original of this item
* @returns {Observable<Bitstream>} the primaryBitstream of the "THUMBNAIL" bundle
*/
getThumbnailForOriginal(original: Observable<Bitstream>): Observable<Bitstream> { //returns obs of obs of bitstream instead...
const bundle: Observable<Bundle> = this.getBundle("THUMBNAIL");
return bundle.map(
bundle => {
if (bundle != null) {
return bundle.bitstreams.find(
file => {
return Observable.combineLatest(
original,
file.payload,
(original, thumbnail) => {
return (thumbnail.name.startsWith(original.name));
});
});
}
}
);
}
/**
* Retrieves all files that should be displayed on the item page of this item
* @returns {Observable<Array<Observable<Bitstream>>>} an array of all Bitstreams in the "ORIGINAL" bundle