Initial stab at fixing the CRUD servlets and service JS.

This commit is contained in:
Michael Jumper
2013-08-10 15:43:33 -07:00
parent 2e990edc22
commit 701368a7fe
6 changed files with 28 additions and 20 deletions

View File

@@ -47,8 +47,8 @@ public class Create extends AuthenticatingHttpServlet {
HttpServletRequest request, HttpServletResponse response)
throws GuacamoleException {
// Get ID and protocol
String identifier = request.getParameter("id");
// Get name and protocol
String name = request.getParameter("name");
String protocol = request.getParameter("protocol");
// Attempt to get connection directory
@@ -75,7 +75,7 @@ public class Create extends AuthenticatingHttpServlet {
// Create connection skeleton
Connection connection = new DummyConnection();
connection.setIdentifier(identifier);
connection.setName(name);
connection.setConfiguration(config);
// Add connection

View File

@@ -126,6 +126,7 @@ public class List extends AuthenticatingHttpServlet {
// Write connection
xml.writeStartElement("connection");
xml.writeAttribute("id", identifier);
xml.writeAttribute("name", connection.getName());
xml.writeAttribute("protocol",
connection.getConfiguration().getProtocol());

View File

@@ -47,9 +47,10 @@ public class Update extends AuthenticatingHttpServlet {
HttpServletRequest request, HttpServletResponse response)
throws GuacamoleException {
// Get ID and protocol
// Get ID, name, and protocol
String identifier = request.getParameter("id");
String protocol = request.getParameter("protocol");
String name = request.getParameter("name");
String protocol = request.getParameter("protocol");
// Attempt to get connection directory
Directory<String, Connection> directory =
@@ -75,6 +76,7 @@ public class Update extends AuthenticatingHttpServlet {
// Create connection skeleton
Connection connection = directory.get(identifier);
connection.setName(name);
connection.setConfiguration(config);
// Update connection