Update Description Template Field Data Classes

This commit is contained in:
George Kalampokis 2024-02-01 18:16:25 +02:00
parent 67d69e029e
commit a717330b6b
17 changed files with 269 additions and 238 deletions

View File

@ -5,8 +5,8 @@ import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Map; import java.util.Map;
public enum FieldType implements DatabaseEnum<String> { public enum FieldType implements DatabaseEnum<String> {
AUTO_COMPLETE(Names.Autocomplete), EXTERNAL_SELECT(Names.ExternalSelect),
WORD_LIST(Names.Wordlist), SELECT(Names.Select),
BOOLEAN_DECISION(Names.BooleanDecision), BOOLEAN_DECISION(Names.BooleanDecision),
RADIO_BOX(Names.RadioBox), RADIO_BOX(Names.RadioBox),
INTERNAL_DMP_ENTRIES_RESEARCHERS(Names.InternalDmpResearchers), INTERNAL_DMP_ENTRIES_RESEARCHERS(Names.InternalDmpResearchers),
@ -36,8 +36,8 @@ public enum FieldType implements DatabaseEnum<String> {
private final String value; private final String value;
public static class Names { public static class Names {
public static final String Autocomplete = "autocomplete"; public static final String ExternalSelect = "externalSelect";
public static final String Wordlist = "wordlist"; public static final String Select = "select";
public static final String BooleanDecision = "booleanDecision"; public static final String BooleanDecision = "booleanDecision";
public static final String RadioBox = "radiobox"; public static final String RadioBox = "radiobox";
public static final String InternalDmpResearchers = "internalDmpResearchers"; public static final String InternalDmpResearchers = "internalDmpResearchers";

View File

@ -1,20 +0,0 @@
package eu.eudat.file.transformer.models.descriptiontemplate.definition.fielddata;
import java.util.List;
public class AutoCompleteDataFileTransformerModel extends BaseFieldDataFileTransformerModel {
private Boolean multiAutoComplete;
private List<AutoCompleteSingleDataFileTransformerModel> autoCompleteSingleDataFileTransformerModelList;
public Boolean getMultiAutoComplete() { return multiAutoComplete; }
public void setMultiAutoComplete(Boolean multiAutoComplete) { this.multiAutoComplete = multiAutoComplete; }
public List<AutoCompleteSingleDataFileTransformerModel> getAutoCompleteSingleDataList() {
return autoCompleteSingleDataFileTransformerModelList;
}
public void setAutoCompleteSingleDataList(List<AutoCompleteSingleDataFileTransformerModel> autoCompleteSingleDataFileTransformerModelList) {
this.autoCompleteSingleDataFileTransformerModelList = autoCompleteSingleDataFileTransformerModelList;
}
}

View File

@ -1,24 +0,0 @@
package eu.eudat.file.transformer.models.descriptiontemplate.definition.fielddata;
public class AutoCompleteSingleDataFileTransformerModel {
private String url;
private ComboBoxOptionFileTransformerModel autoCompleteOptions;
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public ComboBoxOptionFileTransformerModel getAutoCompleteOptions() {
return autoCompleteOptions;
}
public void setAutoCompleteOptions(ComboBoxOptionFileTransformerModel autoCompleteOptions) {
this.autoCompleteOptions = autoCompleteOptions;
}
}

View File

@ -1,61 +1,25 @@
package eu.eudat.file.transformer.models.descriptiontemplate.definition.fielddata; package eu.eudat.file.transformer.models.descriptiontemplate.definition.fielddata;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import eu.eudat.file.transformer.enums.FieldType; import eu.eudat.file.transformer.enums.FieldType;
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
property = "fieldType",
visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = AutoCompleteDataFileTransformerModel.class, name = FieldType.Names.Autocomplete),
@JsonSubTypes.Type(value = LabelAndMultiplicityFieldDataFileTransformerModel.class, name = FieldType.Names.BooleanDecision),
@JsonSubTypes.Type(value = LabelAndMultiplicityFieldDataFileTransformerModel.class, name = FieldType.Names.InternalDmpDatasets),
@JsonSubTypes.Type(value = LabelAndMultiplicityFieldDataFileTransformerModel.class, name = FieldType.Names.InternalDmpDmps),
@JsonSubTypes.Type(value = LabelFieldDataFileTransformerModel.class, name = FieldType.Names.CheckBox),
@JsonSubTypes.Type(value = LabelFieldDataFileTransformerModel.class, name = FieldType.Names.DatePicker),
@JsonSubTypes.Type(value = ExternalDatasetDataFileTransformerModel.class, name = FieldType.Names.ExternalDatasets),
@JsonSubTypes.Type(value = LabelFieldDataFileTransformerModel.class, name = FieldType.Names.FreeText),
@JsonSubTypes.Type(value = LabelAndMultiplicityFieldDataFileTransformerModel.class, name = FieldType.Names.Licenses),
@JsonSubTypes.Type(value = LabelAndMultiplicityFieldDataFileTransformerModel.class, name = FieldType.Names.Organizations),
@JsonSubTypes.Type(value = LabelAndMultiplicityFieldDataFileTransformerModel.class, name = FieldType.Names.Publications),
@JsonSubTypes.Type(value = RadioBoxDataFileTransformerModel.class, name = FieldType.Names.RadioBox),
@JsonSubTypes.Type(value = LabelAndMultiplicityFieldDataFileTransformerModel.class, name = FieldType.Names.Registries),
@JsonSubTypes.Type(value = LabelAndMultiplicityFieldDataFileTransformerModel.class, name = FieldType.Names.InternalDmpResearchers),
@JsonSubTypes.Type(value = LabelAndMultiplicityFieldDataFileTransformerModel.class, name = FieldType.Names.Researchers),
@JsonSubTypes.Type(value = LabelFieldDataFileTransformerModel.class, name = FieldType.Names.RichTextarea),
@JsonSubTypes.Type(value = LabelAndMultiplicityFieldDataFileTransformerModel.class, name = FieldType.Names.Services),
@JsonSubTypes.Type(value = LabelFieldDataFileTransformerModel.class, name = FieldType.Names.Tags),
@JsonSubTypes.Type(value = LabelAndMultiplicityFieldDataFileTransformerModel.class, name = FieldType.Names.Taxonomies),
@JsonSubTypes.Type(value = LabelFieldDataFileTransformerModel.class, name = FieldType.Names.TextArea),
@JsonSubTypes.Type(value = UploadDataFileTransformerModel.class, name = FieldType.Names.Upload),
@JsonSubTypes.Type(value = LabelFieldDataFileTransformerModel.class, name = FieldType.Names.Validation),
@JsonSubTypes.Type(value = LabelFieldDataFileTransformerModel.class, name = FieldType.Names.DatasetIdentifier),
@JsonSubTypes.Type(value = LabelFieldDataFileTransformerModel.class, name = FieldType.Names.Currency),
@JsonSubTypes.Type(value = WordListDataFileTransformerModel.class, name = FieldType.Names.Wordlist),
@JsonSubTypes.Type(value = LabelAndMultiplicityFieldDataFileTransformerModel.class, name = FieldType.Names.DataRepositories),
@JsonSubTypes.Type(value = LabelAndMultiplicityFieldDataFileTransformerModel.class, name = FieldType.Names.JournalRepositories),
@JsonSubTypes.Type(value = LabelAndMultiplicityFieldDataFileTransformerModel.class, name = FieldType.Names.Publications),
})
public abstract class BaseFieldDataFileTransformerModel { public abstract class BaseFieldDataFileTransformerModel {
private String label; private String label;
private FieldType fieldType; private FieldType fieldType;
private String value; private String value;
public String getLabel() { public String getLabel() {
return label; return label;
} }
public void setLabel(String label) { public void setLabel(String label) {
this.label = label; this.label = label;
} }
public FieldType getFieldType() { public FieldType getFieldType() {
return fieldType; return fieldType;
} }
public void setFieldType(FieldType fieldType) { public void setFieldType(FieldType fieldType) {
this.fieldType = fieldType; this.fieldType = fieldType;

View File

@ -1,42 +0,0 @@
package eu.eudat.file.transformer.models.descriptiontemplate.definition.fielddata;
public class ComboBoxOptionFileTransformerModel {
private String label;
private String value;
private String source;
private String uri;
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
}

View File

@ -3,7 +3,7 @@ package eu.eudat.file.transformer.models.descriptiontemplate.definition.fielddat
import eu.eudat.file.transformer.enums.FieldDataExternalDatasetType; import eu.eudat.file.transformer.enums.FieldDataExternalDatasetType;
public class ExternalDatasetDataFileTransformerModel extends LabelAndMultiplicityFieldDataFileTransformerModel { public class ExternalDatasetDataFileTransformerModel extends LabelAndMultiplicityDataFileTransformerModel {
private FieldDataExternalDatasetType type; private FieldDataExternalDatasetType type;
public FieldDataExternalDatasetType getType() { public FieldDataExternalDatasetType getType() {

View File

@ -0,0 +1,150 @@
package eu.eudat.file.transformer.models.descriptiontemplate.definition.fielddata;
import jakarta.xml.bind.annotation.*;
import java.util.List;
@XmlAccessorType(XmlAccessType.FIELD)
public class ExternalSelectDataFileTransformerModel extends LabelAndMultiplicityDataFileTransformerModel {
public static class ExternalSelectAuthDataFileTransformerModel {
private String url;
private String method;
private String body;
private String path;
private String type;
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
public static class ExternalSelectSourceBindingFileTransformerModel {
private String label;
private String value;
private String source;
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
}
public static class ExternalSelectSourceFileTransformerModel {
private String url;
private String method;
private String optionsRoot;
private ExternalSelectSourceBindingFileTransformerModel sourceBinding;
private Boolean hasAuth;
private ExternalSelectAuthDataFileTransformerModel auth;
public String getOptionsRoot() {
return optionsRoot;
}
public void setOptionsRoot(String optionsRoot) {
this.optionsRoot = optionsRoot;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public Boolean getHasAuth() {
return hasAuth;
}
public void setHasAuth(Boolean hasAuth) {
this.hasAuth = hasAuth;
}
public ExternalSelectAuthDataFileTransformerModel getAuth() {
return auth;
}
public void setAuth(ExternalSelectAuthDataFileTransformerModel auth) {
this.auth = auth;
}
public ExternalSelectSourceBindingFileTransformerModel getSourceBinding() {
return sourceBinding;
}
public void setSourceBinding(ExternalSelectSourceBindingFileTransformerModel sourceBinding) {
this.sourceBinding = sourceBinding;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
}
private List<ExternalSelectSourceFileTransformerModel> sources;
public List<ExternalSelectSourceFileTransformerModel> getSources() {
return sources;
}
public void setSources(List<ExternalSelectSourceFileTransformerModel> externalSelectSourceFileTransformerModelList) {
this.sources = externalSelectSourceFileTransformerModelList;
}
}

View File

@ -0,0 +1,13 @@
package eu.eudat.file.transformer.models.descriptiontemplate.definition.fielddata;
public class LabelAndMultiplicityDataFileTransformerModel extends BaseFieldDataFileTransformerModel {
private Boolean multipleSelect;
public Boolean getMultipleSelect() {
return multipleSelect;
}
public void setMultipleSelect(Boolean multipleSelect) {
this.multipleSelect = multipleSelect;
}
}

View File

@ -1,14 +0,0 @@
package eu.eudat.file.transformer.models.descriptiontemplate.definition.fielddata;
public class LabelAndMultiplicityFieldDataFileTransformerModel extends BaseFieldDataFileTransformerModel {
private Boolean multiAutoComplete;
public Boolean getMultiAutoComplete() {
return multiAutoComplete;
}
public void setMultiAutoComplete(Boolean multiAutoComplete) {
this.multiAutoComplete = multiAutoComplete;
}
}

View File

@ -0,0 +1,4 @@
package eu.eudat.file.transformer.models.descriptiontemplate.definition.fielddata;
public class LabelDataFileTransformerModel extends BaseFieldDataFileTransformerModel {
}

View File

@ -1,5 +0,0 @@
package eu.eudat.file.transformer.models.descriptiontemplate.definition.fielddata;
public class LabelFieldDataFileTransformerModel extends BaseFieldDataFileTransformerModel {
}

View File

@ -1,17 +1,36 @@
package eu.eudat.file.transformer.models.descriptiontemplate.definition.fielddata; package eu.eudat.file.transformer.models.descriptiontemplate.definition.fielddata;
import java.util.List; import java.util.List;
public class RadioBoxDataFileTransformerModel extends BaseFieldDataFileTransformerModel { public class RadioBoxDataFileTransformerModel extends BaseFieldDataFileTransformerModel {
public static class RadioBoxDataOptionFileTransformerModel {
private String label;
private String value;
private List<RadioBoxOptionFileTransformerModel> options; public String getLabel() {
return label;
}
public List<RadioBoxOptionFileTransformerModel> getOptions() { public void setLabel(String label) {
this.label = label;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
private List<RadioBoxDataOptionFileTransformerModel> options;
public List<RadioBoxDataOptionFileTransformerModel> getOptions() {
return options; return options;
} }
public void setOptions(List<RadioBoxOptionFileTransformerModel> options) { public void setOptions(List<RadioBoxDataOptionFileTransformerModel> options) {
this.options = options; this.options = options;
} }
} }

View File

@ -1,22 +0,0 @@
package eu.eudat.file.transformer.models.descriptiontemplate.definition.fielddata;
public class RadioBoxOptionFileTransformerModel {
private String label;
private String value;
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

View File

@ -0,0 +1,35 @@
package eu.eudat.file.transformer.models.descriptiontemplate.definition.fielddata;
import java.util.List;
public class SelectDataFileTransformerModel extends LabelAndMultiplicityDataFileTransformerModel {
private List<OptionFileTransformerModel> options;
public List<OptionFileTransformerModel> getOptions() {
return options;
}
public void setOptions(List<OptionFileTransformerModel> optionEntities) {
this.options = optionEntities;
}
public static class OptionFileTransformerModel {
private String label;
private String value;
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
}

View File

@ -1,21 +1,43 @@
package eu.eudat.file.transformer.models.descriptiontemplate.definition.fielddata; package eu.eudat.file.transformer.models.descriptiontemplate.definition.fielddata;
import java.util.List; import java.util.List;
public class UploadDataFileTransformerModel extends BaseFieldDataFileTransformerModel {
private List<UploadOptionFileTransformerModel> types;
public List<UploadOptionFileTransformerModel> getTypes() { public class UploadDataFileTransformerModel extends BaseFieldDataFileTransformerModel {
public static class UploadDataOptionFileTransformerModel {
private String label;
private String value;
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
private List<UploadDataOptionFileTransformerModel> types;
private Integer maxFileSizeInMB;
public List<UploadDataOptionFileTransformerModel> getTypes() {
return types; return types;
} }
public void setTypes(List<UploadOptionFileTransformerModel> types) { public void setTypes(List<UploadDataOptionFileTransformerModel> types) {
this.types = types; this.types = types;
} }
private Integer maxFileSizeInMB;
public Integer getMaxFileSizeInMB() { public Integer getMaxFileSizeInMB() {
return maxFileSizeInMB; return maxFileSizeInMB;
} }
@ -23,7 +45,4 @@ public class UploadDataFileTransformerModel extends BaseFieldDataFileTransformer
public void setMaxFileSizeInMB(Integer maxFileSizeInMB) { public void setMaxFileSizeInMB(Integer maxFileSizeInMB) {
this.maxFileSizeInMB = maxFileSizeInMB; this.maxFileSizeInMB = maxFileSizeInMB;
} }
} }

View File

@ -1,22 +0,0 @@
package eu.eudat.file.transformer.models.descriptiontemplate.definition.fielddata;
public class UploadOptionFileTransformerModel {
private String label;
private String value;
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

View File

@ -1,24 +0,0 @@
package eu.eudat.file.transformer.models.descriptiontemplate.definition.fielddata;
import java.util.List;
public class WordListDataFileTransformerModel extends BaseFieldDataFileTransformerModel {
private List<ComboBoxOptionFileTransformerModel> options;
private Boolean multiList;
public List<ComboBoxOptionFileTransformerModel> getOptions() {
return options;
}
public void setOptions(List<ComboBoxOptionFileTransformerModel> options) {
this.options = options;
}
public Boolean getMultiList() {
return multiList;
}
public void setMultiList(Boolean multiList) {
this.multiList = multiList;
}
}