From 43fab89ecfb17619711b1eec61a4feeb717211b9 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 25 May 2015 19:56:53 -0700 Subject: [PATCH] GUAC-800: Migrate to JSON for protocol descriptions. Use full Forms instead of simply Fields for protocol parameters (allow sections). --- .../guacamole/auth/jdbc/user/UserContext.java | 14 +- guacamole-ext/pom.xml | 7 + .../environment/LocalEnvironment.java | 97 +++--- .../org/glyptodon/guacamole/form/Field.java | 277 +++++++++++++++++ ...{ParameterOption.java => FieldOption.java} | 17 +- .../org/glyptodon/guacamole/form/Form.java | 143 +++++++++ .../glyptodon/guacamole/form/Parameter.java | 283 ------------------ .../{xml/protocol => form}/package-info.java | 9 +- .../guacamole/net/auth/UserContext.java | 8 +- .../net/auth/credentials/CredentialsInfo.java | 38 +-- .../net/auth/simple/SimpleUserContext.java | 14 +- .../guacamole/protocols/ProtocolInfo.java | 56 ++-- .../xml/protocol/OptionTagHandler.java | 65 ---- .../xml/protocol/ParamTagHandler.java | 124 -------- .../xml/protocol/ProtocolTagHandler.java | 81 ----- .../glyptodon/guacamole/protocols/rdp.json | 253 ++++++++++++++++ .../org/glyptodon/guacamole/protocols/rdp.xml | 57 ---- .../glyptodon/guacamole/protocols/ssh.json | 143 +++++++++ .../org/glyptodon/guacamole/protocols/ssh.xml | 33 -- .../glyptodon/guacamole/protocols/telnet.json | 125 ++++++++ .../glyptodon/guacamole/protocols/telnet.xml | 31 -- .../glyptodon/guacamole/protocols/vnc.json | 136 +++++++++ .../org/glyptodon/guacamole/protocols/vnc.xml | 30 -- .../guacamole/net/basic/rest/APIError.java | 17 +- .../net/basic/rest/APIException.java | 6 +- .../AuthProviderRESTExceptionWrapper.java | 6 +- .../basic/rest/schema/SchemaRESTService.java | 20 +- .../manage/styles/connection-parameter.css | 6 + .../manage/templates/manageConnection.html | 2 +- .../main/webapp/app/rest/types/Protocol.js | 8 +- .../src/main/webapp/translations/en_US.json | 42 ++- 31 files changed, 1271 insertions(+), 877 deletions(-) create mode 100644 guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Field.java rename guacamole-ext/src/main/java/org/glyptodon/guacamole/form/{ParameterOption.java => FieldOption.java} (86%) create mode 100644 guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Form.java delete mode 100644 guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Parameter.java rename guacamole-ext/src/main/java/org/glyptodon/guacamole/{xml/protocol => form}/package-info.java (85%) delete mode 100644 guacamole-ext/src/main/java/org/glyptodon/guacamole/xml/protocol/OptionTagHandler.java delete mode 100644 guacamole-ext/src/main/java/org/glyptodon/guacamole/xml/protocol/ParamTagHandler.java delete mode 100644 guacamole-ext/src/main/java/org/glyptodon/guacamole/xml/protocol/ProtocolTagHandler.java create mode 100644 guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/rdp.json delete mode 100644 guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/rdp.xml create mode 100644 guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/ssh.json delete mode 100644 guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/ssh.xml create mode 100644 guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/telnet.json delete mode 100644 guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/telnet.xml create mode 100644 guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/vnc.json delete mode 100644 guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/vnc.xml diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/user/UserContext.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/user/UserContext.java index 171642e7b..00f7150f7 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/user/UserContext.java +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/user/UserContext.java @@ -33,7 +33,7 @@ import java.util.Collections; import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.auth.jdbc.base.RestrictedObject; import org.glyptodon.guacamole.auth.jdbc.activeconnection.ActiveConnectionDirectory; -import org.glyptodon.guacamole.form.Parameter; +import org.glyptodon.guacamole.form.Field; import org.glyptodon.guacamole.net.auth.ActiveConnection; import org.glyptodon.guacamole.net.auth.Connection; import org.glyptodon.guacamole.net.auth.ConnectionGroup; @@ -134,18 +134,18 @@ public class UserContext extends RestrictedObject } @Override - public Collection getUserAttributes() { - return Collections.emptyList(); + public Collection getUserAttributes() { + return Collections.emptyList(); } @Override - public Collection getConnectionAttributes() { - return Collections.emptyList(); + public Collection getConnectionAttributes() { + return Collections.emptyList(); } @Override - public Collection getConnectionGroupAttributes() { - return Collections.emptyList(); + public Collection getConnectionGroupAttributes() { + return Collections.emptyList(); } } diff --git a/guacamole-ext/pom.xml b/guacamole-ext/pom.xml index 4dc59dad0..a817865dd 100644 --- a/guacamole-ext/pom.xml +++ b/guacamole-ext/pom.xml @@ -128,6 +128,13 @@ test + + + org.codehaus.jackson + jackson-mapper-asl + 1.9.2 + + diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/environment/LocalEnvironment.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/environment/LocalEnvironment.java index 35200c0d1..3a1dade0d 100644 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/environment/LocalEnvironment.java +++ b/guacamole-ext/src/main/java/org/glyptodon/guacamole/environment/LocalEnvironment.java @@ -22,7 +22,6 @@ package org.glyptodon.guacamole.environment; -import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FilenameFilter; @@ -31,18 +30,13 @@ import java.io.InputStream; import java.util.HashMap; import java.util.Map; import java.util.Properties; +import org.codehaus.jackson.map.ObjectMapper; import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleServerException; import org.glyptodon.guacamole.properties.GuacamoleProperty; import org.glyptodon.guacamole.protocols.ProtocolInfo; -import org.glyptodon.guacamole.xml.DocumentHandler; -import org.glyptodon.guacamole.xml.protocol.ProtocolTagHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; -import org.xml.sax.helpers.XMLReaderFactory; /** * The environment of the locally-running Guacamole instance, describing @@ -79,6 +73,11 @@ public class LocalEnvironment implements Environment { */ private final Map availableProtocols; + /** + * The Jackson parser for parsing JSON files. + */ + private static final ObjectMapper mapper = new ObjectMapper(); + /** * Creates a new Environment, initializing that environment based on the * location of GUACAMOLE_HOME and the contents of guacamole.properties. @@ -162,48 +161,25 @@ public class LocalEnvironment implements Environment { } /** - * Parses the given XML file, returning the parsed ProtocolInfo. + * Parses the given JSON file, returning the parsed ProtocolInfo. The JSON + * format is conveniently and intentionally identical to a serialized + * ProtocolInfo object, which is identical to the JSON format used by the + * protocol REST service built into the Guacamole web application. * - * @param input An input stream containing XML describing the parameters - * associated with a protocol supported by Guacamole. - * @return A new ProtocolInfo object which contains the parameters described - * by the XML file parsed. - * @throws GuacamoleException If an error occurs while parsing the XML file. + * @param input + * An input stream containing JSON describing the forms and parameters + * associated with a protocol supported by Guacamole. + * + * @return + * A new ProtocolInfo object which contains the forms and parameters + * described by the JSON file parsed. + * + * @throws IOException + * If an error occurs while parsing the JSON file. */ private ProtocolInfo readProtocol(InputStream input) - throws GuacamoleException { - - // Parse document - try { - - // Get handler for root element - ProtocolTagHandler protocolTagHandler = - new ProtocolTagHandler(); - - // Set up document handler - DocumentHandler contentHandler = new DocumentHandler( - "protocol", protocolTagHandler); - - // Set up XML parser - XMLReader parser = XMLReaderFactory.createXMLReader(); - parser.setContentHandler(contentHandler); - - // Read and parse file - InputStream xml = new BufferedInputStream(input); - parser.parse(new InputSource(xml)); - xml.close(); - - // Return parsed protocol - return protocolTagHandler.asProtocolInfo(); - - } - catch (IOException e) { - throw new GuacamoleException("Error reading basic user mapping file.", e); - } - catch (SAXException e) { - throw new GuacamoleException("Error parsing basic user mapping XML.", e); - } - + throws IOException { + return mapper.readValue(input, ProtocolInfo.class); } /** @@ -212,9 +188,11 @@ public class LocalEnvironment implements Environment { * each of these protocols. The key of each entry will be the name of that * protocol, as would be passed to guacd during connection. * - * @return A map of all available protocols. - * @throws GuacamoleException If an error occurs while reading the various - * protocol XML files. + * @return + * A map of all available protocols. + * + * @throws GuacamoleException + * If an error occurs while reading the various protocol JSON files. */ private Map readProtocols() throws GuacamoleException { @@ -227,13 +205,13 @@ public class LocalEnvironment implements Environment { // Read protocols from directory if it exists if (protocol_directory.isDirectory()) { - // Get all XML files + // Get all JSON files File[] files = protocol_directory.listFiles( new FilenameFilter() { @Override public boolean accept(File file, String string) { - return string.endsWith(".xml"); + return string.endsWith(".json"); } } @@ -261,7 +239,7 @@ public class LocalEnvironment implements Environment { } catch (IOException e) { logger.error("Unable to read connection parameter information from \"{}\": {}", file.getAbsolutePath(), e.getMessage()); - logger.debug("Error reading protocol XML.", e); + logger.debug("Error reading protocol JSON.", e); } } @@ -276,11 +254,18 @@ public class LocalEnvironment implements Environment { InputStream stream = LocalEnvironment.class.getResourceAsStream( "/org/glyptodon/guacamole/protocols/" - + protocol + ".xml"); + + protocol + ".json"); - // Parse XML if available - if (stream != null) - protocols.put(protocol, readProtocol(stream)); + // Parse JSON if available + if (stream != null) { + try { + protocols.put(protocol, readProtocol(stream)); + } + catch (IOException e) { + logger.error("Unable to read pre-defined connection parameter information for protocol \"{}\": {}", protocol, e.getMessage()); + logger.debug("Error reading pre-defined protocol JSON.", e); + } + } } diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Field.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Field.java new file mode 100644 index 000000000..70b1b9e3a --- /dev/null +++ b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Field.java @@ -0,0 +1,277 @@ +/* + * Copyright (C) 2013 Glyptodon LLC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package org.glyptodon.guacamole.form; + +import java.util.ArrayList; +import java.util.Collection; +import org.codehaus.jackson.map.annotate.JsonSerialize; + +/** + * Represents an arbitrary field, such as an HTTP parameter, the parameter of a + * remote desktop protocol, or an input field within a form. + * + * @author Michael Jumper + */ +@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL) +public class Field { + + /** + * All possible types of field. + */ + public enum Type { + + /** + * A text field, accepting arbitrary values. + */ + TEXT, + + /** + * A username field. This field type generally behaves identically to + * arbitrary text fields, but has semantic differences. + */ + USERNAME, + + /** + * A password field, whose value is sensitive and must be hidden. + */ + PASSWORD, + + /** + * A numeric field, whose value must contain only digits. + */ + NUMERIC, + + /** + * A boolean field, whose value is either blank or "true". + */ + BOOLEAN, + + /** + * An enumerated field, whose legal values are fully enumerated by a + * provided, finite list. + */ + ENUM, + + /** + * A text field that can span more than one line. + */ + MULTILINE + + } + + /** + * The unique name that identifies this field. + */ + private String name; + + /** + * A human-readable name to be presented to the user. + */ + private String title; + + /** + * The type of this field. + */ + private Type type; + + /** + * The value of this field, when checked. This is only applicable to + * BOOLEAN fields. + */ + private String value; + + /** + * A collection of all associated field options. + */ + private Collection options; + + /** + * Creates a new Parameter with no associated name, title, or type. + */ + public Field() { + } + + /** + * Creates a new Parameter with the given name, title, and type. + * + * @param name + * The unique name to associate with this field. + * + * @param title + * The human-readable title to associate with this field. + * + * @param type + * The type of this field. + */ + public Field(String name, String title, Type type) { + this.name = name; + this.title = title; + this.type = type; + } + + /** + * Creates a new BOOLEAN Parameter with the given name, title, and value. + * + * @param name + * The unique name to associate with this field. + * + * @param title + * The human-readable title to associate with this field. + * + * @param value + * The value that should be assigned to this field if enabled. + */ + public Field(String name, String title, String value) { + this.name = name; + this.title = title; + this.type = Type.BOOLEAN; + this.value = value; + } + + /** + * Creates a new ENUM Parameter with the given name, title, and options. + * + * @param name + * The unique name to associate with this field. + * + * @param title + * The human-readable title to associate with this field. + * + * @param options + * A collection of all possible valid options for this field. + */ + public Field(String name, String title, Collection options) { + this.name = name; + this.title = title; + this.type = Type.ENUM; + this.options = options; + } + + /** + * Returns the unique name associated with this field. + * + * @return + * The unique name associated with this field. + */ + public String getName() { + return name; + } + + /** + * Sets the unique name associated with this field. + * + * @param name + * The unique name to assign to this field. + */ + public void setName(String name) { + this.name = name; + } + + /** + * Returns the human-readable title associated with this field. + * + * @return + * The human-readable title associated with this field. + */ + public String getTitle() { + return title; + } + + /** + * Sets the title associated with this field. The title must be a human- + * readable string which describes accurately this field. + * + * @param title + * A human-readable string describing this field. + */ + public void setTitle(String title) { + this.title = title; + } + + /** + * Returns the value that should be assigned to this field if enabled. This + * is only applicable to BOOLEAN fields. + * + * @return + * The value that should be assigned to this field if enabled. + */ + public String getValue() { + return value; + } + + /** + * Sets the value that should be assigned to this field if enabled. This is + * only applicable to BOOLEAN fields. + * + * @param value + * The value that should be assigned to this field if enabled. + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Returns the type of this field. + * + * @return + * The type of this field. + */ + public Type getType() { + return type; + } + + /** + * Sets the type of this field. + * + * @param type + * The type of this field. + */ + public void setType(Type type) { + this.type = type; + } + + /** + * Returns a mutable collection of field options. Changes to this + * collection directly affect the available options. This is only + * applicable to ENUM fields. + * + * @return + * A mutable collection of field options, or null if the field has no + * options. + */ + public Collection getOptions() { + return options; + } + + /** + * Sets the options available as possible values of this field. This is + * only applicable to ENUM fields. + * + * @param options + * The options to associate with this field. + */ + public void setOptions(Collection options) { + this.options = options; + } + +} diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/ParameterOption.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/FieldOption.java similarity index 86% rename from guacamole-ext/src/main/java/org/glyptodon/guacamole/form/ParameterOption.java rename to guacamole-ext/src/main/java/org/glyptodon/guacamole/form/FieldOption.java index a722749bf..499a069bf 100644 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/ParameterOption.java +++ b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/FieldOption.java @@ -22,12 +22,15 @@ package org.glyptodon.guacamole.form; +import org.codehaus.jackson.map.annotate.JsonSerialize; + /** - * Describes an available legal value for an enumerated parameter. + * Describes an available legal value for an enumerated field. * * @author Michael Jumper */ -public class ParameterOption { +@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL) +public class FieldOption { /** * The value that will be assigned if this option is chosen. @@ -40,13 +43,13 @@ public class ParameterOption { private String title; /** - * Creates a new ParameterOption with no associated value or title. + * Creates a new FieldOption with no associated value or title. */ - public ParameterOption() { + public FieldOption() { } /** - * Creates a new ParameterOption having the given value and title. + * Creates a new FieldOption having the given value and title. * * @param value * The value to assign if this option is chosen. @@ -54,11 +57,11 @@ public class ParameterOption { * @param title * The human-readable title to associate with this option. */ - public ParameterOption(String value, String title) { + public FieldOption(String value, String title) { this.value = value; this.title = title; } - + /** * Returns the value that will be assigned if this option is chosen. * diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Form.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Form.java new file mode 100644 index 000000000..192799a42 --- /dev/null +++ b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Form.java @@ -0,0 +1,143 @@ +/* + * Copyright (C) 2015 Glyptodon LLC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package org.glyptodon.guacamole.form; + +import java.util.ArrayList; +import java.util.Collection; +import org.codehaus.jackson.map.annotate.JsonSerialize; + +/** + * Information which describes logical set of fields. + * + * @author Michael Jumper + */ +@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL) +public class Form { + + /** + * The name of this form. The form name must identify the form uniquely + * from other forms. + */ + private String name; + + /** + * The a human-readable title describing this form. + */ + private String title; + + /** + * All fields associated with this form. + */ + private Collection fields; + + /** + * Creates a new Form object with no associated fields. The name and title + * of the form are left unset as null. If no form name is provided, this + * form must not be used in the same context as another unnamed form. + */ + public Form() { + fields = new ArrayList(); + } + + /** + * Creates a new Form object having the given name and title, and + * containing the given fields. + * + * @param name + * A name which uniquely identifies this form. + * + * @param title + * A human-readable title describing this form. + * + * @param fields + * The fields to provided within the new Form. + */ + public Form(String name, String title, Collection fields) { + this.fields = fields; + } + + /** + * Returns a mutable collection of the fields associated with this form. + * Changes to this collection affect the fields exposed to the user. + * + * @return + * A mutable collection of fields. + */ + public Collection getFields() { + return fields; + } + + /** + * Sets the collection of fields associated with this form. + * + * @param fields + * The collection of fields to associate with this form. + */ + public void setFields(Collection fields) { + this.fields = fields; + } + + /** + * Returns the name of this form. Form names must uniquely identify each + * form. + * + * @return + * The name of this form, or null if the form has no name. + */ + public String getName() { + return name; + } + + /** + * Sets the name of this form. Form names must uniquely identify each form. + * + * @param name + * The name to assign to this form. + */ + public void setName(String name) { + this.name = name; + } + + /** + * Returns the human-readable title associated with this form. A form's + * title describes the form, but need not be unique. + * + * @return + * A human-readable title describing this form. + */ + public String getTitle() { + return title; + } + + /** + * Sets the human-readable title associated with this form. A form's title + * describes the form, but need not be unique. + * + * @param title + * A human-readable title describing this form. + */ + public void setTitle(String title) { + this.title = title; + } + +} diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Parameter.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Parameter.java deleted file mode 100644 index 033749b88..000000000 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Parameter.java +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Copyright (C) 2013 Glyptodon LLC - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package org.glyptodon.guacamole.form; - -import java.util.ArrayList; -import java.util.Collection; - -/** - * Represents an arbitrary parameter, such as an HTTP parameter, or the - * parameter of a remote desktop protocol. - * - * @author Michael Jumper - */ -public class Parameter { - - /** - * All possible types of parameter. - */ - public enum Type { - - /** - * A text parameter, accepting arbitrary values. - */ - TEXT, - - /** - * A username parameter. This parameter type generally behaves - * identically to arbitrary text parameters, but has semantic - * differences. If credential pass-through is in use, the value for this - * parameter may be automatically provided using the credentials - * originally used by the user to authenticate. - */ - USERNAME, - - /** - * A password parameter, whose value is sensitive and must be hidden. If - * credential pass-through is in use, the value for this parameter may - * be automatically provided using the credentials originally used by - * the user to authenticate. - */ - PASSWORD, - - /** - * A numeric parameter, whose value must contain only digits. - */ - NUMERIC, - - /** - * A boolean parameter, whose value is either blank or "true". - */ - BOOLEAN, - - /** - * An enumerated parameter, whose legal values are fully enumerated - * by a provided, finite list. - */ - ENUM, - - /** - * A text parameter that can span more than one line. - */ - MULTILINE - - } - - /** - * The unique name that identifies this parameter. - */ - private String name; - - /** - * A human-readable name to be presented to the user. - */ - private String title; - - /** - * The type of this parameter. - */ - private Type type; - - /** - * The value of this parameter, when checked. This is only applicable to - * BOOLEAN parameters. - */ - private String value; - - /** - * A collection of all associated parameter options. - */ - private Collection options; - - /** - * Creates a new Parameter with no associated name, title, or type. - */ - public Parameter() { - this.options = new ArrayList(); - } - - /** - * Creates a new Parameter with the given name, title, and type. - * - * @param name - * The unique name to associate with this parameter. - * - * @param title - * The human-readable title to associate with this parameter. - * - * @param type - * The type of this parameter. - */ - public Parameter(String name, String title, Type type) { - this.name = name; - this.title = title; - this.type = type; - this.options = new ArrayList(); - } - - /** - * Creates a new BOOLEAN Parameter with the given name, title, and value. - * - * @param name - * The unique name to associate with this parameter. - * - * @param title - * The human-readable title to associate with this parameter. - * - * @param value - * The value that should be assigned to this parameter if enabled. - */ - public Parameter(String name, String title, String value) { - this.name = name; - this.title = title; - this.type = Type.BOOLEAN; - this.value = value; - this.options = new ArrayList(); - } - - /** - * Creates a new ENUM Parameter with the given name, title, and options. - * - * @param name - * The unique name to associate with this parameter. - * - * @param title - * The human-readable title to associate with this parameter. - * - * @param options - * A collection of all possible valid options for this parameter. - */ - public Parameter(String name, String title, Collection options) { - this.name = name; - this.title = title; - this.type = Type.ENUM; - this.options = options; - } - - /** - * Returns the unique name associated with this parameter. - * - * @return - * The unique name associated with this parameter. - */ - public String getName() { - return name; - } - - /** - * Sets the unique name associated with this parameter. - * - * @param name - * The unique name to assign to this parameter. - */ - public void setName(String name) { - this.name = name; - } - - /** - * Returns the human-readable title associated with this parameter. - * - * @return - * The human-readable title associated with this parameter. - */ - public String getTitle() { - return title; - } - - /** - * Sets the title associated with this parameter. The title must be a - * human-readable string which describes accurately this parameter. - * - * @param title - * A human-readable string describing this parameter. - */ - public void setTitle(String title) { - this.title = title; - } - - /** - * Returns the value that should be assigned to this parameter if enabled. - * This is only applicable to BOOLEAN parameters. - * - * @return - * The value that should be assigned to this parameter if enabled. - */ - public String getValue() { - return value; - } - - /** - * Sets the value that should be assigned to this parameter if enabled. - * This is only applicable to BOOLEAN parameters. - * - * @param value - * The value that should be assigned to this parameter if enabled. - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Returns the type of this parameter. - * - * @return - * The type of this parameter. - */ - public Type getType() { - return type; - } - - /** - * Sets the type of this parameter. - * - * @param type - * The type of this parameter. - */ - public void setType(Type type) { - this.type = type; - } - - /** - * Returns a mutable collection of parameter options. Changes to this - * collection directly affect the available options. This is only - * applicable to ENUM parameters. - * - * @return - * A mutable collection of parameter options. - */ - public Collection getOptions() { - return options; - } - - /** - * Sets the options available as possible values of this parameter. This - * is only applicable to ENUM parameters. - * - * @param options - * The options to associate with this parameter. - */ - public void setOptions(Collection options) { - this.options = options; - } - -} diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/xml/protocol/package-info.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/package-info.java similarity index 85% rename from guacamole-ext/src/main/java/org/glyptodon/guacamole/xml/protocol/package-info.java rename to guacamole-ext/src/main/java/org/glyptodon/guacamole/form/package-info.java index 021d7b82d..f8fe65268 100644 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/xml/protocol/package-info.java +++ b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Glyptodon LLC + * Copyright (C) 2015 Glyptodon LLC * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -21,8 +21,7 @@ */ /** - * Classes related to parsing XML files which describe the parameters of a - * protocol. + * Provides classes which describe the contents and semantics of forms which + * may be presented to the user. */ -package org.glyptodon.guacamole.xml.protocol; - +package org.glyptodon.guacamole.form; diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/net/auth/UserContext.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/net/auth/UserContext.java index e5d1f2547..44ca67f20 100644 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/net/auth/UserContext.java +++ b/guacamole-ext/src/main/java/org/glyptodon/guacamole/net/auth/UserContext.java @@ -24,7 +24,7 @@ package org.glyptodon.guacamole.net.auth; import java.util.Collection; import org.glyptodon.guacamole.GuacamoleException; -import org.glyptodon.guacamole.form.Parameter; +import org.glyptodon.guacamole.form.Field; /** * The context of an active user. The functions of this class enforce all @@ -121,7 +121,7 @@ public interface UserContext { * @return * A collection of all attributes applicable to users. */ - Collection getUserAttributes(); + Collection getUserAttributes(); /** * Retrieves a collection of all attributes applicable to connections. This @@ -132,7 +132,7 @@ public interface UserContext { * @return * A collection of all attributes applicable to connections. */ - Collection getConnectionAttributes(); + Collection getConnectionAttributes(); /** * Retrieves a collection of all attributes applicable to connection @@ -143,6 +143,6 @@ public interface UserContext { * @return * A collection of all attributes applicable to connection groups. */ - Collection getConnectionGroupAttributes(); + Collection getConnectionGroupAttributes(); } diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/net/auth/credentials/CredentialsInfo.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/net/auth/credentials/CredentialsInfo.java index 3bd4afbc8..b68e06d5d 100644 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/net/auth/credentials/CredentialsInfo.java +++ b/guacamole-ext/src/main/java/org/glyptodon/guacamole/net/auth/credentials/CredentialsInfo.java @@ -25,7 +25,7 @@ package org.glyptodon.guacamole.net.auth.credentials; import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import org.glyptodon.guacamole.form.Parameter; +import org.glyptodon.guacamole.form.Field; /** * Information which describes a set of valid credentials. @@ -35,45 +35,45 @@ import org.glyptodon.guacamole.form.Parameter; public class CredentialsInfo { /** - * All parameters required for valid credentials. + * All fields required for valid credentials. */ - private final Collection parameters; + private final Collection fields; /** - * Creates a new CredentialsInfo object which requires the given parameters - * for any conforming credentials. + * Creates a new CredentialsInfo object which requires the given fields for + * any conforming credentials. * - * @param parameters - * The parameters to require. + * @param fields + * The fields to require. */ - public CredentialsInfo(Collection parameters) { - this.parameters = parameters; + public CredentialsInfo(Collection fields) { + this.fields = fields; } /** - * Returns all parameters required for valid credentials as described by - * this object. + * Returns all fields required for valid credentials as described by this + * object. * * @return - * All parameters required for valid credentials. + * All fields required for valid credentials. */ - public Collection getParameters() { - return Collections.unmodifiableCollection(parameters); + public Collection getFields() { + return Collections.unmodifiableCollection(fields); } /** - * CredentialsInfo object which describes empty credentials. No parameters - * are required. + * CredentialsInfo object which describes empty credentials. No fields are + * required. */ - public static final CredentialsInfo EMPTY = new CredentialsInfo(Collections.emptyList()); + public static final CredentialsInfo EMPTY = new CredentialsInfo(Collections.emptyList()); /** * CredentialsInfo object which describes standard username/password * credentials. */ public static final CredentialsInfo USERNAME_PASSWORD = new CredentialsInfo(Arrays.asList( - new Parameter("username", "username", Parameter.Type.USERNAME), - new Parameter("password", "password", Parameter.Type.PASSWORD) + new Field("username", "username", Field.Type.USERNAME), + new Field("password", "password", Field.Type.PASSWORD) )); } diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/net/auth/simple/SimpleUserContext.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/net/auth/simple/SimpleUserContext.java index 1f722428f..ee5f24ab3 100644 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/net/auth/simple/SimpleUserContext.java +++ b/guacamole-ext/src/main/java/org/glyptodon/guacamole/net/auth/simple/SimpleUserContext.java @@ -28,7 +28,7 @@ import java.util.Collections; import java.util.Map; import java.util.UUID; import org.glyptodon.guacamole.GuacamoleException; -import org.glyptodon.guacamole.form.Parameter; +import org.glyptodon.guacamole.form.Field; import org.glyptodon.guacamole.net.auth.ActiveConnection; import org.glyptodon.guacamole.net.auth.Connection; import org.glyptodon.guacamole.net.auth.ConnectionGroup; @@ -176,18 +176,18 @@ public class SimpleUserContext implements UserContext { } @Override - public Collection getUserAttributes() { - return Collections.emptyList(); + public Collection getUserAttributes() { + return Collections.emptyList(); } @Override - public Collection getConnectionAttributes() { - return Collections.emptyList(); + public Collection getConnectionAttributes() { + return Collections.emptyList(); } @Override - public Collection getConnectionGroupAttributes() { - return Collections.emptyList(); + public Collection getConnectionGroupAttributes() { + return Collections.emptyList(); } } diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/protocols/ProtocolInfo.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/protocols/ProtocolInfo.java index a5a9c3839..69b7966f1 100644 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/protocols/ProtocolInfo.java +++ b/guacamole-ext/src/main/java/org/glyptodon/guacamole/protocols/ProtocolInfo.java @@ -24,11 +24,11 @@ package org.glyptodon.guacamole.protocols; import java.util.ArrayList; import java.util.Collection; -import org.glyptodon.guacamole.form.Parameter; +import org.glyptodon.guacamole.form.Form; /** - * Describes a protocol and all parameters associated with it, as required by - * a protocol plugin for guacd. This class allows known parameters for a + * Describes a protocol and all forms associated with it, as required by + * a protocol plugin for guacd. This class allows known forms for a * protocol to be exposed to the user as friendly fields. * * @author Michael Jumper @@ -46,21 +46,21 @@ public class ProtocolInfo { private String name; /** - * A collection of all associated protocol parameters. + * A collection of all associated protocol forms. */ - private Collection parameters; + private Collection
forms; /** * Creates a new ProtocolInfo with no associated name, title, or - * parameters. + * forms. */ public ProtocolInfo() { - this.parameters = new ArrayList(); + this.forms = new ArrayList(); } /** * Creates a new ProtocolInfo having the given name and title, but without - * any parameters. + * any forms. * * @param name * The unique name associated with the protocol. @@ -69,13 +69,13 @@ public class ProtocolInfo { * The human-readable title to associate with the protocol. */ public ProtocolInfo(String name, String title) { - this.name = name; - this.title = title; - this.parameters = new ArrayList(); + this.name = name; + this.title = title; + this.forms = new ArrayList(); } /** - * Creates a new ProtocolInfo having the given name, title, and parameters. + * Creates a new ProtocolInfo having the given name, title, and forms. * * @param name * The unique name associated with the protocol. @@ -83,13 +83,13 @@ public class ProtocolInfo { * @param title * The human-readable title to associate with the protocol. * - * @param parameters - * The parameters to associate with the protocol. + * @param forms + * The forms to associate with the protocol. */ - public ProtocolInfo(String name, String title, Collection parameters) { - this.name = name; - this.title = title; - this.parameters = parameters; + public ProtocolInfo(String name, String title, Collection forms) { + this.name = name; + this.title = title; + this.forms = forms; } /** @@ -131,25 +131,25 @@ public class ProtocolInfo { } /** - * Returns a mutable collection of the protocol parameters associated with - * this protocol. Changes to this collection affect the parameters exposed + * Returns a mutable collection of the protocol forms associated with + * this protocol. Changes to this collection affect the forms exposed * to the user. * - * @return A mutable collection of protocol parameters. + * @return A mutable collection of protocol forms. */ - public Collection getParameters() { - return parameters; + public Collection getForms() { + return forms; } /** - * Sets the collection of protocol parameters associated with this + * Sets the collection of protocol forms associated with this * protocol. * - * @param parameters - * The collection of parameters to associate with this protocol. + * @param forms + * The collection of forms to associate with this protocol. */ - public void setParameters(Collection parameters) { - this.parameters = parameters; + public void setForms(Collection forms) { + this.forms = forms; } } diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/xml/protocol/OptionTagHandler.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/xml/protocol/OptionTagHandler.java deleted file mode 100644 index 89743681e..000000000 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/xml/protocol/OptionTagHandler.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2013 Glyptodon LLC - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package org.glyptodon.guacamole.xml.protocol; - -import org.glyptodon.guacamole.form.ParameterOption; -import org.glyptodon.guacamole.xml.TagHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * TagHandler for the "option" element. - * - * @author Mike Jumper - */ -public class OptionTagHandler implements TagHandler { - - /** - * The option backing this option tag. - */ - private ParameterOption option = new ParameterOption(); - - @Override - public void init(Attributes attributes) throws SAXException { - option.setValue(attributes.getValue("value")); - } - - @Override - public TagHandler childElement(String localName) throws SAXException { - throw new SAXException("The 'param' tag can contain no elements."); - } - - @Override - public void complete(String textContent) throws SAXException { - option.setTitle(textContent); - } - - /** - * Returns the ParameterOption backing this tag. - * @return The ParameterOption backing this tag. - */ - public ParameterOption asParameterOption() { - return option; - } - -} diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/xml/protocol/ParamTagHandler.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/xml/protocol/ParamTagHandler.java deleted file mode 100644 index f927891a6..000000000 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/xml/protocol/ParamTagHandler.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (C) 2013 Glyptodon LLC - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package org.glyptodon.guacamole.xml.protocol; - -import org.glyptodon.guacamole.form.Parameter; -import org.glyptodon.guacamole.xml.TagHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * TagHandler for the "param" element. - * - * @author Mike Jumper - */ -public class ParamTagHandler implements TagHandler { - - /** - * The Parameter backing this tag handler. - */ - private Parameter protocolParameter = new Parameter(); - - @Override - public void init(Attributes attributes) throws SAXException { - - protocolParameter.setName(attributes.getValue("name")); - protocolParameter.setTitle(attributes.getValue("title")); - protocolParameter.setValue(attributes.getValue("value")); - - // Parse type - String type = attributes.getValue("type"); - - // Text field - if ("text".equals(type)) - protocolParameter.setType(Parameter.Type.TEXT); - - // Numeric field - else if ("numeric".equals(type)) - protocolParameter.setType(Parameter.Type.NUMERIC); - - // Username field - else if ("username".equals(type)) - protocolParameter.setType(Parameter.Type.USERNAME); - - // Password field - else if ("password".equals(type)) - protocolParameter.setType(Parameter.Type.PASSWORD); - - // Enumerated field - else if ("enum".equals(type)) - protocolParameter.setType(Parameter.Type.ENUM); - - // Multiline field - else if ("multiline".equals(type)) - protocolParameter.setType(Parameter.Type.MULTILINE); - - // Boolean field - else if ("boolean".equals(type)) { - protocolParameter.setType(Parameter.Type.BOOLEAN); - - if(protocolParameter.getValue() == null) - throw new SAXException - ("A value is required for the boolean parameter type."); - } - - // Otherwise, fail with unrecognized type - else - throw new SAXException("Invalid parameter type: " + type); - - } - - @Override - public TagHandler childElement(String localName) throws SAXException { - - // Start parsing of option tags - if (localName.equals("option")) { - - // Get tag handler for option tag - OptionTagHandler tagHandler = new OptionTagHandler(); - - // Store stub in options collection - protocolParameter.getOptions().add( - tagHandler.asParameterOption()); - return tagHandler; - - } - - return null; - - } - - @Override - public void complete(String textContent) throws SAXException { - // Do nothing - } - - /** - * Returns the Parameter backing this tag. - * @return The Parameter backing this tag. - */ - public Parameter asParameter() { - return protocolParameter; - } - -} diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/xml/protocol/ProtocolTagHandler.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/xml/protocol/ProtocolTagHandler.java deleted file mode 100644 index 38da5030f..000000000 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/xml/protocol/ProtocolTagHandler.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2013 Glyptodon LLC - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package org.glyptodon.guacamole.xml.protocol; - -import org.glyptodon.guacamole.protocols.ProtocolInfo; -import org.glyptodon.guacamole.xml.TagHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * TagHandler for the "protocol" element. - * - * @author Mike Jumper - */ -public class ProtocolTagHandler implements TagHandler { - - /** - * The ProtocolInfo object which will contain all data parsed by this tag - * handler. - */ - private ProtocolInfo info = new ProtocolInfo(); - - @Override - public void init(Attributes attributes) throws SAXException { - info.setName(attributes.getValue("name")); - info.setTitle(attributes.getValue("title")); - } - - @Override - public TagHandler childElement(String localName) throws SAXException { - - // Start parsing of param tags, add to list of all parameters - if (localName.equals("param")) { - - // Get tag handler for param tag - ParamTagHandler tagHandler = new ParamTagHandler(); - - // Store stub in parameters collection - info.getParameters().add(tagHandler.asParameter()); - return tagHandler; - - } - - return null; - - } - - @Override - public void complete(String textContent) throws SAXException { - // Do nothing - } - - /** - * Returns the ProtocolInfo backing this tag. - * @return The ProtocolInfo backing this tag. - */ - public ProtocolInfo asProtocolInfo() { - return info; - } - -} diff --git a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/rdp.json b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/rdp.json new file mode 100644 index 000000000..7bab1e536 --- /dev/null +++ b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/rdp.json @@ -0,0 +1,253 @@ +{ + "title" : "RDP", + "name" : "rdp", + "forms" : [ + + { + "title" : "Network", + "name" : "network", + "fields" : [ + { + "name" : "hostname", + "title" : "Hostname", + "type" : "TEXT" + }, + { + "name" : "port", + "title" : "Port", + "type" : "NUMERIC" + } + ] + }, + + { + "title" : "Authentication", + "name" : "authentication", + "fields" : [ + { + "name" : "username", + "title" : "Username", + "type" : "USERNAME" + }, + { + "name" : "password", + "title" : "Password", + "type" : "PASSWORD" + }, + { + "name" : "domain", + "title" : "Domain", + "type" : "TEXT" + }, + { + "name" : "security", + "title" : "Security mode", + "type" : "ENUM", + "options" : [ + { + "value" : "", + "title" : "" + }, + { + "value" : "rdp", + "title" : "RDP encryption" + }, + { + "value" : "tls", + "title" : "TLS encryption" + }, + { + "value" : "nla", + "title" : "NLA (Network Level Authentication)" + }, + { + "value" : "any", + "title" : "Any" + } + ] + }, + { + "name" : "disable-auth", + "title" : "Disable authentication", + "type" : "BOOLEAN" + }, + { + "name" : "ignore-cert", + "title" : "Ignore server certificate", + "type" : "BOOLEAN" + } + ] + }, + + { + "title" : "Basic Parameters", + "name" : "basic-parameters", + "fields" : [ + { + "name" : "initial-program", + "title" : "Initial program", + "type" : "TEXT" + }, + { + "name" : "client-name", + "title" : "Client name", + "type" : "TEXT" + }, + { + "name" : "server-layout", + "title" : "Keyboard layout", + "type" : "ENUM", + "options" : [ + { + "value" : "", + "title" : "" + }, + { + "value" : "en-us-qwerty", + "title" : "US English (Qwerty)" + }, + { + "value" : "fr-fr-azerty", + "title" : "French (Azerty)" + }, + { + "value" : "de-de-qwertz", + "title" : "German (Qwertz)" + }, + { + "value" : "it-it-qwerty", + "title" : "Italian (Qwerty)" + }, + { + "value" : "sv-se-qwerty", + "title" : "Swedish (Qwerty)" + }, + { + "value" : "failsafe", + "title" : "Unicode" + } + ] + }, + { + "name" : "console", + "title" : "Administrator console", + "type" : "BOOLEAN", + "value" : "true" + } + ] + }, + + { + "title" : "Display", + "name" : "display", + "fields" : [ + { + "name" : "width", + "title" : "Display width", + "type" : "NUMERIC" + }, + { + "name" : "height", + "title" : "Display height", + "type" : "NUMERIC" + }, + { + "name" : "dpi", + "title" : "Display resolution (DPI)", + "type" : "NUMERIC" + }, + { + "name" : "color-depth", + "title" : "Color depth", + "type" : "ENUM", + "options" : [ + { + "value" : "", + "title" : "" + }, + { + "value" : "8", + "title" : "256 color" + }, + { + "value" : "16", + "title" : "Low color (16-bit)" + }, + { + "value" : "24", + "title" : "True color (24-bit)" + }, + { + "value" : "32", + "title" : "True color (32-bit)" + } + ] + } + ] + }, + + { + "title" : "Device Redirection", + "name" : "device-redirection", + "fields" : [ + { + "name" : "console-audio", + "title" : "Support audio in console", + "type" : "BOOLEAN", + "value" : "true" + }, + { + "name" : "disable-audio", + "title" : "Disable audio", + "type" : "BOOLEAN", + "value" : "true" + }, + { + "name" : "enable-printing", + "title" : "Enable printing", + "type" : "BOOLEAN", + "value" : "true" + }, + { + "name" : "enable-drive", + "title" : "Enable drive", + "type" : "BOOLEAN", + "value" : "true" + }, + { + "name" : "drive-path", + "title" : "Drive path", + "type" : "TEXT" + }, + { + "name" : "static-channels", + "title" : "Static channel names", + "type" : "TEXT" + } + ] + }, + + { + "title" : "RemoteApp", + "name" : "remoteapp", + "fields" : [ + { + "name" : "remote-app", + "title" : "RemoteApp program", + "type" : "TEXT" + }, + { + "name" : "remote-app-dir", + "title" : "RemoteApp working directory", + "type" : "TEXT" + }, + { + "name" : "remote-app-args", + "title" : "RemoteApp parameters", + "type" : "TEXT" + } + ] + } + + ] +} diff --git a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/rdp.xml b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/rdp.xml deleted file mode 100644 index 73e69a3ed..000000000 --- a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/rdp.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/ssh.json b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/ssh.json new file mode 100644 index 000000000..fa692975b --- /dev/null +++ b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/ssh.json @@ -0,0 +1,143 @@ +{ + "title" : "SSH", + "name" : "ssh", + "forms" : [ + + { + "title" : "Network", + "name" : "network", + "fields" : [ + { + "name" : "hostname", + "title" : "Hostname", + "type" : "TEXT" + }, + { + "name" : "port", + "title" : "Port", + "type" : "NUMERIC" + } + ] + }, + + { + "title" : "Authentication", + "name" : "authentication", + "fields" : [ + { + "name" : "username", + "title" : "Username", + "type" : "USERNAME" + }, + { + "name" : "password", + "title" : "Password", + "type" : "PASSWORD" + }, + { + "name" : "private-key", + "title" : "Private key", + "type" : "MULTILINE" + }, + { + "name" : "passphrase", + "title" : "Passphrase", + "type" : "PASSWORD" + } + ] + }, + + { + "title" : "Display", + "name" : "display", + "fields" : [ + { + "name" : "font-name", + "title" : "Font name", + "type" : "TEXT" + }, + { + "name" : "font-size", + "title" : "Font size", + "type" : "ENUM", + "options" : [ + { + "value" : "", + "title" : "" + }, + { + "value" : "8", + "title" : "8" + }, + { + "value" : "9", + "title" : "9" + }, + { + "value" : "10", + "title" : "10" + }, + { + "value" : "11", + "title" : "11" + }, + { + "value" : "12", + "title" : "12" + }, + { + "value" : "14", + "title" : "14" + }, + { + "value" : "18", + "title" : "18" + }, + { + "value" : "24", + "title" : "24" + }, + { + "value" : "30", + "title" : "30" + }, + { + "value" : "36", + "title" : "36" + }, + { + "value" : "48", + "title" : "48" + }, + { + "value" : "60", + "title" : "60" + }, + { + "value" : "72", + "title" : "72" + }, + { + "value" : "96", + "title" : "96" + } + ] + } + ] + }, + + { + "title" : "SFTP", + "name" : "sftp", + "fields" : [ + { + "name" : "enable-sftp", + "title" : "Enable SFTP", + "type" : "BOOLEAN", + "value" : "true" + } + ] + } + + ] +} \ No newline at end of file diff --git a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/ssh.xml b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/ssh.xml deleted file mode 100644 index 8239e7160..000000000 --- a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/ssh.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/telnet.json b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/telnet.json new file mode 100644 index 000000000..12f30407f --- /dev/null +++ b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/telnet.json @@ -0,0 +1,125 @@ +{ + "title" : "Telnet", + "name" : "telnet", + "forms" : [ + + { + "title" : "Network", + "name" : "network", + "fields" : [ + { + "name" : "hostname", + "title" : "Hostname", + "type" : "TEXT" + }, + { + "name" : "port", + "title" : "Port", + "type" : "NUMERIC" + } + ] + }, + + { + "title" : "Authentication", + "name" : "authentication", + "fields" : [ + { + "name" : "username", + "title" : "Username", + "type" : "USERNAME" + }, + { + "name" : "password", + "title" : "Password", + "type" : "PASSWORD" + }, + { + "name" : "password-regex", + "title" : "Password regular expression", + "type" : "TEXT" + } + ] + }, + + { + "title" : "Display", + "name" : "display", + "fields" : [ + { + "name" : "font-name", + "title" : "Font name", + "type" : "TEXT" + }, + { + "name" : "font-size", + "title" : "Font size", + "type" : "ENUM", + "options" : [ + { + "value" : "", + "title" : "" + }, + { + "value" : "8", + "title" : "8" + }, + { + "value" : "9", + "title" : "9" + }, + { + "value" : "10", + "title" : "10" + }, + { + "value" : "11", + "title" : "11" + }, + { + "value" : "12", + "title" : "12" + }, + { + "value" : "14", + "title" : "14" + }, + { + "value" : "18", + "title" : "18" + }, + { + "value" : "24", + "title" : "24" + }, + { + "value" : "30", + "title" : "30" + }, + { + "value" : "36", + "title" : "36" + }, + { + "value" : "48", + "title" : "48" + }, + { + "value" : "60", + "title" : "60" + }, + { + "value" : "72", + "title" : "72" + }, + { + "value" : "96", + "title" : "96" + } + ] + } + ] + } + + ] +} diff --git a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/telnet.xml b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/telnet.xml deleted file mode 100644 index 984b9caa1..000000000 --- a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/telnet.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/vnc.json b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/vnc.json new file mode 100644 index 000000000..c7d51d034 --- /dev/null +++ b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/vnc.json @@ -0,0 +1,136 @@ +{ + "title" : "VNC", + "name" : "vnc", + "forms" : [ + + { + "title" : "Network", + "name" : "network", + "fields" : [ + { + "name" : "hostname", + "title" : "Hostname", + "type" : "TEXT" + }, + { + "name" : "port", + "title" : "Port", + "type" : "NUMERIC" + } + ] + }, + + { + "title" : "Authentication", + "name" : "authentication", + "fields" : [ + { + "name" : "password", + "title" : "Password", + "type" : "PASSWORD" + } + ] + }, + + { + "title" : "Display", + "name" : "display", + "fields" : [ + { + "name" : "read-only", + "title" : "Read-only", + "type" : "BOOLEAN", + "value" : "true" + }, + { + "name" : "swap-red-blue", + "title" : "Swap red/blue components", + "type" : "BOOLEAN", + "value" : "true" + }, + { + "name" : "cursor", + "title" : "Cursor", + "type" : "ENUM", + "options" : [ + { + "value" : "", + "title" : "" + }, + { + "value" : "local", + "title" : "Local" + }, + { + "value" : "remote", + "title" : "Remote" + } + ] + }, + { + "name" : "color-depth", + "title" : "Color depth", + "type" : "ENUM", + "options" : [ + { + "value" : "", + "title" : "" + }, + { + "value" : "8", + "title" : "256 color" + }, + { + "value" : "16", + "title" : "Low color (16-bit)" + }, + { + "value" : "24", + "title" : "True color (24-bit)" + }, + { + "value" : "32", + "title" : "True color (32-bit)" + } + ] + } + ] + }, + + { + "title" : "Repeater", + "name" : "repeater", + "fields" : [ + { + "name" : "dest-host", + "title" : "Repeater destination host", + "type" : "TEXT" + }, + { + "name" : "dest-port", + "title" : "Repeater destination port", + "type" : "NUMERIC" + } + ] + }, + + { + "title" : "Audio", + "name" : "audio", + "fields" : [ + { + "name" : "enable-audio", + "title" : "Enable audio", + "type" : "BOOLEAN", + "value" : "true" + }, + { + "name" : "audio-servername", + "title" : "Audio server name", + "type" : "TEXT" + } + ] + } + + ] +} diff --git a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/vnc.xml b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/vnc.xml deleted file mode 100644 index ed9faa56f..000000000 --- a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/vnc.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/APIError.java b/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/APIError.java index 3c62725c8..1f8ed261e 100644 --- a/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/APIError.java +++ b/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/APIError.java @@ -24,7 +24,7 @@ package org.glyptodon.guacamole.net.basic.rest; import java.util.Collection; import javax.ws.rs.core.Response; -import org.glyptodon.guacamole.form.Parameter; +import org.glyptodon.guacamole.form.Field; /** * Describes an error that occurred within a REST endpoint. @@ -40,9 +40,9 @@ public class APIError { private final String message; /** - * All expected request parameters, if any. + * All expected request parameters, if any, as a collection of fields. */ - private final Collection expected; + private final Collection expected; /** * The type of error that occurred. @@ -140,9 +140,9 @@ public class APIError { * * @param expected * All parameters expected in the original request, or now required as - * a result of the original request. + * a result of the original request, as a collection of fields. */ - public APIError(Type type, String message, Collection expected) { + public APIError(Type type, String message, Collection expected) { this.type = type; this.message = message; this.expected = expected; @@ -159,12 +159,13 @@ public class APIError { } /** - * Returns an object which describes the required credentials. + * Returns a collection of all required parameters, where each parameter is + * represented by a field. * * @return - * An object which describes the required credentials. + * A collection of all required parameters. */ - public Collection getExpected() { + public Collection getExpected() { return expected; } diff --git a/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/APIException.java b/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/APIException.java index b26f9bd90..4fff36e5b 100644 --- a/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/APIException.java +++ b/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/APIException.java @@ -25,7 +25,7 @@ package org.glyptodon.guacamole.net.basic.rest; import java.util.Collection; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; -import org.glyptodon.guacamole.form.Parameter; +import org.glyptodon.guacamole.form.Field; /** * An exception that will result in the given error error information being @@ -76,9 +76,9 @@ public class APIException extends WebApplicationException { * * @param expected * All parameters expected in the original request, or now required as - * a result of the original request. + * a result of the original request, as a collection of fields. */ - public APIException(APIError.Type type, String message, Collection expected) { + public APIException(APIError.Type type, String message, Collection expected) { this(new APIError(type, message, expected)); } diff --git a/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/AuthProviderRESTExceptionWrapper.java b/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/AuthProviderRESTExceptionWrapper.java index 0878d9632..d73903ef5 100644 --- a/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/AuthProviderRESTExceptionWrapper.java +++ b/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/AuthProviderRESTExceptionWrapper.java @@ -22,14 +22,12 @@ package org.glyptodon.guacamole.net.basic.rest; -import javax.ws.rs.core.Response; import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; import org.glyptodon.guacamole.GuacamoleClientException; import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleResourceNotFoundException; import org.glyptodon.guacamole.GuacamoleSecurityException; -import org.glyptodon.guacamole.net.auth.credentials.CredentialsInfo; import org.glyptodon.guacamole.net.auth.credentials.GuacamoleInsufficientCredentialsException; import org.glyptodon.guacamole.net.auth.credentials.GuacamoleInvalidCredentialsException; import org.slf4j.Logger; @@ -65,7 +63,7 @@ public class AuthProviderRESTExceptionWrapper implements MethodInterceptor { throw new APIException( APIError.Type.INSUFFICIENT_CREDENTIALS, message, - e.getCredentialsInfo().getParameters() + e.getCredentialsInfo().getFields() ); } @@ -80,7 +78,7 @@ public class AuthProviderRESTExceptionWrapper implements MethodInterceptor { throw new APIException( APIError.Type.INVALID_CREDENTIALS, message, - e.getCredentialsInfo().getParameters() + e.getCredentialsInfo().getFields() ); } diff --git a/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/schema/SchemaRESTService.java b/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/schema/SchemaRESTService.java index 029700ec0..fa1dda932 100644 --- a/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/schema/SchemaRESTService.java +++ b/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/schema/SchemaRESTService.java @@ -34,7 +34,7 @@ import javax.ws.rs.core.MediaType; import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.environment.Environment; import org.glyptodon.guacamole.environment.LocalEnvironment; -import org.glyptodon.guacamole.form.Parameter; +import org.glyptodon.guacamole.form.Field; import org.glyptodon.guacamole.net.auth.UserContext; import org.glyptodon.guacamole.net.basic.rest.AuthProviderRESTExposure; import org.glyptodon.guacamole.net.basic.rest.auth.AuthenticationService; @@ -65,8 +65,8 @@ public class SchemaRESTService { * performing the operation. * * @return - * A collection of form parameters which describe the possible - * attributes of a user object. + * A collection of form fields which describe the possible attributes + * of a user object. * * @throws GuacamoleException * If an error occurs while retrieving the possible attributes. @@ -74,7 +74,7 @@ public class SchemaRESTService { @GET @Path("/users/attributes") @AuthProviderRESTExposure - public Collection getUserAttributes(@QueryParam("token") String authToken) throws GuacamoleException { + public Collection getUserAttributes(@QueryParam("token") String authToken) throws GuacamoleException { // Retrieve all possible user attributes UserContext userContext = authenticationService.getUserContext(authToken); @@ -90,8 +90,8 @@ public class SchemaRESTService { * performing the operation. * * @return - * A collection of form parameters which describe the possible - * attributes of a connection object. + * A collection of form fields which describe the possible attributes + * of a connection object. * * @throws GuacamoleException * If an error occurs while retrieving the possible attributes. @@ -99,7 +99,7 @@ public class SchemaRESTService { @GET @Path("/connections/attributes") @AuthProviderRESTExposure - public Collection getConnectionAttributes(@QueryParam("token") String authToken) throws GuacamoleException { + public Collection getConnectionAttributes(@QueryParam("token") String authToken) throws GuacamoleException { // Retrieve all possible connection attributes UserContext userContext = authenticationService.getUserContext(authToken); @@ -115,8 +115,8 @@ public class SchemaRESTService { * performing the operation. * * @return - * A collection of form parameters which describe the possible - * attributes of a connection group object. + * A collection of form fields which describe the possible attributes + * of a connection group object. * * @throws GuacamoleException * If an error occurs while retrieving the possible attributes. @@ -124,7 +124,7 @@ public class SchemaRESTService { @GET @Path("/connectionGroups/attributes") @AuthProviderRESTExposure - public Collection getConnectionGroupAttributes(@QueryParam("token") String authToken) throws GuacamoleException { + public Collection getConnectionGroupAttributes(@QueryParam("token") String authToken) throws GuacamoleException { // Retrieve all possible connection group attributes UserContext userContext = authenticationService.getUserContext(authToken); diff --git a/guacamole/src/main/webapp/app/manage/styles/connection-parameter.css b/guacamole/src/main/webapp/app/manage/styles/connection-parameter.css index 5038c80f3..14b6f3ab8 100644 --- a/guacamole/src/main/webapp/app/manage/styles/connection-parameter.css +++ b/guacamole/src/main/webapp/app/manage/styles/connection-parameter.css @@ -29,6 +29,8 @@ .connection-parameters .form .fields { display: table; + padding-left: .5em; + border-left: 3px solid rgba(0,0,0,0.125); } .connection-parameters .form .fields .labeled-field { @@ -41,3 +43,7 @@ padding: 0.125em; vertical-align: top; } + +.connection-parameters .form .fields .field-header { + padding-right: 1em; +} diff --git a/guacamole/src/main/webapp/app/manage/templates/manageConnection.html b/guacamole/src/main/webapp/app/manage/templates/manageConnection.html index d14b98255..fabe59dcb 100644 --- a/guacamole/src/main/webapp/app/manage/templates/manageConnection.html +++ b/guacamole/src/main/webapp/app/manage/templates/manageConnection.html @@ -61,7 +61,7 @@ THE SOFTWARE.

{{'MANAGE_CONNECTION.SECTION_HEADER_PARAMETERS' | translate}}

diff --git a/guacamole/src/main/webapp/app/rest/types/Protocol.js b/guacamole/src/main/webapp/app/rest/types/Protocol.js index 121673a55..73e66506c 100644 --- a/guacamole/src/main/webapp/app/rest/types/Protocol.js +++ b/guacamole/src/main/webapp/app/rest/types/Protocol.js @@ -54,13 +54,13 @@ angular.module('rest').factory('Protocol', [function defineProtocol() { this.title = template.title; /** - * An array of all known parameters for this protocol, their types, - * and other information. + * An array of forms containing all known parameters for this protocol, + * their types, and other information. * - * @type Field[] + * @type Form[] * @default [] */ - this.parameters = template.parameters || []; + this.forms = template.forms || []; }; diff --git a/guacamole/src/main/webapp/translations/en_US.json b/guacamole/src/main/webapp/translations/en_US.json index 79e5a6db6..08d050a10 100644 --- a/guacamole/src/main/webapp/translations/en_US.json +++ b/guacamole/src/main/webapp/translations/en_US.json @@ -247,7 +247,7 @@ "FIELD_HEADER_DISABLE_AUDIO" : "Disable audio:", "FIELD_HEADER_DISABLE_AUTH" : "Disable authentication:", "FIELD_HEADER_DOMAIN" : "Domain:", - "FIELD_HEADER_DPI" : "Display resolution (DPI):", + "FIELD_HEADER_DPI" : "Resolution (DPI):", "FIELD_HEADER_DRIVE_PATH" : "Drive path:", "FIELD_HEADER_ENABLE_DRIVE" : "Enable drive:", "FIELD_HEADER_ENABLE_PRINTING" : "Enable printing:", @@ -257,9 +257,9 @@ "FIELD_HEADER_INITIAL_PROGRAM" : "Initial program:", "FIELD_HEADER_PASSWORD" : "Password:", "FIELD_HEADER_PORT" : "Port:", - "FIELD_HEADER_REMOTE_APP_ARGS" : "RemoteApp parameters:", - "FIELD_HEADER_REMOTE_APP_DIR" : "RemoteApp working directory:", - "FIELD_HEADER_REMOTE_APP" : "RemoteApp program:", + "FIELD_HEADER_REMOTE_APP_ARGS" : "Parameters:", + "FIELD_HEADER_REMOTE_APP_DIR" : "Working directory:", + "FIELD_HEADER_REMOTE_APP" : "Program:", "FIELD_HEADER_SECURITY" : "Security mode:", "FIELD_HEADER_SERVER_LAYOUT" : "Keyboard layout:", "FIELD_HEADER_USERNAME" : "Username:", @@ -286,7 +286,14 @@ "FIELD_OPTION_SERVER_LAYOUT_IT_IT_QWERTY" : "Italian (Qwerty)", "FIELD_OPTION_SERVER_LAYOUT_SV_SE_QWERTY" : "Swedish (Qwerty)", - "NAME" : "RDP" + "NAME" : "RDP", + + "SECTION_HEADER_AUTHENTICATION" : "Authentication", + "SECTION_HEADER_BASIC_PARAMETERS" : "Basic Settings", + "SECTION_HEADER_DEVICE_REDIRECTION" : "Device Redirection", + "SECTION_HEADER_DISPLAY" : "Display", + "SECTION_HEADER_NETWORK" : "Network", + "SECTION_HEADER_REMOTEAPP" : "RemoteApp" }, @@ -318,7 +325,12 @@ "FIELD_OPTION_FONT_SIZE_96" : "96", "FIELD_OPTION_FONT_SIZE_EMPTY" : "", - "NAME" : "SSH" + "NAME" : "SSH", + + "SECTION_HEADER_AUTHENTICATION" : "Authentication", + "SECTION_HEADER_DISPLAY" : "Display", + "SECTION_HEADER_NETWORK" : "Network", + "SECTION_HEADER_SFTP" : "SFTP" }, @@ -348,7 +360,11 @@ "FIELD_OPTION_FONT_SIZE_96" : "96", "FIELD_OPTION_FONT_SIZE_EMPTY" : "", - "NAME" : "Telnet" + "NAME" : "Telnet", + + "SECTION_HEADER_AUTHENTICATION" : "Authentication", + "SECTION_HEADER_DISPLAY" : "Display", + "SECTION_HEADER_NETWORK" : "Network" }, @@ -357,8 +373,8 @@ "FIELD_HEADER_AUDIO_SERVERNAME" : "Audio server name:", "FIELD_HEADER_COLOR_DEPTH" : "Color depth:", "FIELD_HEADER_CURSOR" : "Cursor:", - "FIELD_HEADER_DEST_HOST" : "Repeater destination host:", - "FIELD_HEADER_DEST_PORT" : "Repeater destination port:", + "FIELD_HEADER_DEST_HOST" : "Destination host:", + "FIELD_HEADER_DEST_PORT" : "Destination port:", "FIELD_HEADER_ENABLE_AUDIO" : "Enable audio:", "FIELD_HEADER_HOSTNAME" : "Hostname:", "FIELD_HEADER_PASSWORD" : "Password:", @@ -376,7 +392,13 @@ "FIELD_OPTION_CURSOR_LOCAL" : "Local", "FIELD_OPTION_CURSOR_REMOTE" : "Remote", - "NAME" : "VNC" + "NAME" : "VNC", + + "SECTION_HEADER_AUDIO" : "Audio", + "SECTION_HEADER_AUTHENTICATION" : "Authentication", + "SECTION_HEADER_DISPLAY" : "Display", + "SECTION_HEADER_NETWORK" : "Network", + "SECTION_HEADER_REPEATER" : "VNC Repeater" },