From 89b3f1164af4d157a1419e203575fe9a56f25794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Tue, 19 Nov 2019 19:22:13 +0100 Subject: Add working home page front-end --- .../mimuw/cloudatlas/client/ClientController.java | 26 ++++++++++++++++++++++ .../pl/edu/mimuw/cloudatlas/client/Controller.java | 25 --------------------- .../java/pl/edu/mimuw/cloudatlas/client/Query.java | 4 ++++ 3 files changed, 30 insertions(+), 25 deletions(-) create mode 100644 src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java delete mode 100644 src/main/java/pl/edu/mimuw/cloudatlas/client/Controller.java create mode 100644 src/main/java/pl/edu/mimuw/cloudatlas/client/Query.java (limited to 'src/main/java') diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java new file mode 100644 index 0000000..ce3ee81 --- /dev/null +++ b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java @@ -0,0 +1,26 @@ +package pl.edu.mimuw.cloudatlas.client; + +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.*; +import org.springframework.stereotype.Controller; + +/* +should enable reading attribute values stored by the agent +installing and +uninstalling queries, and +setting fallback contacts. + +Apart from providing forms for queries and fallback contacts, +and presenting the information fetched from the agent in a textual form (with automatic refreshment), +plotting the attributes with numeric values as real-time graphs. +*/ + +@Controller +public class ClientController { + + @GetMapping("/") + public String homePage(Model model) { + model.addAttribute("homeMessage", "Welcome to CloudaAtlas client interface"); + return "home"; + } +} diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/client/Controller.java b/src/main/java/pl/edu/mimuw/cloudatlas/client/Controller.java deleted file mode 100644 index 3b0ec63..0000000 --- a/src/main/java/pl/edu/mimuw/cloudatlas/client/Controller.java +++ /dev/null @@ -1,25 +0,0 @@ -package pl.edu.mimuw.cloudatlas.client; - -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/* -should enable reading attribute values stored by the agent -installing and -uninstalling queries, and -setting fallback contacts. - -Apart from providing forms for queries and fallback contacts, -and presenting the information fetched from the agent in a textual form (with automatic refreshment), -plotting the attributes with numeric values as real-time graphs. -*/ - -@RestController -public class Controller { - - @GetMapping("/") - public String homePage(Model model) { - return "home"; - } -} diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/client/Query.java b/src/main/java/pl/edu/mimuw/cloudatlas/client/Query.java new file mode 100644 index 0000000..468c869 --- /dev/null +++ b/src/main/java/pl/edu/mimuw/cloudatlas/client/Query.java @@ -0,0 +1,4 @@ +package pl.edu.mimuw.cloudatlas.client; + +public class Query { +} -- cgit v1.2.3 From b5b9ab553ee97019021098028738ed8d253c0bd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Tue, 19 Nov 2019 19:33:10 +0100 Subject: Add query submission form --- .../mimuw/cloudatlas/client/ClientController.java | 13 ++++++++++ .../java/pl/edu/mimuw/cloudatlas/client/Query.java | 30 +++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) (limited to 'src/main/java') 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 ce3ee81..56237f0 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java @@ -23,4 +23,17 @@ public class ClientController { model.addAttribute("homeMessage", "Welcome to CloudaAtlas client interface"); return "home"; } + + @GetMapping("/query") + public String queryPage(Model model) { + model.addAttribute("queryObject", new Query()); + return "queryForm"; + } + + @PostMapping("/submitQuery") + public String submitQuery(@ModelAttribute Query queryObject, Model model) { + System.out.println(queryObject.toString()); + model.addAttribute("homeMessage", "Query submitted successfully"); + return "home"; + } } diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/client/Query.java b/src/main/java/pl/edu/mimuw/cloudatlas/client/Query.java index 468c869..de6a18e 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/client/Query.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/client/Query.java @@ -1,4 +1,32 @@ package pl.edu.mimuw.cloudatlas.client; -public class Query { +class Query { + private String name; + private String value; + +// Query() { +// this.name = ""; +// this.value = ""; +// } +// +// Query(String name, String value){ +// this.name = name; +// this.value = value; +// } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } } -- cgit v1.2.3 From 5baaff8082847b2cfb8243fac63a05bfaa1ef35b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Tue, 19 Nov 2019 19:35:46 +0100 Subject: Simplify query addressing --- src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java') 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 56237f0..01a0b94 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java @@ -30,7 +30,7 @@ public class ClientController { return "queryForm"; } - @PostMapping("/submitQuery") + @PostMapping("/query") public String submitQuery(@ModelAttribute Query queryObject, Model model) { System.out.println(queryObject.toString()); model.addAttribute("homeMessage", "Query submitted successfully"); -- cgit v1.2.3 From fc3fffece6905e1baf2482c844533c7fb4c0a885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Tue, 19 Nov 2019 19:48:18 +0100 Subject: Add contact list submission front-end --- .../pl/edu/mimuw/cloudatlas/client/ClientController.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/main/java') 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 01a0b94..c092d4f 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java @@ -36,4 +36,16 @@ public class ClientController { model.addAttribute("homeMessage", "Query submitted successfully"); return "home"; } + + @GetMapping("/contacts") + public String contactPage(Model model) { + return "contactsForm"; + } + + @PostMapping("/contacts") + public String contactPage(@ModelAttribute String contactsObject, Model model) { + System.out.println(contactsObject); + model.addAttribute("homeMessage", "Contact list submitted successfully"); + return "home"; + } } -- cgit v1.2.3 From c8891036b9d932926b93c0b519244046e54d01ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Tue, 19 Nov 2019 19:49:06 +0100 Subject: Stylistic fixes --- src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/main/java') 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 c092d4f..79676eb 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java @@ -32,7 +32,6 @@ public class ClientController { @PostMapping("/query") public String submitQuery(@ModelAttribute Query queryObject, Model model) { - System.out.println(queryObject.toString()); model.addAttribute("homeMessage", "Query submitted successfully"); return "home"; } @@ -44,7 +43,6 @@ public class ClientController { @PostMapping("/contacts") public String contactPage(@ModelAttribute String contactsObject, Model model) { - System.out.println(contactsObject); model.addAttribute("homeMessage", "Contact list submitted successfully"); return "home"; } -- cgit v1.2.3 From 7805b12121837f38ab4b342b3768ca4dd5777d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Tue, 19 Nov 2019 19:58:46 +0100 Subject: Add atttibute plotting front-end skeleton --- src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main/java') 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 79676eb..62f77ee 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java @@ -46,4 +46,9 @@ public class ClientController { model.addAttribute("homeMessage", "Contact list submitted successfully"); return "home"; } + + @GetMapping("/attribs") + public String attribPage(Model model) { + return "attribChart"; + } } -- cgit v1.2.3 From 5f8ccad41f03b75acb9e3c1d5b46f86c344a721a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Tue, 19 Nov 2019 20:01:09 +0100 Subject: Fix Query comments --- src/main/java/pl/edu/mimuw/cloudatlas/client/Query.java | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/client/Query.java b/src/main/java/pl/edu/mimuw/cloudatlas/client/Query.java index de6a18e..ff9b7f4 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/client/Query.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/client/Query.java @@ -4,16 +4,6 @@ class Query { private String name; private String value; -// Query() { -// this.name = ""; -// this.value = ""; -// } -// -// Query(String name, String value){ -// this.name = name; -// this.value = value; -// } - public String getName() { return this.name; } -- cgit v1.2.3