diff options
author | Magdalena Grodzińska <mag.grodzinska@gmail.com> | 2019-11-24 21:16:39 +0100 |
---|---|---|
committer | Magdalena Grodzińska <mag.grodzinska@gmail.com> | 2019-11-24 21:16:39 +0100 |
commit | 60aa743347f1d7c099cc6fc34e4bc8a9eeaef983 (patch) | |
tree | 2643c34de9b3ed3ef0ee72b44a55f966105ba4ab /src | |
parent | bc208bbea11c4e0babdad30bd13a70ec7c3b70f1 (diff) |
Remove query from attribute submission
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java | 8 | ||||
-rw-r--r-- | src/main/resources/pl/edu/mimuw/cloudatlas/client/templates/attribForm.html | 1 |
2 files changed, 3 insertions, 6 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java index 80a331e..a122813 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java @@ -94,6 +94,7 @@ public class ClientController { private Set<ValueContact> parseContactsString(DataStringInput contactsInput) throws Exception { Gson gson = new Gson(); + System.out.println(contactsInput); Map<String, ArrayList> contactStrings = gson.fromJson(contactsInput.getString(), Map.class); Set<ValueContact> contactObjects = new HashSet<ValueContact>(); ArrayList<Double> cAddr; @@ -147,6 +148,7 @@ public class ClientController { String currentTypeString = types.get(1); AttributeInput attributeInput = new AttributeInput(); ArrayList<String> newTypes = new ArrayList<>(types.subList(1, types.size())); + Gson gson = new Gson(); for (int i = 0; i < values.size(); i++) { if (currentTypeString.equals("List")) { @@ -155,7 +157,7 @@ public class ClientController { resultValue.add(parseSetAttributeValue((List) values.get(i), newTypes)); } else { attributeInput.setAttributeType(currentTypeString); - attributeInput.setValueString(values.get(i).toString()); + attributeInput.setValueString(gson.toJson(values.get(i))); resultValue.add(parseAttributeValue(attributeInput)); } } @@ -208,10 +210,6 @@ public class ClientController { contactsString.setString(attributeObject.getValueString()); attributeValue = parseContactsString(contactsString).iterator().next(); break; - case "Query": - Map parsedQuery = gson.fromJson(attributeObject.getValueString(), Map.class); - attributeValue = new ValueQuery(attributeObject.getValueString()); - break; case "List": List parsedListValue = gson.fromJson(attributeObject.getValueString(), List.class); ArrayList<String> parsedListTypes = new ArrayList<>(Arrays.asList( diff --git a/src/main/resources/pl/edu/mimuw/cloudatlas/client/templates/attribForm.html b/src/main/resources/pl/edu/mimuw/cloudatlas/client/templates/attribForm.html index ed6dcd2..3740491 100644 --- a/src/main/resources/pl/edu/mimuw/cloudatlas/client/templates/attribForm.html +++ b/src/main/resources/pl/edu/mimuw/cloudatlas/client/templates/attribForm.html @@ -30,7 +30,6 @@ <option th:value="Time" th:text="Time"></option> <option th:value="Duration" th:text="Duration"></option> <option th:value="Contact" th:text="Contact"></option> - <option th:value="Query" th:text="Query"></option> <option th:value="List" th:text="List"></option> <option th:value="Set" th:text="Set"></option> </select> |