|
|
|
@ -98,8 +98,12 @@ public class DescriptionTemplateDefinitionFileTransformerBuilder extends BaseFil
|
|
|
|
|
m.setExtendedDescription(d.getExtendedDescription());
|
|
|
|
|
m.setMultiplicity(d.getMultiplicity());
|
|
|
|
|
m.setNumbering(d.getNumbering());
|
|
|
|
|
m.setSections(collectSections(d.getSections()));
|
|
|
|
|
m.setFieldSets(collectFieldSet(d.getFieldSets()));
|
|
|
|
|
if (d.getSections() != null && !d.getSections().isEmpty()) {
|
|
|
|
|
m.setSections(collectSections(d.getSections()));
|
|
|
|
|
}
|
|
|
|
|
if (d.getFieldSets() != null && !d.getFieldSets().isEmpty()) {
|
|
|
|
|
m.setFieldSets(collectFieldSet(d.getFieldSets()));
|
|
|
|
|
}
|
|
|
|
|
result.add(m);
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
@ -135,7 +139,9 @@ public class DescriptionTemplateDefinitionFileTransformerBuilder extends BaseFil
|
|
|
|
|
m.setDefaultValue(d.getDefaultValue());
|
|
|
|
|
m.setIncludeInExport(d.getIncludeInExport());
|
|
|
|
|
m.setValidations(d.getValidations().stream().map(fieldValidationType -> FieldValidationType.of(fieldValidationType.getValue())).toList());
|
|
|
|
|
m.setVisibilityRules(convertVisibilityRules(d.getVisibilityRules()));
|
|
|
|
|
if (d.getVisibilityRules() != null && !d.getVisibilityRules().isEmpty()) {
|
|
|
|
|
m.setVisibilityRules(convertVisibilityRules(d.getVisibilityRules()));
|
|
|
|
|
}
|
|
|
|
|
m.setData(convertData(d.getData()));
|
|
|
|
|
result.add(m);
|
|
|
|
|
}
|
|
|
|
@ -157,11 +163,11 @@ public class DescriptionTemplateDefinitionFileTransformerBuilder extends BaseFil
|
|
|
|
|
BaseFieldDataFileTransformerModel m;
|
|
|
|
|
switch (data) {
|
|
|
|
|
case ExternalSelectDataEntity d -> {
|
|
|
|
|
m = new AutoCompleteDataFileTransformerModel();
|
|
|
|
|
m = new ExternalSelectDataFileTransformerModel();
|
|
|
|
|
m.setLabel(d.getLabel());
|
|
|
|
|
m.setFieldType(FieldType.of(d.getFieldType().getValue()));
|
|
|
|
|
((AutoCompleteDataFileTransformerModel)m).setMultiAutoComplete(d.getMultipleSelect());
|
|
|
|
|
((AutoCompleteDataFileTransformerModel) m).setAutoCompleteSingleDataList(convertAutoCompleteSingleData(d.getSources()));
|
|
|
|
|
((ExternalSelectDataFileTransformerModel)m).setMultipleSelect(d.getMultipleSelect());
|
|
|
|
|
((ExternalSelectDataFileTransformerModel) m).setSources(convertAutoCompleteSingleData(d.getSources()));
|
|
|
|
|
}
|
|
|
|
|
case ExternalDatasetDataEntity d -> {
|
|
|
|
|
m = new ExternalDatasetDataFileTransformerModel();
|
|
|
|
@ -183,21 +189,31 @@ public class DescriptionTemplateDefinitionFileTransformerBuilder extends BaseFil
|
|
|
|
|
((UploadDataFileTransformerModel) m).setTypes(convertUploadDataOptions(d.getTypes()));
|
|
|
|
|
}
|
|
|
|
|
case SelectDataEntity d -> {
|
|
|
|
|
m = new WordListDataFileTransformerModel();
|
|
|
|
|
m = new SelectDataFileTransformerModel();
|
|
|
|
|
m.setLabel(d.getLabel());
|
|
|
|
|
m.setFieldType(FieldType.of(d.getFieldType().getValue()));
|
|
|
|
|
((WordListDataFileTransformerModel) m).setMultiList(d.getMultipleSelect());
|
|
|
|
|
((WordListDataFileTransformerModel) m).setOptions(d.getOptions().stream().map(this::convertComboBoxOption).toList());
|
|
|
|
|
((SelectDataFileTransformerModel) m).setMultipleSelect(d.getMultipleSelect());
|
|
|
|
|
((SelectDataFileTransformerModel) m).setOptions(d.getOptions().stream().map(this::convertComboBoxOption).toList());
|
|
|
|
|
}
|
|
|
|
|
case LabelAndMultiplicityDataEntity d -> {
|
|
|
|
|
m = new LabelAndMultiplicityDataFileTransformerModel();
|
|
|
|
|
m.setLabel(d.getLabel());
|
|
|
|
|
m.setFieldType(FieldType.of(d.getFieldType().getValue()));
|
|
|
|
|
((LabelAndMultiplicityDataFileTransformerModel)m).setMultipleSelect(d.getMultipleSelect());
|
|
|
|
|
}
|
|
|
|
|
default -> {
|
|
|
|
|
m = new LabelDataFileTransformerModel();
|
|
|
|
|
m.setLabel(data.getLabel());
|
|
|
|
|
m.setFieldType(FieldType.of(data.getFieldType().getValue()));
|
|
|
|
|
}
|
|
|
|
|
default -> m = null;
|
|
|
|
|
}
|
|
|
|
|
return m;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<RadioBoxOptionFileTransformerModel> convertRadioBoxOptions(List<RadioBoxDataEntity.RadioBoxDataOptionEntity> data) {
|
|
|
|
|
List<RadioBoxOptionFileTransformerModel> result = new ArrayList<>();
|
|
|
|
|
private List<RadioBoxDataFileTransformerModel.RadioBoxDataOptionFileTransformerModel> convertRadioBoxOptions(List<RadioBoxDataEntity.RadioBoxDataOptionEntity> data) {
|
|
|
|
|
List<RadioBoxDataFileTransformerModel.RadioBoxDataOptionFileTransformerModel> result = new ArrayList<>();
|
|
|
|
|
for (RadioBoxDataEntity.RadioBoxDataOptionEntity d : data) {
|
|
|
|
|
RadioBoxOptionFileTransformerModel m = new RadioBoxOptionFileTransformerModel();
|
|
|
|
|
RadioBoxDataFileTransformerModel.RadioBoxDataOptionFileTransformerModel m = new RadioBoxDataFileTransformerModel.RadioBoxDataOptionFileTransformerModel();
|
|
|
|
|
m.setLabel(d.getLabel());
|
|
|
|
|
m.setValue(d.getValue());
|
|
|
|
|
result.add(m);
|
|
|
|
@ -205,19 +221,25 @@ public class DescriptionTemplateDefinitionFileTransformerBuilder extends BaseFil
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<AutoCompleteSingleDataFileTransformerModel> convertAutoCompleteSingleData(List<ExternalSelectDataEntity.ExternalSelectSourceEntity> data) {
|
|
|
|
|
List<AutoCompleteSingleDataFileTransformerModel> result = new ArrayList<>();
|
|
|
|
|
private List<ExternalSelectDataFileTransformerModel.ExternalSelectSourceFileTransformerModel> convertAutoCompleteSingleData(List<ExternalSelectDataEntity.ExternalSelectSourceEntity> data) {
|
|
|
|
|
List<ExternalSelectDataFileTransformerModel.ExternalSelectSourceFileTransformerModel> result = new ArrayList<>();
|
|
|
|
|
for (ExternalSelectDataEntity.ExternalSelectSourceEntity d : data) {
|
|
|
|
|
AutoCompleteSingleDataFileTransformerModel m = new AutoCompleteSingleDataFileTransformerModel();
|
|
|
|
|
ExternalSelectDataFileTransformerModel.ExternalSelectSourceFileTransformerModel m = new ExternalSelectDataFileTransformerModel.ExternalSelectSourceFileTransformerModel();
|
|
|
|
|
m.setUrl(d.getUrl());
|
|
|
|
|
m.setAutoCompleteOptions(convertComboBoxOption(d.getSourceBinding()));
|
|
|
|
|
m.setMethod(d.getMethod());
|
|
|
|
|
m.setHasAuth(d.getHasAuth());
|
|
|
|
|
m.setOptionsRoot(d.getOptionsRoot());
|
|
|
|
|
if (d.getAuth() != null) {
|
|
|
|
|
m.setAuth(convertAuthData(d.getAuth()));
|
|
|
|
|
}
|
|
|
|
|
m.setSourceBinding(convertComboBoxOption(d.getSourceBinding()));
|
|
|
|
|
result.add(m);
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ComboBoxOptionFileTransformerModel convertComboBoxOption(ExternalSelectDataEntity.ExternalSelectSourceBindingEntity data) {
|
|
|
|
|
ComboBoxOptionFileTransformerModel m = new ComboBoxOptionFileTransformerModel();
|
|
|
|
|
private ExternalSelectDataFileTransformerModel.ExternalSelectSourceBindingFileTransformerModel convertComboBoxOption(ExternalSelectDataEntity.ExternalSelectSourceBindingEntity data) {
|
|
|
|
|
ExternalSelectDataFileTransformerModel.ExternalSelectSourceBindingFileTransformerModel m = new ExternalSelectDataFileTransformerModel.ExternalSelectSourceBindingFileTransformerModel();
|
|
|
|
|
// m.setUri(data.getUri());
|
|
|
|
|
m.setSource(data.getSource());
|
|
|
|
|
m.setLabel(data.getLabel());
|
|
|
|
@ -225,19 +247,27 @@ public class DescriptionTemplateDefinitionFileTransformerBuilder extends BaseFil
|
|
|
|
|
return m;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ComboBoxOptionFileTransformerModel convertComboBoxOption(SelectDataEntity.OptionEntity data) {
|
|
|
|
|
ComboBoxOptionFileTransformerModel m = new ComboBoxOptionFileTransformerModel();
|
|
|
|
|
// m.setUri(data.getUri());
|
|
|
|
|
// m.setSource(data.getSource());
|
|
|
|
|
private ExternalSelectDataFileTransformerModel.ExternalSelectAuthDataFileTransformerModel convertAuthData(ExternalSelectDataEntity.ExternalSelectAuthDataEntity data) {
|
|
|
|
|
ExternalSelectDataFileTransformerModel.ExternalSelectAuthDataFileTransformerModel m = new ExternalSelectDataFileTransformerModel.ExternalSelectAuthDataFileTransformerModel();
|
|
|
|
|
m.setMethod(data.getMethod());
|
|
|
|
|
m.setUrl(data.getUrl());
|
|
|
|
|
m.setType(data.getType());
|
|
|
|
|
m.setBody(data.getBody());
|
|
|
|
|
m.setPath(data.getPath());
|
|
|
|
|
return m;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private SelectDataFileTransformerModel.OptionFileTransformerModel convertComboBoxOption(SelectDataEntity.OptionEntity data) {
|
|
|
|
|
SelectDataFileTransformerModel.OptionFileTransformerModel m = new SelectDataFileTransformerModel.OptionFileTransformerModel();
|
|
|
|
|
m.setLabel(data.getLabel());
|
|
|
|
|
m.setValue(data.getValue());
|
|
|
|
|
return m;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<UploadOptionFileTransformerModel> convertUploadDataOptions(List<UploadDataEntity.UploadDataOptionEntity> data) {
|
|
|
|
|
List<UploadOptionFileTransformerModel> result = new ArrayList<>();
|
|
|
|
|
private List<UploadDataFileTransformerModel.UploadDataOptionFileTransformerModel> convertUploadDataOptions(List<UploadDataEntity.UploadDataOptionEntity> data) {
|
|
|
|
|
List<UploadDataFileTransformerModel.UploadDataOptionFileTransformerModel> result = new ArrayList<>();
|
|
|
|
|
for (UploadDataEntity.UploadDataOptionEntity d : data) {
|
|
|
|
|
UploadOptionFileTransformerModel m = new UploadOptionFileTransformerModel();
|
|
|
|
|
UploadDataFileTransformerModel.UploadDataOptionFileTransformerModel m = new UploadDataFileTransformerModel.UploadDataOptionFileTransformerModel();
|
|
|
|
|
m.setLabel(d.getLabel());
|
|
|
|
|
m.setValue(d.getValue());
|
|
|
|
|
result.add(m);
|
|
|
|
|