Expose the vocabularyName to the submission form definition

This commit is contained in:
Andrea Bollini
2020-06-25 20:14:01 +02:00
parent ba150b1ec7
commit 322b56b422
2 changed files with 11 additions and 2 deletions

View File

@@ -115,7 +115,8 @@ public class SubmissionFormConverter implements DSpaceConverter<DCInputSet, Subm
String inputType = dcinput.getInputType();
SelectableMetadata selMd = new SelectableMetadata();
if (authorityUtils.isChoice(dcinput.getSchema(), dcinput.getElement(), dcinput.getQualifier())) {
if (isChoice(dcinput.getSchema(), dcinput.getElement(), dcinput.getQualifier(),
dcinput.getPairsType(), dcinput.getVocabulary())) {
inputRest.setType(getPresentation(dcinput.getSchema(), dcinput.getElement(),
dcinput.getQualifier(), inputType));
selMd.setControlledVocabulary(getAuthorityName(dcinput.getSchema(), dcinput.getElement(),
@@ -212,6 +213,14 @@ public class SubmissionFormConverter implements DSpaceConverter<DCInputSet, Subm
return authorityUtils.isClosed(schema, element, qualifier);
}
private boolean isChoice(String schema, String element, String qualifier, String valuePairsName,
String vocabularyName) {
if (StringUtils.isNotBlank(valuePairsName) || StringUtils.isNotBlank(vocabularyName)) {
return true;
}
return authorityUtils.isChoice(schema, element, qualifier);
}
@Override
public Class<DCInputSet> getModelClass() {
return DCInputSet.class;

View File

@@ -160,7 +160,7 @@ public class SubmissionFormsControllerIT extends AbstractControllerIntegrationTe
null, true,
"Select the type(s) of content of the item. To select more than one value in the " +
"list, you may have to hold down the \"CTRL\" or \"Shift\" key.",
"dc.type")
null, "dc.type", "common_types")
)))
;
}