Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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');
Original file line number Diff line number Diff line change
@@ -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');
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
11 changes: 9 additions & 2 deletions dspace/config/registries/local-types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
-
-
-->
<dspace-dc-types>

Expand Down Expand Up @@ -41,7 +41,7 @@
<element>hasCMDI</element>
<scope_note>Indicates uploaded cmdi file</scope_note>
</dc-type>

<dc-type>
<schema>local</schema>
<element>contact</element>
Expand Down Expand Up @@ -159,4 +159,11 @@
<scope_note>Count of files in the item</scope_note>
</dc-type>

<dc-type>
<schema>local</schema>
<element>description</element>
<qualifier>usemarkdown</qualifier>
<scope_note>true when dc.description metadata value should be rendered as Markdown formatted text</scope_note>
</dc-type>

</dspace-dc-types>
20 changes: 19 additions & 1 deletion dspace/config/submission-forms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,21 @@
<repeatable>false</repeatable>
<label>Description</label>
<input-type>textarea</input-type>
<hint>Enter a description of the submitted data.</hint>
<hint>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/).</hint>
<required>Please give us a description</required>
</field>
</row>
<row>
<field>
<dc-schema>local</dc-schema>
<dc-element>description</dc-element>
<dc-qualifier>usemarkdown</dc-qualifier>
<repeatable>true</repeatable>
<label>Use Markdown format</label>
<input-type value-pairs-name="use_markdown">list</input-type>
<hint/>
</field>
</row>
<row>
<field>
<dc-schema>dc</dc-schema>
Expand Down Expand Up @@ -3211,6 +3222,13 @@
</pair>
</value-pairs>

<value-pairs value-pairs-name="use_markdown" dc-term="">
<pair>
<displayed-value>Yes</displayed-value>
<stored-value>yes</stored-value>
</pair>
</value-pairs>

</form-value-pairs>

<!-- Example of the complex input type definition.
Expand Down
20 changes: 19 additions & 1 deletion dspace/config/submission-forms_cs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,21 @@
<repeatable>false</repeatable>
<label>Popis</label>
<input-type>textarea</input-type>
<hint>Popište nahrávaná data.</hint>
<hint>Popište nahrávaná data U popisu je možné použít Markdown formátování (https://www.markdownguide.org/).</hint>
<required>Uveďte prosím popis.</required>
</field>
</row>
<row>
<field>
<dc-schema>local</dc-schema>
<dc-element>description</dc-element>
<dc-qualifier>usemarkdown</dc-qualifier>
<repeatable>true</repeatable>
<label>Použít Markdown formátování</label>
<input-type value-pairs-name="use_markdown">list</input-type>
<hint/>
</field>
</row>
<row>
<field>
<dc-schema>dc</dc-schema>
Expand Down Expand Up @@ -3166,6 +3177,13 @@
</pair>
</value-pairs>

<value-pairs value-pairs-name="use_markdown" dc-term="">
<pair>
<displayed-value>Ano</displayed-value>
<stored-value>yes</stored-value>
</pair>
</value-pairs>

</form-value-pairs>

<!-- Example of the complex input type definition.
Expand Down