diff --git a/module-gui/src/main/webapp/resources/uii/include_journals.xhtml b/module-gui/src/main/webapp/resources/uii/include_journals.xhtml index 39a0a65..1bdb5b6 100644 --- a/module-gui/src/main/webapp/resources/uii/include_journals.xhtml +++ b/module-gui/src/main/webapp/resources/uii/include_journals.xhtml @@ -294,7 +294,6 @@ fieldType="#{field.displayType}" propertyValid="#{field.fieldValid}" errorMessageText="#{field.validationErrorText}" - selectItems="#{field.selectList}" fieldRequired="#{field.required}" booleanValue="#{field.booleanValue}" subValue="#{field.value2}" @@ -303,6 +302,10 @@ showHelpBtn="#{field.displayHelpButton}" helpText="#{field.helpMessage}" helpTitle="#{field.helpMessageTitle}" + selectItems="#{field.fields}" + var="var" + itemValue="#{var.value}" + itemLabel="#{msgs[var.label]}" render=":#{cc.clientId}:field_" /> @@ -560,7 +563,10 @@ fieldRequired="#{field.required}" propertyValid="#{field.fieldValid}" errorMessageText="#{field.validationErrorText}" - selectItems="#{field.selectList}" + selectItems="#{field.fields}" + var="var" + itemValue="#{var.value}" + itemLabel="#{msgs[var.label]}" booleanValue="#{field.booleanValue}" subValue="#{field.value2}" displayDuplicateButton="#{field.cardinality == '+' or field.cardinality == '*'}" diff --git a/module-gui/src/main/webapp/resources/uii/include_monographs.xhtml b/module-gui/src/main/webapp/resources/uii/include_monographs.xhtml index 4ff60ff..aca0896 100644 --- a/module-gui/src/main/webapp/resources/uii/include_monographs.xhtml +++ b/module-gui/src/main/webapp/resources/uii/include_monographs.xhtml @@ -176,7 +176,10 @@ propertyValid="#{field.fieldValid}" fieldRequired="#{field.required}" errorMessageText="#{field.validationErrorText}" - selectItems="#{field.selectList}" + selectItems="#{field.fields}" + var="var" + itemValue="#{var.value}" + itemLabel="#{msgs[var.label]}" booleanValue="#{field.booleanValue}" subValue="#{field.value2}" displayDuplicateButton="#{field.cardinality == '+' or field.cardinality == '*'}" @@ -359,7 +362,10 @@ propertyValid="#{field.fieldValid}" fieldRequired="#{field.required}" errorMessageText="#{field.validationErrorText}" - selectItems="#{field.selectList}" + selectItems="#{field.fields}" + var="var" + itemValue="#{var.value}" + itemLabel="#{msgs[var.label]}" booleanValue="#{field.booleanValue}" subValue="#{field.value2}" displayDuplicateButton="#{field.cardinality == '+' or field.cardinality == '*'}" @@ -542,7 +548,10 @@ fieldType="#{field.displayType}" propertyValid="#{field.fieldValid}" errorMessageText="#{field.validationErrorText}" - selectItems="#{field.selectList}" + selectItems="#{field.fields}" + var="var" + itemValue="#{var.value}" + itemLabel="#{msgs[var.label]}" booleanValue="#{field.booleanValue}" subValue="#{field.value2}" displayDuplicateButton="#{field.cardinality == '+' or field.cardinality == '*'}" diff --git a/module-gui/src/main/webapp/resources/uii/include_userdata.xhtml b/module-gui/src/main/webapp/resources/uii/include_userdata.xhtml index 302eba1..c46134d 100644 --- a/module-gui/src/main/webapp/resources/uii/include_userdata.xhtml +++ b/module-gui/src/main/webapp/resources/uii/include_userdata.xhtml @@ -234,7 +234,10 @@ fieldType="#{field.displayType}" propertyValid="#{field.fieldValid}" errorMessageText="#{field.validationErrorText}" - selectItems="#{field.selectList}" + selectItems="#{field.fields}" + var="var" + itemValue="#{var.value}" + itemLabel="#{msgs[var.label]}" booleanValue="#{field.booleanValue}" fieldRequired="#{field.required}" subValue="#{field.value2}" @@ -243,7 +246,12 @@ render="@form" showHelpBtn="#{field.displayHelpButton}" helpText="#{field.helpMessage}" - helpTitle="#{field.helpMessageTitle}" /> + helpTitle="#{field.helpMessageTitle}" + + var="lang" + itemLabel="#{lang.value}" + itemValue="#{lang.value}" + /> @@ -416,7 +424,6 @@ fieldRequired="#{field.required}" propertyValid="#{field.fieldValid}" errorMessageText="#{field.validationErrorText}" - selectItems="#{field.selectList}" booleanValue="#{field.booleanValue}" subValue="#{field.value2}" displayDuplicateButton="#{field.cardinality == '+' or field.cardinality == '*'}" @@ -424,7 +431,16 @@ render="@form" showHelpBtn="#{field.displayHelpButton}" helpText="#{field.helpMessage}" - helpTitle="#{field.helpMessageTitle}" /> + helpTitle="#{field.helpMessageTitle}" + selectItems="#{field.fields}" + var="var" + itemValue="#{var.value}" + itemLabel="#{msgs[var.label]}" + > + + + + @@ -468,7 +484,10 @@ fieldRequired="#{field.required}" propertyValid="#{field.fieldValid}" errorMessageText="#{field.validationErrorText}" - selectItems="#{field.selectList}" + selectItems="#{field.fields}" + var="var" + itemValue="#{var.value}" + itemLabel="#{msgs[var.label]}" booleanValue="#{field.booleanValue}" subValue="#{field.value2}" displayDuplicateButton="#{field.cardinality == '+' or field.cardinality == '*'}" @@ -528,7 +547,10 @@ fieldRequired="#{field.required}" propertyValid="#{field.fieldValid}" errorMessageText="#{field.validationErrorText}" - selectItems="#{field.selectList}" + selectItems="#{field.fields}" + var="var" + itemValue="#{var.value}" + itemLabel="#{msgs[var.label]}" booleanValue="#{field.booleanValue}" subValue="#{field.value2}" displayDuplicateButton="#{field.cardinality == '+' or field.cardinality == '*'}" diff --git a/module-lib/src/main/java/de/intranda/goobi/plugins/utils/MetadataField.java b/module-lib/src/main/java/de/intranda/goobi/plugins/utils/MetadataField.java index 6cca833..63ae215 100644 --- a/module-lib/src/main/java/de/intranda/goobi/plugins/utils/MetadataField.java +++ b/module-lib/src/main/java/de/intranda/goobi/plugins/utils/MetadataField.java @@ -1,5 +1,17 @@ package de.intranda.goobi.plugins.utils; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; +import javax.faces.model.SelectItem; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.validator.routines.checkdigit.EAN13CheckDigit; + import io.goobi.vocabulary.exchange.FieldDefinition; import io.goobi.vocabulary.exchange.Vocabulary; import io.goobi.vocabulary.exchange.VocabularySchema; @@ -7,16 +19,6 @@ import io.goobi.workflow.api.vocabulary.helper.ExtendedVocabularyRecord; import lombok.Data; import lombok.extern.java.Log; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.validator.routines.checkdigit.EAN13CheckDigit; - -import javax.faces.component.UIComponent; -import javax.faces.context.FacesContext; -import javax.faces.model.SelectItem; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; @Data @Log @@ -113,14 +115,16 @@ public void setVocabulary(String name, String displayField, String importFied) { Optional displayFieldDefinition = Optional.empty(); if (!StringUtils.isBlank(vocabularyDisplayField)) { - displayFieldDefinition = schema.getDefinitions().stream() + displayFieldDefinition = schema.getDefinitions() + .stream() .filter(d -> d.getName().equals(vocabularyDisplayField)) .findFirst(); if (displayFieldDefinition.isEmpty()) { log.warning("Vocabulary display field \"" + vocabularyDisplayField + "\" not present in vocabulary \"" + vocabularyName + "\""); } } - Optional importFieldDefinition = schema.getDefinitions().stream() + Optional importFieldDefinition = schema.getDefinitions() + .stream() .filter(d -> d.getName().equals(vocabularyImportField)) .findFirst(); if (importFieldDefinition.isEmpty()) { @@ -384,4 +388,15 @@ public MetadataField cloneField() { public boolean isDisplayHelpButton() { return StringUtils.isNotBlank(helpMessage); } + + public List getFields() { + List spl = new ArrayList<>(); + for (SelectItem si : selectList) { + spl.add(new RadioItem(si.getLabel(), String.valueOf(si.getValue()))); + + } + + return spl; + + } } diff --git a/module-lib/src/main/java/de/intranda/goobi/plugins/utils/RadioItem.java b/module-lib/src/main/java/de/intranda/goobi/plugins/utils/RadioItem.java new file mode 100644 index 0000000..8867420 --- /dev/null +++ b/module-lib/src/main/java/de/intranda/goobi/plugins/utils/RadioItem.java @@ -0,0 +1,15 @@ +package de.intranda.goobi.plugins.utils; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class RadioItem { + + private String label; + private String value; + +}