Fix issues with import and export of dataset template

This commit is contained in:
George Kalampokis 2021-05-10 16:10:18 +03:00
parent 1d5befaf6a
commit 6f658db27f
7 changed files with 15 additions and 15 deletions

View File

@ -95,14 +95,14 @@ public class AutoCompleteData extends ComboBoxData<AutoCompleteData> {
this.autoCompleteSingleDataList.add(new AutoCompleteSingleData());
this.mapFromXml(item, this.autoCompleteSingleDataList.get(0));
}
this.multiAutoComplete = Boolean.parseBoolean(item.getAttribute("multiAutoComplete"));
this.multiAutoComplete = Boolean.parseBoolean(item.getAttribute("multiAutocomplete"));
return this;
}
private void mapFromXml(Element item, AutoCompleteSingleData singleData) {
singleData.url = item.getAttribute("url");
singleData.optionsRoot = item.getAttribute("optionsRoot");
this.multiAutoComplete = Boolean.parseBoolean(item.getAttribute("multiAutoComplete"));
this.multiAutoComplete = Boolean.parseBoolean(item.getAttribute("multiAutocomplete"));
if (item.getAttribute("autoCompleteType") == null || item.getAttribute("autoCompleteType").equals("") ) {
singleData.autocompleteType = AutocompleteType.UNCACHED.getValue();
} else {
@ -173,7 +173,7 @@ public class AutoCompleteData extends ComboBoxData<AutoCompleteData> {
dataMap.put("label", item != null ? item.getAttribute("label") : "");
//dataMap.put("url", item != null ? item.getAttribute("url") : "");
dataMap.put("type", item != null ? item.getAttribute("type") : "autocomplete");
dataMap.put("multiAutoComplete", item != null ? Boolean.valueOf(item.getAttribute("multiAutoComplete")) : false);
dataMap.put("multiAutoComplete", item != null ? Boolean.valueOf(item.getAttribute("multiAutocomplete")) : false);
List<Map<String, Object>> autoCompletes = new ArrayList<>();
NodeList autoCompleteSingles = item.getChildNodes();
for (int i = 0; i < autoCompleteSingles.getLength(); i++) {

View File

@ -21,7 +21,7 @@ public class DataRepositoriesData extends FieldData<DataRepositoriesData> {
public DataRepositoriesData fromData(Object data) {
if (data != null) {
this.setLabel((String) ((Map<String, Object>) data).get("label"));
this.setMultiAutoComplete(((Map<String, Object>) data).get("multiAutoComplete") != null ? (Boolean) ((Map<String, Object>) data).get("multiAutoComplete") : false);
this.setMultiAutoComplete(((Map<String, Object>) data).get("multiAutoComplete") != null && !((Map<String, Object>) data).get("multiAutoComplete").toString().isEmpty()? Boolean.parseBoolean(((Map<String, Object>) data).get("multiAutoComplete").toString()) : false);
}
return this;
}
@ -52,7 +52,7 @@ public class DataRepositoriesData extends FieldData<DataRepositoriesData> {
public Map<String, Object> toMap(Element item) {
HashMap dataMap = new HashMap();
dataMap.put("label", item != null && item.getAttributes().getLength() > 0? item.getAttribute("label") : "");
dataMap.put("multiAutoComplete", item != null && item.getAttributes().getLength() > 0 ? item.getAttribute("multiAutoComplete") : false);
dataMap.put("multiAutoComplete", item != null && item.getAttributes().getLength() > 0 ? item.getAttribute("multiAutocomplete") : false);
return dataMap;
}
}

View File

@ -21,7 +21,7 @@ public class ExternalDatasetsData extends FieldData<ExternalDatasetsData> {
public ExternalDatasetsData fromData(Object data) {
if (data != null) {
this.setLabel((String) ((Map<String, Object>) data).get("label"));
this.setMultiAutoComplete(((Map<String, Object>) data).get("multiAutoComplete") != null ? (Boolean) ((Map<String, Object>) data).get("multiAutoComplete") : false);
this.setMultiAutoComplete(((Map<String, Object>) data).get("multiAutoComplete") != null && !((Map<String, Object>) data).get("multiAutoComplete").toString().isEmpty()? Boolean.parseBoolean( ((Map<String, Object>) data).get("multiAutoComplete").toString()) : false);
}
return this;
}
@ -52,7 +52,7 @@ public class ExternalDatasetsData extends FieldData<ExternalDatasetsData> {
public Map<String, Object> toMap(Element item) {
HashMap dataMap = new HashMap();
dataMap.put("label", item != null && item.getAttributes().getLength() > 0? item.getAttribute("label") : "");
dataMap.put("multiAutoComplete", item != null && item.getAttributes().getLength() > 0? item.getAttribute("multiAutoComplete") : false);
dataMap.put("multiAutoComplete", item != null && item.getAttributes().getLength() > 0? Boolean.parseBoolean(item.getAttribute("multiAutocomplete")) : false);
return dataMap;
}
}

View File

@ -21,7 +21,7 @@ public class OrganizationsData extends FieldData<OrganizationsData> {
public OrganizationsData fromData(Object data) {
if (data != null) {
this.setLabel((String) ((Map<String, Object>) data).get("label"));
this.setMultiAutoComplete(((Map<String, Object>) data).get("multiAutoComplete") != null ? (Boolean) ((Map<String, Object>) data).get("multiAutoComplete") : false);
this.setMultiAutoComplete(((Map<String, Object>) data).get("multiAutoComplete") != null && !((Map<String, Object>) data).get("multiAutoComplete").toString().isEmpty()? Boolean.parseBoolean( ((Map<String, Object>) data).get("multiAutoComplete").toString()) : false);
}
return this;
}
@ -52,7 +52,7 @@ public class OrganizationsData extends FieldData<OrganizationsData> {
public Map<String, Object> toMap(Element item) {
HashMap dataMap = new HashMap();
dataMap.put("label", item != null && item.getAttributes().getLength() > 0? item.getAttribute("label") : "");
dataMap.put("multiAutoComplete", item != null && item.getAttributes().getLength() > 0? item.getAttribute("multiAutoComplete") : false);
dataMap.put("multiAutoComplete", item != null && item.getAttributes().getLength() > 0? Boolean.parseBoolean(item.getAttribute("multiAutocomplete")) : false);
return dataMap;
}
}

View File

@ -21,7 +21,7 @@ public class RegistriesData extends FieldData<RegistriesData> {
public RegistriesData fromData(Object data) {
if (data != null) {
this.setLabel((String) ((Map<String, Object>) data).get("label"));
this.setMultiAutoComplete((Boolean) ((Map<String, Object>) data).get("multiAutoComplete"));
this.setMultiAutoComplete(((Map<String, Object>) data).get("multiAutoComplete") != null && !((Map<String, Object>) data).get("multiAutoComplete").toString().isEmpty()?Boolean.parseBoolean( ((Map<String, Object>) data).get("multiAutoComplete").toString()): false);
}
return this;
}
@ -52,7 +52,7 @@ public class RegistriesData extends FieldData<RegistriesData> {
public Map<String, Object> toMap(Element item) {
HashMap dataMap = new HashMap();
dataMap.put("label", item != null && item.getAttributes().getLength() > 0? item.getAttribute("label") : "");
dataMap.put("multiAutoComplete", item != null && item.getAttributes().getLength() > 0? item.getAttribute("multiAutoComplete") : false);
dataMap.put("multiAutoComplete", item != null && item.getAttributes().getLength() > 0? Boolean.parseBoolean(item.getAttribute("multiAutocomplete")) : false);
return dataMap;
}
}

View File

@ -21,7 +21,7 @@ public class ResearcherData extends FieldData<ResearcherData> {
public ResearcherData fromData(Object data) {
if (data != null) {
this.setLabel((String) ((Map<String, Object>) data).get("label"));
this.setMultiAutoComplete(((Map<String, Object>) data).get("multiAutoComplete") != null ? (Boolean) ((Map<String, Object>) data).get("multiAutoComplete") : false);
this.setMultiAutoComplete(((Map<String, Object>) data).get("multiAutoComplete") != null && !((Map<String, Object>) data).get("multiAutoComplete").toString().isEmpty()? Boolean.parseBoolean( ((Map<String, Object>) data).get("multiAutoComplete").toString()) : false);
}
return this;
}
@ -52,7 +52,7 @@ public class ResearcherData extends FieldData<ResearcherData> {
public Map<String, Object> toMap(Element item) {
HashMap dataMap = new HashMap();
dataMap.put("label", item != null && item.getAttributes().getLength() > 0 ? item.getAttribute("label") : "");
dataMap.put("multiAutoComplete", item != null && item.getAttributes().getLength() > 0 ? item.getAttribute("multiAutoComplete") : false);
dataMap.put("multiAutoComplete", item != null && item.getAttributes().getLength() > 0 ? Boolean.parseBoolean(item.getAttribute("multiAutocomplete")) : false);
return dataMap;
}
}

View File

@ -21,7 +21,7 @@ public class ServicesData extends FieldData<ServicesData> {
public ServicesData fromData(Object data) {
if (data != null) {
this.setLabel((String) ((Map<String, Object>) data).get("label"));
this.setMultiAutoComplete(((Map<String, Object>) data).get("multiAutoComplete") != null ? (Boolean) ((Map<String, Object>) data).get("multiAutoComplete") : false);
this.setMultiAutoComplete(((Map<String, Object>) data).get("multiAutoComplete") != null && !((Map<String, Object>) data).get("multiAutoComplete").toString().isEmpty()? Boolean.parseBoolean( ((Map<String, Object>) data).get("multiAutoComplete").toString()) : false);
}
return this;
}
@ -52,7 +52,7 @@ public class ServicesData extends FieldData<ServicesData> {
public Map<String, Object> toMap(Element item) {
HashMap dataMap = new HashMap();
dataMap.put("label", item != null && item.getAttributes().getLength() > 0? item.getAttribute("label") : "");
dataMap.put("multiAutoComplete", item != null && item.getAttributes().getLength() > 0? item.getAttribute("multiAutoComplete") : false);
dataMap.put("multiAutoComplete", item != null && item.getAttributes().getLength() > 0? Boolean.parseBoolean(item.getAttribute("multiAutocomplete")) : false);
return dataMap;
}
}