Ticket #307: Added missing 'value' parameter to the boolean checkbox parameters from the source xml through to the webapp.

This commit is contained in:
James Muehlner
2013-04-11 22:57:02 -07:00
parent 6116840369
commit 414426b779
7 changed files with 42 additions and 10 deletions

View File

@@ -75,7 +75,12 @@ public class ProtocolParameter {
* The type of this field.
*/
private Type type;
/**
* The value of this parameter, for boolean parameters.
*/
private String value;
/**
* A collection of all associated parameter options.
*/
@@ -119,6 +124,24 @@ public class ProtocolParameter {
this.title = title;
}
/**
* Returns the value associated with this protocol parameter.
* @return The value associated with this protocol parameter.
*/
public String getValue() {
return value;
}
/**
* Sets the value associated with this protocol parameter. The value must
* be a human-readable string which describes accurately this parameter.
*
* @param value A human-readable string describing this parameter.
*/
public void setValue(String value) {
this.value = value;
}
/**
* Returns the type of this parameter.
* @return The type of this parameter.

View File

@@ -158,6 +158,7 @@ public class List extends AuthenticatingHttpServlet {
// Boolean parameter
case BOOLEAN:
xml.writeAttribute("type", "boolean");
xml.writeAttribute("value", param.getValue());
break;
// Enumerated parameter

View File

@@ -40,6 +40,7 @@ public class ParamTagHandler implements TagHandler {
protocolParameter.setName(attributes.getValue("name"));
protocolParameter.setTitle(attributes.getValue("title"));
protocolParameter.setValue(attributes.getValue("value"));
// Parse type
String type = attributes.getValue("type");

View File

@@ -17,8 +17,8 @@
<option value="32">True color (32-bit)</option>
</param>
<param name="console" type="boolean" title="Administrator console"/>
<param name="console-audio" type="boolean" title="Support audio in console"/>
<param name="disable-audio" type="boolean" title="Disable audio"/>
<param name="console" type="boolean" title="Administrator console" value="true"/>
<param name="console-audio" type="boolean" title="Support audio in console" value="true"/>
<param name="disable-audio" type="boolean" title="Disable audio" value="true"/>
</protocol>

View File

@@ -4,8 +4,8 @@
<param name="port" type="numeric" title="Port"/>
<param name="password" type="password" title="Password"/>
<param name="read-only" type="boolean" title="Read-only"/>
<param name="swap-red-blue" type="boolean" title="Swap red/blue components"/>
<param name="read-only" type="boolean" title="Read-only" value="true"/>
<param name="swap-red-blue" type="boolean" title="Swap red/blue components" value="true"/>
<param name="color-depth" type="enum" title="Color depth">
<option value="8">256 color</option>

View File

@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path=""/>
<Context antiJARLocking="true" path="/guacamole"/>

View File

@@ -767,10 +767,11 @@ GuacamoleService.Protocol = function(name, title, parameters) {
/**
* A parameter belonging to a protocol. Each parameter has a name which
* identifies the parameter to the protocol, a human-readable title, and a type
* which dictates its presentation to the user.
* identifies the parameter to the protocol, a human-readable title,
* a value for boolean parameters, and a type which dictates
* its presentation to the user.
*/
GuacamoleService.Protocol.Parameter = function(name, title, type, options) {
GuacamoleService.Protocol.Parameter = function(name, title, type, value, options) {
/**
* The name of this parameter.
@@ -787,6 +788,11 @@ GuacamoleService.Protocol.Parameter = function(name, title, type, options) {
*/
this.type = type;
/**
* The value of this parameter.
*/
this.value = value;
/**
* All available options, if applicable, in desired order of presentation.
* @type GuacamoleService.Protocol.Parameter.Option[]
@@ -924,6 +930,7 @@ GuacamoleService.Protocols = {
// Boolean parameter
case "boolean":
parameter.type = GuacamoleService.Protocol.Parameter.BOOLEAN;
parameter.value = paramElement.getAttribute("value");
break;
// Enumerated parameter