diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/protocols/ProtocolInfo.java b/guacamole-ext/src/main/java/org/apache/guacamole/protocols/ProtocolInfo.java index ec3323189..a5a8aa617 100644 --- a/guacamole-ext/src/main/java/org/apache/guacamole/protocols/ProtocolInfo.java +++ b/guacamole-ext/src/main/java/org/apache/guacamole/protocols/ProtocolInfo.java @@ -24,9 +24,10 @@ import java.util.Collection; import org.apache.guacamole.form.Form; /** - * 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. + * Describes a protocol and all parameters associated with it, as required by + * a protocol plugin for guacd. Each parameter is described with a Form, which + * allows the parameters of a protocol to be exposed to the user as friendly + * groupings of fields. * * @author Michael Jumper */ @@ -38,15 +39,45 @@ public class ProtocolInfo { private String name; /** - * A collection of all associated protocol forms. + * A collection of forms describing all known parameters for a connection + * using this protocol. */ - private Collection
forms; + private Collection connectionForms; + + /** + * A collection of forms describing all known parameters relevant to a + * sharing profile whose primary connection uses this protocol. + */ + private Collection sharingProfileForms; + + /** + * Creates a new ProtocolInfo having the given name and forms. The given + * collections of forms are used to describe the parameters for connections + * and sharing profiles respectively. + * + * @param name + * The unique name associated with the protocol. + * + * @param connectionForms + * A collection of forms describing all known parameters for a + * connection using this protocol. + * + * @param sharingProfileForms + * A collection of forms describing all known parameters relevant to a + * sharing profile whose primary connection uses this protocol. + */ + public ProtocolInfo(String name, Collection connectionForms, + Collection sharingProfileForms) { + this.name = name; + this.connectionForms = connectionForms; + this.sharingProfileForms = sharingProfileForms; + } /** * Creates a new ProtocolInfo with no associated name or forms. */ public ProtocolInfo() { - this.forms = new ArrayList(); + this(null); } /** @@ -56,22 +87,24 @@ public class ProtocolInfo { * The unique name associated with the protocol. */ public ProtocolInfo(String name) { - this.name = name; - this.forms = new ArrayList(); + this(name, new ArrayList()); } /** - * Creates a new ProtocolInfo having the given name and forms. + * Creates a new ProtocolInfo having the given name and forms. The given + * forms are used to describe the parameters for both connections and + * sharing profiles. * * @param name * The unique name associated with the protocol. * * @param forms - * The forms to associate with the protocol. + * A collection of forms describing all known parameters for this + * protocol, regardless of whether it is used in the context of a + * connection or a sharing profile. */ public ProtocolInfo(String name, Collection forms) { - this.name = name; - this.forms = forms; + this(name, forms, new ArrayList(forms)); } /** @@ -95,25 +128,57 @@ public class ProtocolInfo { } /** - * Returns a mutable collection of the protocol forms associated with - * this protocol. Changes to this collection affect the forms exposed - * to the user. + * Returns a mutable collection of forms describing all known parameters for + * a connection using this protocol. Changes to this collection affect the + * forms exposed to the user. * - * @return A mutable collection of protocol forms. + * @return + * A mutable collection of forms describing all known parameters for a + * connection using this protocol. */ - public Collection getForms() { - return forms; + public Collection getConnectionForms() { + return connectionForms; } /** - * Sets the collection of protocol forms associated with this - * protocol. + * Sets the collection of forms describing all known parameters for a + * connection using this protocol. The provided collection must be mutable. * - * @param forms - * The collection of forms to associate with this protocol. + * @param connectionForms + * A mutable collection of forms describing all known parameters for a + * connection using this protocol. */ - public void setForms(Collection forms) { - this.forms = forms; + public void setConnectionForms(Collection connectionForms) { + this.connectionForms = connectionForms; } - + + /** + * Returns a mutable collection of forms describing all known parameters + * relevant to a sharing profile whose primary connection uses this + * protocol. Changes to this collection affect the forms exposed to the + * user. + * + * @return + * A mutable collection of forms describing all known parameters + * relevant to a sharing profile whose primary connection uses this + * protocol. + */ + public Collection getSharingProfileForms() { + return sharingProfileForms; + } + + /** + * Sets the collection of forms describing all known parameters relevant to + * a sharing profile whose primary connection uses this protocol. The + * provided collection must be mutable. + * + * @param sharingProfileForms + * A mutable collection of forms describing all known parameters + * relevant to a sharing profile whose primary connection uses this + * protocol. + */ + public void setSharingProfileForms(Collection sharingProfileForms) { + this.sharingProfileForms = sharingProfileForms; + } + } diff --git a/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/rdp.json b/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/rdp.json index c768d5059..9ff5d512f 100644 --- a/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/rdp.json +++ b/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/rdp.json @@ -1,6 +1,6 @@ { "name" : "rdp", - "forms" : [ + "connectionForms" : [ { "name" : "network", diff --git a/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/ssh.json b/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/ssh.json index 1f75db20a..36e3a0e64 100644 --- a/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/ssh.json +++ b/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/ssh.json @@ -1,6 +1,6 @@ { "name" : "ssh", - "forms" : [ + "connectionForms" : [ { "name" : "network", diff --git a/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/telnet.json b/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/telnet.json index b33a28962..2a4f9dde3 100644 --- a/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/telnet.json +++ b/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/telnet.json @@ -1,6 +1,6 @@ { "name" : "telnet", - "forms" : [ + "connectionForms" : [ { "name" : "network", diff --git a/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/vnc.json b/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/vnc.json index 5a9a572ac..76222e834 100644 --- a/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/vnc.json +++ b/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/vnc.json @@ -1,6 +1,6 @@ { "name" : "vnc", - "forms" : [ + "connectionForms" : [ { "name" : "network", diff --git a/guacamole/src/main/webapp/app/manage/templates/manageConnection.html b/guacamole/src/main/webapp/app/manage/templates/manageConnection.html index 2bf0fad43..336530d87 100644 --- a/guacamole/src/main/webapp/app/manage/templates/manageConnection.html +++ b/guacamole/src/main/webapp/app/manage/templates/manageConnection.html @@ -47,7 +47,7 @@

{{'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 cf1298a2d..cfb26f02d 100644 --- a/guacamole/src/main/webapp/app/rest/types/Protocol.js +++ b/guacamole/src/main/webapp/app/rest/types/Protocol.js @@ -44,13 +44,23 @@ angular.module('rest').factory('Protocol', [function defineProtocol() { this.name = template.name; /** - * An array of forms containing all known parameters for this protocol, - * their types, and other information. + * An array of forms describing all known parameters for a connection + * using this protocol, including their types and other information. * * @type Form[] * @default [] */ - this.forms = template.forms || []; + this.connectionForms = template.connectionForms || []; + + /** + * An array of forms describing all known parameters relevant to a + * sharing profile whose primary connection uses this protocol, + * including their types, and other information. + * + * @type Form[] + * @default [] + */ + this.sharingProfileForms = template.sharingProfileForms || []; };