mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-10 03:23:07 +00:00
Added more comments
This commit is contained in:
@@ -5,17 +5,42 @@ import { isNotEmpty } from '../../../../../shared/empty.util';
|
||||
import { Metadata } from '../../../../../core/shared/metadata.utils';
|
||||
import { MetadataMap, MetadataValue } from '../../../../../core/shared/metadata.models';
|
||||
|
||||
/**
|
||||
* This component allow to show bitstream's metadata
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ds-submission-upload-section-file-view',
|
||||
templateUrl: './section-upload-file-view.component.html',
|
||||
})
|
||||
export class UploadSectionFileViewComponent implements OnInit {
|
||||
|
||||
/**
|
||||
* The bitstream's metadata data
|
||||
* @type {WorkspaceitemSectionUploadFileObject}
|
||||
*/
|
||||
@Input() fileData: WorkspaceitemSectionUploadFileObject;
|
||||
|
||||
/**
|
||||
* The [[MetadataMap]] object
|
||||
* @type {MetadataMap}
|
||||
*/
|
||||
public metadata: MetadataMap = Object.create({});
|
||||
|
||||
/**
|
||||
* The bitstream's title key
|
||||
* @type {string}
|
||||
*/
|
||||
public fileTitleKey = 'Title';
|
||||
|
||||
/**
|
||||
* The bitstream's description key
|
||||
* @type {string}
|
||||
*/
|
||||
public fileDescrKey = 'Description';
|
||||
|
||||
/**
|
||||
* Initialize instance variables
|
||||
*/
|
||||
ngOnInit() {
|
||||
if (isNotEmpty(this.fileData.metadata)) {
|
||||
this.metadata[this.fileTitleKey] = Metadata.all(this.fileData.metadata, 'dc.title');
|
||||
@@ -23,7 +48,15 @@ export class UploadSectionFileViewComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
getAllMetadataValue(metadataKey): MetadataValue[] {
|
||||
/**
|
||||
* Gets all matching metadata in the map(s)
|
||||
*
|
||||
* @param metadataKey
|
||||
* The metadata key(s) in scope
|
||||
* @returns {MetadataValue[]}
|
||||
* The matching values
|
||||
*/
|
||||
getAllMetadataValue(metadataKey: string): MetadataValue[] {
|
||||
return Metadata.all(this.metadata, metadataKey);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user