diff --git a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2025.10.15__Description_UseMarkdown.sql b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2025.10.15__Description_UseMarkdown.sql new file mode 100644 index 000000000000..a3c300c69a9f --- /dev/null +++ b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2025.10.15__Description_UseMarkdown.sql @@ -0,0 +1,16 @@ +-- +-- The contents of this file are subject to the license and copyright +-- detailed in the LICENSE and NOTICE files at the root of the source +-- tree and available online at +-- +-- http://www.dspace.org/license/ +-- + +----------------------------------------------------------------------------------- +-- create new local.description.usemarkdown metadata property (if not exist) +----------------------------------------------------------------------------------- +INSERT INTO metadatafieldregistry (metadata_field_id, metadata_schema_id, element, qualifier, scope_note) +SELECT nextval('metadatafieldregistry_seq'), msr.metadata_schema_id, 'description', 'usemarkdown', + 'true when dc.description metadata value should be rendered as Markdown formatted text' +FROM metadataschemaregistry msr WHERE msr.short_id='local' + AND NOT EXISTS (SELECT 1 from metadatafieldregistry mfr WHERE mfr.element='description' AND mfr.qualifier='usemarkdown'); diff --git a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2025.10.15__Description_UseMarkdown.sql b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2025.10.15__Description_UseMarkdown.sql new file mode 100644 index 000000000000..a3c300c69a9f --- /dev/null +++ b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2025.10.15__Description_UseMarkdown.sql @@ -0,0 +1,16 @@ +-- +-- The contents of this file are subject to the license and copyright +-- detailed in the LICENSE and NOTICE files at the root of the source +-- tree and available online at +-- +-- http://www.dspace.org/license/ +-- + +----------------------------------------------------------------------------------- +-- create new local.description.usemarkdown metadata property (if not exist) +----------------------------------------------------------------------------------- +INSERT INTO metadatafieldregistry (metadata_field_id, metadata_schema_id, element, qualifier, scope_note) +SELECT nextval('metadatafieldregistry_seq'), msr.metadata_schema_id, 'description', 'usemarkdown', + 'true when dc.description metadata value should be rendered as Markdown formatted text' +FROM metadataschemaregistry msr WHERE msr.short_id='local' + AND NOT EXISTS (SELECT 1 from metadatafieldregistry mfr WHERE mfr.element='description' AND mfr.qualifier='usemarkdown'); diff --git a/dspace-api/src/test/java/org/dspace/content/LocalMetadataTest.java b/dspace-api/src/test/java/org/dspace/content/LocalMetadataTest.java index 51d543c90074..a9c0cd719a73 100644 --- a/dspace-api/src/test/java/org/dspace/content/LocalMetadataTest.java +++ b/dspace-api/src/test/java/org/dspace/content/LocalMetadataTest.java @@ -95,4 +95,13 @@ public void existsHidden() throws Exception { MetadataField field = metadataFieldService.findByString(context, "local.hidden", '.'); assertThat("existsHidden 0", field, notNullValue()); } + + /** + * Test if `local.description.usemarkdown` exists + */ + @Test + public void existsDescriptionUseMarkdown() throws Exception { + MetadataField field = metadataFieldService.findByString(context, "local.description.usemarkdown", '.'); + assertThat(field, notNullValue()); + } } diff --git a/dspace/config/registries/local-types.xml b/dspace/config/registries/local-types.xml index e05977c5cd26..46557cb72ea5 100644 --- a/dspace/config/registries/local-types.xml +++ b/dspace/config/registries/local-types.xml @@ -5,7 +5,7 @@ - An empty registry for instance-specific, local metadata. Any non-standard - metadata fields should be added here to avoid polluting the standard - namespaces. - - + - --> @@ -41,7 +41,7 @@ hasCMDI Indicates uploaded cmdi file - + local contact @@ -159,4 +159,11 @@ Count of files in the item + + local + description + usemarkdown + true when dc.description metadata value should be rendered as Markdown formatted text + + diff --git a/dspace/config/submission-forms.xml b/dspace/config/submission-forms.xml index db4cf1fa9ef2..3a1d97a7889d 100644 --- a/dspace/config/submission-forms.xml +++ b/dspace/config/submission-forms.xml @@ -239,10 +239,21 @@ false textarea - Enter a description of the submitted data. + Enter a description of the submitted data. Also, the Markdown format can be used to format text in the description (see: https://www.markdownguide.org/). Please give us a description + + + local + description + usemarkdown + true + + list + + + dc @@ -3211,6 +3222,13 @@ + + + Yes + yes + + +