40416: Start of file section

This commit is contained in:
Lotte Hofstede
2017-05-04 13:44:03 +02:00
parent d932b44a77
commit 86901fae2e
6 changed files with 41 additions and 2 deletions

View File

@@ -50,6 +50,16 @@ export class Item extends DSpaceObject {
);
}
getFiles(): Array<Observable<Bitstream>> {
return this.getBundle("ORIGINAL").map(bundle => bundle.bitstreams.map(bitstream => bitstream.payload.flatMap(b => b))).;
// const bundle: Observable<Bundle> = this.getBundle("ORIGINAL");
// return bundle.map(
// bundle => bundle.bitstreams.flatMap(
// bitstream => bitstream.payload
// )
// );
}
getBundle(name: String): Observable<Bundle> {
return Observable.combineLatest(
...this.bundles.map(b => b.payload),

View File

@@ -0,0 +1,4 @@
<div class="item-page-specific-field">
<ds-metadata-uri-values [values]="item.getBundle("ORIGINAL")" [separator]="separator" [label]="label"></ds-metadata-uri-values>
</div>

View File

@@ -0,0 +1,24 @@
import { Component, Input } from '@angular/core';
import { Bitstream } from "../../core/shared/bitstream.model";
import { Item } from "../../core/shared/item.model";
@Component({
selector: 'ds-metadata-field-wrapper',
styleUrls: ['./metadata-field-wrapper.component.css'],
templateUrl: './metadata-field-wrapper.component.html'
})
export class MetadataFieldWrapperComponent {
@Input() item: Item;
files: Array<Bitstream>;
constructor() {
this.universalInit();
}
universalInit() {
this.files = this.item.getBundle("ORIGINAL").map(bundle => bundle.bitstreams.map(bitstream => bitstream.payload));
}
}

View File

@@ -6,7 +6,7 @@ import { ItemPageComponent } from './item-page.component';
@NgModule({
imports: [
RouterModule.forChild([
{ path: 'item/:id', pathMatch: 'full', component: ItemPageComponent },
{ path: 'items/:id', pathMatch: 'full', component: ItemPageComponent },
])
]
})

View File

@@ -6,4 +6,5 @@
<ds-item-page-author-field [item]="item.payload | async"></ds-item-page-author-field>
<ds-item-page-abstract-field [item]="item.payload | async"></ds-item-page-abstract-field>
<ds-item-page-uri-field [item]="item.payload | async"></ds-item-page-uri-field>
<ds-item-page-file-section [item]="item.payload | async"></ds-item-page-file-section>
</div>

View File

@@ -10,5 +10,5 @@
* ];
**/
export const routes: string[] = [
'home', 'item/:id' , '**'
'home', 'items/:id' , '**'
];