refactor description template xml

This commit is contained in:
Efstratios Giannopoulos 2024-01-31 14:44:20 +02:00
parent 6a0d1a7c8b
commit 7e63abca50
6 changed files with 7 additions and 7 deletions

View File

@ -6,7 +6,7 @@ import eu.eudat.data.converters.enums.DatabaseEnum;
import java.util.Map;
public enum FieldType implements DatabaseEnum<String> {
AUTO_COMPLETE(Names.ExternalSelect),
EXTERNAL_SELECT(Names.ExternalSelect),
SELECT(Names.Select),
BOOLEAN_DECISION(Names.BooleanDecision),
RADIO_BOX(Names.RadioBox),

View File

@ -77,7 +77,7 @@ public class DescriptionFieldDepositBuilder extends BaseDepositBuilder<Descripti
}
switch (field.getData().getFieldType()) {
case AUTO_COMPLETE -> m.setFieldType(FieldType.AUTO_COMPLETE);
case EXTERNAL_SELECT -> m.setFieldType(FieldType.AUTO_COMPLETE);
case SELECT -> m.setFieldType(FieldType.WORD_LIST);
case BOOLEAN_DECISION -> m.setFieldType(FieldType.BOOLEAN_DECISION);
case RADIO_BOX -> m.setFieldType(FieldType.RADIO_BOX);

View File

@ -60,7 +60,7 @@ public class FieldDataHelperServiceProvider {
item = this.applicationContext.getBean(SelectFieldDataHelperService.class);
break;
}
case AUTO_COMPLETE: {
case EXTERNAL_SELECT: {
item = this.applicationContext.getBean(ExternalSelectFieldDataHelperService.class);
break;
}

View File

@ -282,7 +282,7 @@ public class PrefillingServiceImpl implements PrefillingService {
Field field = new Field();
field.setKey(id);
switch (fieldEntity.getData().getFieldType()) {
case AUTO_COMPLETE:
case EXTERNAL_SELECT:
case SELECT: {
if (!parsedValues.stream().allMatch(Objects::isNull)) {
field.setValue(this.jsonHandlingService.toJsonSafe(parseComboBoxValues(fieldEntity, parsedValues)));
@ -364,7 +364,7 @@ public class PrefillingServiceImpl implements PrefillingService {
private Object parseComboBoxValues(FieldEntity fieldEntity, List<String> parsedValues) {
List<String> normalizedValues = new ArrayList<>();
boolean isMultiSelect;
if(fieldEntity.getData().getFieldType().equals(FieldType.AUTO_COMPLETE)) {
if(fieldEntity.getData().getFieldType().equals(FieldType.EXTERNAL_SELECT)) {
ExternalSelectDataEntity autoCompleteData = (ExternalSelectDataEntity)fieldEntity.getData();
isMultiSelect = autoCompleteData.getMultipleSelect();
for (String format : parsedValues) {

View File

@ -165,7 +165,7 @@ public class PrefillingMapper {
String renderStyle = node.isArray() ? node.get(0).get("viewStyle").get("renderStyle").asText() : node.get("viewStyle").get("renderStyle").asText();
switch (FieldType.of(renderStyle)) {
case AUTO_COMPLETE:
case EXTERNAL_SELECT:
case SELECT:
if (parsedValues.isEmpty())
parsedValues.add(parsedValue);

View File

@ -213,7 +213,7 @@ public class ExportXmlBuilderDatasetProfile {
Element dataOut = element.createElement("data");
switch (field.getViewStyle().getFieldType()) {
case SELECT:
case AUTO_COMPLETE:
case EXTERNAL_SELECT:
// ComboBoxDataEntity comboBoxDataEntityObject = (ComboBoxDataEntity) field.getData();
// if (comboBoxDataEntityObject.getFieldType().equals("wordlist")) {
// SelectDataEntity selectDataEntityObject = (SelectDataEntity) field.getData();