diff --git a/src/app/item-page/field-components/metadata-values/metadata-values.component.html b/src/app/item-page/field-components/metadata-values/metadata-values.component.html index 44a3657fa56..78b834c9564 100644 --- a/src/app/item-page/field-components/metadata-values/metadata-values.component.html +++ b/src/app/item-page/field-components/metadata-values/metadata-values.component.html @@ -36,7 +36,7 @@ - {{value}} + diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.html b/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.html index 5463b068276..93280cbf4e4 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.html +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.html @@ -16,7 +16,7 @@ diff --git a/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.html b/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.html index 7748e385ca4..826091aebc8 100644 --- a/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.html +++ b/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.html @@ -1,6 +1,13 @@ -
+ + +
+
{{ label }}
+
+ +
diff --git a/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.scss b/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.scss index bf17d63d6c6..4c874e019f2 100644 --- a/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.scss +++ b/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.scss @@ -1,8 +1,23 @@ -:host { - .simple-view-element { - margin-bottom: 15px; +.simple-view-element { + h6 { + display: inline; + margin-right: 0.5em; } - .simple-view-element-header { - font-size: 1.25rem; + div { + display: inline; + } +} + +.simple-view-element-header { + font-weight: bold; +} + +.not-inline-label { + h6 { + display: block; + margin-right: 0; + } + div { + display: block; } } diff --git a/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.ts b/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.ts index af139e78e6f..e4548e2e24a 100644 --- a/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.ts +++ b/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.ts @@ -1,4 +1,4 @@ -import { NgIf } from '@angular/common'; +import { NgIf, NgClass } from '@angular/common'; import { Component, Input, @@ -13,7 +13,7 @@ import { styleUrls: ['./metadata-field-wrapper.component.scss'], templateUrl: './metadata-field-wrapper.component.html', standalone: true, - imports: [NgIf], + imports: [NgIf, NgClass], }) export class MetadataFieldWrapperComponent { @@ -23,4 +23,12 @@ export class MetadataFieldWrapperComponent { @Input() label: string; @Input() hideIfNoTextContent = true; + + @Input() inlineLabel: boolean; + + ngOnInit() { + if (this.inlineLabel === undefined) { + this.inlineLabel = true; + } + } } diff --git a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts index 5b69a7e72a9..668a0fc945b 100644 --- a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts +++ b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts @@ -24,6 +24,7 @@ import { Item } from '../../../../../core/shared/item.model'; import { ITEM } from '../../../../../core/shared/item.resource-type'; import { hasValue } from '../../../../empty.util'; import { AccessStatusObject } from './access-status.model'; +import { RemoteData } from 'src/app/core/data/remote-data'; @Component({ selector: 'ds-base-access-status-badge', @@ -70,12 +71,17 @@ export class AccessStatusBadgeComponent { } const item = this.object as Item; + let accessStatus$; + if (item.accessStatus == null) { // In case the access status has not been loaded, do it individually. - item.accessStatus = this.accessStatusDataService.findAccessStatusFor(item); + accessStatus$ = this.accessStatusDataService.findAccessStatusFor(item); + } else { + accessStatus$ = item.accessStatus; } - this.accessStatus$ = item.accessStatus.pipe( - map((accessStatusRD) => { + + this.accessStatus$ = accessStatus$.pipe( + map((accessStatusRD: RemoteData) => { if (accessStatusRD.statusCode !== 401 && hasValue(accessStatusRD.payload)) { return accessStatusRD.payload; } else { diff --git a/src/assets/i18n/es.json5 b/src/assets/i18n/es.json5 index a39271d568d..bc4867272a7 100644 --- a/src/assets/i18n/es.json5 +++ b/src/assets/i18n/es.json5 @@ -4104,7 +4104,7 @@ "item.preview.dc.identifier": "Identificador:", // "item.preview.dc.relation.ispartof": "Journal or Series", - "item.preview.dc.relation.ispartof": "Revista o Serie", + "item.preview.dc.relation.ispartof": "Serie/Colección", // "item.preview.dc.identifier.doi": "DOI", "item.preview.dc.identifier.doi": "DOI", @@ -8624,8 +8624,15 @@ "workflow-item.editaction.header": "Aprobando...", + // FALTAN + // workflow-item.editaction.notification.success.content + // workflow-item.editaction.notification.success.title + "workflow-item.selectCollection.header": "Elegir Coleccion", + // FALTAN + // workflow-item.selectCollection.notification.success.content + // workflow-item.selectCollection.notification.success.title //"browse.search-form.placeholder": "Search the repository", "browse.search-form.placeholder": "Buscar en el repositorio", diff --git a/src/assets/images/LAREFERENCIA.png b/src/assets/images/LAREFERENCIA.png new file mode 100644 index 00000000000..7ea1f010a86 Binary files /dev/null and b/src/assets/images/LAREFERENCIA.png differ diff --git a/src/themes/custom/app/item-page/simple/field-components/badge-metadata-values/badge-metadata-values.component.html b/src/themes/custom/app/item-page/simple/field-components/badge-metadata-values/badge-metadata-values.component.html new file mode 100644 index 00000000000..4efbb6e3824 --- /dev/null +++ b/src/themes/custom/app/item-page/simple/field-components/badge-metadata-values/badge-metadata-values.component.html @@ -0,0 +1,21 @@ + + + + + + + +
+ + {{badgeLabel}} + + + {{mdValue.value}} + + {{mdValue.value}} + + + +
+
+ diff --git a/src/themes/custom/app/item-page/simple/field-components/badge-metadata-values/badge-metadata-values.component.scss b/src/themes/custom/app/item-page/simple/field-components/badge-metadata-values/badge-metadata-values.component.scss new file mode 100644 index 00000000000..3ca39290284 --- /dev/null +++ b/src/themes/custom/app/item-page/simple/field-components/badge-metadata-values/badge-metadata-values.component.scss @@ -0,0 +1,41 @@ +.badge-label { + border-top-right-radius: unset; + border-bottom-right-radius: unset; + display: inline-block; +} + +.badge-content { + border-top-left-radius: unset; + border-bottom-left-radius: unset; + display: inline-block; +} + +.badge-group { + display: inline-block; +} + +.badge-group::after { + white-space: pre; + content: " "; +} + +.badge-identifier { + color: #505050; + background-color: #c3c3c3; + font-weight: inherit; +} + +.group-inline-block { + display: inline-block; +} + +::ng-deep .badge-group span { + padding: 0.4em; + padding-right: 0.5em; +} + +.copyButton { + color: #fff; + cursor: pointer; + margin-left: 5px; +} \ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/field-components/badge-metadata-values/badge-metadata-values.component.ts b/src/themes/custom/app/item-page/simple/field-components/badge-metadata-values/badge-metadata-values.component.ts new file mode 100644 index 00000000000..2b211a13834 --- /dev/null +++ b/src/themes/custom/app/item-page/simple/field-components/badge-metadata-values/badge-metadata-values.component.ts @@ -0,0 +1,37 @@ +import { Component, Input } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { TranslateModule } from '@ngx-translate/core'; +import { MetadataValuesComponent } from 'src/app/item-page/field-components/metadata-values/metadata-values.component'; +import { MetadataFieldWrapperComponent } from 'src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; + +@Component({ + selector: 'ds-badge-metadata-values', + standalone: true, + templateUrl: './badge-metadata-values.component.html', + styleUrls: ['./badge-metadata-values.component.scss'], + imports: [CommonModule, MetadataFieldWrapperComponent, TranslateModule], +}) +export class BadgeMetadataValuesComponent extends MetadataValuesComponent { + @Input() badgeType: string; + @Input() badgeUrl: string; + @Input() badgeLabel: string; + @Input() badgeLabelType: string; + @Input() copyToClipboardButton: boolean = false; + + copyToClipboard(el: HTMLDivElement, id: string) { + if (navigator.clipboard) { + navigator.clipboard.writeText(el.innerText).then(() => { + document.getElementById(id).classList.remove('fa-copy'); + document.getElementById(id).classList.add('fa-check'); + setTimeout(() => { + document.getElementById(id).classList.remove('fa-check'); + document.getElementById(id).classList.add('fa-copy'); + }, 1000); + }, (error) => { + console.log(error); + }); + } else { + console.log('Browser do not support Clipboard API'); + } + } +} \ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/field-components/date-metadata-values/sedici-date-metadata-values.component.html b/src/themes/custom/app/item-page/simple/field-components/date-metadata-values/sedici-date-metadata-values.component.html new file mode 100644 index 00000000000..3b11b5e5a52 --- /dev/null +++ b/src/themes/custom/app/item-page/simple/field-components/date-metadata-values/sedici-date-metadata-values.component.html @@ -0,0 +1,3 @@ + + {{ dateString }} + \ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/field-components/date-metadata-values/sedici-date-metadata-values.component.ts b/src/themes/custom/app/item-page/simple/field-components/date-metadata-values/sedici-date-metadata-values.component.ts new file mode 100644 index 00000000000..11bdda8daa8 --- /dev/null +++ b/src/themes/custom/app/item-page/simple/field-components/date-metadata-values/sedici-date-metadata-values.component.ts @@ -0,0 +1,36 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { MetadataValuesComponent } from 'src/app/item-page/field-components/metadata-values/metadata-values.component'; +import { MetadataFieldWrapperComponent } from 'src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { TranslateModule } from '@ngx-translate/core'; + +/** + * This component renders the configured 'values' into the ds-metadata-field-wrapper component. + * It puts the given 'separator' between each two values. + */ +@Component({ + selector: 'ds-sedici-date-metadata-values', + templateUrl: './sedici-date-metadata-values.component.html', + standalone: true, + imports: [ + TranslateModule, + MetadataValuesComponent, + MetadataFieldWrapperComponent, + ], +}) +export class SediciDateMetadataValuesComponent extends MetadataValuesComponent implements OnInit { + @Input() inlineLabel: boolean; + dateString: string; + + ngOnInit(): void { + const date = this.mdValues?.[0]?.value; + if (date !== undefined) { + if (date.length === 10) { + this.dateString = new Date(date).toLocaleDateString('es-AR',{ year: 'numeric', month: 'long', day: 'numeric', timeZone: 'UTC' }); + } else if (date.length === 7) { + this.dateString = new Date(date).toLocaleDateString('es-AR',{ year: 'numeric', month: 'long', timeZone: 'UTC' }); + } else { + this.dateString = date; + } + } + } +} diff --git a/src/themes/custom/app/item-page/simple/field-components/language-metadata-values/sedici-language-metadata-values.component.html b/src/themes/custom/app/item-page/simple/field-components/language-metadata-values/sedici-language-metadata-values.component.html new file mode 100644 index 00000000000..b6fa087014b --- /dev/null +++ b/src/themes/custom/app/item-page/simple/field-components/language-metadata-values/sedici-language-metadata-values.component.html @@ -0,0 +1,3 @@ + + {{ languageString }} + \ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/field-components/language-metadata-values/sedici-language-metadata-values.component.ts b/src/themes/custom/app/item-page/simple/field-components/language-metadata-values/sedici-language-metadata-values.component.ts new file mode 100644 index 00000000000..c085ddf72b5 --- /dev/null +++ b/src/themes/custom/app/item-page/simple/field-components/language-metadata-values/sedici-language-metadata-values.component.ts @@ -0,0 +1,34 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { MetadataValuesComponent } from 'src/app/item-page/field-components/metadata-values/metadata-values.component'; +import { MetadataFieldWrapperComponent } from 'src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { TranslateModule } from '@ngx-translate/core'; + +/** + * This component renders the configured 'values' into the ds-metadata-field-wrapper component. + * It puts the given 'separator' between each two values. + */ +@Component({ + selector: 'ds-sedici-language-metadata-values', + templateUrl: './sedici-language-metadata-values.component.html', + standalone: true, + imports: [ + TranslateModule, + MetadataValuesComponent, + MetadataFieldWrapperComponent, + ], +}) +export class SediciLanguageMetadataValuesComponent extends MetadataValuesComponent implements OnInit { + @Input() inlineLabel: boolean; + languageString: string; + + ngOnInit(): void { + const language = this.mdValues?.[0]?.value; + if (language === 'es') { + this.languageString = 'Español'; + } else if (language === 'en') { + this.languageString = 'Inlgés'; + } else if (language === 'pt') { + this.languageString = 'Portugués'; + } + } +} diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/apa-citation.component.html b/src/themes/custom/app/item-page/simple/item-types/untyped-item/apa-citation.component.html new file mode 100644 index 00000000000..7a1421effd8 --- /dev/null +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/apa-citation.component.html @@ -0,0 +1,12 @@ +
+
+ +
+
+ {{ citation }} +
+
+
+ Copiar al portapapeles + +
\ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/apa-citation.component.scss b/src/themes/custom/app/item-page/simple/item-types/untyped-item/apa-citation.component.scss new file mode 100644 index 00000000000..630bb5d0292 --- /dev/null +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/apa-citation.component.scss @@ -0,0 +1,62 @@ +.apa-citation-container { + border: 1px dashed #cccccc; + padding: 10px; + border-radius: 5px; + background-color: #f9f9f9; + font-family: Arial, sans-serif; + max-width: 300px; + max-height: 200px; // Tamaño máximo de la caja + overflow: hidden; // Ocultar el contenido que se desborda + transition: max-height 0.3s ease; // Transición para el cambio de tamaño + + &.expanded { + max-height: none; // Permitir que la caja se expanda completamente + } +} + +.apa-citation { + font-size: 14px; + color: #333333; + line-height: 1.5; + font-style: italic; + padding: 5px 0; +} + +.copy-button-container { + display: flex; + justify-content: space-between; + align-items: center; + padding-top: 5px; +} + +.copy-text { + font-size: 12px; + color: #666666; +} + +.copyButton { + cursor: pointer; + font-size: 16px; + color: #333333; + transition: color 0.3s; +} + +.copyButton:hover { + color: #007bff; +} + +.toggle-button-container { + display: flex; + justify-content: right; +} + +.toggleButton { + cursor: pointer; + font-size: 16px; + color: #333333; + transition: color 0.3s; +} + +.toggleButton:hover { + color: #007bff; +} \ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/apa-citation.component.ts b/src/themes/custom/app/item-page/simple/item-types/untyped-item/apa-citation.component.ts new file mode 100644 index 00000000000..01322d60b4a --- /dev/null +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/apa-citation.component.ts @@ -0,0 +1,95 @@ +import { Component, Input, OnInit, AfterViewInit, ViewChild, ElementRef } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +@Component({ + selector: 'ds-apa-citation', + standalone: true, + imports: [CommonModule], + templateUrl: './apa-citation.component.html', + styleUrls: ['./apa-citation.component.scss'] +}) +export class ApaCitationComponent implements OnInit { + @Input() item: any; + @ViewChild('elementContentToCopy') elementContentToCopy: ElementRef; + citation: string; + isExpanded: boolean = false; + showToggleButton: boolean = false; + + ngOnInit(): void { + this.generateCitation(); + } + + ngAfterViewInit(): void { + this.checkContentHeight(); + } + + generateCitation(): void { + const authors = this.getAuthors(); + const year = this.getYear(); + const title = this.getTitle(); + const journalTitle = this.getJournalTitle(); + const journalVolumeAndIssue = this.getJournalVolumeAndIssue(); + const pages = this.getPages(); + const source = this.getSource(); + + this.citation = `${authors} (${year}). ${title}. ${journalTitle}, ${journalVolumeAndIssue}, ${pages}. ${source}.`; + } + + getAuthors(): string { + const authors = this.item.allMetadata(['sedici.creator.person']); + return authors.map(author => author.value).join(', '); + } + + getYear(): string { + const date = this.item.firstMetadataValue('dc.date.issued'); + return date ? new Date(date).getFullYear().toString() : 's.f.'; + } + + getTitle(): string { + return this.item.firstMetadataValue('dc.title') || 'Sin título'; + } + + getJournalTitle(): string { + return this.item.firstMetadataValue('sedici.relation.journalTitle') || 'Sin journalTitle'; + } + + getJournalVolumeAndIssue(): string { + return this.item.firstMetadataValue('sedici.relation.journalVolumeAndIssue') || 'Sin journalVolumeAndIssue'; + } + + getPages(): string { + return this.item.firstMetadataValue('dc.format.extent') || 'Sin pages'; + } + + getSource(): string { + return this.item.firstMetadataValue('dc.identifier.doi') || 'Sin fuente'; + } + + copyToClipboard(el: HTMLDivElement, id: string) { + if (navigator.clipboard) { + navigator.clipboard.writeText(el.innerText).then(() => { + document.getElementById(id).classList.remove('fa-copy'); + document.getElementById(id).classList.add('fa-check'); + setTimeout(() => { + document.getElementById(id).classList.remove('fa-check'); + document.getElementById(id).classList.add('fa-copy'); + }, 1000); + }, (error) => { + console.log(error); + }); + } else { + console.log('Browser do not support Clipboard API'); + } + } + + toggleExpand(): void { + this.isExpanded = !this.isExpanded; + } + + checkContentHeight(): void { + const maxHeight = 195; // Altura máxima de la caja + if (this.elementContentToCopy.nativeElement.scrollHeight > maxHeight) { + this.showToggleButton = true; + } + } +} \ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/content-files.component.html b/src/themes/custom/app/item-page/simple/item-types/untyped-item/content-files.component.html new file mode 100644 index 00000000000..c16172a4028 --- /dev/null +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/content-files.component.html @@ -0,0 +1,36 @@ +
+
+
+
+ .{{ getFileExtension(file.name) }} +
+
+
+ {{ getFileDescription(file) }} + {{ (file?.sizeBytes) | dsFileSize }} +
+ +
+
+
+
+
+ +
+
+ + + SOY UNA IMAGEN + + + + {{ dsoNameService.getName(selectedFile) }} + +
+ +
+ preview +
+
+
+
\ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/content-files.component.scss b/src/themes/custom/app/item-page/simple/item-types/untyped-item/content-files.component.scss new file mode 100644 index 00000000000..43f30a82c8d --- /dev/null +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/content-files.component.scss @@ -0,0 +1,111 @@ +.content-container { + display: flex; + flex-direction: row; + + .col-3 { + padding-left: 10px; + padding-right: 10px; + } + + .file-list { + flex: 1; + display: flex; + flex-direction: column; + max-height: 500px; // Ajusta este valor según el tamaño del previsualizador + overflow-y: auto; // Agrega el scrollbar vertical si el contenido excede el tamaño + + .file-item { + display: flex; + align-items: center; + padding: 5px; + cursor: pointer; + border-bottom: 1px solid #e0e0e0; + + &:hover { + background-color: #f5f5f5; + } + + .file-icon { + display: flex; + justify-content: center; + background-color: #333; + color: #fff; + border-radius: 4px; + + .file-extension { + font-size: 10px; + font-weight: bold; + } + } + + .file-info { + flex: 1; + display: flex; + flex-direction: column; + + .row { + display: flex; + align-items: center; + + .file-name { + font-weight: bold; + overflow: hidden; // Oculta el texto que se desborda + text-overflow: ellipsis; // Agrega puntos suspensivos al texto que se desborda + display: -webkit-box; // Necesario para line-clamp + -webkit-box-orient: vertical; // Necesario para line-clamp + -webkit-line-clamp: 2; // Limita el texto a 2 líneas + line-clamp: 2; // Limita el texto a 2 líneas + } + + .file-size { + text-align: right; + font-size: 14px; + } + + .download-btn { + background-color: #fff; + border: 1px solid #ccc; + padding: 5px 10px; + cursor: pointer; + border-radius: 4px; + + &:hover { + background-color: #e0e0e0; + } + } + } + + .file-preview { + font-size: 12px; + color: #888; + margin-top: 5px; + } + } + } + } + + .file-preview { + flex: 2; + position: relative; + + .preview-image { + width: 100%; + height: 500px; // Ajusta el tamaño según tus necesidades + } + + .no-preview { + width: 100%; + height: 500px; + display: flex; + justify-content: center; + align-items: center; + border: 2px solid #ccc; + background-color: #f5f5f5; + + span { + font-size: 24px; + color: #aaa; + } + } + } +} diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/content-files.component.ts b/src/themes/custom/app/item-page/simple/item-types/untyped-item/content-files.component.ts new file mode 100644 index 00000000000..214e2e483d6 --- /dev/null +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/content-files.component.ts @@ -0,0 +1,78 @@ +import { Component, Input, Inject } from '@angular/core'; +import { NgFor, NgIf } from '@angular/common'; +import { Item } from 'src/app/core/shared/item.model'; +import { BitstreamDataService } from 'src/app/core/data/bitstream-data.service'; +import { APP_CONFIG, AppConfig } from 'src/config/app-config.interface'; +import { Bitstream } from 'src/app/core/shared/bitstream.model'; +import { FileSizePipe } from 'src/app/shared/utils/file-size-pipe'; +import { DSONameService } from 'src/app/core/breadcrumbs/dso-name.service'; +import { SediciFileDownloadLinkComponent } from './sedici-file-download-link.component'; + +@Component({ + selector: 'content-files', + styleUrls: ['./content-files.component.scss'], + templateUrl: './content-files.component.html', + standalone: true, + imports: [ + NgFor, + NgIf, + FileSizePipe, + SediciFileDownloadLinkComponent, + ], +}) +export class ContentFilesComponent { + @Input() object: Item; + + primaryBitsreamId: string; + + files: Bitstream[] = []; + + constructor( + protected bitstreamDataService: BitstreamDataService, + public dsoNameService: DSONameService, + @Inject(APP_CONFIG) protected appConfig: AppConfig, + ) {} + + selectedFile: Bitstream | null = null; + + selectFile(file: Bitstream) { + this.selectedFile = file; + } + + getFileExtension(fileName: string): string { + const parts = fileName.split('.'); + return parts.length > 1 ? parts.pop() : ''; + } + + isImage(file: Bitstream): boolean { + const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp']; + const extension = this.getFileExtension(file.name).toLowerCase(); + return imageExtensions.includes(extension); + } + + getFileDescription(file: Bitstream): string { + return file.metadata['dc.description']?.[0]?.value || this.dsoNameService.getName(file) ; + } + + ngOnInit(): void { + this.getPrimaryBitstreamId(); + this.getAllPages(); + } + + private getPrimaryBitstreamId() { + this.bitstreamDataService.findPrimaryBitstreamByItemAndName(this.object, 'ORIGINAL', true, true).subscribe((primaryBitstream: Bitstream | null) => { + if (!primaryBitstream) { + return; + } + this.primaryBitsreamId = primaryBitstream?.id; + }); + } + + getAllPages(): void { + this.bitstreamDataService.findAllByItemAndBundleName(this.object, 'ORIGINAL', { currentPage: 0, elementsPerPage: 1000 }).subscribe((response: any) => { + if (response && response.payload && response.payload.page.length > 0) { + this.files = response.payload.page; + } + }); + } +} \ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/full-item.component.html b/src/themes/custom/app/item-page/simple/item-types/untyped-item/full-item.component.html new file mode 100644 index 00000000000..58d441a78e6 --- /dev/null +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/full-item.component.html @@ -0,0 +1,48 @@ + + +
+ + + + + + + + + + + + + + + + +
+ +
+ + {{"item.page.link.full" | translate}} + +
\ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/full-item.component.ts b/src/themes/custom/app/item-page/simple/item-types/untyped-item/full-item.component.ts new file mode 100644 index 00000000000..582dc07efa6 --- /dev/null +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/full-item.component.ts @@ -0,0 +1,40 @@ +import { Component, Input } from '@angular/core'; +import { NgFor } from '@angular/common'; +import { Item } from 'src/app/core/shared/item.model'; +import { RouterLink } from '@angular/router'; +import { getItemPageRoute } from 'src/app/item-page/item-page-routing-paths'; +import { TranslateModule } from '@ngx-translate/core'; + +import { GenericItemPageFieldComponent } from 'src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { SediciDateMetadataValuesComponent } from '../../field-components/date-metadata-values/sedici-date-metadata-values.component'; +import { SediciLanguageMetadataValuesComponent } from '../../field-components/language-metadata-values/sedici-language-metadata-values.component'; +import { CollectionsComponent } from 'src/app/item-page/field-components/collections/collections.component'; + +@Component({ + selector: 'full-item', + // styleUrls: ['./full-item.component.scss'], + templateUrl: './full-item.component.html', + standalone: true, + imports: [ + NgFor, + RouterLink, + TranslateModule, + GenericItemPageFieldComponent, + SediciDateMetadataValuesComponent, + SediciLanguageMetadataValuesComponent, + CollectionsComponent, + ], +}) +export class FullItemComponent { + @Input() object: Item; + itemPageRoute: string; + + ngOnInit(): void { + this.itemPageRoute = getItemPageRoute(this.object); + } + + getMetadataEntries() { + const metadata = this.object.metadata; + return Object.keys(metadata).map(key => ({ key, value: metadata[key] })); + } +} \ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/language-switcher.component.html b/src/themes/custom/app/item-page/simple/item-types/untyped-item/language-switcher.component.html new file mode 100644 index 00000000000..9e3708f95d4 --- /dev/null +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/language-switcher.component.html @@ -0,0 +1,14 @@ + +
+ + + +
+ +

+
+
\ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/language-switcher.component.scss b/src/themes/custom/app/item-page/simple/item-types/untyped-item/language-switcher.component.scss new file mode 100644 index 00000000000..8a9908e15e0 --- /dev/null +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/language-switcher.component.scss @@ -0,0 +1,17 @@ +.container { + margin-top: 10px; + margin-bottom: 10px; +} + +button { + margin-right: 5px; +} + +button.active { + font-weight: bold; +} + +.abstract-text { + white-space: pre-wrap; + text-align: justify; +} \ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/language-switcher.component.ts b/src/themes/custom/app/item-page/simple/item-types/untyped-item/language-switcher.component.ts new file mode 100644 index 00000000000..889fd9cadaa --- /dev/null +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/language-switcher.component.ts @@ -0,0 +1,55 @@ +import { Component, Input } from '@angular/core'; +import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; +import { NgIf, NgFor } from '@angular/common'; +import { MetadataFieldWrapperComponent } from 'src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { TranslateModule } from '@ngx-translate/core'; +import { TruncatableComponent } from 'src/app/shared/truncatable/truncatable.component'; +import { TruncatablePartComponent } from 'src/app/shared/truncatable/truncatable-part/truncatable-part.component'; + +@Component({ + selector: 'language-switcher', + styleUrls: ['./language-switcher.component.scss'], + templateUrl: './language-switcher.component.html', + standalone: true, + imports: [ + NgIf, + NgFor, + MetadataFieldWrapperComponent, + TranslateModule, + TruncatableComponent, + TruncatablePartComponent, + ], +}) +export class LanguageSwitcherComponent { + @Input() item: any; + selectedLanguage: string; + availableLanguages: any[]; + + constructor(private sanitizer: DomSanitizer) {} + + ngOnInit() { + this.selectedLanguage = this.item.metadata['dc.language']?.[0]?.value || 'es'; + this.availableLanguages = this.getAvailableLanguages(); + } + + getAbstract(): SafeHtml { + const abstracts = this.item.metadata['dc.description.abstract']; + if (!abstracts) { + return this.sanitizer.bypassSecurityTrustHtml(''); + } + const abstract = abstracts.find((abstract: any) => (abstract.language || 'es') === this.selectedLanguage)?.value || ''; + return this.sanitizer.bypassSecurityTrustHtml(abstract); + } + + changeLanguage(language: string) { + this.selectedLanguage = language; + } + + getAvailableLanguages() { + const abstracts = this.item.metadata['dc.description.abstract']; + if (!abstracts) { + return []; + } + return [...new Set(abstracts.map((abstract: any) => abstract.language))]; + } +} \ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/sedici-file-download-link.component.html b/src/themes/custom/app/item-page/simple/item-types/untyped-item/sedici-file-download-link.component.html new file mode 100644 index 00000000000..a3f6fd009d8 --- /dev/null +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/sedici-file-download-link.component.html @@ -0,0 +1,15 @@ + + + \ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/sedici-file-download-link.component.scss b/src/themes/custom/app/item-page/simple/item-types/untyped-item/sedici-file-download-link.component.scss new file mode 100644 index 00000000000..999612ca708 --- /dev/null +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/sedici-file-download-link.component.scss @@ -0,0 +1,20 @@ +.download-btn { + background-color: #fff; + border: 1px solid #ccc; + padding: 3px 8px; // Reducir el padding para achicar el botón + cursor: pointer; + border-radius: 4px; + font-size: 14px; // Reducir el tamaño de la letra + + &:hover { + background-color: #e0e0e0; + } + + .pr-1 { + padding-right: 5px; // Ajustar el padding del icono si es necesario + } + + i { + font-size: 12px; // Ajustar el tamaño del icono si es necesario + } +} \ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/sedici-file-download-link.component.ts b/src/themes/custom/app/item-page/simple/item-types/untyped-item/sedici-file-download-link.component.ts new file mode 100644 index 00000000000..af1ac0da3b0 --- /dev/null +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/sedici-file-download-link.component.ts @@ -0,0 +1,26 @@ +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; +import { Component, OnInit } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { FileDownloadLinkComponent } from 'src/app/shared/file-download-link/file-download-link.component'; + +@Component({ + selector: 'ds-sedici-file-download-link', + templateUrl: './sedici-file-download-link.component.html', + styleUrls: ['./sedici-file-download-link.component.scss'], + standalone: true, + imports: [ + AsyncPipe, + NgClass, + NgIf, + RouterLink, + TranslateModule, + ], +}) +export class SediciFileDownloadLinkComponent extends FileDownloadLinkComponent implements OnInit { + +} \ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/tabbed-content.component.html b/src/themes/custom/app/item-page/simple/item-types/untyped-item/tabbed-content.component.html new file mode 100644 index 00000000000..5de590c1eda --- /dev/null +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/tabbed-content.component.html @@ -0,0 +1,28 @@ +
+
+
+ {{ tab.label }} +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ Selecciona una solapa. +
+
+
+
+ \ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/tabbed-content.component.scss b/src/themes/custom/app/item-page/simple/item-types/untyped-item/tabbed-content.component.scss new file mode 100644 index 00000000000..c47f37b0f5a --- /dev/null +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/tabbed-content.component.scss @@ -0,0 +1,37 @@ +.tab-container { + display: flex; + flex-direction: column; + border: 1px solid #e0e0e0; + border-radius: 4px; + overflow: hidden; + font-family: 'Arial', sans-serif; +} + +.tab-header { + display: flex; + background-color: #f8f8f8; + border-bottom: 1px solid #e0e0e0; +} + +.tab { + flex: 1; + padding: 12px 16px; + text-align: center; + cursor: pointer; + font-size: 1em; + font-weight: bold; + color: #555; + transition: background-color 0.3s ease; +} + +.tab.active { + background-color: #ffffff; + border-bottom: 2px solid #007bff; + color: #007bff; +} + +.tab-content { + padding: 16px; + background-color: #ffffff; + min-height: 500px; //AJUSTAR +} diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/tabbed-content.component.ts b/src/themes/custom/app/item-page/simple/item-types/untyped-item/tabbed-content.component.ts new file mode 100644 index 00000000000..9195bc401a3 --- /dev/null +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/tabbed-content.component.ts @@ -0,0 +1,29 @@ +import { Component, Input } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { Item } from 'src/app/core/shared/item.model'; +import { ItemPageCcLicenseFieldComponent } from 'src/app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component'; +import { FullItemComponent } from './full-item.component'; +import { ContentFilesComponent } from './content-files.component'; + +@Component({ + selector: 'ds-tabbed-content', + standalone: true, + imports: [CommonModule, ItemPageCcLicenseFieldComponent, FullItemComponent, ContentFilesComponent], + templateUrl: './tabbed-content.component.html', + styleUrls: ['./tabbed-content.component.scss'] +}) +export class TabbedContentComponent { + @Input() object: Item; + + selectedTabIndex = 0; + + tabs = [ + { label: 'Contenido' }, + { label: 'Licencia' }, + { label: 'Registro completo' } + ]; + + selectTab(index: number) { + this.selectedTabIndex = index; + } +} \ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.html b/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.html index 7aa21532981..60da797b752 100644 --- a/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.html +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.html @@ -1,239 +1,275 @@ - -
-
- - -
-
+
+
+
+
+
+
+ +
+

+ + +

+
+ +
+
+
+ + + + + + +
+
+
+ + + + + + + + + + + + + +
+
-
-

- -

- -
-
- - - -
-
-
- - - - - -
- + + + +
Información de la tesis
+
Información general
+ + + + + + + + + + + +
Información general
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - -
+
+ + + + + + + + \ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.scss b/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.scss index e69de29bb2d..4421d20a190 100644 --- a/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.scss +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.scss @@ -0,0 +1,50 @@ +.badge-title-container { + display: flex; + align-items: center; +} + +.badge-title-content { + display: flex; + flex-direction: column; + + h4 { + font-size: 1.75rem; + color: #999; + margin-bottom: 0.5rem; + } +} + +.edit-menu { + margin-left: auto; +} + +.subtitle-content { + font-style: italic; + color: #555; + margin-bottom: 0.5rem; +} + +.divider { + border-top: 1px solid #999; + margin: 0.5rem 0; +} + +.section-divider { + border-bottom: 1px solid #D8E8Eb; +} + +.item-identifiers { + display: flex; + flex-wrap: wrap; + gap: 0.2em; + + div { + display: inline-block; + padding-right: 0.2em; + } +} + +.reference-image { + max-width: 100%; + height: auto; +} \ No newline at end of file diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts b/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts index 9609ad35739..f7bf1258b23 100644 --- a/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts @@ -1,6 +1,8 @@ import { AsyncPipe, NgIf, + NgFor, + NgStyle, } from '@angular/common'; import { ChangeDetectionStrategy, @@ -19,6 +21,7 @@ import { ThemedFileSectionComponent } from '../../../../../../../app/item-page/s import { ItemPageAbstractFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component'; import { ItemPageCcLicenseFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component'; import { ItemPageDateFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/date/item-page-date-field.component'; +import { ItemPageAuthorFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/author/item-page-author-field.component'; import { GenericItemPageFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; import { ThemedItemPageTitleFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; import { ItemPageUriFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component'; @@ -35,6 +38,16 @@ import { FileSectionComponent } from '../../field-components/file-section/file-s import { MediaViewerComponent } from '../../../media-viewer/media-viewer.component'; import { ThumbnailComponent } from 'src/themes/custom/app/thumbnail/thumbnail.component'; import { ResultsBackButtonComponent } from 'src/themes/custom/app/shared/results-back-button/results-back-button.component'; +import { SediciContextBadgeComponent } from 'src/themes/custom/app/shared/object-collection/shared/badges/sedici-context-badge/sedici-context-badge.component'; +import { LanguageSwitcherComponent } from './language-switcher.component'; +import { ApaCitationComponent } from './apa-citation.component'; +import { MetadataValue } from 'src/app/core/shared/metadata.models'; +import { BadgeMetadataValuesComponent } from '../../field-components/badge-metadata-values/badge-metadata-values.component'; +import { TruncatableComponent } from 'src/app/shared/truncatable/truncatable.component'; +import { TruncatablePartComponent } from 'src/app/shared/truncatable/truncatable-part/truncatable-part.component'; +import { TabbedContentComponent } from './tabbed-content.component'; +import { SediciDateMetadataValuesComponent } from '../../field-components/date-metadata-values/sedici-date-metadata-values.component'; +import { SediciLanguageMetadataValuesComponent } from '../../field-components/language-metadata-values/sedici-language-metadata-values.component'; /** * Component that represents an untyped Item page */ @@ -49,6 +62,8 @@ import { ResultsBackButtonComponent } from 'src/themes/custom/app/shared/results standalone: true, imports: [ NgIf, + NgFor, + NgStyle, ThemedResultsBackButtonComponent, MiradorViewerComponent, ThemedItemPageTitleFieldComponent, @@ -73,6 +88,65 @@ import { ResultsBackButtonComponent } from 'src/themes/custom/app/shared/results MediaViewerComponent, ThumbnailComponent, ResultsBackButtonComponent, + LanguageSwitcherComponent, + ItemPageAuthorFieldComponent, + BadgeMetadataValuesComponent, + TruncatableComponent, + TruncatablePartComponent, + ApaCitationComponent, + TabbedContentComponent, + SediciDateMetadataValuesComponent, + SediciLanguageMetadataValuesComponent, + SediciContextBadgeComponent, ], }) -export class UntypedItemComponent extends BaseComponent {} +export class UntypedItemComponent extends BaseComponent { + hasMultipleLanguages: boolean; + subtype; + identifierOtherMetadataName = ['dc.identifier.uri', 'sedici.identifier.other']; + itemIdentifiers: { mdValue: MetadataValue, label: string }[]; + + ngOnInit() { + super.ngOnInit(); + const abstracts = this.object.metadata['dc.description.abstract']; + this.hasMultipleLanguages = abstracts && abstracts.length > 1; + this.subtype = this.object.metadata['sedici.subtype'][0]?.value; + this.setIdentifierOtherValues(); + } + + setIdentifierOtherValues(): void { + this.itemIdentifiers = []; + const length = this.itemIdentifiers.push({ + mdValue: new MetadataValue(), + label: 'HDL' + }); + this.itemIdentifiers[length - 1].mdValue.value = this.object?.handle; + this.object.allMetadata(this.identifierOtherMetadataName).forEach( + (mdValue, index) => { + let charIndex = -1; + let label = ''; + if (mdValue.value.includes(this.object?.handle)) { + if (mdValue.value.includes('doi')) { + label = 'DOI'; + } else { + return; + } + } else { + if (!mdValue.value.startsWith('http')) { + const splitChar = mdValue.value.includes(':') ? ':' : ' '; + charIndex = mdValue.value.indexOf(splitChar); + label = mdValue.value.substring(0, charIndex).toUpperCase(); + } else { + label = 'URL'; + } + } + const value = mdValue.value.substring(charIndex + 1).trim(); + const identifierListLength = this.itemIdentifiers.push({ + mdValue: new MetadataValue(), + label: label + }); + this.itemIdentifiers[identifierListLength - 1].mdValue.value = value; + } + ); + } +} diff --git a/src/themes/custom/app/shared/object-collection/shared/badges/sedici-context-badge/sedici-context-badge.component.html b/src/themes/custom/app/shared/object-collection/shared/badges/sedici-context-badge/sedici-context-badge.component.html new file mode 100644 index 00000000000..f23e7b4b6a8 --- /dev/null +++ b/src/themes/custom/app/shared/object-collection/shared/badges/sedici-context-badge/sedici-context-badge.component.html @@ -0,0 +1,16 @@ + + + + +
+ + + + +
+ {{ getContextInfo() }} +
+
+ {{ getYear() }} +
+
diff --git a/src/themes/custom/app/shared/object-collection/shared/badges/sedici-context-badge/sedici-context-badge.component.scss b/src/themes/custom/app/shared/object-collection/shared/badges/sedici-context-badge/sedici-context-badge.component.scss new file mode 100644 index 00000000000..b8cb48e7358 --- /dev/null +++ b/src/themes/custom/app/shared/object-collection/shared/badges/sedici-context-badge/sedici-context-badge.component.scss @@ -0,0 +1,30 @@ +.badge-title-container { + display: flex; + align-items: center; + margin-bottom: 10px; + + .context-info, + .context-year { + font-size: 12px; + position: relative; + &:hover::after { + content: ''; + position: absolute; + left: 1.5%; + right: 1.5%; + bottom: 0; + height: 2px; + background-color: #8d8d8d; + } + } + + .context-info { + color: #8d8d8d; + margin-left: 5px; + } + + .context-year { + color: #4a90e2; + margin-left: 5px; + } +} \ No newline at end of file diff --git a/src/themes/custom/app/shared/object-collection/shared/badges/sedici-context-badge/sedici-context-badge.component.ts b/src/themes/custom/app/shared/object-collection/shared/badges/sedici-context-badge/sedici-context-badge.component.ts new file mode 100644 index 00000000000..6ba11b96d53 --- /dev/null +++ b/src/themes/custom/app/shared/object-collection/shared/badges/sedici-context-badge/sedici-context-badge.component.ts @@ -0,0 +1,86 @@ +import { NgIf } from '@angular/common'; +import { Component } from '@angular/core'; +import { BadgesComponent as BaseComponent } from '../badges.component'; + +import { ThemedAccessStatusBadgeComponent } from 'src/app/shared/object-collection/shared/badges/access-status-badge/themed-access-status-badge.component'; +import { ThemedMyDSpaceStatusBadgeComponent } from 'src/app/shared/object-collection/shared/badges/my-dspace-status-badge/themed-my-dspace-status-badge.component'; +import { ThemedStatusBadgeComponent } from 'src/app/shared/object-collection/shared/badges/status-badge/themed-status-badge.component'; +import { ThemedTypeBadgeComponent } from 'src/app/shared/object-collection/shared/badges/type-badge/themed-type-badge.component'; + +@Component({ + selector: 'ds-sedici-context-badge', + styleUrls: ['./sedici-context-badge.component.scss'], + templateUrl: './sedici-context-badge.component.html', + standalone: true, + imports: [ThemedStatusBadgeComponent, NgIf, ThemedMyDSpaceStatusBadgeComponent, ThemedTypeBadgeComponent, ThemedAccessStatusBadgeComponent], +}) +export class SediciContextBadgeComponent extends BaseComponent { + + getThesisInfo(): string { + const thesisDegreeName = this.object.firstMetadataValue('thesis.degree.name'); + const thesisDegreeGrantor = this.object.firstMetadataValue('thesis.degree.grantor'); + + if (thesisDegreeName && thesisDegreeGrantor) { + return `${thesisDegreeName}; ${thesisDegreeGrantor}`; + } else { + return ''; + } + } + + getJournalInfo(): string { + const journalTitle = this.object.firstMetadataValue('sedici.relation.journalTitle'); + const journalVolumeAndIssue = this.object.firstMetadataValue('sedici.relation.journalVolumeAndIssue'); + + if (journalTitle && journalVolumeAndIssue) { + return `${journalTitle}; ${journalVolumeAndIssue}`; + } else if (journalTitle) { + return journalTitle; + } else { + return ''; + } + } + + getOriginInfoPlace(): string { + let place = this.object.firstMetadataValue('mods.originInfo.place'); + if (!place) { + return ''; + } + return place; + } + + getEventInfo(): string { + let event = this.object.firstMetadataValue('sedici.relation.event'); + if (!event) { + return ''; + } + return event; + } + + getContextInfo(): string { + let thesis = this.getThesisInfo(); + let journal = this.getJournalInfo(); + let event = this.getEventInfo(); + let origin = this.getOriginInfoPlace(); + if (thesis) { + return thesis; + }; + if (journal || event) { + if (journal && event) { + return `${journal} | ${event}`; + } else if (journal) { + return journal; + } else { + return event; + }; + }; + return origin; + } + + getYear(): string { + let dateString = this.object.firstMetadataValue('dc.date.issued') || this.object.firstMetadataValue('dc.date.created'); + if (!dateString) { + return ''; + } + return dateString.split('-')[0]; + } +}