Skip to content

Commit

Permalink
108055: isClosed method should use xml configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Vannerum committed Nov 8, 2023
1 parent 60d4bca commit d800d80
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private SubmissionFormFieldRest getField(DCInput dcinput, String formName) {
dcinput.getVocabulary()));
selMd.setClosed(
isClosed(dcinput.getSchema(), dcinput.getElement(), dcinput.getQualifier(),
dcinput.getPairsType(), dcinput.getVocabulary()));
dcinput.getPairsType(), dcinput.getVocabulary(), dcinput.isClosedVocabulary()));
} else {
inputRest.setType(inputType);
}
Expand All @@ -145,7 +145,7 @@ private SubmissionFormFieldRest getField(DCInput dcinput, String formName) {
selMd.setControlledVocabulary(getAuthorityName(dcinput.getSchema(), dcinput.getElement(),
pairs.get(idx + 1), dcinput.getPairsType(), dcinput.getVocabulary()));
selMd.setClosed(isClosed(dcinput.getSchema(), dcinput.getElement(),
dcinput.getQualifier(), null, dcinput.getVocabulary()));
dcinput.getQualifier(), null, dcinput.getVocabulary(), dcinput.isClosedVocabulary()));
}
selectableMetadata.add(selMd);
}
Expand Down Expand Up @@ -212,9 +212,11 @@ private String getAuthorityName(String schema, String element, String qualifier,
}

private boolean isClosed(String schema, String element, String qualifier, String valuePairsName,
String vocabularyName) {
if (StringUtils.isNotBlank(valuePairsName) || StringUtils.isNotBlank(vocabularyName)) {
String vocabularyName, boolean isClosedVocabulary) {
if (StringUtils.isNotBlank(valuePairsName)) {
return true;
} else if (StringUtils.isNotBlank(vocabularyName)) {
return isClosedVocabulary;
}
return authorityUtils.isClosed(schema, element, qualifier);
}
Expand Down

0 comments on commit d800d80

Please sign in to comment.