From 60aa743347f1d7c099cc6fc34e4bc8a9eeaef983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Sun, 24 Nov 2019 21:16:39 +0100 Subject: Remove query from attribute submission --- .../java/pl/edu/mimuw/cloudatlas/client/ClientController.java | 8 +++----- .../pl/edu/mimuw/cloudatlas/client/templates/attribForm.html | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'src/main') 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 parseContactsString(DataStringInput contactsInput) throws Exception { Gson gson = new Gson(); + System.out.println(contactsInput); Map contactStrings = gson.fromJson(contactsInput.getString(), Map.class); Set contactObjects = new HashSet(); ArrayList cAddr; @@ -147,6 +148,7 @@ public class ClientController { String currentTypeString = types.get(1); AttributeInput attributeInput = new AttributeInput(); ArrayList 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 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 @@ - -- cgit v1.2.3