Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As a metadata configurator, I want to display values of a controlled vocabulary as images #6289

Closed
doigl opened this issue Oct 18, 2019 · 5 comments
Labels
Component: JSF Involves modifying JSF (Jakarta Server Faces) code, which is being replaced with React. Feature: Metadata Type: Suggestion an idea User Role: Depositor Creates datasets, uploads data, etc.

Comments

@doigl
Copy link
Contributor

doigl commented Oct 18, 2019

In a metadata block for software basing on CodeMeta (see thread in user mailinglist) we tried to get Dataverse to display the values of a controlled variable as images linking to pages with more information about the values (see repostatus.org for examples)

The corresponding value for displayFormat in tsv is
<a href='https://www.repostatus.org/##VALUE'><img src='https://www.repostatus.org/badges/latest/#VALUE.svg' alt='ProjectStatus: #VALUE '/>

The whole tsv-file is attached (codemeta.tsv.txt), the line concerned is about codeMetaDevelopmentStatus (line 5) with the vocabulary in line 28.

As there is an example with an image in the documentation for display formats., the image itself doesn't seem to be the problem. Dataverse is ignoring everything I put into the displayFormat field, even something like (#VALUE).

Is this because of the controlled vocabulary? Are there any other possibilities to change the appearance of the metadata fields?

Other wishes would be to combine the values of a compound field, like <a href="#VALUE_OF_SUBFIELD_URL">#VALUE_OF_SUBFIELD_TITLE</a>.

@djbrooke
Copy link
Contributor

@jggautier, let's discuss next week!

@pdurbin
Copy link
Member

pdurbin commented Nov 18, 2019

Thanks to @donsizemore it's now possible to spin up instances of Dataverse with custom metadata blocks using dataverse-ansible. Here's the issue I just tested and closed: IQSS/dataverse-ansible#133

Since I tested with the metadata block in this issue, here are some screenshots of how it looks:

full "Metadata for Research Software" metadata block

Screen Shot 2019-11-18 at 5 00 48 PM

the repo status field (edit)

Screen Shot 2019-11-18 at 5 01 07 PM

the repo status field (view)

Screen Shot 2019-11-18 at 5 03 41 PM

@poikilotherm
Copy link
Contributor

@doigl controlled vocabularies are retrieved as localized values but not formated with displayFormat.

public List<String> getValues() {
List<String> returnList = new ArrayList<>();
if (!datasetFieldValues.isEmpty()) {
for (DatasetFieldValue dsfv : datasetFieldValues) {
returnList.add(dsfv.getDisplayValue());
}
} else {
for (ControlledVocabularyValue cvv : controlledVocabularyValues) {
if (cvv != null && cvv.getLocaleStrValue() != null) {
returnList.add(cvv.getLocaleStrValue());
}
}
}
return returnList;
}

(DatasetFieldValue.getDisplayValue() is doing the format work)

@poikilotherm
Copy link
Contributor

@doigl As we now created #7856, I'm gonna remove the "other wishes" from the issue title.

@poikilotherm poikilotherm changed the title As a metadata configurator, I want to display values of a controlled vocabulary as images (among other wishes regarding displayFormat possibilities ) As a metadata configurator, I want to display values of a controlled vocabulary as images May 7, 2021
@pdurbin pdurbin added Type: Suggestion an idea Feature: Metadata User Role: Depositor Creates datasets, uploads data, etc. Component: JSF Involves modifying JSF (Jakarta Server Faces) code, which is being replaced with React. labels Oct 10, 2022
@cmbz
Copy link

cmbz commented Aug 20, 2024

To focus on the most important features and bugs, we are closing issues created before 2020 (version 5.0) that are not new feature requests with the label 'Type: Feature'.

If you created this issue and you feel the team should revisit this decision, please reopen the issue and leave a comment.

@cmbz cmbz closed this as completed Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: JSF Involves modifying JSF (Jakarta Server Faces) code, which is being replaced with React. Feature: Metadata Type: Suggestion an idea User Role: Depositor Creates datasets, uploads data, etc.
Projects
None yet
Development

No branches or pull requests

6 participants