GUACAMOLE-5: Merge sharing connection, sharing profile parameter addition.

This commit is contained in:
James Muehlner
2016-08-10 16:49:57 -07:00
12 changed files with 194 additions and 33 deletions

View File

@@ -24,9 +24,10 @@ import java.util.Collection;
import org.apache.guacamole.form.Form; import org.apache.guacamole.form.Form;
/** /**
* Describes a protocol and all forms associated with it, as required by * Describes a protocol and all parameters associated with it, as required by
* a protocol plugin for guacd. This class allows known forms for a * a protocol plugin for guacd. Each parameter is described with a Form, which
* protocol to be exposed to the user as friendly fields. * allows the parameters of a protocol to be exposed to the user as friendly
* groupings of fields.
* *
* @author Michael Jumper * @author Michael Jumper
*/ */
@@ -38,15 +39,45 @@ public class ProtocolInfo {
private String name; 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<Form> forms; private Collection<Form> connectionForms;
/**
* A collection of forms describing all known parameters relevant to a
* sharing profile whose primary connection uses this protocol.
*/
private Collection<Form> 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<Form> connectionForms,
Collection<Form> sharingProfileForms) {
this.name = name;
this.connectionForms = connectionForms;
this.sharingProfileForms = sharingProfileForms;
}
/** /**
* Creates a new ProtocolInfo with no associated name or forms. * Creates a new ProtocolInfo with no associated name or forms.
*/ */
public ProtocolInfo() { public ProtocolInfo() {
this.forms = new ArrayList<Form>(); this(null);
} }
/** /**
@@ -56,22 +87,24 @@ public class ProtocolInfo {
* The unique name associated with the protocol. * The unique name associated with the protocol.
*/ */
public ProtocolInfo(String name) { public ProtocolInfo(String name) {
this.name = name; this(name, new ArrayList<Form>());
this.forms = new ArrayList<Form>();
} }
/** /**
* 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 * @param name
* The unique name associated with the protocol. * The unique name associated with the protocol.
* *
* @param forms * @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<Form> forms) { public ProtocolInfo(String name, Collection<Form> forms) {
this.name = name; this(name, forms, new ArrayList<Form>(forms));
this.forms = forms;
} }
/** /**
@@ -95,25 +128,57 @@ public class ProtocolInfo {
} }
/** /**
* Returns a mutable collection of the protocol forms associated with * Returns a mutable collection of forms describing all known parameters for
* this protocol. Changes to this collection affect the forms exposed * a connection using this protocol. Changes to this collection affect the
* to the user. * 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<Form> getForms() { public Collection<Form> getConnectionForms() {
return forms; return connectionForms;
} }
/** /**
* Sets the collection of protocol forms associated with this * Sets the collection of forms describing all known parameters for a
* protocol. * connection using this protocol. The provided collection must be mutable.
* *
* @param forms * @param connectionForms
* The collection of forms to associate with this protocol. * A mutable collection of forms describing all known parameters for a
* connection using this protocol.
*/ */
public void setForms(Collection<Form> forms) { public void setConnectionForms(Collection<Form> connectionForms) {
this.forms = forms; 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<Form> 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<Form> sharingProfileForms) {
this.sharingProfileForms = sharingProfileForms;
}
} }

View File

@@ -1,6 +1,6 @@
{ {
"name" : "rdp", "name" : "rdp",
"forms" : [ "connectionForms" : [
{ {
"name" : "network", "name" : "network",
@@ -106,6 +106,11 @@
"name" : "resize-method", "name" : "resize-method",
"type" : "ENUM", "type" : "ENUM",
"options" : [ "", "reconnect", "display-update" ] "options" : [ "", "reconnect", "display-update" ]
},
{
"name" : "read-only",
"type" : "BOOLEAN",
"options" : [ "true" ]
} }
] ]
}, },
@@ -280,5 +285,19 @@
] ]
} }
],
"sharingProfileForms" : [
{
"name" : "display",
"fields" : [
{
"name" : "read-only",
"type" : "BOOLEAN",
"options" : [ "true" ]
}
]
}
] ]
} }

View File

@@ -1,6 +1,6 @@
{ {
"name" : "ssh", "name" : "ssh",
"forms" : [ "connectionForms" : [
{ {
"name" : "network", "name" : "network",
@@ -54,6 +54,11 @@
"name" : "font-size", "name" : "font-size",
"type" : "ENUM", "type" : "ENUM",
"options" : [ "", "8", "9", "10", "11", "12", "14", "18", "24", "30", "36", "48", "60", "72", "96" ] "options" : [ "", "8", "9", "10", "11", "12", "14", "18", "24", "30", "36", "48", "60", "72", "96" ]
},
{
"name" : "read-only",
"type" : "BOOLEAN",
"options" : [ "true" ]
} }
] ]
}, },
@@ -117,5 +122,19 @@
] ]
} }
],
"sharingProfileForms" : [
{
"name" : "display",
"fields" : [
{
"name" : "read-only",
"type" : "BOOLEAN",
"options" : [ "true" ]
}
]
}
] ]
} }

View File

@@ -1,6 +1,6 @@
{ {
"name" : "telnet", "name" : "telnet",
"forms" : [ "connectionForms" : [
{ {
"name" : "network", "name" : "network",
@@ -50,6 +50,11 @@
"name" : "font-size", "name" : "font-size",
"type" : "ENUM", "type" : "ENUM",
"options" : [ "", "8", "9", "10", "11", "12", "14", "18", "24", "30", "36", "48", "60", "72", "96" ] "options" : [ "", "8", "9", "10", "11", "12", "14", "18", "24", "30", "36", "48", "60", "72", "96" ]
},
{
"name" : "read-only",
"type" : "BOOLEAN",
"options" : [ "true" ]
} }
] ]
}, },
@@ -92,5 +97,19 @@
] ]
} }
],
"sharingProfileForms" : [
{
"name" : "display",
"fields" : [
{
"name" : "read-only",
"type" : "BOOLEAN",
"options" : [ "true" ]
}
]
}
] ]
} }

View File

@@ -1,6 +1,6 @@
{ {
"name" : "vnc", "name" : "vnc",
"forms" : [ "connectionForms" : [
{ {
"name" : "network", "name" : "network",
@@ -150,5 +150,19 @@
] ]
} }
],
"sharingProfileForms" : [
{
"name" : "display",
"fields" : [
{
"name" : "read-only",
"type" : "BOOLEAN",
"options" : [ "true" ]
}
]
}
] ]
} }

View File

@@ -47,7 +47,7 @@
<h2 class="header">{{'MANAGE_CONNECTION.SECTION_HEADER_PARAMETERS' | translate}}</h2> <h2 class="header">{{'MANAGE_CONNECTION.SECTION_HEADER_PARAMETERS' | translate}}</h2>
<div class="section connection-parameters" ng-class="{loading: !parameters}"> <div class="section connection-parameters" ng-class="{loading: !parameters}">
<guac-form namespace="getNamespace(connection.protocol)" <guac-form namespace="getNamespace(connection.protocol)"
content="protocols[connection.protocol].forms" content="protocols[connection.protocol].connectionForms"
model="parameters"></guac-form> model="parameters"></guac-form>
</div> </div>

View File

@@ -44,13 +44,23 @@ angular.module('rest').factory('Protocol', [function defineProtocol() {
this.name = template.name; this.name = template.name;
/** /**
* An array of forms containing all known parameters for this protocol, * An array of forms describing all known parameters for a connection
* their types, and other information. * using this protocol, including their types and other information.
* *
* @type Form[] * @type Form[]
* @default [] * @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 || [];
}; };

View File

@@ -292,6 +292,7 @@
"FIELD_HEADER_INITIAL_PROGRAM" : "Startprogramm:", "FIELD_HEADER_INITIAL_PROGRAM" : "Startprogramm:",
"FIELD_HEADER_PASSWORD" : "Passwort:", "FIELD_HEADER_PASSWORD" : "Passwort:",
"FIELD_HEADER_PORT" : "Port:", "FIELD_HEADER_PORT" : "Port:",
"FIELD_HEADER_READ_ONLY" : "Nur-Lesen:",
"FIELD_HEADER_REMOTE_APP_ARGS" : "Parameter:", "FIELD_HEADER_REMOTE_APP_ARGS" : "Parameter:",
"FIELD_HEADER_REMOTE_APP_DIR" : "Arbeitsverzeichnis:", "FIELD_HEADER_REMOTE_APP_DIR" : "Arbeitsverzeichnis:",
"FIELD_HEADER_REMOTE_APP" : "Programm:", "FIELD_HEADER_REMOTE_APP" : "Programm:",
@@ -354,6 +355,7 @@
"FIELD_HEADER_PASSPHRASE" : "Passphrase:", "FIELD_HEADER_PASSPHRASE" : "Passphrase:",
"FIELD_HEADER_PORT" : "Port:", "FIELD_HEADER_PORT" : "Port:",
"FIELD_HEADER_PRIVATE_KEY" : "Privater Schlüssel:", "FIELD_HEADER_PRIVATE_KEY" : "Privater Schlüssel:",
"FIELD_HEADER_READ_ONLY" : "Nur-Lesen:",
"FIELD_OPTION_COLOR_SCHEME_BLACK_WHITE" : "Schwarz auf Weiß", "FIELD_OPTION_COLOR_SCHEME_BLACK_WHITE" : "Schwarz auf Weiß",
"FIELD_OPTION_COLOR_SCHEME_EMPTY" : "", "FIELD_OPTION_COLOR_SCHEME_EMPTY" : "",
@@ -397,6 +399,7 @@
"FIELD_HEADER_PASSWORD" : "Passwort:", "FIELD_HEADER_PASSWORD" : "Passwort:",
"FIELD_HEADER_PASSWORD_REGEX" : "Reguläre Passwortersetzungen:", "FIELD_HEADER_PASSWORD_REGEX" : "Reguläre Passwortersetzungen:",
"FIELD_HEADER_PORT" : "Port:", "FIELD_HEADER_PORT" : "Port:",
"FIELD_HEADER_READ_ONLY" : "Nur-Lesen:",
"FIELD_OPTION_COLOR_SCHEME_BLACK_WHITE" : "Schwarz auf Weiß", "FIELD_OPTION_COLOR_SCHEME_BLACK_WHITE" : "Schwarz auf Weiß",
"FIELD_OPTION_COLOR_SCHEME_EMPTY" : "", "FIELD_OPTION_COLOR_SCHEME_EMPTY" : "",

View File

@@ -304,6 +304,7 @@
"FIELD_HEADER_PORT" : "Port:", "FIELD_HEADER_PORT" : "Port:",
"FIELD_HEADER_PRECONNECTION_BLOB" : "Preconnection BLOB (VM ID):", "FIELD_HEADER_PRECONNECTION_BLOB" : "Preconnection BLOB (VM ID):",
"FIELD_HEADER_PRECONNECTION_ID" : "RDP source ID:", "FIELD_HEADER_PRECONNECTION_ID" : "RDP source ID:",
"FIELD_HEADER_READ_ONLY" : "Read-only:",
"FIELD_HEADER_RECORDING_NAME" : "Recording name:", "FIELD_HEADER_RECORDING_NAME" : "Recording name:",
"FIELD_HEADER_RECORDING_PATH" : "Recording path:", "FIELD_HEADER_RECORDING_PATH" : "Recording path:",
"FIELD_HEADER_RESIZE_METHOD" : "Resize method:", "FIELD_HEADER_RESIZE_METHOD" : "Resize method:",
@@ -378,6 +379,7 @@
"FIELD_HEADER_PASSPHRASE" : "Passphrase:", "FIELD_HEADER_PASSPHRASE" : "Passphrase:",
"FIELD_HEADER_PORT" : "Port:", "FIELD_HEADER_PORT" : "Port:",
"FIELD_HEADER_PRIVATE_KEY" : "Private key:", "FIELD_HEADER_PRIVATE_KEY" : "Private key:",
"FIELD_HEADER_READ_ONLY" : "Read-only:",
"FIELD_HEADER_RECORDING_NAME" : "Recording name:", "FIELD_HEADER_RECORDING_NAME" : "Recording name:",
"FIELD_HEADER_RECORDING_PATH" : "Recording path:", "FIELD_HEADER_RECORDING_PATH" : "Recording path:",
"FIELD_HEADER_TYPESCRIPT_NAME" : "Typescript name:", "FIELD_HEADER_TYPESCRIPT_NAME" : "Typescript name:",
@@ -429,6 +431,7 @@
"FIELD_HEADER_PASSWORD" : "Password:", "FIELD_HEADER_PASSWORD" : "Password:",
"FIELD_HEADER_PASSWORD_REGEX" : "Password regular expression:", "FIELD_HEADER_PASSWORD_REGEX" : "Password regular expression:",
"FIELD_HEADER_PORT" : "Port:", "FIELD_HEADER_PORT" : "Port:",
"FIELD_HEADER_READ_ONLY" : "Read-only:",
"FIELD_HEADER_RECORDING_NAME" : "Recording name:", "FIELD_HEADER_RECORDING_NAME" : "Recording name:",
"FIELD_HEADER_RECORDING_PATH" : "Recording path:", "FIELD_HEADER_RECORDING_PATH" : "Recording path:",
"FIELD_HEADER_TYPESCRIPT_NAME" : "Typescript name:", "FIELD_HEADER_TYPESCRIPT_NAME" : "Typescript name:",

View File

@@ -294,6 +294,7 @@
"FIELD_HEADER_PORT" : "Port:", "FIELD_HEADER_PORT" : "Port:",
"FIELD_HEADER_PRECONNECTION_BLOB" : "Pré-connexion BLOB (VM ID):", "FIELD_HEADER_PRECONNECTION_BLOB" : "Pré-connexion BLOB (VM ID):",
"FIELD_HEADER_PRECONNECTION_ID" : "Source RDP ID:", "FIELD_HEADER_PRECONNECTION_ID" : "Source RDP ID:",
"FIELD_HEADER_READ_ONLY" : "Lecture seule:",
"FIELD_HEADER_REMOTE_APP_ARGS" : "Paramètres:", "FIELD_HEADER_REMOTE_APP_ARGS" : "Paramètres:",
"FIELD_HEADER_REMOTE_APP_DIR" : "Répertoire de travail:", "FIELD_HEADER_REMOTE_APP_DIR" : "Répertoire de travail:",
"FIELD_HEADER_REMOTE_APP" : "Programme:", "FIELD_HEADER_REMOTE_APP" : "Programme:",
@@ -357,6 +358,7 @@
"FIELD_HEADER_PASSPHRASE" : "Phrase secrète:", "FIELD_HEADER_PASSPHRASE" : "Phrase secrète:",
"FIELD_HEADER_PORT" : "Port:", "FIELD_HEADER_PORT" : "Port:",
"FIELD_HEADER_PRIVATE_KEY" : "Clé privée:", "FIELD_HEADER_PRIVATE_KEY" : "Clé privée:",
"FIELD_HEADER_READ_ONLY" : "Lecture seule:",
"FIELD_OPTION_COLOR_SCHEME_BLACK_WHITE" : "Noir sur blanc", "FIELD_OPTION_COLOR_SCHEME_BLACK_WHITE" : "Noir sur blanc",
"FIELD_OPTION_COLOR_SCHEME_EMPTY" : "", "FIELD_OPTION_COLOR_SCHEME_EMPTY" : "",
@@ -400,6 +402,7 @@
"FIELD_HEADER_PASSWORD" : "Mot de passe:", "FIELD_HEADER_PASSWORD" : "Mot de passe:",
"FIELD_HEADER_PASSWORD_REGEX" : "Expression régulière Mot de passe:", "FIELD_HEADER_PASSWORD_REGEX" : "Expression régulière Mot de passe:",
"FIELD_HEADER_PORT" : "Port:", "FIELD_HEADER_PORT" : "Port:",
"FIELD_HEADER_READ_ONLY" : "Lecture seule:",
"FIELD_OPTION_COLOR_SCHEME_BLACK_WHITE" : "Noir sur blanc", "FIELD_OPTION_COLOR_SCHEME_BLACK_WHITE" : "Noir sur blanc",
"FIELD_OPTION_COLOR_SCHEME_EMPTY" : "", "FIELD_OPTION_COLOR_SCHEME_EMPTY" : "",

View File

@@ -295,6 +295,7 @@
"FIELD_HEADER_PORT" : "Poort:", "FIELD_HEADER_PORT" : "Poort:",
"FIELD_HEADER_PRECONNECTION_BLOB" : "Voor te bereiden BLOB (VM ID):", "FIELD_HEADER_PRECONNECTION_BLOB" : "Voor te bereiden BLOB (VM ID):",
"FIELD_HEADER_PRECONNECTION_ID" : "RDP bron ID:", "FIELD_HEADER_PRECONNECTION_ID" : "RDP bron ID:",
"FIELD_HEADER_READ_ONLY" : "Alleen lezen:",
"FIELD_HEADER_RECORDING_NAME" : "Opname naam:", "FIELD_HEADER_RECORDING_NAME" : "Opname naam:",
"FIELD_HEADER_RECORDING_PATH" : "Opname map:", "FIELD_HEADER_RECORDING_PATH" : "Opname map:",
"FIELD_HEADER_RESIZE_METHOD" : "Schaal methode:", "FIELD_HEADER_RESIZE_METHOD" : "Schaal methode:",
@@ -369,6 +370,7 @@
"FIELD_HEADER_PASSPHRASE" : "Wachtwoordzin:", "FIELD_HEADER_PASSPHRASE" : "Wachtwoordzin:",
"FIELD_HEADER_PORT" : "Poort:", "FIELD_HEADER_PORT" : "Poort:",
"FIELD_HEADER_PRIVATE_KEY" : "Persoonlijke sleutel:", "FIELD_HEADER_PRIVATE_KEY" : "Persoonlijke sleutel:",
"FIELD_HEADER_READ_ONLY" : "Alleen lezen:",
"FIELD_HEADER_RECORDING_NAME" : "Opname naam:", "FIELD_HEADER_RECORDING_NAME" : "Opname naam:",
"FIELD_HEADER_RECORDING_PATH" : "Opname map:", "FIELD_HEADER_RECORDING_PATH" : "Opname map:",
"FIELD_HEADER_TYPESCRIPT_NAME" : "Typescript naam:", "FIELD_HEADER_TYPESCRIPT_NAME" : "Typescript naam:",
@@ -420,6 +422,7 @@
"FIELD_HEADER_PASSWORD" : "Wachtwoord:", "FIELD_HEADER_PASSWORD" : "Wachtwoord:",
"FIELD_HEADER_PASSWORD_REGEX" : "Wachtwoord reguliere expressie:", "FIELD_HEADER_PASSWORD_REGEX" : "Wachtwoord reguliere expressie:",
"FIELD_HEADER_PORT" : "Poort:", "FIELD_HEADER_PORT" : "Poort:",
"FIELD_HEADER_READ_ONLY" : "Alleen lezen:",
"FIELD_HEADER_RECORDING_NAME" : "Opname naam:", "FIELD_HEADER_RECORDING_NAME" : "Opname naam:",
"FIELD_HEADER_RECORDING_PATH" : "Opname map:", "FIELD_HEADER_RECORDING_PATH" : "Opname map:",
"FIELD_HEADER_TYPESCRIPT_NAME" : "Typescript naam:", "FIELD_HEADER_TYPESCRIPT_NAME" : "Typescript naam:",

View File

@@ -271,6 +271,7 @@
"FIELD_HEADER_INITIAL_PROGRAM" : "Запуск программ при подключении:", "FIELD_HEADER_INITIAL_PROGRAM" : "Запуск программ при подключении:",
"FIELD_HEADER_PASSWORD" : "Пароль:", "FIELD_HEADER_PASSWORD" : "Пароль:",
"FIELD_HEADER_PORT" : "Порт:", "FIELD_HEADER_PORT" : "Порт:",
"FIELD_HEADER_READ_ONLY" : "Только просмотр:",
"FIELD_HEADER_REMOTE_APP_ARGS" : "Параметры RemoteApp:", "FIELD_HEADER_REMOTE_APP_ARGS" : "Параметры RemoteApp:",
"FIELD_HEADER_REMOTE_APP_DIR" : "Рабочий каталог RemoteApp:", "FIELD_HEADER_REMOTE_APP_DIR" : "Рабочий каталог RemoteApp:",
"FIELD_HEADER_REMOTE_APP" : "Программы RemoteApp:", "FIELD_HEADER_REMOTE_APP" : "Программы RemoteApp:",
@@ -322,6 +323,7 @@
"FIELD_HEADER_PASSPHRASE" : "Секретная фраза:", "FIELD_HEADER_PASSPHRASE" : "Секретная фраза:",
"FIELD_HEADER_PORT" : "Порт:", "FIELD_HEADER_PORT" : "Порт:",
"FIELD_HEADER_PRIVATE_KEY" : "Приватный ключ:", "FIELD_HEADER_PRIVATE_KEY" : "Приватный ключ:",
"FIELD_HEADER_READ_ONLY" : "Только просмотр:",
"FIELD_OPTION_FONT_SIZE_8" : "8", "FIELD_OPTION_FONT_SIZE_8" : "8",
"FIELD_OPTION_FONT_SIZE_9" : "9", "FIELD_OPTION_FONT_SIZE_9" : "9",
@@ -352,6 +354,7 @@
"FIELD_HEADER_PASSWORD" : "Пароль:", "FIELD_HEADER_PASSWORD" : "Пароль:",
"FIELD_HEADER_PASSWORD_REGEX" : "Регулярное выражение для пароля:", "FIELD_HEADER_PASSWORD_REGEX" : "Регулярное выражение для пароля:",
"FIELD_HEADER_PORT" : "Порт:", "FIELD_HEADER_PORT" : "Порт:",
"FIELD_HEADER_READ_ONLY" : "Только просмотр:",
"FIELD_OPTION_FONT_SIZE_8" : "8", "FIELD_OPTION_FONT_SIZE_8" : "8",
"FIELD_OPTION_FONT_SIZE_9" : "9", "FIELD_OPTION_FONT_SIZE_9" : "9",