no message
This commit is contained in:
parent
5377b1db18
commit
59c425a240
|
@ -7,7 +7,7 @@ import java.util.Map;
|
|||
|
||||
public enum FieldType implements DatabaseEnum<String> {
|
||||
AUTO_COMPLETE(Names.Autocomplete),
|
||||
WORD_LIST(Names.Wordlist),
|
||||
SELECT(Names.Select),
|
||||
BOOLEAN_DECISION(Names.BooleanDecision),
|
||||
RADIO_BOX(Names.RadioBox),
|
||||
INTERNAL_DMP_ENTRIES_RESEARCHERS(Names.InternalDmpResearchers),
|
||||
|
@ -39,7 +39,7 @@ public enum FieldType implements DatabaseEnum<String> {
|
|||
public static class Names {
|
||||
public static final String ComboBox = "combobox";
|
||||
public static final String Autocomplete = "autocomplete";
|
||||
public static final String Wordlist = "wordlist";
|
||||
public static final String Select = "wordlist";
|
||||
public static final String BooleanDecision = "booleanDecision";
|
||||
public static final String RadioBox = "radiobox";
|
||||
public static final String InternalDmpEntities = "internalDmpEntities";
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate;
|
||||
|
||||
import eu.eudat.commons.enums.FieldValidationType;
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import eu.eudat.commons.types.common.DatabaseViewStyleDefinition;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.*;
|
||||
import jakarta.xml.bind.annotation.*;
|
||||
|
@ -31,8 +30,8 @@ public class FieldEntity implements DatabaseViewStyleDefinition {
|
|||
@XmlElement(name = "externalDatasetsData", type = ExternalDatasetDataEntity.class),
|
||||
@XmlElement(name = "uploadData", type = UploadDataEntity.class),
|
||||
@XmlElement(name = "radioBoxData", type = RadioBoxDataEntity.class),
|
||||
@XmlElement(name = "wordListData", type = WordListDataEntity.class),
|
||||
@XmlElement(name = "autocompleteData", type = AutoCompleteDataEntity.class),
|
||||
@XmlElement(name = "wordListData", type = SelectDataEntity.class),
|
||||
@XmlElement(name = "autocompleteData", type = ExternalSelectDataEntity.class),
|
||||
})
|
||||
private BaseFieldDataEntity<?> data;
|
||||
@XmlElementWrapper(name = "validations")
|
||||
|
|
|
@ -7,7 +7,7 @@ import jakarta.xml.bind.annotation.XmlAttribute;
|
|||
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public abstract class BaseFieldDataEntity<T> {
|
||||
public abstract class BaseFieldDataEntity {
|
||||
|
||||
@XmlAttribute(name = "label")
|
||||
private String label;
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public abstract class ComboBoxDataEntity<T> extends BaseFieldDataEntity<T> {
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public static class Option {
|
||||
@XmlAttribute(name="label")
|
||||
private String label;
|
||||
@XmlAttribute(name="value")
|
||||
private String value;
|
||||
@XmlAttribute(name="source")
|
||||
private String source;
|
||||
@XmlAttribute(name="uri")
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -12,20 +12,10 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class ExternalDatasetDataEntity extends BaseFieldDataEntity<ExternalDatasetDataEntity> {
|
||||
@XmlAttribute(name="multiAutoComplete")
|
||||
private Boolean multiAutoComplete;
|
||||
public class ExternalDatasetDataEntity extends LabelAndMultiplicityDataEntity {
|
||||
@XmlAttribute(name="type")
|
||||
private FieldDataExternalDatasetType type;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
public FieldDataExternalDatasetType getType() {
|
||||
return type;
|
||||
}
|
||||
|
|
|
@ -10,11 +10,11 @@ import java.util.Map;
|
|||
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class AutoCompleteDataEntity extends ComboBoxDataEntity<AutoCompleteDataEntity> {
|
||||
public class ExternalSelectDataEntity extends LabelAndMultiplicityDataEntity {
|
||||
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public static class AuthAutoCompleteData {
|
||||
public static class ExternalSelectAuthDataEntity {
|
||||
@XmlAttribute(name="url")
|
||||
private String url;
|
||||
@XmlAttribute(name="method")
|
||||
|
@ -68,29 +68,50 @@ public class AutoCompleteDataEntity extends ComboBoxDataEntity<AutoCompleteDataE
|
|||
}
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public static class AutoCompleteSingleData {
|
||||
@XmlAttribute(name="autocompleteType")
|
||||
private AutocompleteType autocompleteType;
|
||||
public static class ExternalSelectSourceBindingEntity {
|
||||
@XmlAttribute(name="label")
|
||||
private String label;
|
||||
@XmlAttribute(name="value")
|
||||
private String value;
|
||||
@XmlAttribute(name="source")
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public static class ExternalSelectSourceEntity {
|
||||
@XmlAttribute(name="url")
|
||||
private String url;
|
||||
@XmlElement(name="option")
|
||||
private ComboBoxDataEntity.Option autoCompleteOptions;
|
||||
@XmlAttribute(name="method")
|
||||
private String method;
|
||||
@XmlAttribute(name="optionsRoot")
|
||||
private String optionsRoot;
|
||||
@XmlElement(name="option")
|
||||
private ExternalSelectSourceBindingEntity externalSelectSourceBindingEntity;
|
||||
@XmlAttribute(name="hasAuth")
|
||||
private Boolean hasAuth;
|
||||
@XmlElement(name="auth")
|
||||
private AuthAutoCompleteData auth;
|
||||
@XmlAttribute(name="method")
|
||||
private String method;
|
||||
|
||||
public AutocompleteType getAutocompleteType() {
|
||||
return autocompleteType;
|
||||
}
|
||||
|
||||
public void setAutocompleteType(AutocompleteType autocompleteType) {
|
||||
this.autocompleteType = autocompleteType;
|
||||
}
|
||||
private ExternalSelectAuthDataEntity auth;
|
||||
|
||||
public String getOptionsRoot() {
|
||||
return optionsRoot;
|
||||
|
@ -114,19 +135,19 @@ public class AutoCompleteDataEntity extends ComboBoxDataEntity<AutoCompleteDataE
|
|||
this.hasAuth = hasAuth;
|
||||
}
|
||||
|
||||
public AuthAutoCompleteData getAuth() {
|
||||
public ExternalSelectAuthDataEntity getAuth() {
|
||||
return auth;
|
||||
}
|
||||
|
||||
public void setAuth(AuthAutoCompleteData auth) {
|
||||
public void setAuth(ExternalSelectAuthDataEntity auth) {
|
||||
this.auth = auth;
|
||||
}
|
||||
|
||||
public ComboBoxDataEntity.Option getAutoCompleteOptions() {
|
||||
return autoCompleteOptions;
|
||||
public ExternalSelectSourceBindingEntity getExternalSelectSourceBindingEntity() {
|
||||
return externalSelectSourceBindingEntity;
|
||||
}
|
||||
public void setAutoCompleteOptions(ComboBoxDataEntity.Option autoCompleteOptions) {
|
||||
this.autoCompleteOptions = autoCompleteOptions;
|
||||
public void setExternalSelectSourceBindingEntity(ExternalSelectSourceBindingEntity externalSelectSourceBindingEntity) {
|
||||
this.externalSelectSourceBindingEntity = externalSelectSourceBindingEntity;
|
||||
}
|
||||
|
||||
public String getMethod() {
|
||||
|
@ -138,48 +159,16 @@ public class AutoCompleteDataEntity extends ComboBoxDataEntity<AutoCompleteDataE
|
|||
}
|
||||
}
|
||||
|
||||
@XmlAttribute(name="multiAutoComplete")
|
||||
private Boolean multiAutoComplete;
|
||||
@XmlElementWrapper(name = "autoCompleteSingleDataList")
|
||||
@XmlElement(name = "autoCompleteSingleData")
|
||||
private List<AutoCompleteSingleData> autoCompleteSingleDataList;
|
||||
private List<ExternalSelectSourceEntity> sources;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
public List<ExternalSelectSourceEntity> getAutoCompleteSingleDataList() {
|
||||
return sources;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
public List<AutoCompleteSingleData> getAutoCompleteSingleDataList() {
|
||||
return autoCompleteSingleDataList;
|
||||
}
|
||||
|
||||
public void setAutoCompleteSingleDataList(List<AutoCompleteSingleData> autoCompleteSingleDataList) {
|
||||
this.autoCompleteSingleDataList = autoCompleteSingleDataList;
|
||||
}
|
||||
|
||||
public enum AutocompleteType implements DatabaseEnum<Integer> {
|
||||
UNCACHED(0),
|
||||
CACHED(1);
|
||||
|
||||
private final int value;
|
||||
|
||||
AutocompleteType(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Integer, AutocompleteType> map = EnumUtils.getEnumValueMap(AutocompleteType.class);
|
||||
|
||||
public static AutocompleteType of(int i) {
|
||||
return map.get(i);
|
||||
}
|
||||
public void setAutoCompleteSingleDataList(List<ExternalSelectSourceEntity> externalSelectSourceEntityList) {
|
||||
this.sources = externalSelectSourceEntityList;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,23 +1,20 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class LabelAndMultiplicityDataEntity extends BaseFieldDataEntity<LabelAndMultiplicityDataEntity> {
|
||||
public class LabelAndMultiplicityDataEntity extends BaseFieldDataEntity {
|
||||
|
||||
@XmlAttribute(name = "multiAutoComplete")
|
||||
private Boolean multiAutoComplete;
|
||||
@XmlAttribute(name = "multipleSelect")
|
||||
private Boolean multipleSelect;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
public Boolean getMultipleSelect() {
|
||||
return multipleSelect;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
public void setMultipleSelect(Boolean multipleSelect) {
|
||||
this.multipleSelect = multipleSelect;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,5 +5,5 @@ import jakarta.xml.bind.annotation.XmlAccessorType;
|
|||
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class LabelDataEntity extends BaseFieldDataEntity<LabelDataEntity> {
|
||||
public class LabelDataEntity extends BaseFieldDataEntity {
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import jakarta.xml.bind.annotation.*;
|
|||
import java.util.List;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class RadioBoxDataEntity extends BaseFieldDataEntity<RadioBoxDataEntity> {
|
||||
public class RadioBoxDataEntity extends BaseFieldDataEntity {
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public static class RadioBoxDataOptionEntity {
|
||||
@XmlAttribute(name="label")
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class SelectDataEntity extends LabelAndMultiplicityDataEntity {
|
||||
@XmlElementWrapper(name = "options")
|
||||
@XmlElement(name = "options")
|
||||
private List<OptionEntity> options;
|
||||
|
||||
public List<OptionEntity> getOptions() {
|
||||
return options;
|
||||
}
|
||||
|
||||
public void setOptions(List<OptionEntity> optionEntities) {
|
||||
this.options = optionEntities;
|
||||
}
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public static class OptionEntity {
|
||||
@XmlAttribute(name="label")
|
||||
private String label;
|
||||
@XmlAttribute(name="value")
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@ import java.util.List;
|
|||
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class UploadDataEntity extends BaseFieldDataEntity<UploadDataEntity> {
|
||||
public class UploadDataEntity extends BaseFieldDataEntity {
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public static class UploadDataOptionEntity {
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class WordListDataEntity extends ComboBoxDataEntity<WordListDataEntity> {
|
||||
@XmlElementWrapper(name = "options")
|
||||
@XmlElement(name = "options")
|
||||
private List<Option> options;
|
||||
|
||||
@XmlAttribute(name="multiList")
|
||||
private Boolean multiList;
|
||||
|
||||
public List<Option> getOptions() {
|
||||
return options;
|
||||
}
|
||||
|
||||
public void setOptions(List<Option> options) {
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
public Boolean getMultiList() {
|
||||
return multiList;
|
||||
}
|
||||
|
||||
public void setMultiList(Boolean multiList) {
|
||||
this.multiList = multiList;
|
||||
}
|
||||
}
|
|
@ -2,7 +2,6 @@ package eu.eudat.commons.types.descriptiontemplate.importexport;
|
|||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import eu.eudat.commons.enums.FieldValidationType;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.*;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.*;
|
||||
import jakarta.xml.bind.annotation.*;
|
||||
|
||||
|
@ -40,7 +39,7 @@ public class FieldImportExport {
|
|||
@XmlElement(name = "externalDatasetsData", type = ExternalDatasetDataImportExport.class),
|
||||
@XmlElement(name = "uploadData", type = UploadDataImportExport.class),
|
||||
@XmlElement(name = "radioBoxData", type = RadioBoxDataImportExport.class),
|
||||
@XmlElement(name = "wordListData", type = WordListDataImportExport.class),
|
||||
@XmlElement(name = "wordListData", type = SelectDataImportExport.class),
|
||||
@XmlElement(name = "autocompleteData", type = AutoCompleteDataImportExport.class),
|
||||
})
|
||||
private BaseFieldDataImportExport data;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ExternalSelectDataEntity;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
@ -8,7 +9,7 @@ import jakarta.xml.bind.annotation.XmlElement;
|
|||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class AutoCompleteSingleData {
|
||||
@XmlAttribute(name = "autocompleteType")
|
||||
private eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity.AutocompleteType autocompleteType;
|
||||
private ExternalSelectDataEntity.AutocompleteType autocompleteType;
|
||||
@XmlAttribute(name = "url")
|
||||
private String url;
|
||||
@XmlElement(name = "autoCompleteOptions")
|
||||
|
@ -22,11 +23,11 @@ public class AutoCompleteSingleData {
|
|||
@XmlAttribute(name = "method")
|
||||
private String method;
|
||||
|
||||
public eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity.AutocompleteType getAutocompleteType() {
|
||||
public ExternalSelectDataEntity.AutocompleteType getAutocompleteType() {
|
||||
return autocompleteType;
|
||||
}
|
||||
|
||||
public void setAutocompleteType(eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity.AutocompleteType autocompleteType) {
|
||||
public void setAutocompleteType(ExternalSelectDataEntity.AutocompleteType autocompleteType) {
|
||||
this.autocompleteType = autocompleteType;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import jakarta.xml.bind.annotation.*;
|
|||
import java.util.List;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class WordListDataImportExport extends BaseFieldDataImportExport {
|
||||
public class SelectDataImportExport extends BaseFieldDataImportExport {
|
||||
@XmlElementWrapper(name = "options")
|
||||
@XmlElement(name = "options")
|
||||
private List<ComboBoxDataOptionEntity> options;
|
|
@ -78,7 +78,7 @@ public class DescriptionFieldDepositBuilder extends BaseDepositBuilder<Descripti
|
|||
|
||||
switch (field.getData().getFieldType()) {
|
||||
case AUTO_COMPLETE -> m.setFieldType(FieldType.AUTO_COMPLETE);
|
||||
case WORD_LIST -> m.setFieldType(FieldType.WORD_LIST);
|
||||
case SELECT -> m.setFieldType(FieldType.WORD_LIST);
|
||||
case BOOLEAN_DECISION -> m.setFieldType(FieldType.BOOLEAN_DECISION);
|
||||
case RADIO_BOX -> m.setFieldType(FieldType.RADIO_BOX);
|
||||
case INTERNAL_DMP_ENTRIES_RESEARCHERS -> m.setFieldType(FieldType.INTERNAL_DMP_ENTRIES_RESEARCHERS);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package eu.eudat.model.builder.descriptiontemplatedefinition.fielddata;
|
||||
|
||||
import eu.eudat.authorization.AuthorizationFlags;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ExternalSelectDataEntity;
|
||||
import eu.eudat.convention.ConventionService;
|
||||
import eu.eudat.model.builder.BaseBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.AuthAutoCompleteData;
|
||||
|
@ -19,7 +19,7 @@ import java.util.*;
|
|||
|
||||
@Component
|
||||
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||
public class AuthAutoCompleteDataBuilder extends BaseBuilder<AuthAutoCompleteData, AutoCompleteDataEntity.AuthAutoCompleteData> {
|
||||
public class AuthAutoCompleteDataBuilder extends BaseBuilder<AuthAutoCompleteData, ExternalSelectDataEntity.ExternalSelectAuthDataEntity> {
|
||||
|
||||
private EnumSet<AuthorizationFlags> authorize = EnumSet.of(AuthorizationFlags.None);
|
||||
|
||||
|
@ -35,14 +35,14 @@ public class AuthAutoCompleteDataBuilder extends BaseBuilder<AuthAutoCompleteDat
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<AuthAutoCompleteData> build(FieldSet fields, List<AutoCompleteDataEntity.AuthAutoCompleteData> data) throws MyApplicationException {
|
||||
public List<AuthAutoCompleteData> build(FieldSet fields, List<ExternalSelectDataEntity.ExternalSelectAuthDataEntity> data) throws MyApplicationException {
|
||||
this.logger.debug("building for {} items requesting {} fields", Optional.ofNullable(data).map(List::size).orElse(0), Optional.ofNullable(fields).map(FieldSet::getFields).map(Set::size).orElse(0));
|
||||
this.logger.trace(new DataLogEntry("requested fields", fields));
|
||||
if (fields == null || data == null || fields.isEmpty())
|
||||
return new ArrayList<>();
|
||||
|
||||
List<AuthAutoCompleteData> models = new ArrayList<>();
|
||||
for (AutoCompleteDataEntity.AuthAutoCompleteData d : data) {
|
||||
for (ExternalSelectDataEntity.ExternalSelectAuthDataEntity d : data) {
|
||||
AuthAutoCompleteData m = new AuthAutoCompleteData();
|
||||
if (fields.hasField(this.asIndexer(AuthAutoCompleteData._url))) m.setUrl(d.getUrl());
|
||||
if (fields.hasField(this.asIndexer(AuthAutoCompleteData._method))) m.setMethod(d.getMethod());
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package eu.eudat.model.builder.descriptiontemplatedefinition.fielddata;
|
||||
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ExternalSelectDataEntity;
|
||||
import eu.eudat.convention.ConventionService;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.AutoCompleteData;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
|
@ -14,7 +14,7 @@ import org.springframework.stereotype.Component;
|
|||
|
||||
@Component
|
||||
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||
public class AutoCompleteDataBuilder extends BaseFieldDataBuilder<AutoCompleteData, AutoCompleteDataEntity> {
|
||||
public class AutoCompleteDataBuilder extends BaseFieldDataBuilder<AutoCompleteData, ExternalSelectDataEntity> {
|
||||
private final BuilderFactory builderFactory;
|
||||
@Autowired
|
||||
public AutoCompleteDataBuilder(ConventionService conventionService, BuilderFactory builderFactory) {
|
||||
|
@ -28,9 +28,9 @@ public class AutoCompleteDataBuilder extends BaseFieldDataBuilder<AutoCompleteDa
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void buildChild(FieldSet fields, AutoCompleteDataEntity d, AutoCompleteData m) {
|
||||
protected void buildChild(FieldSet fields, ExternalSelectDataEntity d, AutoCompleteData m) {
|
||||
FieldSet autoCompleteSingleDataListFields = fields.extractPrefixed(this.asPrefix(AutoCompleteData._autoCompleteSingleDataList));
|
||||
if (fields.hasField(this.asIndexer(AutoCompleteData._multiAutoComplete))) m.setMultiAutoComplete(d.getMultiAutoComplete());
|
||||
if (fields.hasField(this.asIndexer(AutoCompleteData._multiAutoComplete))) m.setMultiAutoComplete(d.getMultipleSelect());
|
||||
if (!autoCompleteSingleDataListFields.isEmpty() && d.getAutoCompleteSingleDataList() != null) m.setAutoCompleteSingleDataList(this.builderFactory.builder(AutoCompleteSingleDataBuilder.class).authorize(this.authorize).build(autoCompleteSingleDataListFields, d.getAutoCompleteSingleDataList()));
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package eu.eudat.model.builder.descriptiontemplatedefinition.fielddata;
|
||||
|
||||
import eu.eudat.authorization.AuthorizationFlags;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ExternalSelectDataEntity;
|
||||
import eu.eudat.convention.ConventionService;
|
||||
import eu.eudat.model.builder.BaseBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.AutoCompleteSingleData;
|
||||
|
@ -20,7 +20,7 @@ import java.util.*;
|
|||
|
||||
@Component
|
||||
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||
public class AutoCompleteSingleDataBuilder extends BaseBuilder<AutoCompleteSingleData, AutoCompleteDataEntity.AutoCompleteSingleData> {
|
||||
public class AutoCompleteSingleDataBuilder extends BaseBuilder<AutoCompleteSingleData, ExternalSelectDataEntity.ExternalSelectSourceEntity> {
|
||||
|
||||
private EnumSet<AuthorizationFlags> authorize = EnumSet.of(AuthorizationFlags.None);
|
||||
private final BuilderFactory builderFactory;
|
||||
|
@ -38,7 +38,7 @@ public class AutoCompleteSingleDataBuilder extends BaseBuilder<AutoCompleteSingl
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<AutoCompleteSingleData> build(FieldSet fields, List<AutoCompleteDataEntity.AutoCompleteSingleData> data) throws MyApplicationException {
|
||||
public List<AutoCompleteSingleData> build(FieldSet fields, List<ExternalSelectDataEntity.ExternalSelectSourceEntity> data) throws MyApplicationException {
|
||||
this.logger.debug("building for {} items requesting {} fields", Optional.ofNullable(data).map(List::size).orElse(0), Optional.ofNullable(fields).map(FieldSet::getFields).map(Set::size).orElse(0));
|
||||
this.logger.trace(new DataLogEntry("requested fields", fields));
|
||||
if (fields == null || data == null || fields.isEmpty())
|
||||
|
@ -47,14 +47,14 @@ public class AutoCompleteSingleDataBuilder extends BaseBuilder<AutoCompleteSingl
|
|||
FieldSet autoCompleteOptionsFields = fields.extractPrefixed(this.asPrefix(AutoCompleteSingleData._autoCompleteOptions));
|
||||
FieldSet authFields = fields.extractPrefixed(this.asPrefix(AutoCompleteSingleData._auth));
|
||||
List<AutoCompleteSingleData> models = new ArrayList<>();
|
||||
for (AutoCompleteDataEntity.AutoCompleteSingleData d : data) {
|
||||
for (ExternalSelectDataEntity.ExternalSelectSourceEntity d : data) {
|
||||
AutoCompleteSingleData m = new AutoCompleteSingleData();
|
||||
if (fields.hasField(this.asIndexer(AutoCompleteSingleData._autocompleteType))) m.setAutocompleteType(d.getAutocompleteType());
|
||||
if (fields.hasField(this.asIndexer(AutoCompleteSingleData._url))) m.setUrl(d.getUrl());
|
||||
if (fields.hasField(this.asIndexer(AutoCompleteSingleData._optionsRoot))) m.setOptionsRoot(d.getOptionsRoot());
|
||||
if (fields.hasField(this.asIndexer(AutoCompleteSingleData._hasAuth))) m.setHasAuth(d.getHasAuth());
|
||||
if (fields.hasField(this.asIndexer(AutoCompleteSingleData._method))) m.setMethod(d.getMethod());
|
||||
if (!autoCompleteOptionsFields.isEmpty() && d.getAutoCompleteOptions() != null) m.setAutoCompleteOptions(this.builderFactory.builder(ComboBoxOptionBuilder.class).authorize(this.authorize).build(autoCompleteOptionsFields, d.getAutoCompleteOptions()));
|
||||
if (!autoCompleteOptionsFields.isEmpty() && d.getExternalSelectSourceBindingEntity() != null) m.setAutoCompleteOptions(this.builderFactory.builder(ComboBoxOptionBuilder.class).authorize(this.authorize).build(autoCompleteOptionsFields, d.getExternalSelectSourceBindingEntity()));
|
||||
if (!authFields.isEmpty() && d.getAuth() != null) m.setAuth(this.builderFactory.builder(AuthAutoCompleteDataBuilder.class).authorize(this.authorize).build(authFields, d.getAuth()));
|
||||
models.add(m);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package eu.eudat.model.builder.descriptiontemplatedefinition.fielddata;
|
||||
|
||||
import eu.eudat.authorization.AuthorizationFlags;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ComboBoxDataEntity;
|
||||
import eu.eudat.convention.ConventionService;
|
||||
import eu.eudat.model.builder.BaseBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.ComboBoxOption;
|
||||
|
|
|
@ -25,7 +25,7 @@ public class ExternalDatasetDataBuilder extends BaseFieldDataBuilder<ExternalDat
|
|||
}
|
||||
@Override
|
||||
protected void buildChild(FieldSet fields, ExternalDatasetDataEntity d, ExternalDatasetData m) {
|
||||
if (fields.hasField(this.asIndexer(ExternalDatasetData._multiAutoComplete))) m.setMultiAutoComplete(d.getMultiAutoComplete());
|
||||
if (fields.hasField(this.asIndexer(ExternalDatasetData._multiAutoComplete))) m.setMultiAutoComplete(d.getMultipleSelect());
|
||||
if (fields.hasField(this.asIndexer(ExternalDatasetData._type))) m.setType(d.getType());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,6 @@ public class LabelAndMultiplicityDataBuilder extends BaseFieldDataBuilder<LabelA
|
|||
}
|
||||
@Override
|
||||
protected void buildChild(FieldSet fields, LabelAndMultiplicityDataEntity d, LabelAndMultiplicityData m) {
|
||||
if (fields.hasField(this.asIndexer(LabelAndMultiplicityData._multiAutoComplete))) m.setMultiAutoComplete(d.getMultiAutoComplete());
|
||||
if (fields.hasField(this.asIndexer(LabelAndMultiplicityData._multiAutoComplete))) m.setMultiAutoComplete(d.getMultipleSelect());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package eu.eudat.model.builder.descriptiontemplatedefinition.fielddata;
|
||||
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.WordListDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.SelectDataEntity;
|
||||
import eu.eudat.convention.ConventionService;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.WordListData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.SelectData;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import gr.cite.tools.logging.LoggerService;
|
||||
|
@ -14,23 +14,23 @@ import org.springframework.stereotype.Component;
|
|||
|
||||
@Component
|
||||
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||
public class WordListDataBuilder extends BaseFieldDataBuilder<WordListData, WordListDataEntity> {
|
||||
public class SelectDataBuilder extends BaseFieldDataBuilder<SelectData, SelectDataEntity> {
|
||||
private final BuilderFactory builderFactory;
|
||||
@Autowired
|
||||
public WordListDataBuilder(ConventionService conventionService, BuilderFactory builderFactory) {
|
||||
super(conventionService, new LoggerService(LoggerFactory.getLogger(WordListDataBuilder.class)));
|
||||
public SelectDataBuilder(ConventionService conventionService, BuilderFactory builderFactory) {
|
||||
super(conventionService, new LoggerService(LoggerFactory.getLogger(SelectDataBuilder.class)));
|
||||
this.builderFactory = builderFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected WordListData getInstance() {
|
||||
return new WordListData();
|
||||
protected SelectData getInstance() {
|
||||
return new SelectData();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void buildChild(FieldSet fields, WordListDataEntity d, WordListData m) {
|
||||
FieldSet optionsFields = fields.extractPrefixed(this.asPrefix(WordListData._options));
|
||||
if (fields.hasField(this.asIndexer(WordListData._multiList))) m.setMultiList(d.getMultiList());
|
||||
protected void buildChild(FieldSet fields, SelectDataEntity d, SelectData m) {
|
||||
FieldSet optionsFields = fields.extractPrefixed(this.asPrefix(SelectData._options));
|
||||
if (fields.hasField(this.asIndexer(SelectData._multiList))) m.setMultiList(d.getMultiList());
|
||||
if (!optionsFields.isEmpty() && d.getOptions() != null) m.setOptions(this.builderFactory.builder(ComboBoxOptionBuilder.class).authorize(this.authorize).build(optionsFields, d.getOptions()));
|
||||
|
||||
}
|
|
@ -156,11 +156,11 @@ public class DescriptionTemplateDefinitionFileTransformerBuilder extends BaseFil
|
|||
public BaseFieldDataFileTransformerModel convertData (BaseFieldDataEntity data) {
|
||||
BaseFieldDataFileTransformerModel m;
|
||||
switch (data) {
|
||||
case AutoCompleteDataEntity d -> {
|
||||
case ExternalSelectDataEntity d -> {
|
||||
m = new AutoCompleteDataFileTransformerModel();
|
||||
m.setLabel(d.getLabel());
|
||||
m.setFieldType(FieldType.of(d.getFieldType().getValue()));
|
||||
((AutoCompleteDataFileTransformerModel)m).setMultiAutoComplete(d.getMultiAutoComplete());
|
||||
((AutoCompleteDataFileTransformerModel)m).setMultiAutoComplete(d.getMultipleSelect());
|
||||
((AutoCompleteDataFileTransformerModel) m).setAutoCompleteSingleDataList(convertAutoCompleteSingleData(d.getAutoCompleteSingleDataList()));
|
||||
}
|
||||
case ExternalDatasetDataEntity d -> {
|
||||
|
@ -182,7 +182,7 @@ public class DescriptionTemplateDefinitionFileTransformerBuilder extends BaseFil
|
|||
((UploadDataFileTransformerModel) m).setMaxFileSizeInMB(d.getMaxFileSizeInMB());
|
||||
((UploadDataFileTransformerModel) m).setTypes(convertUploadDataOptions(d.getTypes()));
|
||||
}
|
||||
case WordListDataEntity d -> {
|
||||
case SelectDataEntity d -> {
|
||||
m = new WordListDataFileTransformerModel();
|
||||
m.setLabel(d.getLabel());
|
||||
m.setFieldType(FieldType.of(d.getFieldType().getValue()));
|
||||
|
@ -205,12 +205,12 @@ public class DescriptionTemplateDefinitionFileTransformerBuilder extends BaseFil
|
|||
return result;
|
||||
}
|
||||
|
||||
private List<AutoCompleteSingleDataFileTransformerModel> convertAutoCompleteSingleData(List<AutoCompleteDataEntity.AutoCompleteSingleData> data) {
|
||||
private List<AutoCompleteSingleDataFileTransformerModel> convertAutoCompleteSingleData(List<ExternalSelectDataEntity.ExternalSelectSourceEntity> data) {
|
||||
List<AutoCompleteSingleDataFileTransformerModel> result = new ArrayList<>();
|
||||
for (AutoCompleteDataEntity.AutoCompleteSingleData d : data) {
|
||||
for (ExternalSelectDataEntity.ExternalSelectSourceEntity d : data) {
|
||||
AutoCompleteSingleDataFileTransformerModel m = new AutoCompleteSingleDataFileTransformerModel();
|
||||
m.setUrl(d.getUrl());
|
||||
m.setAutoCompleteOptions(convertComboBoxOption(d.getAutoCompleteOptions()));
|
||||
m.setAutoCompleteOptions(convertComboBoxOption(d.getExternalSelectSourceBindingEntity()));
|
||||
result.add(m);
|
||||
}
|
||||
return result;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package eu.eudat.model.descriptiontemplatedefinition.fielddata;
|
||||
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ExternalSelectDataEntity;
|
||||
|
||||
public class AutoCompleteSingleData {
|
||||
public final static String _autocompleteType = "autocompleteType";
|
||||
private AutoCompleteDataEntity.AutocompleteType autocompleteType;
|
||||
private ExternalSelectDataEntity.AutocompleteType autocompleteType;
|
||||
public final static String _url = "url";
|
||||
private String url;
|
||||
public final static String _autoCompleteOptions = "autoCompleteOptions";
|
||||
|
@ -18,11 +18,11 @@ public class AutoCompleteSingleData {
|
|||
public final static String _method = "method";
|
||||
private String method;
|
||||
|
||||
public AutoCompleteDataEntity.AutocompleteType getAutocompleteType() {
|
||||
public ExternalSelectDataEntity.AutocompleteType getAutocompleteType() {
|
||||
return autocompleteType;
|
||||
}
|
||||
|
||||
public void setAutocompleteType(AutoCompleteDataEntity.AutocompleteType autocompleteType) {
|
||||
public void setAutocompleteType(ExternalSelectDataEntity.AutocompleteType autocompleteType) {
|
||||
this.autocompleteType = autocompleteType;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package eu.eudat.model.descriptiontemplatedefinition.fielddata;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
public class WordListData extends BaseFieldData {
|
||||
public class SelectData extends BaseFieldData {
|
||||
public final static String _options = "options";
|
||||
private List<ComboBoxOption> options;
|
||||
public final static String _multiList = "multiList";
|
|
@ -1,6 +1,6 @@
|
|||
package eu.eudat.model.persist.descriptiontemplatedefinition.fielddata;
|
||||
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ExternalSelectDataEntity;
|
||||
import eu.eudat.commons.validation.BaseValidator;
|
||||
import gr.cite.tools.validation.ValidatorFactory;
|
||||
import gr.cite.tools.validation.specification.Specification;
|
||||
|
@ -17,7 +17,7 @@ import java.util.List;
|
|||
|
||||
public class AutoCompleteSingleDataPersist {
|
||||
|
||||
private AutoCompleteDataEntity.AutocompleteType autocompleteType;
|
||||
private ExternalSelectDataEntity.AutocompleteType autocompleteType;
|
||||
|
||||
public static final String _autocompleteType = "autocompleteType";
|
||||
|
||||
|
@ -43,11 +43,11 @@ public class AutoCompleteSingleDataPersist {
|
|||
|
||||
public static final String _method = "method";
|
||||
|
||||
public AutoCompleteDataEntity.AutocompleteType getAutocompleteType() {
|
||||
public ExternalSelectDataEntity.AutocompleteType getAutocompleteType() {
|
||||
return autocompleteType;
|
||||
}
|
||||
|
||||
public void setAutocompleteType(AutoCompleteDataEntity.AutocompleteType autocompleteType) {
|
||||
public void setAutocompleteType(ExternalSelectDataEntity.AutocompleteType autocompleteType) {
|
||||
this.autocompleteType = autocompleteType;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ import java.util.List;
|
|||
@JsonSubTypes.Type(value = LabelDataPersist.class, name = FieldType.Names.Validation),
|
||||
@JsonSubTypes.Type(value = LabelDataPersist.class, name = FieldType.Names.DatasetIdentifier),
|
||||
@JsonSubTypes.Type(value = LabelDataPersist.class, name = FieldType.Names.Currency),
|
||||
@JsonSubTypes.Type(value = WordListDataPersist.class, name = FieldType.Names.Wordlist),
|
||||
@JsonSubTypes.Type(value = SelectDataPersist.class, name = FieldType.Names.Select),
|
||||
@JsonSubTypes.Type(value = LabelAndMultiplicityDataPersist.class, name = FieldType.Names.DataRepositories),
|
||||
@JsonSubTypes.Type(value = LabelAndMultiplicityDataPersist.class, name = FieldType.Names.JournalRepositories),
|
||||
@JsonSubTypes.Type(value = LabelAndMultiplicityDataPersist.class, name = FieldType.Names.Publications),
|
||||
|
|
|
@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class WordListDataPersist extends BaseFieldDataPersist {
|
||||
public class SelectDataPersist extends BaseFieldDataPersist {
|
||||
|
||||
private List<ComboBoxOptionPersist> options = null;
|
||||
|
||||
|
@ -39,38 +39,38 @@ public class WordListDataPersist extends BaseFieldDataPersist {
|
|||
this.multiList = multiList;
|
||||
}
|
||||
|
||||
@Component(WordListDataPersistValidator.ValidatorName)
|
||||
@Component(SelectDataPersistValidator.ValidatorName)
|
||||
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||
public static class WordListDataPersistValidator extends BaseFieldDataPersistValidator<WordListDataPersist> {
|
||||
public static class SelectDataPersistValidator extends BaseFieldDataPersistValidator<SelectDataPersist> {
|
||||
|
||||
public static final String ValidatorName = "DescriptionTemplate.WordListDataPersistValidator";
|
||||
public static final String ValidatorName = "DescriptionTemplate.SelectDataPersistValidator";
|
||||
|
||||
private final ValidatorFactory validatorFactory;
|
||||
|
||||
protected WordListDataPersistValidator(ConventionService conventionService, ErrorThesaurusProperties errors, MessageSource messageSource, ValidatorFactory validatorFactory) {
|
||||
protected SelectDataPersistValidator(ConventionService conventionService, ErrorThesaurusProperties errors, MessageSource messageSource, ValidatorFactory validatorFactory) {
|
||||
super(conventionService, errors, messageSource);
|
||||
this.validatorFactory = validatorFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<WordListDataPersist> modelClass() {
|
||||
return WordListDataPersist.class;
|
||||
protected Class<SelectDataPersist> modelClass() {
|
||||
return SelectDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<Specification> specifications(WordListDataPersist item) {
|
||||
protected List<Specification> specifications(SelectDataPersist item) {
|
||||
List<Specification> specifications = getBaseSpecifications(item);
|
||||
specifications.addAll(Arrays.asList(
|
||||
this.spec()
|
||||
.must(() -> !this.isNull(item.getMultiList()))
|
||||
.failOn(WordListDataPersist._multiList).failWith(messageSource.getMessage("Validation_Required", new Object[]{WordListDataPersist._multiList}, LocaleContextHolder.getLocale())),
|
||||
.failOn(SelectDataPersist._multiList).failWith(messageSource.getMessage("Validation_Required", new Object[]{SelectDataPersist._multiList}, LocaleContextHolder.getLocale())),
|
||||
|
||||
this.spec()
|
||||
.must(() -> !this.isNull(item.getOptions()))
|
||||
.failOn(WordListDataPersist._options).failWith(messageSource.getMessage("Validation_Required", new Object[]{WordListDataPersist._options}, LocaleContextHolder.getLocale())),
|
||||
.failOn(SelectDataPersist._options).failWith(messageSource.getMessage("Validation_Required", new Object[]{SelectDataPersist._options}, LocaleContextHolder.getLocale())),
|
||||
this.navSpec()
|
||||
.iff(() -> !this.isNull(item.getOptions()))
|
||||
.on(WordListDataPersist._options)
|
||||
.on(SelectDataPersist._options)
|
||||
.over(item.getOptions())
|
||||
.using((itm) -> this.validatorFactory.validator(ComboBoxOptionPersist.ComboBoxOptionPersistValidator.class))
|
||||
));
|
|
@ -1,8 +1,7 @@
|
|||
package eu.eudat.service.fielddatahelper;
|
||||
|
||||
import eu.eudat.authorization.AuthorizationFlags;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ComboBoxDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ExternalSelectDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.*;
|
||||
import eu.eudat.convention.ConventionService;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.AutoCompleteDataBuilder;
|
||||
|
@ -20,7 +19,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class AutoCompleteFieldDataHelperService extends BaseFieldDataHelperService<AutoCompleteData, AutoCompleteDataPersist, AutoCompleteDataEntity, AutoCompleteDataImportExport> {
|
||||
public class AutoCompleteFieldDataHelperService extends BaseFieldDataHelperService<AutoCompleteData, AutoCompleteDataPersist, ExternalSelectDataEntity, AutoCompleteDataImportExport> {
|
||||
private final ConventionService conventionService;
|
||||
private final BuilderFactory builderFactory;
|
||||
private final ValidatorFactory validatorFactory;
|
||||
|
@ -33,8 +32,8 @@ public class AutoCompleteFieldDataHelperService extends BaseFieldDataHelperServi
|
|||
|
||||
|
||||
@Override
|
||||
public AutoCompleteDataEntity newDataInstanceInternal() {
|
||||
return new AutoCompleteDataEntity();
|
||||
public ExternalSelectDataEntity newDataInstanceInternal() {
|
||||
return new ExternalSelectDataEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -54,7 +53,7 @@ public class AutoCompleteFieldDataHelperService extends BaseFieldDataHelperServi
|
|||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return AutoCompleteDataEntity.class;
|
||||
return ExternalSelectDataEntity.class;
|
||||
}
|
||||
@Override
|
||||
public Class<?> getModelClass() {
|
||||
|
@ -76,13 +75,13 @@ public class AutoCompleteFieldDataHelperService extends BaseFieldDataHelperServi
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<AutoCompleteData> buildInternal(FieldSet fieldSet, List<AutoCompleteDataEntity> data, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
public List<AutoCompleteData> buildInternal(FieldSet fieldSet, List<ExternalSelectDataEntity> data, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(AutoCompleteDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AutoCompleteDataEntity applyPersistInternal(AutoCompleteDataPersist persist, AutoCompleteDataEntity data) {
|
||||
data.setMultiAutoComplete(persist.getMultiAutoComplete());
|
||||
protected ExternalSelectDataEntity applyPersistInternal(AutoCompleteDataPersist persist, ExternalSelectDataEntity data) {
|
||||
data.setMultipleSelect(persist.getMultiAutoComplete());
|
||||
if (!this.conventionService.isListNullOrEmpty(persist.getAutoCompleteSingleDataList())){
|
||||
data.setAutoCompleteSingleDataList(new ArrayList<>());
|
||||
for (AutoCompleteSingleDataPersist autoCompleteSingleDataPersist: persist.getAutoCompleteSingleDataList()) {
|
||||
|
@ -92,15 +91,15 @@ public class AutoCompleteFieldDataHelperService extends BaseFieldDataHelperServi
|
|||
return data;
|
||||
}
|
||||
|
||||
private @NotNull AutoCompleteDataEntity.AutoCompleteSingleData buildAutoCompleteSingleData(AutoCompleteSingleDataPersist persist){
|
||||
AutoCompleteDataEntity.AutoCompleteSingleData data = new AutoCompleteDataEntity.AutoCompleteSingleData();
|
||||
private @NotNull ExternalSelectDataEntity.ExternalSelectSourceEntity buildAutoCompleteSingleData(AutoCompleteSingleDataPersist persist){
|
||||
ExternalSelectDataEntity.ExternalSelectSourceEntity data = new ExternalSelectDataEntity.ExternalSelectSourceEntity();
|
||||
if (persist == null) return data;
|
||||
|
||||
data.setUrl(persist.getUrl());
|
||||
data.setAutocompleteType(persist.getAutocompleteType());
|
||||
data.setOptionsRoot(persist.getOptionsRoot());
|
||||
data.setHasAuth(persist.getHasAuth());
|
||||
if(persist.getAutoCompleteOptions() != null) data.setAutoCompleteOptions(this.buildOption(persist.getAutoCompleteOptions()));
|
||||
if(persist.getAutoCompleteOptions() != null) data.setExternalSelectSourceBindingEntity(this.buildOption(persist.getAutoCompleteOptions()));
|
||||
if(persist.getAuth() != null) data.setAuth(this.buildAuthAutoCompleteData(persist.getAuth()));
|
||||
data.setMethod(persist.getMethod());
|
||||
|
||||
|
@ -119,8 +118,8 @@ public class AutoCompleteFieldDataHelperService extends BaseFieldDataHelperServi
|
|||
return data;
|
||||
}
|
||||
|
||||
private @NotNull AutoCompleteDataEntity.AuthAutoCompleteData buildAuthAutoCompleteData(AuthAutoCompleteDataPersist persist){
|
||||
AutoCompleteDataEntity.AuthAutoCompleteData data = new AutoCompleteDataEntity.AuthAutoCompleteData();
|
||||
private @NotNull ExternalSelectDataEntity.ExternalSelectAuthDataEntity buildAuthAutoCompleteData(AuthAutoCompleteDataPersist persist){
|
||||
ExternalSelectDataEntity.ExternalSelectAuthDataEntity data = new ExternalSelectDataEntity.ExternalSelectAuthDataEntity();
|
||||
if (persist == null) return data;
|
||||
|
||||
data.setBody(persist.getBody());
|
||||
|
@ -185,23 +184,23 @@ public class AutoCompleteFieldDataHelperService extends BaseFieldDataHelperServi
|
|||
}
|
||||
|
||||
@Override
|
||||
protected AutoCompleteDataImportExport dataToImportExportXmlInternal(AutoCompleteDataEntity data, AutoCompleteDataImportExport xml) {
|
||||
xml.setMultiAutoComplete(data.getMultiAutoComplete());
|
||||
protected AutoCompleteDataImportExport dataToImportExportXmlInternal(ExternalSelectDataEntity data, AutoCompleteDataImportExport xml) {
|
||||
xml.setMultiAutoComplete(data.getMultipleSelect());
|
||||
if (!this.conventionService.isListNullOrEmpty(data.getAutoCompleteSingleDataList())){
|
||||
xml.setAutoCompleteSingleDataList(new ArrayList<>());
|
||||
for (AutoCompleteDataEntity.AutoCompleteSingleData autoCompleteSingleData: data.getAutoCompleteSingleDataList()) {
|
||||
xml.getAutoCompleteSingleDataList().add(this.buildAutoCompleteSingleData(autoCompleteSingleData));
|
||||
for (ExternalSelectDataEntity.ExternalSelectSourceEntity externalSelectSourceEntity : data.getAutoCompleteSingleDataList()) {
|
||||
xml.getAutoCompleteSingleDataList().add(this.buildAutoCompleteSingleData(externalSelectSourceEntity));
|
||||
}
|
||||
}
|
||||
return xml;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isMultiValueInternal(AutoCompleteDataEntity data) {
|
||||
return data.getMultiAutoComplete();
|
||||
protected boolean isMultiValueInternal(ExternalSelectDataEntity data) {
|
||||
return data.getMultipleSelect();
|
||||
}
|
||||
|
||||
private @NotNull AutoCompleteSingleData buildAutoCompleteSingleData(AutoCompleteDataEntity.AutoCompleteSingleData data){
|
||||
private @NotNull AutoCompleteSingleData buildAutoCompleteSingleData(ExternalSelectDataEntity.ExternalSelectSourceEntity data){
|
||||
AutoCompleteSingleData xml = new AutoCompleteSingleData();
|
||||
if (data == null) return xml;
|
||||
|
||||
|
@ -209,7 +208,7 @@ public class AutoCompleteFieldDataHelperService extends BaseFieldDataHelperServi
|
|||
xml.setAutocompleteType(data.getAutocompleteType());
|
||||
xml.setOptionsRoot(data.getOptionsRoot());
|
||||
xml.setHasAuth(data.getHasAuth());
|
||||
if(data.getAutoCompleteOptions() != null) xml.setAutoCompleteOptions(this.buildOption(data.getAutoCompleteOptions()));
|
||||
if(data.getExternalSelectSourceBindingEntity() != null) xml.setAutoCompleteOptions(this.buildOption(data.getExternalSelectSourceBindingEntity()));
|
||||
if(data.getAuth() != null) xml.setAuth(this.buildAuthAutoCompleteData(data.getAuth()));
|
||||
xml.setMethod(data.getMethod());
|
||||
|
||||
|
@ -228,7 +227,7 @@ public class AutoCompleteFieldDataHelperService extends BaseFieldDataHelperServi
|
|||
return xml;
|
||||
}
|
||||
|
||||
private @NotNull AuthAutoCompleteData buildAuthAutoCompleteData(AutoCompleteDataEntity.AuthAutoCompleteData data){
|
||||
private @NotNull AuthAutoCompleteData buildAuthAutoCompleteData(ExternalSelectDataEntity.ExternalSelectAuthDataEntity data){
|
||||
AuthAutoCompleteData xml = new AuthAutoCompleteData();
|
||||
if (data == null) return xml;
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ public class ExternalDatasetFieldDataHelperService extends BaseFieldDataHelperSe
|
|||
|
||||
@Override
|
||||
protected ExternalDatasetDataEntity applyPersistInternal(ExternalDatasetDataPersist persist, ExternalDatasetDataEntity data) {
|
||||
data.setMultiAutoComplete(persist.getMultiAutoComplete());
|
||||
data.setMultipleSelect(persist.getMultiAutoComplete());
|
||||
data.setType(persist.getType());
|
||||
return data;
|
||||
}
|
||||
|
@ -89,13 +89,13 @@ public class ExternalDatasetFieldDataHelperService extends BaseFieldDataHelperSe
|
|||
|
||||
@Override
|
||||
protected ExternalDatasetDataImportExport dataToImportExportXmlInternal(ExternalDatasetDataEntity data, ExternalDatasetDataImportExport xml) {
|
||||
xml.setMultiAutoComplete(data.getMultiAutoComplete());
|
||||
xml.setMultiAutoComplete(data.getMultipleSelect());
|
||||
xml.setType(data.getType());
|
||||
return xml;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isMultiValueInternal(ExternalDatasetDataEntity data) {
|
||||
return data.getMultiAutoComplete();
|
||||
return data.getMultipleSelect();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
package eu.eudat.service.fielddatahelper;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.LabelDataPersist;
|
||||
import gr.cite.tools.data.builder.Builder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
|
@ -60,8 +56,8 @@ public class FieldDataHelperServiceProvider {
|
|||
item = this.applicationContext.getBean(ExternalDatasetFieldDataHelperService.class);
|
||||
break;
|
||||
}
|
||||
case WORD_LIST: {
|
||||
item = this.applicationContext.getBean(WordListFieldDataHelperService.class);
|
||||
case SELECT: {
|
||||
item = this.applicationContext.getBean(SelectFieldDataHelperService.class);
|
||||
break;
|
||||
}
|
||||
case AUTO_COMPLETE: {
|
||||
|
|
|
@ -76,7 +76,7 @@ public class LabelAndMultiplicityFieldDataHelperService extends BaseFieldDataHel
|
|||
|
||||
@Override
|
||||
protected LabelAndMultiplicityDataEntity applyPersistInternal(LabelAndMultiplicityDataPersist persist, LabelAndMultiplicityDataEntity data) {
|
||||
data.setMultiAutoComplete(persist.getMultiAutoComplete());
|
||||
data.setMultipleSelect(persist.getMultiAutoComplete());
|
||||
return data;
|
||||
}
|
||||
|
||||
|
@ -88,12 +88,12 @@ public class LabelAndMultiplicityFieldDataHelperService extends BaseFieldDataHel
|
|||
|
||||
@Override
|
||||
protected LabelAndMultiplicityDataImportExport dataToImportExportXmlInternal(LabelAndMultiplicityDataEntity data, LabelAndMultiplicityDataImportExport xml) {
|
||||
xml.setMultiAutoComplete(data.getMultiAutoComplete());
|
||||
xml.setMultiAutoComplete(data.getMultipleSelect());
|
||||
return xml;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isMultiValueInternal(LabelAndMultiplicityDataEntity data) {
|
||||
return data.getMultiAutoComplete();
|
||||
return data.getMultipleSelect();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,12 +2,12 @@ package eu.eudat.service.fielddatahelper;
|
|||
|
||||
import eu.eudat.authorization.AuthorizationFlags;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.*;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.WordListDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.SelectDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.ComboBoxDataOptionEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.SelectDataImportExport;
|
||||
import eu.eudat.convention.ConventionService;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.WordListDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.WordListData;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.SelectDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.SelectData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.*;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
|
@ -21,13 +21,13 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class WordListFieldDataHelperService extends BaseFieldDataHelperService<WordListData, WordListDataPersist, WordListDataEntity, WordListDataImportExport> {
|
||||
public class SelectFieldDataHelperService extends BaseFieldDataHelperService<SelectData, SelectDataPersist, SelectDataEntity, SelectDataImportExport> {
|
||||
|
||||
private final ConventionService conventionService;
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
private final ValidatorFactory validatorFactory;
|
||||
public WordListFieldDataHelperService(ConventionService conventionService, BuilderFactory builderFactory, ValidatorFactory validatorFactory) {
|
||||
public SelectFieldDataHelperService(ConventionService conventionService, BuilderFactory builderFactory, ValidatorFactory validatorFactory) {
|
||||
this.conventionService = conventionService;
|
||||
this.builderFactory = builderFactory;
|
||||
this.validatorFactory = validatorFactory;
|
||||
|
@ -35,55 +35,55 @@ public class WordListFieldDataHelperService extends BaseFieldDataHelperService<W
|
|||
|
||||
|
||||
@Override
|
||||
public WordListDataEntity newDataInstanceInternal() {
|
||||
return new WordListDataEntity();
|
||||
public SelectDataEntity newDataInstanceInternal() {
|
||||
return new SelectDataEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public WordListData newModelInstanceInternal() {
|
||||
return new WordListData();
|
||||
public SelectData newModelInstanceInternal() {
|
||||
return new SelectData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public WordListDataPersist newPersistModelInstanceInternal() {
|
||||
return new WordListDataPersist();
|
||||
public SelectDataPersist newPersistModelInstanceInternal() {
|
||||
return new SelectDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected WordListDataImportExport newImportExportInstanceInternal() {
|
||||
return new WordListDataImportExport();
|
||||
protected SelectDataImportExport newImportExportInstanceInternal() {
|
||||
return new SelectDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return WordListDataEntity.class;
|
||||
return SelectDataEntity.class;
|
||||
}
|
||||
@Override
|
||||
public Class<?> getModelClass() {
|
||||
return WordListData.class;
|
||||
return SelectData.class;
|
||||
}
|
||||
@Override
|
||||
public Class<?> getPersistModelClass() {
|
||||
return WordListDataPersist.class;
|
||||
return SelectDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return WordListDataImportExport.class;
|
||||
return SelectDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Validator getPersistModelValidator() {
|
||||
return this.validatorFactory.validator(WordListDataPersist.WordListDataPersistValidator.class);
|
||||
return this.validatorFactory.validator(SelectDataPersist.SelectDataPersistValidator.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WordListData> buildInternal(FieldSet fieldSet, List<WordListDataEntity> data, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(WordListDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data);
|
||||
public List<SelectData> buildInternal(FieldSet fieldSet, List<SelectDataEntity> data, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(SelectDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected WordListDataEntity applyPersistInternal(WordListDataPersist persist, WordListDataEntity data) {
|
||||
protected SelectDataEntity applyPersistInternal(SelectDataPersist persist, SelectDataEntity data) {
|
||||
data.setMultiList(persist.getMultiList());
|
||||
if (!this.conventionService.isListNullOrEmpty(persist.getOptions())){
|
||||
data.setOptions(new ArrayList<>());
|
||||
|
@ -108,7 +108,7 @@ public class WordListFieldDataHelperService extends BaseFieldDataHelperService<W
|
|||
}
|
||||
|
||||
@Override
|
||||
protected WordListDataPersist importExportMapDataToPersistInternal(WordListDataImportExport data, WordListDataPersist persist) {
|
||||
protected SelectDataPersist importExportMapDataToPersistInternal(SelectDataImportExport data, SelectDataPersist persist) {
|
||||
persist.setMultiList(data.getMultiList());
|
||||
if (!this.conventionService.isListNullOrEmpty(data.getOptions())){
|
||||
persist.setOptions(new ArrayList<>());
|
||||
|
@ -132,7 +132,7 @@ public class WordListFieldDataHelperService extends BaseFieldDataHelperService<W
|
|||
}
|
||||
|
||||
@Override
|
||||
protected WordListDataImportExport dataToImportExportXmlInternal(WordListDataEntity data, WordListDataImportExport xml) {
|
||||
protected SelectDataImportExport dataToImportExportXmlInternal(SelectDataEntity data, SelectDataImportExport xml) {
|
||||
xml.setMultiList(data.getMultiList());
|
||||
if (!this.conventionService.isListNullOrEmpty(data.getOptions())){
|
||||
xml.setOptions(new ArrayList<>());
|
||||
|
@ -144,7 +144,7 @@ public class WordListFieldDataHelperService extends BaseFieldDataHelperService<W
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean isMultiValueInternal(WordListDataEntity data) {
|
||||
protected boolean isMultiValueInternal(SelectDataEntity data) {
|
||||
return data.getMultiList();
|
||||
}
|
||||
|
|
@ -7,10 +7,9 @@ import eu.eudat.commons.JsonHandlingService;
|
|||
import eu.eudat.commons.XmlHandlingService;
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import eu.eudat.commons.types.descriptiontemplate.FieldEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ComboBoxDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ExternalSelectDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.LabelAndMultiplicityDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.WordListDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.SelectDataEntity;
|
||||
import eu.eudat.commons.types.prefilling.PrefillingEntity;
|
||||
import eu.eudat.convention.ConventionService;
|
||||
import eu.eudat.data.DescriptionTemplateEntity;
|
||||
|
@ -284,7 +283,7 @@ public class PrefillingServiceImpl implements PrefillingService {
|
|||
field.setKey(id);
|
||||
switch (fieldEntity.getData().getFieldType()) {
|
||||
case AUTO_COMPLETE:
|
||||
case WORD_LIST: {
|
||||
case SELECT: {
|
||||
if (!parsedValues.stream().allMatch(Objects::isNull)) {
|
||||
field.setValue(this.jsonHandlingService.toJsonSafe(parseComboBoxValues(fieldEntity, parsedValues)));
|
||||
}
|
||||
|
@ -307,9 +306,9 @@ public class PrefillingServiceImpl implements PrefillingService {
|
|||
}
|
||||
case LICENSES: {
|
||||
List<ReferenceEntity> licenses = this.queryFactory.query(ReferenceQuery.class).references(parsedValues).collect();
|
||||
LabelAndMultiplicityDataEntity wordListDataEntity = (LabelAndMultiplicityDataEntity) fieldEntity.getData();
|
||||
if (licenses != null && !licenses.isEmpty() && wordListDataEntity != null) {
|
||||
boolean isMultiAutocomplete = wordListDataEntity.getMultiAutoComplete();
|
||||
LabelAndMultiplicityDataEntity licenseDataEntity = (LabelAndMultiplicityDataEntity) fieldEntity.getData();
|
||||
if (licenses != null && !licenses.isEmpty() && licenseDataEntity != null) {
|
||||
boolean isMultiAutocomplete = licenseDataEntity.getMultipleSelect();
|
||||
List<Reference> licenseModels = this.builderFactory.builder(ReferenceBuilder.class).authorize(AuthorizationFlags.OwnerOrDmpAssociatedOrPermissionOrPublic).build(new BaseFieldSet(), licenses);
|
||||
if (isMultiAutocomplete) {
|
||||
field.setValue(jsonHandlingService.toJsonSafe(licenseModels));
|
||||
|
@ -366,8 +365,8 @@ public class PrefillingServiceImpl implements PrefillingService {
|
|||
List<String> normalizedValues = new ArrayList<>();
|
||||
boolean isMultiSelect;
|
||||
if(fieldEntity.getData().getFieldType().equals(FieldType.AUTO_COMPLETE)) {
|
||||
AutoCompleteDataEntity autoCompleteData = (AutoCompleteDataEntity)fieldEntity.getData();
|
||||
isMultiSelect = autoCompleteData.getMultiAutoComplete();
|
||||
ExternalSelectDataEntity autoCompleteData = (ExternalSelectDataEntity)fieldEntity.getData();
|
||||
isMultiSelect = autoCompleteData.getMultipleSelect();
|
||||
for (String format : parsedValues) {
|
||||
List<ExternalAutocompleteFieldResult> result = new ArrayList<>();
|
||||
try {
|
||||
|
@ -391,10 +390,10 @@ public class PrefillingServiceImpl implements PrefillingService {
|
|||
}
|
||||
return !normalizedValues.isEmpty() ? (isMultiSelect ? normalizedValues : normalizedValues.getFirst()) : null;
|
||||
} else {
|
||||
WordListDataEntity wordListDataEntity = (WordListDataEntity)fieldEntity.getData();
|
||||
isMultiSelect = wordListDataEntity.getMultiList();
|
||||
if (wordListDataEntity.getOptions() != null) {
|
||||
for (ComboBoxDataEntity.Option option : wordListDataEntity.getOptions()) {
|
||||
SelectDataEntity selectDataEntity = (SelectDataEntity)fieldEntity.getData();
|
||||
isMultiSelect = selectDataEntity.getMultiList();
|
||||
if (selectDataEntity.getOptions() != null) {
|
||||
for (ComboBoxDataEntity.Option option : selectDataEntity.getOptions()) {
|
||||
if (parsedValues.contains(option.getValue())) {
|
||||
normalizedValues.add(option.getValue());
|
||||
}
|
||||
|
@ -419,7 +418,7 @@ public class PrefillingServiceImpl implements PrefillingService {
|
|||
return parsedTags;
|
||||
}
|
||||
|
||||
public List<ExternalAutocompleteFieldResult> getAutocomplete(AutoCompleteDataEntity data, String like) throws URISyntaxException {
|
||||
public List<ExternalAutocompleteFieldResult> getAutocomplete(ExternalSelectDataEntity data, String like) throws URISyntaxException {
|
||||
|
||||
List<ExternalAutocompleteFieldResult> result = new LinkedList<>();
|
||||
ExternalReferenceCriteria urlCriteria = new ExternalReferenceCriteria();
|
||||
|
@ -428,7 +427,7 @@ public class PrefillingServiceImpl implements PrefillingService {
|
|||
List<Map<String, String>> rawResults = new ArrayList<>();
|
||||
genericUrls.setFetchMode(FetchStrategy.FIRST);
|
||||
urlCriteria.setLike(like);
|
||||
for (AutoCompleteDataEntity.AutoCompleteSingleData singleData : data.getAutoCompleteSingleDataList()) {
|
||||
for (ExternalSelectDataEntity.ExternalSelectSourceEntity singleData : data.getAutoCompleteSingleDataList()) {
|
||||
UrlConfiguration urlConfiguration = new UrlConfiguration();
|
||||
try {
|
||||
URI uri;
|
||||
|
@ -437,9 +436,9 @@ public class PrefillingServiceImpl implements PrefillingService {
|
|||
} else {
|
||||
uri = new URI(singleData.getUrl());
|
||||
}
|
||||
String source = singleData.getAutoCompleteOptions().getSource();
|
||||
String source = singleData.getExternalSelectSourceBindingEntity().getSource();
|
||||
source = source != null && !source.isEmpty() ? source : uri.getHost();
|
||||
String uriString = singleData.getAutoCompleteOptions().getUri();
|
||||
String uriString = singleData.getExternalSelectSourceBindingEntity().getUri();
|
||||
uriString = uriString != null && !uriString.isEmpty() ? uriString : "uri";
|
||||
String parsedUrl = singleData.getUrl();
|
||||
parsedUrl = parsedUrl.replace("%20", " ");
|
||||
|
@ -456,9 +455,9 @@ public class PrefillingServiceImpl implements PrefillingService {
|
|||
DataUrlConfiguration dataUrlConfiguration = new DataUrlConfiguration();
|
||||
dataUrlConfiguration.setPath(singleData.getOptionsRoot());
|
||||
DataFieldsUrlConfiguration fieldsUrlConfiguration = new DataFieldsUrlConfiguration();
|
||||
fieldsUrlConfiguration.setId(singleData.getAutoCompleteOptions().getValue());
|
||||
fieldsUrlConfiguration.setName(singleData.getAutoCompleteOptions().getLabel());
|
||||
fieldsUrlConfiguration.setSource(singleData.getAutoCompleteOptions().getSource().isEmpty()? null : singleData.getAutoCompleteOptions().getSource());
|
||||
fieldsUrlConfiguration.setId(singleData.getExternalSelectSourceBindingEntity().getValue());
|
||||
fieldsUrlConfiguration.setName(singleData.getExternalSelectSourceBindingEntity().getLabel());
|
||||
fieldsUrlConfiguration.setSource(singleData.getExternalSelectSourceBindingEntity().getSource().isEmpty()? null : singleData.getExternalSelectSourceBindingEntity().getSource());
|
||||
fieldsUrlConfiguration.setUri(uriString);
|
||||
dataUrlConfiguration.setFieldsUrlConfiguration(fieldsUrlConfiguration);
|
||||
urlConfiguration.setKey(source);
|
||||
|
@ -475,8 +474,8 @@ public class PrefillingServiceImpl implements PrefillingService {
|
|||
}
|
||||
genericUrls.getUrls().add(urlConfiguration);
|
||||
List<Map<String, String>> singleResults = this.remoteFetcherService.getExternalGeneric(urlCriteria, genericUrls);
|
||||
if (!singleResults.isEmpty() && !singleResults.get(0).containsKey("source") && !singleData.getAutoCompleteOptions().getSource().isEmpty()) {
|
||||
singleResults.forEach(singleResult -> singleResult.put("source", singleData.getAutoCompleteOptions().getSource()));
|
||||
if (!singleResults.isEmpty() && !singleResults.get(0).containsKey("source") && !singleData.getExternalSelectSourceBindingEntity().getSource().isEmpty()) {
|
||||
singleResults.forEach(singleResult -> singleResult.put("source", singleData.getExternalSelectSourceBindingEntity().getSource()));
|
||||
}
|
||||
rawResults.addAll(singleResults);
|
||||
genericUrls.getUrls().clear();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package eu.eudat.logic.managers;
|
||||
|
||||
import eu.eudat.commons.types.descriptiontemplate.FieldEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ExternalSelectDataEntity;
|
||||
import eu.eudat.logic.xml.XmlBuilder;
|
||||
import eu.eudat.data.DescriptionTemplateEntity;
|
||||
import eu.eudat.logic.proxy.config.configloaders.ConfigLoader;
|
||||
|
@ -62,7 +62,7 @@ public class DatasetProfileManager {
|
|||
return fieldEntity;
|
||||
}
|
||||
|
||||
public List<ExternalAutocompleteFieldResult> getAutocomplete(AutoCompleteDataEntity data, String like) {
|
||||
public List<ExternalAutocompleteFieldResult> getAutocomplete(ExternalSelectDataEntity data, String like) {
|
||||
/*List<ExternalAutocompleteFieldModel> result = new LinkedList<>();
|
||||
SimpleClientHttpRequestFactory simpleFactory = new SimpleClientHttpRequestFactory();
|
||||
|
||||
|
@ -134,7 +134,7 @@ public class DatasetProfileManager {
|
|||
List<Map<String, String>> rawResults = new ArrayList<>();
|
||||
genericUrls.setFetchMode(FetchStrategy.FIRST);
|
||||
urlCriteria.setLike(like);
|
||||
for (AutoCompleteDataEntity.AutoCompleteSingleData singleData : data.getAutoCompleteSingleDataList()) {
|
||||
for (ExternalSelectDataEntity.ExternalSelectSourceEntity singleData : data.getAutoCompleteSingleDataList()) {
|
||||
UrlConfiguration urlConfiguration = new UrlConfiguration();
|
||||
try {
|
||||
URI uri;
|
||||
|
@ -143,9 +143,9 @@ public class DatasetProfileManager {
|
|||
} else {
|
||||
uri = new URI(singleData.getUrl());
|
||||
}
|
||||
String source = singleData.getAutoCompleteOptions().getSource();
|
||||
String source = singleData.getExternalSelectSourceBindingEntity().getSource();
|
||||
source = source != null && !source.isEmpty() ? source : uri.getHost();
|
||||
String uriString = singleData.getAutoCompleteOptions().getUri();
|
||||
String uriString = singleData.getExternalSelectSourceBindingEntity().getUri();
|
||||
uriString = uriString != null && !uriString.isEmpty() ? uriString : "uri";
|
||||
String parsedUrl = singleData.getUrl();
|
||||
parsedUrl = parsedUrl.replace("%20", " ");
|
||||
|
@ -162,9 +162,9 @@ public class DatasetProfileManager {
|
|||
DataUrlConfiguration dataUrlConfiguration = new DataUrlConfiguration();
|
||||
dataUrlConfiguration.setPath(singleData.getOptionsRoot());
|
||||
DataFieldsUrlConfiguration fieldsUrlConfiguration = new DataFieldsUrlConfiguration();
|
||||
fieldsUrlConfiguration.setId(singleData.getAutoCompleteOptions().getValue());
|
||||
fieldsUrlConfiguration.setName(singleData.getAutoCompleteOptions().getLabel());
|
||||
fieldsUrlConfiguration.setSource(singleData.getAutoCompleteOptions().getSource().isEmpty()? null : singleData.getAutoCompleteOptions().getSource());
|
||||
fieldsUrlConfiguration.setId(singleData.getExternalSelectSourceBindingEntity().getValue());
|
||||
fieldsUrlConfiguration.setName(singleData.getExternalSelectSourceBindingEntity().getLabel());
|
||||
fieldsUrlConfiguration.setSource(singleData.getExternalSelectSourceBindingEntity().getSource().isEmpty()? null : singleData.getExternalSelectSourceBindingEntity().getSource());
|
||||
fieldsUrlConfiguration.setUri(uriString);
|
||||
dataUrlConfiguration.setFieldsUrlConfiguration(fieldsUrlConfiguration);
|
||||
urlConfiguration.setKey(source);
|
||||
|
@ -181,8 +181,8 @@ public class DatasetProfileManager {
|
|||
}
|
||||
genericUrls.getUrls().add(urlConfiguration);
|
||||
List<Map<String, String>> singleResults = this.remoteFetcherService.getExternalGeneric(urlCriteria, genericUrls);
|
||||
if (!singleResults.isEmpty() && !singleResults.get(0).containsKey("source") && !singleData.getAutoCompleteOptions().getSource().isEmpty()) {
|
||||
singleResults.forEach(singleResult -> singleResult.put("source", singleData.getAutoCompleteOptions().getSource()));
|
||||
if (!singleResults.isEmpty() && !singleResults.get(0).containsKey("source") && !singleData.getExternalSelectSourceBindingEntity().getSource().isEmpty()) {
|
||||
singleResults.forEach(singleResult -> singleResult.put("source", singleData.getExternalSelectSourceBindingEntity().getSource()));
|
||||
}
|
||||
rawResults.addAll(singleResults);
|
||||
genericUrls.getUrls().clear();
|
||||
|
|
|
@ -15,7 +15,7 @@ import eu.eudat.service.remotefetcher.config.entities.PrefillingGet;
|
|||
import eu.eudat.service.remotefetcher.config.entities.PrefillingMapping;
|
||||
import eu.eudat.utilities.helpers.StreamDistinctBy;
|
||||
import eu.eudat.logic.utilities.json.JsonSearcher;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ExternalSelectDataEntity;
|
||||
import eu.eudat.models.data.datasetwizard.DatasetWizardModel;
|
||||
import eu.eudat.service.remotefetcher.models.ExternalAutocompleteFieldResult;
|
||||
import org.json.JSONObject;
|
||||
|
@ -166,7 +166,7 @@ public class PrefillingMapper {
|
|||
|
||||
switch (FieldType.of(renderStyle)) {
|
||||
case AUTO_COMPLETE:
|
||||
case WORD_LIST:
|
||||
case SELECT:
|
||||
if (parsedValues.isEmpty())
|
||||
parsedValues.add(parsedValue);
|
||||
if (!parsedValues.stream().allMatch(Objects::isNull)) {
|
||||
|
@ -227,12 +227,12 @@ public class PrefillingMapper {
|
|||
String type = node.isArray() ? node.get(0).get("data").get("type").asText() : node.get("data").get("type").asText();
|
||||
if(type.equals("autocomplete")) {
|
||||
JsonNode dataNode = node.isArray() ? node.get(0).get("data") : node.get("data");
|
||||
AutoCompleteDataEntity autoCompleteDataEntity = mapper.treeToValue(dataNode, AutoCompleteDataEntity.class);
|
||||
isMultiSelect = autoCompleteDataEntity.getMultiAutoComplete();
|
||||
ExternalSelectDataEntity externalSelectDataEntity = mapper.treeToValue(dataNode, ExternalSelectDataEntity.class);
|
||||
isMultiSelect = externalSelectDataEntity.getMultipleSelect();
|
||||
for (String format : parsedValues) {
|
||||
List<ExternalAutocompleteFieldResult> result = new ArrayList<>();
|
||||
try {
|
||||
result = datasetProfileManager.getAutocomplete(autoCompleteDataEntity, format);
|
||||
result = datasetProfileManager.getAutocomplete(externalSelectDataEntity, format);
|
||||
}
|
||||
catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
|
|
|
@ -491,7 +491,7 @@ public class WordBuilder {
|
|||
String format = this.formatter(field);
|
||||
if (field.getViewStyle().getFieldType().equals("tags")) {
|
||||
format = getCommaSeparatedFormatsFromJson(format, "name");
|
||||
} else if (field.getViewStyle().getFieldType().equals("combobox") && field.getData() instanceof AutoCompleteDataEntity) {
|
||||
} else if (field.getViewStyle().getFieldType().equals("combobox") && field.getData() instanceof ExternalSelectDataEntity) {
|
||||
format = getCommaSeparatedFormatsFromJson(format, "label");
|
||||
}
|
||||
boolean isResearcher = field.getViewStyle().getFieldType().equals("researchers");
|
||||
|
@ -637,7 +637,7 @@ public class WordBuilder {
|
|||
String format = this.formatter(field);
|
||||
if (field.getViewStyle().getFieldType().equals("tags")) {
|
||||
format = getCommaSeparatedFormatsFromJson(format, "name");
|
||||
} else if (field.getViewStyle().getFieldType().equals("combobox") && field.getData() instanceof AutoCompleteDataEntity) {
|
||||
} else if (field.getViewStyle().getFieldType().equals("combobox") && field.getData() instanceof ExternalSelectDataEntity) {
|
||||
format = getCommaSeparatedFormatsFromJson(format, "label");
|
||||
}
|
||||
switch (field.getViewStyle().getFieldType().getValue()) {
|
||||
|
|
|
@ -212,16 +212,16 @@ public class ExportXmlBuilderDatasetProfile {
|
|||
if (field.getData() != null) {
|
||||
Element dataOut = element.createElement("data");
|
||||
switch (field.getViewStyle().getFieldType()) {
|
||||
case WORD_LIST:
|
||||
case SELECT:
|
||||
case AUTO_COMPLETE:
|
||||
ComboBoxDataEntity comboBoxDataEntityObject = (ComboBoxDataEntity) field.getData();
|
||||
if (comboBoxDataEntityObject.getFieldType().equals("wordlist")) {
|
||||
WordListDataEntity wordListDataEntityObject = (WordListDataEntity) field.getData();
|
||||
dataOut.setAttribute("label", wordListDataEntityObject.getLabel());
|
||||
dataOut.setAttribute("type", wordListDataEntityObject.getFieldType().getValue());
|
||||
dataOut.setAttribute("multiList", wordListDataEntityObject.getMultiList().toString());
|
||||
SelectDataEntity selectDataEntityObject = (SelectDataEntity) field.getData();
|
||||
dataOut.setAttribute("label", selectDataEntityObject.getLabel());
|
||||
dataOut.setAttribute("type", selectDataEntityObject.getFieldType().getValue());
|
||||
dataOut.setAttribute("multiList", selectDataEntityObject.getMultiList().toString());
|
||||
Element options = element.createElement("options");
|
||||
wordListDataEntityObject.getOptions().forEach(optionChildFor -> {
|
||||
selectDataEntityObject.getOptions().forEach(optionChildFor -> {
|
||||
Element optionChild = element.createElement("option");
|
||||
optionChild.setAttribute("label", optionChildFor.getLabel());
|
||||
optionChild.setAttribute("value", optionChildFor.getValue());
|
||||
|
@ -229,19 +229,19 @@ public class ExportXmlBuilderDatasetProfile {
|
|||
});
|
||||
dataOut.appendChild(options);
|
||||
} else if (comboBoxDataEntityObject.getFieldType().equals("autocomplete")) {
|
||||
AutoCompleteDataEntity autoCompleteDataEntityObject = (AutoCompleteDataEntity) field.getData();
|
||||
dataOut.setAttribute("label", autoCompleteDataEntityObject.getLabel());
|
||||
dataOut.setAttribute("type", autoCompleteDataEntityObject.getFieldType().getValue());
|
||||
dataOut.setAttribute("multiAutoComplete", autoCompleteDataEntityObject.getMultiAutoComplete().toString());
|
||||
for (AutoCompleteDataEntity.AutoCompleteSingleData singleData: autoCompleteDataEntityObject.getAutoCompleteSingleDataList()) {
|
||||
ExternalSelectDataEntity externalSelectDataEntityObject = (ExternalSelectDataEntity) field.getData();
|
||||
dataOut.setAttribute("label", externalSelectDataEntityObject.getLabel());
|
||||
dataOut.setAttribute("type", externalSelectDataEntityObject.getFieldType().getValue());
|
||||
dataOut.setAttribute("multiAutoComplete", externalSelectDataEntityObject.getMultipleSelect().toString());
|
||||
for (ExternalSelectDataEntity.ExternalSelectSourceEntity singleData: externalSelectDataEntityObject.getAutoCompleteSingleDataList()) {
|
||||
Element singleItem = element.createElement("autocompleteSingle");
|
||||
singleItem.setAttribute("optionsRoot", singleData.getOptionsRoot());
|
||||
singleItem.setAttribute("url", singleData.getUrl());
|
||||
singleItem.setAttribute("autoCompleteType", Integer.toString(singleData.getAutocompleteType().getValue()));
|
||||
if (singleData.getAutoCompleteOptions() != null) {
|
||||
if (singleData.getExternalSelectSourceBindingEntity() != null) {
|
||||
Element optionChild = element.createElement("option");
|
||||
optionChild.setAttribute("label", singleData.getAutoCompleteOptions().getLabel());
|
||||
optionChild.setAttribute("value", singleData.getAutoCompleteOptions().getValue());
|
||||
optionChild.setAttribute("label", singleData.getExternalSelectSourceBindingEntity().getLabel());
|
||||
optionChild.setAttribute("value", singleData.getExternalSelectSourceBindingEntity().getValue());
|
||||
singleItem.appendChild(optionChild);
|
||||
}
|
||||
dataOut.appendChild(singleItem);
|
||||
|
@ -298,22 +298,22 @@ public class ExportXmlBuilderDatasetProfile {
|
|||
switch (internalDmpEntitiesData.getFieldType()) {
|
||||
case INTERNAL_DMP_ENTRIES_RESEARCHERS:
|
||||
InternalDmpBaseDataEntity researchersAutoCompleteData = (InternalDmpBaseDataEntity) internalDmpEntitiesData;
|
||||
dataOut.setAttribute("multiAutocomplete", researchersAutoCompleteData.getMultiAutoComplete().toString());
|
||||
dataOut.setAttribute("multiAutocomplete", researchersAutoCompleteData.getMultipleSelect().toString());
|
||||
break;
|
||||
case INTERNAL_DMP_ENTRIES_DATASETS:
|
||||
InternalDmpBaseDataEntity datasetAutoCompleteDataEntity = (InternalDmpBaseDataEntity) internalDmpEntitiesData;
|
||||
dataOut.setAttribute("multiAutocomplete", datasetAutoCompleteDataEntity.getMultiAutoComplete().toString());
|
||||
dataOut.setAttribute("multiAutocomplete", datasetAutoCompleteDataEntity.getMultipleSelect().toString());
|
||||
break;
|
||||
case INTERNAL_DMP_ENTRIES_DMPS:
|
||||
InternalDmpBaseDataEntity dmpAutoCompleteDataEntity = (InternalDmpBaseDataEntity) internalDmpEntitiesData;
|
||||
dataOut.setAttribute("multiAutocomplete", dmpAutoCompleteDataEntity.getMultiAutoComplete().toString());
|
||||
dataOut.setAttribute("multiAutocomplete", dmpAutoCompleteDataEntity.getMultipleSelect().toString());
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EXTERNAL_DATASETS:
|
||||
ExternalDatasetDataEntity externalDatasetDataEntity = (ExternalDatasetDataEntity) field.getData();
|
||||
dataOut.setAttribute("label", externalDatasetDataEntity.getLabel());
|
||||
dataOut.setAttribute("multiAutocomplete", externalDatasetDataEntity.getMultiAutoComplete().toString());
|
||||
dataOut.setAttribute("multiAutocomplete", externalDatasetDataEntity.getMultipleSelect().toString());
|
||||
dataOut.setAttribute("type", externalDatasetDataEntity.getType().getValue());
|
||||
break;
|
||||
case DATA_REPOSITORIES:
|
||||
|
@ -321,42 +321,42 @@ public class ExportXmlBuilderDatasetProfile {
|
|||
case PUB_REPOSITORIES:
|
||||
InternalDmpBaseDataEntity dataRepositoryDataEntity = (InternalDmpBaseDataEntity) field.getData();
|
||||
dataOut.setAttribute("label", dataRepositoryDataEntity.getLabel());
|
||||
dataOut.setAttribute("multiAutocomplete", dataRepositoryDataEntity.getMultiAutoComplete().toString());
|
||||
dataOut.setAttribute("multiAutocomplete", dataRepositoryDataEntity.getMultipleSelect().toString());
|
||||
break;
|
||||
case TAXONOMIES:
|
||||
InternalDmpBaseDataEntity taxonomyDataEntity = (InternalDmpBaseDataEntity) field.getData();
|
||||
dataOut.setAttribute("label", taxonomyDataEntity.getLabel());
|
||||
dataOut.setAttribute("multiAutocomplete", taxonomyDataEntity.getMultiAutoComplete().toString());
|
||||
dataOut.setAttribute("multiAutocomplete", taxonomyDataEntity.getMultipleSelect().toString());
|
||||
break;
|
||||
case LICENSES:
|
||||
InternalDmpBaseDataEntity licensesData = (InternalDmpBaseDataEntity) field.getData();
|
||||
dataOut.setAttribute("label", licensesData.getLabel());
|
||||
dataOut.setAttribute("multiAutocomplete", licensesData.getMultiAutoComplete().toString());
|
||||
dataOut.setAttribute("multiAutocomplete", licensesData.getMultipleSelect().toString());
|
||||
break;
|
||||
case PUBLICATIONS:
|
||||
InternalDmpBaseDataEntity publicationDataEntity = (InternalDmpBaseDataEntity) field.getData();
|
||||
dataOut.setAttribute("label", publicationDataEntity.getLabel());
|
||||
dataOut.setAttribute("multiAutocomplete", publicationDataEntity.getMultiAutoComplete().toString());
|
||||
dataOut.setAttribute("multiAutocomplete", publicationDataEntity.getMultipleSelect().toString());
|
||||
break;
|
||||
case ORGANIZATIONS:
|
||||
InternalDmpBaseDataEntity organizationDataEntity = (InternalDmpBaseDataEntity) field.getData();
|
||||
dataOut.setAttribute("label", organizationDataEntity.getLabel());
|
||||
dataOut.setAttribute("multiAutocomplete", organizationDataEntity.getMultiAutoComplete().toString());
|
||||
dataOut.setAttribute("multiAutocomplete", organizationDataEntity.getMultipleSelect().toString());
|
||||
break;
|
||||
case RESEARCHERS:
|
||||
InternalDmpBaseDataEntity researcherDataEntity = (InternalDmpBaseDataEntity) field.getData();
|
||||
dataOut.setAttribute("label", researcherDataEntity.getLabel());
|
||||
dataOut.setAttribute("multiAutocomplete", researcherDataEntity.getMultiAutoComplete().toString());
|
||||
dataOut.setAttribute("multiAutocomplete", researcherDataEntity.getMultipleSelect().toString());
|
||||
break;
|
||||
case REGISTRIES:
|
||||
InternalDmpBaseDataEntity registriesEntity = (InternalDmpBaseDataEntity) field.getData();
|
||||
dataOut.setAttribute("label", registriesEntity.getLabel());
|
||||
dataOut.setAttribute("multiAutocomplete", registriesEntity.getMultiAutoComplete().toString());
|
||||
dataOut.setAttribute("multiAutocomplete", registriesEntity.getMultipleSelect().toString());
|
||||
break;
|
||||
case SERVICES:
|
||||
InternalDmpBaseDataEntity serviceDataEntity = (InternalDmpBaseDataEntity) field.getData();
|
||||
dataOut.setAttribute("label", serviceDataEntity.getLabel());
|
||||
dataOut.setAttribute("multiAutocomplete", serviceDataEntity.getMultiAutoComplete().toString());
|
||||
dataOut.setAttribute("multiAutocomplete", serviceDataEntity.getMultipleSelect().toString());
|
||||
break;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
package eu.eudat.models.data.helpers.common;
|
||||
|
||||
import eu.eudat.data.dao.criteria.Criteria;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ExternalSelectDataEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AutoCompleteOptionsLookupItem extends Criteria<AutoCompleteOptionsLookupItem> {
|
||||
|
||||
private List<AutoCompleteDataEntity.AutoCompleteSingleData> autoCompleteSingleDataList;
|
||||
private List<ExternalSelectDataEntity.ExternalSelectSourceEntity> externalSelectSourceEntityList;
|
||||
|
||||
public List<AutoCompleteDataEntity.AutoCompleteSingleData> getAutoCompleteSingleDataList() {
|
||||
return autoCompleteSingleDataList;
|
||||
public List<ExternalSelectDataEntity.ExternalSelectSourceEntity> getAutoCompleteSingleDataList() {
|
||||
return externalSelectSourceEntityList;
|
||||
}
|
||||
public void setAutoCompleteSingleDataList(List<AutoCompleteDataEntity.AutoCompleteSingleData> autoCompleteSingleDataList) {
|
||||
this.autoCompleteSingleDataList = autoCompleteSingleDataList;
|
||||
public void setAutoCompleteSingleDataList(List<ExternalSelectDataEntity.ExternalSelectSourceEntity> externalSelectSourceEntityList) {
|
||||
this.externalSelectSourceEntityList = externalSelectSourceEntityList;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue