diff options
| author | Keith Wall <kwall@apache.org> | 2014-08-16 15:03:21 +0000 |
|---|---|---|
| committer | Keith Wall <kwall@apache.org> | 2014-08-16 15:03:21 +0000 |
| commit | a22fa634fe3a3f51d1a27078e17cba82e48fcf46 (patch) | |
| tree | d2a04b686bae034f2172b64a388726eb40c2538b /qpid/java | |
| parent | 1b0754c1ab44c56bc966b3e170d071a050f3cc2a (diff) | |
| download | qpid-python-a22fa634fe3a3f51d1a27078e17cba82e48fcf46.tar.gz | |
QPID-6006: [Java Broker] UI to expose attribute defaults during create and edit workflows
* Metadata service now used to discover the attributes for each category instance type.
* Create/edit dialogues now have promptMessages to provide a fuller description of the field's purpose
* If the attribute has a default, the default is interpolated into the promptMessage in a standard way.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1618373 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
41 files changed, 971 insertions, 484 deletions
diff --git a/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb_ha/edit.js b/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb_ha/edit.js index 087caf34c6..ed34bbbd7a 100644 --- a/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb_ha/edit.js +++ b/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb_ha/edit.js @@ -16,10 +16,11 @@ * specific language governing permissions and limitations * under the License. */ -define(["qpid/common/util", "dijit/registry", "dojo/_base/window", "dojo/domReady!"], - function (util, registry, win) +define(["qpid/common/util", "qpid/common/metadata", "dijit/registry", "dojo/_base/window", "dojo/domReady!"], + function (util, metadata, registry, win) { - var fieldNames = ["storeUnderfullSize", "storeOverfullSize"]; + var fieldNames = ["storeUnderfullSize", "storeOverfullSize", + "localTransactionSynchronizationPolicy", "remoteTransactionSynchronizationPolicy"]; return { show: function(data) { @@ -28,17 +29,6 @@ define(["qpid/common/util", "dijit/registry", "dojo/_base/window", "dojo/domRead registry.byId("editVirtualHost.storeUnderfullSize").set("regExpGen", util.numericOrContextVarRegexp); registry.byId("editVirtualHost.storeOverfullSize").set("regExpGen", util.numericOrContextVarRegexp); - var widget = registry.byId("editVirtualHost.localTransactionSynchronizationPolicy-" + data.data["localTransactionSynchronizationPolicy"]); - if (widget) - { - widget.set("checked", true); - } - widget = registry.byId("editVirtualHost.remoteTransactionSynchronizationPolicy-" + data.data["remoteTransactionSynchronizationPolicy"]); - if (widget) - { - widget.set("checked", true); - } - var that = this; this.permittedNodes = registry.byId("editVirtualHost.permittedNodes"); this.permittedNodesList = registry.byId("editVirtualHost.permittedNodesList"); diff --git a/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb_ha/show.js b/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb_ha/show.js index 9cf6bdea66..f211d19d16 100644 --- a/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb_ha/show.js +++ b/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb_ha/show.js @@ -47,8 +47,8 @@ define(["qpid/common/util", "dojo/query", "dojo/domReady!"], } this["permittedNodes"].innerHTML = permittedNodesMarkup ; - var localSyncPolicy = data[localTransactionSynchronizationPolicy].toLowerCase(); - var remoteSyncPolicy = data[remoteTransactionSynchronizationPolicy].toLowerCase(); + var localSyncPolicy = data[localTransactionSynchronizationPolicy] ? data[localTransactionSynchronizationPolicy].toLowerCase() : ""; + var remoteSyncPolicy = data[remoteTransactionSynchronizationPolicy] ? data[remoteTransactionSynchronizationPolicy].toLowerCase() : ""; for(var i=0; i<this[localTransactionSynchronizationPolicy].children.length;i++) { diff --git a/qpid/java/bdbstore/src/main/java/resources/virtualhost/bdb_ha/edit.html b/qpid/java/bdbstore/src/main/java/resources/virtualhost/bdb_ha/edit.html index cad6b9301e..9d0b0ab860 100644 --- a/qpid/java/bdbstore/src/main/java/resources/virtualhost/bdb_ha/edit.html +++ b/qpid/java/bdbstore/src/main/java/resources/virtualhost/bdb_ha/edit.html @@ -27,7 +27,8 @@ name: 'storeOverfullSize', placeHolder: 'size in bytes', required: false, - title: 'Enter ceiling (in bytes) at which store will begin to throttle sessions producing messages'"/> + title: 'Enter ceiling (in bytes) at which store will begin to throttle sessions producing messages', + promptMessage: 'Ceiling (in bytes) at which store will begin to throttle sessions producing messages'"/> </div> </div> <div class="clear"> @@ -39,7 +40,8 @@ name: 'storeUnderfullSize', placeHolder: 'size in bytes', required: false, - title: 'Enter floor (in bytes) at which store will cease to throttle sessions producing messages'"/> + title: 'Enter floor (in bytes) at which store will cease to throttle sessions producing messages', + promptMessage: 'Floor (in bytes) at which store will cease to throttle sessions producing messages'"/> </div> </div> @@ -74,8 +76,9 @@ data-dojo-props=" name: 'permittedNode', placeHolder: 'host:port', - title: 'Enter address', - intermediateChanges: true" /> + intermediateChanges: true, + title: 'Enter address of node to be permitted into the group', + promptMessage: 'Address of node to be permitted into the group'" /> </div> <button data-dojo-type="dijit/form/Button" id="editVirtualHost.permittedNodeAdd" data-dojo-props="label: '+'"></button> </div> @@ -86,42 +89,30 @@ <div class="formBox clear"> <fieldset> - <legend>High availability durability</legend> - <div> - <div class="haOptionLabel">Master transaction sync policy</div> + <legend>High availability durability</legend> <div> - <input data-dojo-type="dijit/form/RadioButton" type="radio" name="localTransactionSynchronizationPolicy" value="SYNC" id="editVirtualHost.localTransactionSynchronizationPolicy-SYNC"/> - <label>SYNC (the transaction will be written and synchronized to the disk; highest durability)</label> - </div> - - <div> - <input data-dojo-type="dijit/form/RadioButton" type="radio" name="localTransactionSynchronizationPolicy" value="WRITE_NO_SYNC" id="editVirtualHost.localTransactionSynchronizationPolicy-WRITE_NO_SYNC"/> - <label>WRITE_NO_SYNC (the transaction will be written only; the synchronization will be performed later)</label> - </div> + <div class="haOptionLabel">Master transaction sync policy</div> - <div> - <input data-dojo-type="dijit/form/RadioButton" type="radio" name="localTransactionSynchronizationPolicy" value="NO_SYNC" id="editVirtualHost.localTransactionSynchronizationPolicy-NO_SYNC"/> - <label>NO_SYNC (write later; the transaction will be written and synchronized later; lowest durability)</label> - </div> - </div> - <br/> - <div> - <div class="haOptionLabel">Replica transaction sync policy</div> - <div> - <input data-dojo-type="dijit/form/RadioButton" type="radio" name="remoteTransactionSynchronizationPolicy" value="SYNC" id="editVirtualHost.remoteTransactionSynchronizationPolicy-SYNC"/> - <label>SYNC (the transaction will be written and synchronized to the disk; highest durability)</label> + <select id="editVirtualHost.localTransactionSynchronizationPolicy" + name="localTransactionSynchronizationPolicy" + data-dojo-type="dojox/form/CheckedMultiSelect"> + <option value="SYNC">SYNC (the transaction will be written and synchronized to the disk; highest durability)</option> + <option value="WRITE_NO_SYNC">WRITE_NO_SYNC (the transaction will be written only; the synchronization will be performed later)</option> + <option value="NO_SYNC">NO_SYNC (write later; the transaction will be written and synchronized later; lowest durability)</option> + </select> </div> - + <br/> <div> - <input data-dojo-type="dijit/form/RadioButton" type="radio" name="remoteTransactionSynchronizationPolicy" value="WRITE_NO_SYNC" id="editVirtualHost.remoteTransactionSynchronizationPolicy-WRITE_NO_SYNC"/> - <label>WRITE_NO_SYNC (the transaction will be written only; the synchronization will be performed later)</label> - </div> + <div class="haOptionLabel">Replica transaction sync policy</div> - <div> - <input data-dojo-type="dijit/form/RadioButton" type="radio" name="remoteTransactionSynchronizationPolicy" value="NO_SYNC" id="editVirtualHost.remoteTransactionSynchronizationPolicy-NO_SYNC"/> - <label>NO_SYNC (write later; the transaction will be written and synchronized later; lowest durability)</label> + <select id="editVirtualHost.remoteTransactionSynchronizationPolicy" + name="remoteTransactionSynchronizationPolicy" + data-dojo-type="dojox/form/CheckedMultiSelect"> + <option value="SYNC">SYNC (the transaction will be written and synchronized to the disk; highest durability)</option> + <option value="WRITE_NO_SYNC">WRITE_NO_SYNC (the transaction will be written only; the synchronization will be performed later)</option> + <option value="NO_SYNC">NO_SYNC (write later; the transaction will be written and synchronized later; lowest durability)</option> + </select> </div> - </div> </fieldset> </div> diff --git a/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb/add.html b/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb/add.html index 9ce23084c5..c16dd675d2 100644 --- a/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb/add.html +++ b/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb/add.html @@ -27,7 +27,8 @@ data-dojo-props=" name: 'storePath', placeHolder: 'path/to/store', - title: 'Enter store path'" /> + title: 'Enter store path', + promptMessage: 'File system location for the configuration store.'"/> </div> </div> diff --git a/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add.html b/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add.html index c7e44a38b2..6973cf9002 100644 --- a/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add.html +++ b/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add.html @@ -31,7 +31,9 @@ data-dojo-props="store:groupStore, searchAttr:'name', required: true, - placeHolder: 'choose new or existing'" + placeHolder: 'choose new or existing', + promptMessage: 'Create a new group or join to an existing one', + title: 'Choose whether to create a new group or join to an existing one'" name="group" id="addVirtualHostNode.group" /> </div> diff --git a/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add/existinggroup/add.html b/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add/existinggroup/add.html index 820a94e754..d8f1ae5c57 100644 --- a/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add/existinggroup/add.html +++ b/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add/existinggroup/add.html @@ -30,8 +30,8 @@ name: 'groupName', placeHolder: 'group name', required: true, - missingMessage: 'The group name must be supplied', - title: 'Enter the group name'" /> + promptMessage: 'Name of the existing group', + title: 'Enter name of the existing group'," /> </div> </div> <div class="clear"> @@ -43,8 +43,8 @@ name: 'helperNodeName', placeHolder: 'node name from group', required: true, - missingMessage: 'A node name must be supplied', - title: 'Enter a node name'" /> + promptMessage: 'Node name of an existing group member.', + title: 'Enter node name of an existing member of the group'" /> </div> </div> <div class="clear"> @@ -56,8 +56,8 @@ name: 'helperAddress', placeHolder: 'node address from group', required: true, - missingMessage: 'Node host and port must be supplied', - title: 'Enter address'" /> + promptMessage: 'Node address of the existing group member.', + title: 'Enter node address of the existing group member'" /> </div> </div> </fieldset> @@ -76,8 +76,8 @@ name: 'address', placeHolder: 'host:port', required: true, - missingMessage: 'Node host and port must be supplied', - title: 'Enter address'" /> + promptMessage: 'Node hostname and port number that new node will use.<br/>Other nodes will use connect to this address to replicate messages', + title: 'Enter node hostname and port number that new node will use'" /> </div> </div> <div class="clear"> @@ -88,7 +88,8 @@ data-dojo-props=" name: 'storePath', placeHolder: 'path/to/store', - title: 'Enter store path'" /> + promptMessage: 'File system location for the store', + title: 'Enter file system location for the store'" /> </div> </div> </fieldset> diff --git a/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add/newgroup/add.html b/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add/newgroup/add.html index 1d3b2a1906..c25bae3419 100644 --- a/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add/newgroup/add.html +++ b/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add/newgroup/add.html @@ -27,8 +27,8 @@ name: 'groupName', placeHolder: 'group name', required: true, - missingMessage: 'A group name must be supplied', - title: 'Enter a group name'" /> + title: 'Enter name to identify the new group', + promptMessage: 'Name to identify the new group.'"/> </div> </div> <div class="clear"> @@ -40,8 +40,8 @@ name: 'address', placeHolder: 'host:port', required: true, - missingMessage: 'Node host and port must be supplied', - title: 'Enter address'" /> + title: 'Enter node hostname and port number that new node will use', + promptMessage: 'Node hostname and port number that new node will use.<br/>Other nodes will use connect to this address to replicate messages'" /> </div> </div> <div class="clear"> @@ -52,7 +52,8 @@ data-dojo-props=" name: 'storePath', placeHolder: 'path/to/store', - title: 'Enter store path'" /> + title: 'Enter file system location for the store', + promptMessage: 'File system location for the store'" /> </div> </div> <div class="clear formBox"> @@ -66,7 +67,7 @@ data-dojo-props=" name: 'permittedNodesList', readOnly : 'true', - title: 'Enter permitted nodes'"> + title: 'Enter list of the other node address that will form the group'"> </select> <!-- must use closing tag rather than shorthand - dojo bug? --> </div> <button data-dojo-type="dijit/form/Button" id="addVirtualHostNode.permittedNodeRemove" data-dojo-props="label: '-'" ></button> @@ -81,8 +82,9 @@ data-dojo-props=" name: 'permittedNode', placeHolder: 'host:port', - title: 'Enter address', - intermediateChanges: true" /> + intermediateChanges: true, + title: 'Enter address of node to be permitted into the group', + promptMessage: 'Address of node to be permitted into the group'" /> </div> <button data-dojo-type="dijit/form/Button" id="addVirtualHostNode.permittedNodeAdd" data-dojo-props="label: '+'"></button> </div> diff --git a/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/edit.html b/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/edit.html index 189eb6f7b6..f163390fa2 100644 --- a/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/edit.html +++ b/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/edit.html @@ -25,8 +25,7 @@ placeHolder: 'Group Name', required: true, disabled: true, - missingMessage: 'A group name must be supplied', - title: 'Enter group name'" /> + title: 'Name of the group'" /> </div> </div> <div class="clear"> @@ -39,9 +38,7 @@ placeHolder: 'host:port', required: true, disabled: true, - missingMessage: 'A Host and Port must be supplied', - invalidMessage: 'Must be of the form host:port', - title: 'Enter Host and Port name'" /> + title: 'Node address of the group member'" /> </div> </div> <div class="clear"> @@ -51,8 +48,9 @@ data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props=" name: 'storePath', - placeHolder: 'path/to/store', - title: 'Enter configuration store path'" /> + title: 'File system location for the store', + promptMessage: 'File system location for the store'" /> + </div> </div> <div class="clear"> @@ -63,7 +61,8 @@ data-dojo-props=" name: 'designatedPrimary', required: false, - title: 'Designate node as primary. It is applicable only to 2-nodes cluster'" /> + title: 'Designate node as primary allowing it to operate solo in a group of two.', + promptMessage: 'Designate node as primary allowing it to operate solo operate solo in a group of two'" /> </div> </div> <div class="clear"> @@ -80,8 +79,9 @@ data-dojo-props=" name: 'priority', required: false, - title: 'Select node priority for election as a Master', store: nodePriorityStore, + title: 'Set the election priority associated with this node', + promptMessage: 'Election priority associated with this node.<br/>Elections will choose the node with the most recent transactions.<br/>If there is a tie, priority is used as a tie-breaker.', searchAttr: 'name'" /> </div> </div> @@ -95,7 +95,8 @@ data-dojo-props=" name: 'quorumOverride', required: false, - title: 'Enter quorum override. 0 signifies simple majority', + title: 'Select minimum required number of nodes or choose Majority', + promptMessage: 'Modifies the minimum number of nodes required to be present to elect a master or commit transactions.<br/>Majority signifies that a natural majority of nodes must be present.', store: nodeQuorumOverrideStore, searchAttr: 'name'" /> </div> diff --git a/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhost/derby/edit.js b/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhost/derby/edit.js index c71c2c28de..3a3107b01a 100644 --- a/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhost/derby/edit.js +++ b/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhost/derby/edit.js @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -define(["qpid/common/util", "dojo/domReady!"], - function (util) +define(["qpid/common/util", "dijit/registry", "dojo/domReady!"], + function (util, registry) { var fieldNames = ["storeUnderfullSize", "storeOverfullSize", "storePath"]; return { diff --git a/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhostnode/derby/add.html b/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhostnode/derby/add.html index 0ec1e89c24..4e82ab09e9 100644 --- a/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhostnode/derby/add.html +++ b/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhostnode/derby/add.html @@ -27,7 +27,8 @@ data-dojo-props=" name: 'storePath', placeHolder: 'path/to/store', - title: 'Enter store path'" /> + title: 'Enter store path', + promptMessage: 'File system location for the configuration store'"/> </div> </div> <div class="clear"></div> diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/add.html b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/add.html index f60f54e7d8..f9561d4c51 100644 --- a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/add.html +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/add.html @@ -28,7 +28,7 @@ name: 'connectionUrl', placeHolder: 'jdbc:provider:info', required: true, - missingMessage: 'JDBC URL must be supplied', + promptMessage: 'JDBC URL specifying the connection to the database', title: 'Enter JDBC URL'"/> </div> </div> @@ -41,7 +41,7 @@ name: 'username', placeHolder: 'username', required: true, - missingMessage: 'Username must be supplied', + promptMessage: 'Database user name', title: 'Enter username'" /> </div> </div> @@ -54,7 +54,7 @@ name: 'password', placeHolder: 'password', required: true, - missingMessage: 'Password must be supplied', + promptMessage: 'Database password', title: 'Enter password'" /> </div> </div> @@ -66,8 +66,8 @@ data-dojo-props=" name: 'connectionPoolType', required: true, - missingMessage: 'Connection Pool type must be supplied', - title: 'Select Connection Pool', + promptMessage: 'Connection pool type to use when connecting to the database', + title: 'Select the connection pool type', placeHolder: 'Select pool type'" /> </div> </div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageServlet.java b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageServlet.java index 8de74d189b..cb77735a7b 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageServlet.java +++ b/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageServlet.java @@ -143,7 +143,12 @@ public class MessageServlet extends AbstractServlet throw new IllegalArgumentException("Could not find virtual host with name '" + vhostName + "'"); } - return getQueueFromVirtualHost(queueName, vhost); + Queue queueFromVirtualHost = getQueueFromVirtualHost(queueName, vhost); + if (queueFromVirtualHost == null) + { + throw new IllegalArgumentException("Could not find queue with name '" + queueName + "' on virtual host '" + vhost.getName() + "'"); + } + return queueFromVirtualHost; } private Queue getQueueFromVirtualHost(String queueName, VirtualHost<?,?,?> vhost) diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/addBinding.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/addBinding.html index a07419977b..1b30c6ddcc 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/addBinding.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/addBinding.html @@ -39,7 +39,7 @@ name: 'name', placeHolder: 'Binding Key', required: true, - missingMessage: 'A binding key must be supplied', + promptMessage: 'Binding key', title: 'Enter binding key'" /> </div> </div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/addExchange.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/addExchange.html index 8c9968e37a..77d5ed0bc1 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/addExchange.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/addExchange.html @@ -21,32 +21,53 @@ <div class="dijitHidden"> <div data-dojo-type="dijit.Dialog" style="width:600px;" data-dojo-props="title:'Add Exchange'" id="addExchange"> <form id="formAddExchange" method="post" dojoType="dijit.form.Form"> - <table cellpadding="0" cellspacing="2"> - <tr> - <td valign="top"><strong>Exchange Name*: </strong></td> - <td><input type="text" required="true" name="name" id="formAddExchange.name" placeholder="Exchange Name" - dojoType="dijit.form.ValidationTextBox" missingMessage="A name must be supplied" - data-dojo-props="regExp:'^(?!qpid\.|amq\.|\<\<default\>\>)[\x20-\x2e\x30-\x7F]{1,255}$', invalidMessage:'Illegal or reserved exchange name!'"/></td> - </tr> - <tr> - <td valign="top"><strong>Durable? </strong></td> - <td><input type="checkbox" name="durable" id="formAddExchange.durable" value="durable" checked="checked" dojoType="dijit.form.CheckBox" /></td> - </tr> - <tr> - <td valign="top"><strong>Exchange Type: </strong></td> - <td> - <select name="type" id="formAddExchange.type" dojoType="dijit.form.FilteringSelect"> - <option value="direct">direct</option> - <option value="topic">topic</option> - <option value="headers">headers</option> - <option value="fanout">fanout</option> - </select> - </td> - </tr> - </table> + <div class="clear"> + <div class="formLabel-labelCell">Name*:</div> + <div class="formLabel-controlCell"> + <input type="text" id="formAddExchange.name" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'name', + placeHolder: 'exchange name', + required: true, + promptMessage: 'Name of exchange', + title: 'Enter an exchange name', + regExp:'^(?!qpid\.|amq\.|\<\<default\>\>)[\x20-\x2e\x30-\x7F]{1,255}$', + invalidMessage:'Illegal or reserved exchange name!'"/> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Exchange Type:</div> + <div class="formLabel-controlCell"> + <select id="formAddExchange.type" + dojoType="dijit.form.FilteringSelect" + data-dojo-props=" + name: 'type', + promptMessage: 'Type of exchange - responsible for routing messages to queues'"> + <option value="direct">direct</option> + <option value="topic">topic</option> + <option value="headers">headers</option> + <option value="fanout">fanout</option> + </select> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Durable?</div> + <div class="formLabel-controlCell"> + <input type="checkbox" id="formAddExchange.durable" + dojoType="dijit.form.CheckBox" + data-dojo-props=" + name: 'durable', + value: 'durable', + checked: true"/> + </div> + </div> + + + <div class="clear"></div> + <div class="dijitDialogPaneActionBar"> - <!-- submit buttons --> - <input type="submit" value="Create Exchange" label="Create Exchange" dojoType="dijit.form.Button" /> + <input type="submit" value="Create Exchange" label="Create Exchange" dojoType="dijit.form.Button" /> </div> </form> </div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/addPort.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/addPort.html index 69d49248b8..25f2600b74 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/addPort.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/addPort.html @@ -24,35 +24,77 @@ <div style="height:320px; width:420px; overflow: auto"> <div class="hidden" id="portEditWarning">NOTE: changes will only take effect after Broker restart.</div> <div id="formAddPort:fields"> - <input type="text" required="true" name="name" id="formAddPort.name" placeholder="Name" - data-dojo-props="label: 'Name*:'" dojoType="dijit.form.ValidationTextBox" - missingMessage="A name must be supplied"/> + <input id="formAddPort.name" type="text" + dojoType="dijit.form.ValidationTextBox" + data-dojo-props=" + name: 'name', + label: 'Port Number*:', + required: 'true', + placeHolder: 'name', + promptMessage: 'Name of port, must be unique', + title: 'Enter name of port'"/> - <input type="text" required="true" id="formAddPort.port" - data-dojo-props="label: 'Port Number*:', placeHolder: 'Enter port number'" dojoType="dijit.form.ValidationTextBox" - name="port" missingMessage="A port number must be supplied"/> - <select id="formAddPort.type" data-dojo-type="dijit.form.FilteringSelect" - data-dojo-props="name: 'type', value: '',placeHolder: 'Select Port Type', label: 'Port Type*:'"> + <input id="formAddPort.port" type="text" + dojoType="dijit.form.ValidationTextBox" + data-dojo-props=" + name: 'port', + label: 'Port Number*:', + required: 'true', + placeHolder: 'port number', + promptMessage: 'Port number to be bound', + title: 'Enter port number'"/> + <select id="formAddPort.type" + data-dojo-type="dijit.form.FilteringSelect" + data-dojo-props=" + name: 'type', + label: 'Port Type*:', + value: '', + placeHolder: 'port type', + promptMessage: 'Port type', + title: 'Enter port type'"> <option value="AMQP" selected="selected">AMQP</option> <option value="JMX">JMX</option> <option value="HTTP">HTTP</option> </select> </div> <div id="formAddPort:fieldsAuthenticationProvider"> - <select id="formAddPort.authenticationProvider" data-dojo-type="dijit.form.FilteringSelect" - data-dojo-props="name:'authenticationProvider',label:'Authentication Provider*:', searchAttr: 'name', required: true, placeHolder: 'Select Provider'"> + <select id="formAddPort.authenticationProvider" + data-dojo-type="dijit.form.FilteringSelect" + data-dojo-props=" + name: 'authenticationProvider', + label: 'Authentication Provider*:', + searchAttr: 'name', + required: true, + placeHolder: 'provider', + promptMessage: 'Authentication provider to authenticate users connecting to the port', + title: 'Associate the port with an authentication provider'"> </select> </div> <div id="formAddPort:fieldsBindingAddress"> - <input id="formAddPort.bindingAddress" type="text" name="bindingAddress" placeholder="*" - dojoType="dijit.form.TextBox" data-dojo-props="label: 'Binding address:'"/> + <input id="formAddPort.bindingAddress" type="text" + data-dojo-type="dijit.form.ValidationTextBox" + data-dojo-props=" + name: 'bindingAddress', + label: 'Binding address:', + placeHolder: 'binding address', + promptMessage: 'Restricts the port to listen on the specified address only. The <code>*</code> wildcard signifies all addresses', + title: 'Enter a binding address'"/> </div> <div id="formAddPort:fieldsAMQP"> - <input id="formAddPort.protocolsDefault" type="checkbox" checked="checked" - dojoType="dijit.form.CheckBox" data-dojo-props="label: 'Support default protocols:'"/> - <select id="formAddPort.protocolsAMQP" name="protocols" data-dojo-type="dijit.form.MultiSelect" multiple="true" - data-dojo-props="name: 'protocols', value: '', placeHolder: 'Select AMQP versions', label: 'AMQP versions:'" - missingMessage="AMQP protocol(s) must be supplied"> + <input id="formAddPort.protocolsDefault" type="checkbox" + checked="checked" + dojoType="dijit.form.CheckBox" + data-dojo-props="label: 'Support default protocols:'"/> + <select id="formAddPort.protocolsAMQP" + data-dojo-type="dijit.form.MultiSelect" + data-dojo-props=" + name: 'protocols', + label: 'AMQP protocols:', + value: '', + placeHolder: 'AMQP protocols', + promptMessage: 'AMQP protocols to be associated with this port', + title: 'Select AMQP protocols to be associated with this port', + multiple: true"> <option value="AMQP_0_8">AMQP 0.8</option> <option value="AMQP_0_9">AMQP 0.9</option> <option value="AMQP_0_9_1">AMQP 0.9.1</option> @@ -61,40 +103,80 @@ </select> </div> <div id="formAddPort:fieldsJMX"> - <select id="formAddPort.protocolsJMX" name="protocols" data-dojo-type="dijit.form.FilteringSelect" - data-dojo-props="name: 'protocols', value: '', label: 'JMX protocol*:'" missingMessage="JMX protocol must be supplied"> + <select id="formAddPort.protocolsJMX" + data-dojo-type="dijit.form.FilteringSelect" + data-dojo-props=" + name: 'protocols', + value: '', + label: 'JMX protocol*:', + promptMessage: 'JMX protocol to be associated with this port', + title: 'Enter JMX protocol to be associated with this port'"> <option value="RMI">RMI</option> <option value="JMX_RMI">JMX RMI</option> </select> </div> <div id="formAddPort:fieldsHTTP"> - <select id="formAddPort.protocolsHTTP" name="protocols" data-dojo-type="dijit.form.FilteringSelect" - data-dojo-props="name: 'protocols', value: 'HTTP', label: 'HTTP protocol*:'" missingMessage="HTTP protocol must be supplied"> + <select id="formAddPort.protocolsHTTP" + data-dojo-type="dijit.form.FilteringSelect" + data-dojo-props=" + name: 'protocols', + value: 'HTTP', + label: 'HTTP protocol*:', + promptMessage: 'HTTP protocol to be associated with this port', + title: 'Enter HTTP protocol to be associated with this port'"> <option value="HTTP">HTTP</option> </select> </div> <div id="formAddPort:transport" > - <select id="formAddPort.transports" name="transports" data-dojo-type="dijit.form.MultiSelect" multiple="true" - data-dojo-props="name: 'transports',label: 'Transport:',placeHolder: 'TCP', value: '' "> + <select id="formAddPort.transports" + data-dojo-type="dijit.form.MultiSelect" + data-dojo-props=" + name: 'transports', + label: 'Transport:', + placeHolder: 'TCP', + value: '', + multiple: true, + promptMessage: 'Transport(s)', + title: 'Select transports'"> <option value="TCP">TCP</option> <option value="SSL">SSL</option> </select> </div> <div id="formAddPort:fieldsTransportSSL"> - <select id="formAddPort.keyStore" data-dojo-type="dijit.form.FilteringSelect" - data-dojo-props="name:'keyStore',label:'Key Store*:', searchAttr: 'name', placeHolder: 'Select keystore', value: '', required: true "> + <select id="formAddPort.keyStore" + data-dojo-type="dijit.form.FilteringSelect" + data-dojo-props=" + name: 'keyStore', + label: 'Key Store*:', + searchAttr: 'name', + placeHolder: 'keystore', + value: '', + required: true, + promptMessage: 'Keystore that provides the SSL certificate', + title: 'Select the keystore that provides the SSL certificate'"> </select> </div> <div id="formAddPort:fieldsClientAuth"> <div id="formAddPort:fieldsClientAuthCheckboxes"> - <input id="formAddPort.needClientAuth" type="checkbox" name="needClientAuth" - dojoType="dijit.form.CheckBox" data-dojo-props="label: 'Need SSL Client Certificate:'" /> - <input id="formAddPort.wantClientAuth" type="checkbox" name="wantClientAuth" - dojoType="dijit.form.CheckBox" data-dojo-props="label: 'Want SSL Client Certificate:'" /> + <input id="formAddPort.needClientAuth" type="checkbox" + data-dojo-type="dijit.form.CheckBox" + data-dojo-props=" + name: 'needClientAuth', + label: 'Need SSL Client Certificate:'" /> + <input id="formAddPort.wantClientAuth" type="checkbox" + data-dojo-type="dijit.form.CheckBox" + data-dojo-props=" + name: 'wantClientAuth', + label: 'Want SSL Client Certificate:'" /> </div> <div><strong>Trust Stores:</strong></div> - <table id="formAddPort.trustStores" data-dojo-type="dojox.grid.EnhancedGrid" - data-dojo-props="label:'Trust Stores:',plugins:{indirectSelection: true},rowSelector:'0px' " style="height: 100px; width:400px"> + <table id="formAddPort.trustStores" + data-dojo-type="dojox.grid.EnhancedGrid" + data-dojo-props=" + label: 'Trust Stores:', + plugins:{indirectSelection: true}, + rowSelector:'0px'" + style="height: 100px; width:400px"> <thead> <tr> <th field="name">Name</th> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/addQueue.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/addQueue.html index 75d0888200..352e69893b 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/addQueue.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/addQueue.html @@ -21,216 +21,316 @@ <div class="dijitHidden"> <div data-dojo-type="dijit.Dialog" data-dojo-props="title:'Add Queue'" id="addQueue"> <form id="formAddQueue" method="post" dojoType="dijit.form.Form"> - <div style="height:250px; width:600px; overflow: auto"> - <table cellpadding="0" cellspacing="2"> - <tr> - <td valign="top"><strong>Queue Name*: </strong></td> - <td><input type="text" required="true" name="name" id="formAddQueue.name" placeholder="Queue Name" - dojoType="dijit.form.ValidationTextBox" missingMessage="A name must be supplied" regexp="^[\x20-\x2e\x30-\x7F]{1,255}$"/></td> - </tr> - <tr> - <td valign="top"><strong>Durable? </strong></td> - <td><input type="checkbox" name="durable" id="formAddQueue.durable" value="durable" checked="checked" dojoType="dijit.form.CheckBox" /></td> - </tr> - <tr> - <td valign="top"><strong>Persist Messages? </strong></td> - <td> - <select id="formAddQueue.messageDurability" name="messageDurability" data-dojo-type="dijit.form.FilteringSelect" - data-dojo-props="name: 'messageDurability', value: '', searchAttr: 'name', placeHolder: '', value: '', required: false "> - <option value="ALWAYS">Always</option> - <option value="DEFAULT">Default</option> - <option value="NEVER">Never</option> - </select> - </td> - </tr> - <tr> - <td valign="top"><strong>Max Ttl: </strong></td> - <td><input type="text" required="false" name="maximumMessageTtl" id="formAddQueue.maximumMessageTtl" placeholder="Ttl in ms." - dojoType="dijit.form.ValidationTextBox" - trim="true" - regexp="[0-9]+" - invalidMessage= "Invalid value" /></td> - </tr> - <tr> - <td valign="top"><strong>Min Ttl: </strong></td> - <td><input type="text" required="false" name="minimumMessageTtl" id="formAddQueue.minimumMessageTtl" placeholder="Ttl in ms." - dojoType="dijit.form.ValidationTextBox" - trim="true" - regexp="[0-9]+" - invalidMessage= "Invalid value" /></td> - </tr> - <tr> - <td valign="top"><strong>Queue Type: </strong></td> - <td> + + <div class="clear"> + <div class="formLabel-labelCell">Queue Name*:</div> + <div class="formLabel-controlCell"> + <input type="text" id="formAddQueue.name" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'name', + placeHolder: 'queue name', + required: true, + promptMessage: 'Name of queue', + title: 'Enter a queue name', + regExp:'^[\x20-\x2e\x30-\x7F]{1,255}$'"/> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Queue Type:</div> + <div class="formLabel-controlCell"> <input type="radio" id="formAddQueueTypeStandard" name="type" value="standard" checked="checked" dojoType="dijit.form.RadioButton" /> <label for="formAddQueueTypeStandard">Standard</label> - + <input type="radio" id="formAddQueueTypePriority" name="type" value="priority" dojoType="dijit.form.RadioButton" /> <label for="formAddQueueTypePriority">Priority</label> - + <input type="radio" id="formAddQueueTypeLVQ" name="type" value="lvq" dojoType="dijit.form.RadioButton" /> <label for="formAddQueueTypeLVQ">LVQ</label> - + <input type="radio" id="formAddQueueTypeSorted" name="type" value="sorted" dojoType="dijit.form.RadioButton" /> <label for="formAddQueueTypeSorted">Sorted</label> - </td> - </tr> - </table> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Durable?</div> + <div class="formLabel-controlCell"> + <input type="checkbox" id="formAddQueue.durable" + dojoType="dijit.form.CheckBox" + data-dojo-props=" + name: 'durable', + value: 'durable', + checked: true"/> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Persist Messages?</div> + <div class="formLabel-controlCell"> + <select id="formAddQueue.messageDurability" + dojoType="dijit.form.FilteringSelect" + data-dojo-props=" + name: 'messageDurability', + value: '', + searchAttr: 'name', + required: false, + promptMessage: 'Message durability override. If not default, messages arriving will have durability setting overridden', + title: 'Enter message durability override'"> + <option value="ALWAYS">Always</option> + <option value="DEFAULT">Default</option> + <option value="NEVER">Never</option> + </select> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Maximum Ttl:</div> + <div class="formLabel-controlCell"> + <input type="text" id="formAddQueue.maximumMessageTtl" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'maximumMessageTtl', + placeHolder: 'ttl in ms', + promptMessage: 'Maximum message time to live (ttl) in ms. Messages arriving with larger ttl values will be overridden by this value', + title: 'Enter the maximum message time to live in milliseconds', + trim: true"/> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Minimum Ttl:</div> + <div class="formLabel-controlCell"> + <input type="text" id="formAddQueue.minimumMessageTtl" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'minimumMessageTtl', + placeHolder: 'ttl in ms', + promptMessage: 'Minimum message time to live (ttl) in ms. Messages arriving with smaller ttl values will be overridden by this value', + title: 'Enter the minimum message time to live in milliseconds', + trim: true"/> + </div> + </div> + <br/> + <div class="clear"></div> + <div id="formAddQueueTypePriority:fields" class="hidden" data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Priority Queue Settings'"> - <table cellpadding="0" cellspacing="2"> - <tr> - <td valign="top"><strong>Priorities: </strong></td> - <td><input data-dojo-type="dijit.form.NumberSpinner" id="formAddQueue.priorities" - name="priorities" value="10" smallDelta="1" constraints="{min:1,max:10,places:0}"/> - </tr> - </table> + <div class="clear"> + <div class="formLabel-labelCell">Priorities:</div> + <div class="formLabel-controlCell"> + <input type="text" id="formAddQueue.priorities" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'priorities', + placeHolder: 'number of priorities', + promptMessage: 'Number of priorities supported by the queue', + title: 'Enter the number of priorities supported by the queue', + trim: true"/> + </div> + </div> + <div class="clear"></div> </div> - <div id="formAddQueueTypeLVQ:fields" class="hidden" data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Last Value Queue Settings'"> - <table cellpadding="0" cellspacing="2"> - <tr> - <td valign="top"><strong>LVQ Message Property: </strong></td> - <td><input type="text" name="lvqKey" id="formAddQueue.lvqkey" - placeholder="qpid.LVQ_key" dojoType="dijit.form.ValidationTextBox" /></td> - </tr> - </table> + <div class="clear"> + <div class="formLabel-labelCell">LVQ Message Property:</div> + <div class="formLabel-controlCell"> + <input type="text" id="formAddQueue.lvqkey" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'lvqKey', + placeHolder: 'lvq key', + promptMessage: 'Name of the message property used to perform the conflation', + title: 'Enter the name of the message property used to perform the conflation', + trim: true"/> + </div> + </div> + <div class="clear"></div> </div> <div id="formAddQueueTypeSorted:fields" class="hidden" data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Sorted Queue Settings'"> - <table cellpadding="0" cellspacing="2"> - <tr> - <td valign="top"><strong>Sort Message Property: </strong></td> - <td><input type="text" name="sortKey" id="formAddQueue.sortkey" required="false" - placeholder="" dojoType="dijit.form.ValidationTextBox" /></td> - </tr> - </table> + <div class="clear"> + <div class="formLabel-labelCell">Sort Message Property*:</div> + <div class="formLabel-controlCell"> + <input type="text" id="formAddQueue.sortkey" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'sortKey', + placeHolder: 'sort key', + promptMessage: 'Name of the message property used for sorting the messages on the queue', + title: 'Enter the name of the message property used for sorting the messages on the queue', + trim: true"/> + </div> + </div> + <div class="clear"></div> </div> <br/> <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Flow Control Settings', open: false"> - <table cellpadding="0" cellspacing="2"> - - <!-- x-qpid-capacity --> - <tr> - <td valign="top"><strong>Capacity: </strong></td> - <td><input type="text" required="false" name="queueFlowControlSizeBytes" id="formAddQueue.capacity" placeholder="Size in bytes" - dojoType="dijit.form.ValidationTextBox" - trim="true" - regexp="[0-9]+" - invalidMessage= "Invalid value"/></td> - </tr> - <!-- x-qpid-flow-resume-capacity --> - <tr> - <td valign="top"><strong>Resume Capacity: </strong></td> - <td><input type="text" required="false" name="queueFlowResumeSizeBytes" id="formAddQueue.flowResumeCapacity" placeholder="Size in bytes" - dojoType="dijit.form.ValidationTextBox" - trim="true" - regexp="[0-9]+" - invalidMessage= "Invalid value"/></td> - </tr> - </table> + <div class="clear"> + <div class="formLabel-labelCell">Capacity:</div> + <div class="formLabel-controlCell"> + <input type="text" id="formAddQueue.capacity" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'queueFlowControlSizeBytes', + placeHolder: 'size in bytes', + promptMessage: 'Ceiling (in bytes) at which queue will begin to throttle sessions producing messages', + title: 'Enter the ceiling (in bytes) at which queue will begin to throttle sessions producing messages', + trim: true"/> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Resume Capacity:</div> + <div class="formLabel-controlCell"> + <input type="text" id="formAddQueue.flowResumeCapacity" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'queueFlowResumeSizeBytes', + placeHolder: 'size in bytes', + promptMessage: 'Floor (in bytes) at which queue will cease to throttle sessions producing messages', + title: 'Enter the floor (in bytes) at which queue will cease to throttle sessions producing messages', + trim: true"/> + </div> + </div> + <div class="clear"></div> </div> + <br/> <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Alerting Settings', open: false"> - <table cellpadding="0" cellspacing="2"> - <!-- x-qpid-maximum-message-count --> - <tr> - <td valign="top"><strong>Queue Depth: </strong></td> - <td><input type="text" required="false" name="alertThresholdQueueDepthMessages" id="formAddQueue.maximumMessageCount" placeholder="Number of messages" - dojoType="dijit.form.ValidationTextBox" - trim="true" - regexp="[0-9]+" - invalidMessage= "Invalid value" /></td> - </tr> - <!-- x-qpid-maximum-queue-depth --> - <tr> - <td valign="top"><strong>Queue Depth: </strong></td> - <td><input type="text" required="false" name="alertThresholdQueueDepthBytes" id="formAddQueue.maximumQueueDepth" placeholder="Total message size in bytes" - dojoType="dijit.form.ValidationTextBox" - trim="true" - regexp="[0-9]+" - invalidMessage= "Invalid value" /></td> - </tr> - <!-- x-qpid-maximum-message-age --> - <tr> - <td valign="top"><strong>Message Age: </strong></td> - <td><input type="text" required="false" name="alertThresholdMessageAge" id="formAddQueue.maximumMessageAge" placeholder="Time in ms" - dojoType="dijit.form.ValidationTextBox" - trim="true" - regexp="[0-9]+" - invalidMessage= "Invalid value" /></td> - </tr> - <!-- x-qpid-maximum-message-size --> - <tr> - <td valign="top"><strong>Message Size: </strong></td> - <td><input type="text" required="false" name="alertThresholdMessageSize" id="formAddQueue.maximumMessageSize" placeholder="Size in bytes" - dojoType="dijit.form.ValidationTextBox" - trim="true" - regexp="[0-9]+" - invalidMessage= "Invalid value"/></td> - </tr> - <!-- x-qpid-minimum-alert-repeat-gap --> - <tr> - <td valign="top"><strong>Gap between alerts: </strong></td> - <td><input type="text" required="false" name="alertRepeatGap" id="formAddQueue.minimumAlertRepeatGap" placeholder="Time in ms" - dojoType="dijit.form.ValidationTextBox" - trim="true" - regexp="[0-9]+" - invalidMessage= "Invalid value" /></td> - </tr> - </table> + <div class="clear"> + <div class="formLabel-labelCell">Queue Depth:</div> + <div class="formLabel-controlCell"> + <input type="text" id="formAddQueue.maximumMessageCount" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'alertThresholdQueueDepthMessages', + placeHolder: 'number of messages', + promptMessage: 'Ceiling value for number of messages on queue before alerts will be generated', + title: 'Enter the ceiling value for number of messages on queue before alerts will be generated', + trim: true"/> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Queue Depth:</div> + <div class="formLabel-controlCell"> + <input type="text" id="formAddQueue.maximumQueueDepth" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'alertThresholdQueueDepthBytes', + placeHolder: 'total message size in bytes', + promptMessage: 'Ceiling value (in bytes) for total size of all messages on the queue before alerts will be generated', + title: 'Enter the ceiling value (in bytes) for total size of all messages on the queue before alerts will be generated', + trim: true"/> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Message Age:</div> + <div class="formLabel-controlCell"> + <input type="text" id="formAddQueue.maximumMessageAge" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'alertThresholdMessageAge', + placeHolder: 'time in ms', + promptMessage: 'Message age (in milliseconds) above which alerts will be generated', + title: 'Enter the message age (in milliseconds) above which alerts will be generated', + trim: true"/> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Message Size:</div> + <div class="formLabel-controlCell"> + <input type="text" id="formAddQueue.maximumMessageSize" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'alertThresholdMessageSize', + placeHolder: 'message size in bytes', + promptMessage: 'Message size (in bytes) above which alerts will be generated', + title: 'Enter the message size (in bytes) above which alerts will be generated', + trim: true"/> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Gap between alerts:</div> + <div class="formLabel-controlCell"> + <input type="text" id="formAddQueue.alertRepeatGap" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'alertRepeatGap', + placeHolder: 'time in ms', + promptMessage: 'Minimum time (in milliseconds) between each alert', + title: 'Enter the minimum time (in milliseconds) between each alert.', + trim: true"/> + </div> + </div> + <div class="clear"></div> </div> + <br/> <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Other Settings', open: false"> - <table cellpadding="0" cellspacing="2"> + <div class="clear"> + <div class="formLabel-labelCell">Maximum Delivery Retries:</div> + <div class="formLabel-controlCell"> + <input type="text" id="formAddQueue.maximumDeliveryAttempts" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'maximumDeliveryAttempts', + placeHolder: 'number of retries', + promptMessage: 'Maximum number of delivery attempts before the message will be sent to the alternate exchange', + title: 'Enter the maximum number of delivery attempts before the message will be sent to the alternate exchange', + trim: true"/> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Create DLQ?</div> + <div class="formLabel-controlCell"> + <input type="checkbox" id="formAddQueue.dlqEnabled" + dojoType="dijit.form.CheckBox" + data-dojo-props=" + name: 'dlqEnabled', + value: 'dlqEnabled', + title: 'Controls where a dead letter queue is automatically created', + checked: false"/> + </div> + </div> - <!-- x-qpid-maximum-delivery-count --> - <tr> - <td valign="top"><strong>Maximum Delivery Retries: </strong></td> - <td><input type="text" required="false" name="maximumDeliveryAttempts" id="formAddQueue.maximumDeliveryCount" - dojoType="dijit.form.ValidationTextBox" - trim="true" - regexp="[0-9]+" - invalidMessage= "Invalid value"/></td> - </tr> - <tr> - <td valign="top"><strong>Create DLQ? </strong></td> - <td><input type="checkbox" name="dlqEnabled" id="formAddQueue.dlqEnabled" value="dlqEnabled" dojoType="dijit.form.CheckBox" /></td> - </tr> - </table> - <table cellpadding="0" cellspacing="2"> - <tr> - <td valign="top">NOTE: Configuring maximum delivery retries on a queue which has no DLQ / AlternateExchange will result in messages being discarded after the limit is reached.</td> - </tr> - </table> - <table cellpadding="0" cellspacing="2"> + <div class="clear"></div> + <div class="infoMessage">Configuring maximum delivery retries on a queue which has no DLQ or alternate <br/>exchange will result in messages being discarded after the limit is reached.</div> - <!-- qpid.group_header_key --> - <tr> - <td valign="top"><strong>Message Group Key: </strong></td> - <td><input type="text" required="false" name="messageGroupKey" id="formAddQueue.messageGroupKey" - dojoType="dijit.form.ValidationTextBox" - trim="true"/></td> - </tr> - - <!-- qpid.qpid.shared_msg_group --> - <tr> - <td valign="top"><strong>Shared Message Groups? </strong></td> - <td><input type="checkbox" name="messageGroupSharedGroups" id="formAddQueue.messageGroupSharedGroups" value="messageGroupSharedGroups" dojoType="dijit.form.CheckBox" /></td> - </tr> - </table> - </div> + <div class="clear"> + <div class="formLabel-labelCell">Message Group Key:</div> + <div class="formLabel-controlCell"> + <input type="text" id="formAddQueue.messageGroupKey" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'messageGroupKey', + placeHolder: 'message group key', + promptMessage: 'Name of the message property used for message grouping', + title: 'Enter the name of the message property used for message grouping', + trim: true"/> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Shared Message Groups?</div> + <div class="formLabel-controlCell"> + <input type="checkbox" id="formAddQueue.messageGroupSharedGroups" + dojoType="dijit.form.CheckBox" + data-dojo-props=" + name: 'messageGroupSharedGroups', + value: 'messageGroupSharedGroups', + checked: false, + title: 'Controls where a shared groups feature is enabled'"/> + </div> + </div> + <div class="clear"></div> </div> + <div class="dijitDialogPaneActionBar"> <!-- submit buttons --> <input type="submit" value="Create Queue" label="Create Queue" dojoType="dijit.form.Button" /> </div> + </form> </div> </div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/addVirtualHostNodeAndVirtualHost.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/addVirtualHostNodeAndVirtualHost.html index d751a6c1cd..738af25332 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/addVirtualHostNodeAndVirtualHost.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/addVirtualHostNodeAndVirtualHost.html @@ -34,9 +34,9 @@ data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props=" name: 'name', - placeHolder: 'unique node name per broker', + placeHolder: 'node name', required: true, - missingMessage: 'A node name must be supplied', + promptMessage: 'Name of node, must be unique', title: 'Enter a unique node name per broker'" /> </div> </div> @@ -49,6 +49,7 @@ required: true, disabled: true, placeHolder: 'select virtual host node type', + promptMessage: 'Type of virtual host node', title: 'Select virtual host node type', searchAttr: 'name'"> </select> @@ -75,6 +76,7 @@ required: true, disabled: true, placeHolder: 'select virtual host type', + promptMessage: 'Type of virtual host', title: 'Select virtual host type', searchAttr: 'name'"> </select> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css b/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css index bfe0839cbc..f49451b5d8 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css @@ -239,8 +239,28 @@ div .messages { font-weight: bold; margin-left: 5px; } + .editNoteBanner { font-style: italic; margin: 0px 0px 10px 5px; } +/* Required to keep queue type radio buttons on one line when dialog adds scrollbar */ +#addQueue { + max-height: 350px; + overflow: auto; + width: 630px; +} + +#authenticatedUserControls { + max-width: 300px; +} + +.claro .dojoxCheckedMultiSelectWrapper { + height: auto; +} + +.claro .dojoxCheckedMultiSelect .dojoxCheckedMultiSelectWrapper { + border: none; + background-color: transparent; +} diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/editVirtualHost.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/editVirtualHost.html index 6f4db66c7d..9b981b055e 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/editVirtualHost.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/editVirtualHost.html @@ -19,111 +19,112 @@ <div class="dijitHidden"> <div data-dojo-type="dijit/Dialog" data-dojo-props="title:'Edit Virtual Host'" id="editVirtualHostDialog"> <form id="editVirtualHostForm" method="post" data-dojo-type="dijit/form/Form"> - <div class="editNoteBanner">NOTE: All changes will only take effect after Virtual Host restart.</div> - <div class="clear"> - <div class="formLabel-labelCell tableContainer-labelCell">Name*:</div> - <div class="formLabel-controlCell tableContainer-valueCell"> - <input type="text" id="editVirtualHost.name" - data-dojo-type="dijit/form/ValidationTextBox" - data-dojo-props=" + <div id="editVirtualHost.allFields"> + <div class="editNoteBanner">NOTE: All changes will only take effect after Virtual Host restart.</div> + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Name*:</div> + <div class="formLabel-controlCell tableContainer-valueCell"> + <input type="text" id="editVirtualHost.name" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" name: 'name', placeHolder: 'name', required: true, - missingMessage: 'Name must be supplied', disabled: true, title: 'Enter virtual host name'" /> + </div> </div> - </div> - <div id="editVirtualHost.typeFields"></div> + <div id="editVirtualHost.typeFields"></div> - <div class="clear formBox"> - <fieldset> - <legend>Store transaction settings</legend> - <div class="clear"> - <div class="formLabel-labelCell tableContainer-labelCell">Idle Timeout Warn:</div> - <div class="tableContainer-valueCell formLabel-controlCell"> - <input data-dojo-type="dijit/form/ValidationTextBox" - id="editVirtualHost.storeTransactionIdleTimeoutWarn" - name="storeTransactionIdleTimeoutWarn" - placeHolder="idle timeout warn time in ms" - missingMessage="An idle timeout warn time in ms must be supplied"/> + <div class="clear formBox"> + <fieldset> + <legend>Store transaction settings</legend> + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Idle Timeout Warn:</div> + <div class="tableContainer-valueCell formLabel-controlCell"> + <input data-dojo-type="dijit/form/ValidationTextBox" + id="editVirtualHost.storeTransactionIdleTimeoutWarn" + name="storeTransactionIdleTimeoutWarn" + placeHolder="idle timeout warn time in ms" + promptMessage="Length of time a transaction must be idle before warnings produced"/> + </div> </div> - </div> - <div class="clear"> - <div class="formLabel-labelCell tableContainer-labelCell">Idle Timeout Close:</div> - <div class="tableContainer-valueCell formLabel-controlCell"> - <input data-dojo-type="dijit/form/ValidationTextBox" - id="editVirtualHost.storeTransactionIdleTimeoutClose" - name="storeTransactionIdleTimeoutClose" - placeHolder="idle timeout close time in ms" - missingMessage="An idle timeout close time in ms must be supplied"/> + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Idle Timeout Close:</div> + <div class="tableContainer-valueCell formLabel-controlCell"> + <input data-dojo-type="dijit/form/ValidationTextBox" + id="editVirtualHost.storeTransactionIdleTimeoutClose" + name="storeTransactionIdleTimeoutClose" + placeHolder="idle timeout close time in ms" + promptMessage="Length of time a transaction must be idle before the connection is closed"/> + </div> </div> - </div> - <div class="clear"> - <div class="formLabel-labelCell tableContainer-labelCell">Open Timeout Warn:</div> - <div class="tableContainer-valueCell formLabel-controlCell"> - <input data-dojo-type="dijit/form/ValidationTextBox" - id="editVirtualHost.storeTransactionOpenTimeoutWarn" - name="storeTransactionOpenTimeoutWarn" - placeHolder="open timeout warn time in ms" - missingMessage="An open timeout warn time in ms must be supplied"/> + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Open Timeout Warn:</div> + <div class="tableContainer-valueCell formLabel-controlCell"> + <input data-dojo-type="dijit/form/ValidationTextBox" + id="editVirtualHost.storeTransactionOpenTimeoutWarn" + name="storeTransactionOpenTimeoutWarn" + placeHolder="open timeout warn time in ms" + promptMessage="Length of time a transaction must be open before warnings produced"/> + </div> </div> - </div> - <div class="clear"> - <div class="formLabel-labelCell tableContainer-labelCell">Open Timeout Close:</div> - <div class="tableContainer-valueCell formLabel-controlCell"> - <input data-dojo-type="dijit/form/ValidationTextBox" - id="editVirtualHost.storeTransactionOpenTimeoutClose" - name="storeTransactionOpenTimeoutClose" - placeHolder="open timeout close time in ms" - missingMessage="An open timeout close time in ms must be supplied"/> + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Open Timeout Close:</div> + <div class="tableContainer-valueCell formLabel-controlCell"> + <input data-dojo-type="dijit/form/ValidationTextBox" + id="editVirtualHost.storeTransactionOpenTimeoutClose" + name="storeTransactionOpenTimeoutClose" + placeHolder="open timeout close time in ms" + promptMessage="Length of time a transaction must be open before the connection is closed"/> + </div> </div> - </div> - </fieldset> - </div> + </fieldset> + </div> - <div class="clear formBox"> - <fieldset> - <legend>House keeping settings</legend> - <div class="clear"> - <div class="formLabel-labelCell tableContainer-labelCell">Check period (ms):</div> - <div class="tableContainer-valueCell formLabel-controlCell"> - <input data-dojo-type="dijit/form/ValidationTextBox" - id="editVirtualHost.housekeepingCheckPeriod" - name="housekeepingCheckPeriod" - placeHolder="house keeping check period in ms" - missingMessage="A house keeping check period must be supplied"/> + <div class="clear formBox"> + <fieldset> + <legend>House keeping settings</legend> + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Check period (ms):</div> + <div class="tableContainer-valueCell formLabel-controlCell"> + <input data-dojo-type="dijit/form/ValidationTextBox" + id="editVirtualHost.housekeepingCheckPeriod" + name="housekeepingCheckPeriod" + placeHolder="house keeping check period in ms" + promptMessage="Frequency with which the housekeeper runs"/> + </div> </div> - </div> - <div class="clear"> - <div class="formLabel-labelCell tableContainer-labelCell">Thread count:</div> - <div class="tableContainer-valueCell formLabel-controlCell"> - <input data-dojo-type="dijit/form/ValidationTextBox" - id="editVirtualHost.housekeepingThreadCount" - name="housekeepingThreadCount" - placeHolder="house keeping thread count" - missingMessage="A house keeping thread count must be supplied"/> + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Thread count:</div> + <div class="tableContainer-valueCell formLabel-controlCell"> + <input data-dojo-type="dijit/form/ValidationTextBox" + id="editVirtualHost.housekeepingThreadCount" + name="housekeepingThreadCount" + placeHolder="house keeping thread count" + promptMessage="Number of threads used to perform housekeeping"/> + </div> </div> - </div> - </fieldset> - </div> - <div class="clear"></div> + </fieldset> + </div> + <div class="clear"></div> - <div class="clear"> - <div class="formLabel-labelCell tableContainer-labelCell">Dead letter queue enabled:</div> - <div class="tableContainer-valueCell formLabel-controlCell"> - <input type="checkbox" id="editVirtualHost.queue.deadLetterQueueEnabled" - data-dojo-type="dijit/form/CheckBox" - data-dojo-props="name: 'queue.deadLetterQueueEnabled'"> - </input> + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Dead letter queue enabled:</div> + <div class="tableContainer-valueCell formLabel-controlCell"> + <input type="checkbox" id="editVirtualHost.queue.deadLetterQueueEnabled" + data-dojo-type="dijit/form/CheckBox" + data-dojo-props="name: 'queue.deadLetterQueueEnabled'"> + </input> + </div> </div> - </div> - <div class="clear"></div> + <div class="clear"></div> - <div class="dijitDialogPaneActionBar"> - <button data-dojo-type="dijit/form/Button" id="editVirtualHost.saveButton" data-dojo-props="label: 'Save'">Save</button> - <button data-dojo-type="dijit/form/Button" id="editVirtualHost.cancelButton" data-dojo-props="label: 'Cancel'" ></button> + <div class="dijitDialogPaneActionBar"> + <button data-dojo-type="dijit/form/Button" id="editVirtualHost.saveButton" data-dojo-props="label: 'Save'">Save</button> + <button data-dojo-type="dijit/form/Button" id="editVirtualHost.cancelButton" data-dojo-props="label: 'Cancel'" ></button> + </div> </div> </form> </div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html index ee67e4ce21..dfbec13320 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html @@ -86,7 +86,7 @@ <div id="header" class="header" style="float: left; width: 300px"></div> <div style="float: right;"> <div id="login" class="hidden"><span id="authenticatedUser" class="hidden"></span> - <div id="authenticatedUserControls" data-dojo-type="dijit.form.DropDownButton" data-dojo-props="iconClass: 'preferencesIcon', style:{'max-width': '100px'}"> + <div id="authenticatedUserControls" data-dojo-type="dijit.form.DropDownButton" data-dojo-props="iconClass: 'preferencesIcon'"> <div data-dojo-type="dijit.Menu"> <div data-dojo-type="dijit.MenuItem" data-dojo-props="onClick: function(){window.location='logout';}" >Log out</div> <div data-dojo-type="dijit.MenuItem" diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/metadata.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/metadata.js new file mode 100644 index 0000000000..19ec53744f --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/metadata.js @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +define(["dojo/_base/xhr", + "dojox/lang/functional/object", + "qpid/common/properties", + "dojo/domReady!" + ], + function (xhr, fobject, properties) + { + var metadata = + { + _init: function () + { + var that = this; + xhr.get({sync: true, handleAs: "json", url: "service/metadata", load: function(metadata){that._onMetadata(metadata)}}); + }, + _onMetadata: function (metadata) + { + this.metadata = metadata; + }, + getMetaData: function (category, type) + { + return this.metadata[category][type]; + }, + getDefaultValueForAttribute: function (category, type, attributeName) + { + var metaDataForInstance = this.getMetaData(category, type); + var attributesForType = metaDataForInstance["attributes"]; + var attributesForName = attributesForType[attributeName]; + return attributesForName ? attributesForName["defaultValue"] : undefined; + }, + getTypesForCategory: function (category) + { + return fobject.keys(this.metadata[category]); + } + }; + + metadata._init(); + + return metadata; + }); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js index 1a89bfb374..9e433bbb34 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js @@ -19,15 +19,19 @@ * */ define(["dojo/_base/xhr", + "dojo/_base/array", "dojo/_base/event", - "dojo/json", "dojo/_base/lang", + "dojo/json", "dojo/dom-construct", "dojo/dom-geometry", "dojo/window", "dojo/query", "dojo/parser", + "dojo/store/Memory", "dojox/html/entities", + "qpid/common/metadata", + "qpid/common/widgetconfigurer", "dijit/registry", "dijit/TitlePane", "dijit/Dialog", @@ -35,13 +39,15 @@ define(["dojo/_base/xhr", "dijit/form/Button", "dijit/form/RadioButton", "dijit/form/CheckBox", + "dijit/form/FilteringSelect", + "dijit/form/ValidationTextBox", "dojox/layout/TableContainer", "dijit/layout/ContentPane", "dojox/validate/us", "dojox/validate/web", "dojo/domReady!" ], - function (xhr, event, json, lang, dom, geometry, win, query, parser, entities, registry) { + function (xhr, array, event, lang, json, dom, geometry, win, query, parser, Memory, entities, metadata, widgetconfigurer, registry) { var util = {}; if (Array.isArray) { util.isArray = function (object) { @@ -146,7 +152,7 @@ define(["dojo/_base/xhr", return (type === "PlainPasswordFile" || type === "Base64MD5PasswordFile" || type === "SCRAM-SHA-1" || type === "SCRAM-SHA-256"); }; - util.showSetAttributesDialog = function(attributeWidgetFactories, data, putURL, dialogTitle, appendNameToUrl) + util.showSetAttributesDialog = function(attributeWidgetFactories, data, putURL, dialogTitle, category, type, appendNameToUrl) { var layout = new dojox.layout.TableContainer({ cols: 1, @@ -200,7 +206,7 @@ define(["dojo/_base/xhr", { groupFieldContainer = new dojox.layout.TableContainer({ cols: 1, - "labelWidth": "290", + "labelWidth": "300", showLabels: true, orientation: "horiz", customClass: "formLabel" @@ -220,6 +226,8 @@ define(["dojo/_base/xhr", } } + this.applyMetadataToWidgets(dialogContent, category, type); + // add onchange handler to set required property for dependent widget for(var widgetName in requiredFor) { @@ -310,14 +318,17 @@ define(["dojo/_base/xhr", aproximateHeight += 30; } } - var viewport = win.getBox(); - var maxHeight = Math.max(Math.floor(viewport.h * 0.6), 100); dialogContentArea.style.overflow= "auto"; - dialogContentArea.style.height = Math.min(aproximateHeight, maxHeight ) + "px"; + dialogContentArea.style.height = "300"; setAttributesDialog.on("hide", function(e){setAttributesDialog.destroy();}); setAttributesDialog.show(); }; + util.findAllWidgets = function(root) + { + return query("[widgetid]", root).map(registry.byNode).filter(function(w){ return w;}); + }; + util.xhrErrorHandler = function(error) { if (error) @@ -540,6 +551,16 @@ define(["dojo/_base/xhr", } } + util.applyMetadataToWidgets = function(domRoot, category, type) + { + var widgets = util.findAllWidgets(domRoot); + array.forEach(widgets, + function (widget) + { + widgetconfigurer.config(widget, category, type); + }); + } + util.getFormWidgetValues = function (form, initialData) { var values = {}; @@ -636,6 +657,16 @@ define(["dojo/_base/xhr", } } + util.makeTypeStore = function (types) + { + var typeData = []; + for (var i = 0; i < types.length; i++) { + var type = types[i]; + typeData.push({id: type, name: type}); + } + return new Memory({ data: typeData }); + } + var singleContextVarRegexp = "(\\${[\\w\\.\\-]+})"; util.numericOrContextVarRegexp = function(constraints) diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/widgetconfigurer.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/widgetconfigurer.js new file mode 100644 index 0000000000..0b08dde615 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/widgetconfigurer.js @@ -0,0 +1,97 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +define(["dojo/_base/xhr", + "dojo/string", + "dojo/query", + "dojo/dom", + "dojo/dom-construct", + "dojo/dom-attr", + "qpid/common/properties", + "qpid/common/metadata", + "dojo/text!strings.html", + "dojo/domReady!" + ], + function (xhr, string, query, dom, domConstruct, domAttr, properties, metadata, template) + { + var widgetconfigurer = + { + _init: function () + { + var stringsTemplate = domConstruct.create("div", {innerHTML: template}); + var promptTemplateWithDefaultNode = query("[id='promptTemplateWithDefault']", stringsTemplate)[0]; + + // The following will contain ${prompt} and ${default} formatted with html elements + this.promptTemplateWithDefault = promptTemplateWithDefaultNode.innerHTML; + + domConstruct.destroy(stringsTemplate); + }, + _processWidgetPrompt: function (widget, category, type) + { + var widgetName = widget.name; + if (widgetName && (widget instanceof dijit.form.ValidationTextBox || widget instanceof dijit.form.FilteringSelect)) + { + // If not done so already, save the prompt text specified on the widget. We do this so if we + // config the same widget again, we can apply the default again (which may be different if the user + // has selected a different type within the category). + if (typeof widget.get("qpid.originalPromptMessage") == "undefined") + { + widget.set("qpid.originalPromptMessage", widget.get("promptMessage")); + } + + var promptMessage = widget.get("qpid.originalPromptMessage"); + var defaultValue = metadata.getDefaultValueForAttribute(category, type, widgetName); + if (defaultValue) + { + var newPromptMessage = string.substitute(this.promptTemplateWithDefault, { 'default': defaultValue, 'prompt': promptMessage }); + + if (promptMessage != newPromptMessage) + { + widget.set("promptMessage", newPromptMessage); + } + } + } + }, + _processWidgetValue: function (widget, category, type) + { + var widgetName = widget.name; + + if (widgetName && (widget instanceof dijit.form.FilteringSelect || widget instanceof dojox.form.CheckedMultiSelect)) + { + if (!widget.get("value")) + { + var defaultValue = metadata.getDefaultValueForAttribute(category, type, widgetName); + if (defaultValue) + { + widget.set("value", defaultValue); + } + } + } + }, + config: function (widget, category, type) + { + this._processWidgetPrompt(widget, category, type); + this._processWidgetValue(widget, category, type); + } + }; + + widgetconfigurer._init(); + + return widgetconfigurer; + }); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js index 51a6c761f1..c52553c386 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js @@ -69,7 +69,8 @@ define(["dojo/_base/xhr", regExpGen: util.nameOrContextVarRegexp, value: brokerData.name, label: "Name*:", - name: "name"}) + name: "name", + promptMessage: "Identifies the broker instance."}) } }, { name: "defaultVirtualHost", @@ -89,7 +90,8 @@ define(["dojo/_base/xhr", required: true, store: hostsStore, value: brokerData.defaultVirtualHost, label: "Default Virtual Host*:", - name: "defaultVirtualHost"}) + name: "defaultVirtualHost", + promptMessage: "Default virtual host used for clients that don't specify one when connecting."}) } }, { name: "statisticsReportingPeriod", @@ -97,12 +99,12 @@ define(["dojo/_base/xhr", return new dijit.form.ValidationTextBox({ trim: "true", regExpGen: util.numericOrContextVarRegexp, - invalidMessage: "Invalid value", required: false, value: brokerData.statisticsReportingPeriod, placeholder: "Time in ms", label: "Statistics reporting period (ms):", - name: "statisticsReportingPeriod" + name: "statisticsReportingPeriod", + promptMessage: "Frequency with which statistics are reported to broker log." }); } }, { @@ -123,11 +125,12 @@ define(["dojo/_base/xhr", return new dijit.form.ValidationTextBox({ trim: "true", regExpGen: util.numericOrContextVarRegexp, - invalidMessage: "Invalid value", required: false, value: brokerData["connection.sessionCountLimit"], + placeholder: "Number of sessions", label: "Maximum number of sessions:", - name: "connection.sessionCountLimit" + name: "connection.sessionCountLimit", + promptMessage: "Maximum number of sessions per connection" }); } }, { @@ -141,7 +144,8 @@ define(["dojo/_base/xhr", value: brokerData["connection.heartBeatDelay"], placeholder: "Time in ms", label: "Heart beat delay (ms):", - name: "connection.heartBeatDelay" + name: "connection.heartBeatDelay", + promptMessage: "Interval between heart beat messages exchanged between broker and clients" }); } } ]; @@ -235,7 +239,7 @@ define(["dojo/_base/xhr", that.attributeWidgetFactories, brokerData, query, - "Set broker attributes"); + "Set broker attributes", "Broker", "broker"); }); } ); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/KeyStore.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/KeyStore.js index 667c83c6ea..9f0ba9c16e 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/KeyStore.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/KeyStore.js @@ -74,6 +74,7 @@ define(["dojo/dom", xhr.get({url: that.url, sync: properties.useSyncGet, handleAs: "json", content: { actuals: true }}) .then(function(data) { + // calls showKeystoreDialog that.dialog(data[0], that.url); }); }); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAccessControlProvider.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAccessControlProvider.js index 49a99418bf..ac0493bfa5 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAccessControlProvider.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAccessControlProvider.js @@ -56,6 +56,8 @@ define(["dojo/_base/lang", disabled: accessControlProvider.name ? true : false, label: "Name*:", regexp: "^[\x20-\x2e\x30-\x7F]{1,255}$", + promptMessage: "Name of access control provider.", + placeHolder: "name", name: "name"}); } }, { @@ -171,6 +173,8 @@ define(["dojo/_base/lang", accessControlProvider ? accessControlProvider : {}, "api/latest/accesscontrolprovider" + (name ? "/" + encodeURIComponent(name.name) : ""), accessControlProvider ? "Edit access control provider - " + accessControlProvider.name : "Add access control provider", + "AccessControlProvider", + accessControlProvider && accessControlProvider.type ? accessControlProvider.type : "AclFile", accessControlProvider ? false : true); }; return addAccessControlProvider; diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addBinding.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addBinding.js index 8e70b78446..ac4937da68 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addBinding.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addBinding.js @@ -386,7 +386,9 @@ define(["dojo/_base/connect", that.queueChooser = new FilteringSelect({ id: "addBindingSelectQueue", name: "queue", store: queueStore, - searchAttr: "name"}, input); + searchAttr: "name", + promptMessage: "Name of the queue", + title: "Select the name of the queue"}, input); if(obj.queue) { @@ -414,7 +416,9 @@ define(["dojo/_base/connect", that.exchangeChooser = new FilteringSelect({ id: "addBindingSelectExchange", name: "exchange", store: exchangeStore, - searchAttr: "name"}, input); + searchAttr: "name", + promptMessage: "Name of the exchange", + title: "Select the name of the exchange"}, input); if(obj.exchange) { diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addGroupProvider.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addGroupProvider.js index 5f01b9769b..82281ad3d3 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addGroupProvider.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addGroupProvider.js @@ -56,6 +56,8 @@ define(["dojo/_base/lang", disabled: groupProvider.name ? true : false, label: "Name*:", regexp: "^[\x20-\x2e\x30-\x7F]{1,255}$", + promptMessage: "Name of group provider.", + placeHolder: "name", name: "name"}); } }, { @@ -171,6 +173,8 @@ define(["dojo/_base/lang", groupProvider ? groupProvider : {}, "api/latest/groupprovider" + (name ? "/" + encodeURIComponent(name.name) : ""), groupProvider ? "Edit group provider - " + groupProvider.name : "Add group provider", + "Group", + groupProvider && groupProvider.type ? groupProvider.type : "Group", groupProvider ? false : true); }; return addGroupProvider; diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addKeystore.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addKeystore.js index 0ec8fb6c6c..e7e79e742d 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addKeystore.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addKeystore.js @@ -57,6 +57,8 @@ define(["dojo/_base/lang", disabled: keystore.name ? true : false, label: "Name:", regExpGen: util.nameOrContextVarRegexp, + promptMessage: "Name of keystore. Used to refer to the keystore from other objects within the Broker.", + placeHolder: "name", name: "name"}); } }, { @@ -66,6 +68,8 @@ define(["dojo/_base/lang", required: true, value: keystore.path, label: "Path to keystore:", + promptMessage: "File system location to the keystore file", + placeHolder: "path/to/keystore", name: "path"}); } }, { @@ -75,7 +79,7 @@ define(["dojo/_base/lang", return new dijit.form.ValidationTextBox({ required: false, label: "Keystore password:", - invalidMessage: "Missed keystore password", + promptMessage: "Password used to open the keystore", name: "password", placeHolder: keystore["password"] ? keystore["password"] : "" }); @@ -96,10 +100,11 @@ define(["dojo/_base/lang", } fields.push({ name: "Options", + createWidget: function(keystore) { var optionalFieldContainer = new dojox.layout.TableContainer({ cols: 1, - "labelWidth": "290", + "labelWidth": "300", showLabels: true, orientation: "horiz", customClass: "formLabel" @@ -110,12 +115,16 @@ define(["dojo/_base/lang", required: false, value: keystore.certificateAlias, label: "Keystore certificate alias:", - name: "certificateAlias"})); + name: "certificateAlias", + placeHolder: "alias", + promptMessage: "Used to identify one certificate in a store that has many"})); + optionalFieldContainer.addChild( new dijit.form.ValidationTextBox({ required: false, value: keystore.keyManagerFactoryAlgorithm, label: "Key manager factory algorithm:", - placeHolder: "Use default", + placeHolder: "algorithm name", + promptMessage: "Name of the key manager algorithm known to Java", name: "keyManagerFactoryAlgorithm"})); } else @@ -124,16 +133,20 @@ define(["dojo/_base/lang", required: false, value: keystore.trustManagerFactoryAlgorithm, label: "Trust manager factory algorithm:", - placeHolder: "Use default", + placeHolder: "algorithm name", + promptMessage: "Name of the trust manager algorithm known to Java", name: "trustManagerFactoryAlgorithm"})); } optionalFieldContainer.addChild(new dijit.form.ValidationTextBox({ required: false, value: isKeystore ? keystore.keyStoreType : keystore.trustStoreType, label: "Key store type:", - placeHolder: "Use default", + placeHolder: "store type", + promptMessage: "Name of the store type known to Java", name: isKeystore ? "keyStoreType" : "trustStoreType"})); + var panel = new dijit.TitlePane({title: "Optional Attributes", content: optionalFieldContainer.domNode, open: false}); + return panel; } }); @@ -148,6 +161,8 @@ define(["dojo/_base/lang", keystore ? keystore : {}, keystore ? putURL : "api/latest/keystore", keystore ? "Edit keystore - " + keystore.name : "Add keystore", + "KeyStore", + keystore && keystore.type ? keystore.type : "FileKeyStore", // GET?actuals=true doesn't get type for objects of the default type for the category keystore ? false : true); }; @@ -158,6 +173,8 @@ define(["dojo/_base/lang", truststore ? truststore : {}, truststore ? putURL : "api/latest/truststore", truststore ? "Edit truststore - " + truststore.name : "Add truststore", + "TrustStore", + truststore && truststore.type ? truststore.type : "FileTrustStore", truststore ? false : true); }; return addKeystore; diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js index 34e2d58afb..89c3152d97 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js @@ -72,7 +72,7 @@ define(["dojo/_base/xhr", } for(var propName in formValues) { - if(formValues.hasOwnProperty(propName)) + if(formValues.hasOwnProperty(propName) && formValues[propName]) { if (propName == "needClientAuth" || propName == "wantClientAuth") { @@ -81,6 +81,12 @@ define(["dojo/_base/xhr", else if (propName === "protocols") { var val = formValues[propName]; + + if(val === "" || (lang.isArray(val) && val.length == 0) ) + { + continue; + } + if (!lang.isArray(val)) { val = [ val ]; @@ -91,7 +97,7 @@ define(["dojo/_base/xhr", { var val = formValues[propName]; - if(val === "") + if(val === "" || (lang.isArray(val) && val.length == 0) ) { continue; } @@ -496,10 +502,13 @@ define(["dojo/_base/xhr", providerWidget.initialValue = providerWidget.value; registry.byId("addPort").show(); - }); + util.applyMetadataToWidgets(registry.byId("addPort").domNode, "Port", typeWidget.get("value")); + + }); } else { + // Creating new port var typeWidget = registry.byId("formAddPort.type"); if (typeWidget.get("disabled")) { @@ -510,7 +519,10 @@ define(["dojo/_base/xhr", name.set("disabled", false); editWarning.style.display = "none"; registry.byId("addPort").show(); + + util.applyMetadataToWidgets(registry.byId("addPort").domNode, "Port", "AMQP"); } + }; return addPort; diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addQueue.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addQueue.js index 5a1ea48b3e..c66b99ee4c 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addQueue.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addQueue.js @@ -27,6 +27,7 @@ define(["dojo/_base/xhr", "dojo/_base/array", "dojo/_base/event", 'dojo/_base/json', + 'qpid/common/util', "dijit/form/NumberSpinner", // required by the form /* dojox/ validate resources */ "dojox/validate/us", "dojox/validate/web", @@ -41,7 +42,7 @@ define(["dojo/_base/xhr", /* basic dojox classes */ "dojox/form/BusyButton", "dojox/form/CheckedMultiSelect", "dojo/domReady!"], - function (xhr, dom, construct, win, registry, parser, array, event, json) { + function (xhr, dom, construct, win, registry, parser, array, event, json, util) { var addQueue = {}; @@ -147,6 +148,8 @@ define(["dojo/_base/xhr", { dijit.byId('formAddQueue.' + requiredFields[widgetValue]).required = isChecked; } + + util.applyMetadataToWidgets(obj.domNode, "Queue", widgetValue); } }) } @@ -192,9 +195,12 @@ define(["dojo/_base/xhr", addQueue.show = function(data) { addQueue.vhost = data.virtualhost; addQueue.vhostnode = data.virtualhostnode; - registry.byId("formAddQueue").reset(); + var form = registry.byId("formAddQueue"); + form.reset(); registry.byId("addQueue").show(); - }; + util.applyMetadataToWidgets(form.domNode, "Queue", "standard"); + + }; return addQueue; }); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js index 2eac2094e5..ede0c4bc48 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js @@ -34,6 +34,7 @@ define(["dojo/_base/xhr", "dijit/form/FilteringSelect", "qpid/common/properties", "qpid/common/util", + "qpid/common/metadata", "dojo/text!addVirtualHostNodeAndVirtualHost.html", "dijit/form/Form", "dijit/form/CheckBox", @@ -41,7 +42,7 @@ define(["dojo/_base/xhr", "dojox/validate/us", "dojox/validate/web", "dojo/domReady!"], - function (xhr, event, lang, array, dom, domConstruct, json, parser, Memory, fobject, registry, Dialog, Button, FilteringSelect, properties, util, template) + function (xhr, event, lang, array, dom, domConstruct, json, parser, Memory, fobject, registry, Dialog, Button, FilteringSelect, properties, util, metadata, template) { var addVirtualHostNodeAndVirtualHost = @@ -71,38 +72,26 @@ define(["dojo/_base/xhr", this.virtualHostType = registry.byId("addVirtualHost.type"); this.virtualHostType.set("disabled", true); - xhr.get({sync: properties.useSyncGet, handleAs: "json", url: "api/latest/broker?depth=0", load: function(data){that._onBrokerData(data[0]) }}); - }, - _makeTypeStore: function (types) { - var typeData = []; - for (var i = 0; i < types.length; i++) { - var type = types[i]; - typeData.push({id: type, name: type}); - } - return new Memory({ data: typeData }); - }, - _onBrokerData: function(brokerData) - { - var that=this; - this.supportedVirtualHostNodeTypes = brokerData.supportedVirtualHostNodeTypes; - this.supportedVirtualHostNodeTypes.sort(); - this.supportedVirtualHostTypes = brokerData.supportedVirtualHostTypes; - this.supportedVirtualHostTypes.sort(); + this.supportedVirtualHostNodeTypes = metadata.getTypesForCategory("VirtualHostNode"); + this.supportedVirtualHostNodeTypes.sort(); + this.supportedVirtualHostTypes = metadata.getTypesForCategory("VirtualHost"); + this.supportedVirtualHostTypes.sort(); - //VH Type BDB_HA_REPLICA is not user creatable. This is only needed until we have model meta data available. - this.supportedVirtualHostTypes = array.filter(this.supportedVirtualHostTypes, function(item){ - return item != "BDB_HA_REPLICA" && item != "BDB_HA"; - }); + //VH Type BDB_HA_REPLICA is not user creatable. This is only needed until we have model meta data available. + this.supportedVirtualHostTypes = array.filter(this.supportedVirtualHostTypes, function(item){ + return item != "BDB_HA_REPLICA" && item != "BDB_HA"; + }); - var virtualHostNodeTypeStore = this._makeTypeStore(this.supportedVirtualHostNodeTypes); - this.virtualHostNodeType.set("store", virtualHostNodeTypeStore); - this.virtualHostNodeType.set("disabled", false); - this.virtualHostNodeType.on("change", function(type){that._vhnTypeChanged(type, that.virtualHostNodeTypeFieldsContainer, "qpid/management/virtualhostnode/");}); + var virtualHostNodeTypeStore = util.makeTypeStore(this.supportedVirtualHostNodeTypes); + this.virtualHostNodeType.set("store", virtualHostNodeTypeStore); + this.virtualHostNodeType.set("disabled", false); + this.virtualHostNodeType.on("change", function(type){that._vhnTypeChanged(type, that.virtualHostNodeTypeFieldsContainer, "qpid/management/virtualhostnode/");}); + + this.virtualHostTypeStore = util.makeTypeStore(this.supportedVirtualHostTypes); + this.virtualHostType.set("store", this.virtualHostTypeStore); + this.virtualHostType.set("disabled", false); + this.virtualHostType.on("change", function(type){that._vhTypeChanged(type, that.virtualHostTypeFieldsContainer, "qpid/management/virtualhost/");}); - this.virtualHostTypeStore = this._makeTypeStore(this.supportedVirtualHostTypes); - this.virtualHostType.set("store", this.virtualHostTypeStore); - this.virtualHostType.set("disabled", false); - this.virtualHostType.on("change", function(type){that._vhTypeChanged(type, that.virtualHostTypeFieldsContainer, "qpid/management/virtualhost/");}); }, show: function() { @@ -132,13 +121,14 @@ define(["dojo/_base/xhr", { this._processDropDownsForBdbHa(type); this._processDropDownsForJson(type); - this._typeChanged(type, typeFieldsContainer, urlStem); + + this._typeChanged(type, typeFieldsContainer, urlStem, "VirtualHostNode"); }, _vhTypeChanged: function (type, typeFieldsContainer, urlStem) { - this._typeChanged(type, typeFieldsContainer, urlStem); + this._typeChanged(type, typeFieldsContainer, urlStem, "VirtualHost"); }, - _typeChanged: function (type, typeFieldsContainer, urlStem) + _typeChanged: function (type, typeFieldsContainer, urlStem, category) { var widgets = registry.findWidgets(typeFieldsContainer); array.forEach(widgets, function(item) { item.destroyRecursive();}); @@ -148,11 +138,13 @@ define(["dojo/_base/xhr", { var that = this; require([urlStem + type.toLowerCase() + "/add"], - function(TypeUI) + function(typeUI) { try { - TypeUI.show({containerNode:typeFieldsContainer, parent: that}); + typeUI.show({containerNode:typeFieldsContainer, parent: that}); + + util.applyMetadataToWidgets(typeFieldsContainer,category, type); } catch(e) { diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHost.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHost.js index 1a24e5e770..a959586655 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHost.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHost.js @@ -56,6 +56,7 @@ define(["dojo/_base/xhr", var that=this; this.containerNode = domConstruct.create("div", {innerHTML: template}); parser.parse(this.containerNode); + this.allFieldsContainer = dom.byId("editVirtualHost.allFields"); this.typeFieldsContainer = dom.byId("editVirtualHost.typeFields"); this.dialog = registry.byId("editVirtualHostDialog"); this.saveButton = registry.byId("editVirtualHost.saveButton"); @@ -176,6 +177,8 @@ define(["dojo/_base/xhr", { TypeUI.show({containerNode:that.typeFieldsContainer, parent: that, data: virtualHostData}); that.form.connectChildren(); + + util.applyMetadataToWidgets(that.allFieldsContainer, "VirtualHost", virtualHostData.type); } catch(e) { diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHostNode.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHostNode.js index 704063ae16..3c78eaa29c 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHostNode.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHostNode.js @@ -147,6 +147,8 @@ define(["dojo/_base/xhr", { TypeUI.show({containerNode:that.typeFieldsContainer, parent: that, data: nodeData}); that.form.connectChildren(); + + util.applyMetadataToWidgets(that.allFieldsContainer, "VirtualHostNode", nodeData.type); } catch(e) { diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementhttp.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementhttp.js index 07c5c25171..69f520bf42 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementhttp.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementhttp.js @@ -139,7 +139,9 @@ define(["dojo/_base/xhr", widgetFactories, data, "api/latest/plugin/" + encodeURIComponent(data.name), - "Edit plugin - " + data.name); + "Edit plugin - " + data.name, + "Plugin", + "MANAGEMENT-HTTP"); }; function ManagementHttpUpdater(node, pluginObject, controller) diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementjmx.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementjmx.js index 78d06da51f..3579d258e9 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementjmx.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementjmx.js @@ -86,7 +86,9 @@ define(["dojo/_base/xhr", widgetFactories, data, "api/latest/plugin/" + encodeURIComponent(data.name), - "Edit plugin - " + data.name); + "Edit plugin - " + data.name, + "Plugin", + "MANAGEMENT-JMX"); }; function ManagementJmxUpdater(node, pluginObject, controller) diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/strings.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/strings.html new file mode 100644 index 0000000000..d29ef5c21c --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/strings.html @@ -0,0 +1,21 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + --> +<div> + <div id="promptTemplateWithDefault"><i>Optional:</i> ${prompt}.<br/>Defaults to <code>${default}</code></div> +</div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/add.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/add.html index 320f056cef..c0cd3f5653 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/add.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/add.html @@ -28,7 +28,8 @@ name: 'storeOverfullSize', placeHolder: 'size in bytes', required: false, - title: 'Enter ceiling (in bytes) at which store will begin to throttle sessions producing messages'" /> + title: 'Enter ceiling (in bytes) at which store will begin to throttle sessions producing messages', + promptMessage: 'Ceiling (in bytes) at which store will begin to throttle sessions producing messages'" /> </div> </div> <div class="clear"> @@ -40,7 +41,8 @@ name: 'storeUnderfullSize', placeHolder: 'size in bytes', required: false, - title: 'Enter floor (in bytes) at which store will cease to throttle sessions producing messages'" /> + title: 'Enter floor (in bytes) at which store will cease to throttle sessions producing messages', + promptMessage: 'Floor (in bytes) at which store will cease to throttle sessions producing messages'" /> </div> </div> </div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/edit.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/edit.html index ec02c67ff4..427a1bab86 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/edit.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/edit.html @@ -28,7 +28,8 @@ name: 'storeOverfullSize', placeHolder: 'size in bytes', required: false, - title: 'Enter ceiling (in bytes) at which store will begin to throttle sessions producing messages'" + title: 'Enter ceiling (in bytes) at which store will begin to throttle sessions producing messages', + promptMessage: 'Ceiling (in bytes) at which store will begin to throttle sessions producing messages'" /> </div> </div> @@ -41,7 +42,8 @@ name: 'storeUnderfullSize', placeHolder: 'size in bytes', required: false, - title: 'Enter floor (in bytes) at which store will cease to throttle sessions producing messages'" + title: 'Enter floor (in bytes) at which store will cease to throttle sessions producing messages', + promptMessage: 'Floor (in bytes) at which store will cease to throttle sessions producing messages'" /> </div> </div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/add.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/add.html index 88ca0b3807..484a85b965 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/add.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/add.html @@ -26,7 +26,8 @@ data-dojo-props=" name: 'storePath', placeHolder: 'path/to/store', - title: 'Enter message store path'" /> + title: 'Enter message store path', + promptMessage: 'File system location for the message store'" /> </div> </div> <div class="clear"> @@ -38,7 +39,8 @@ name: 'storeOverfullSize', placeHolder: 'size in bytes', required: false, - title: 'Enter ceiling (in bytes) at which store will begin to throttle sessions producing messages'" /> + title: 'Enter ceiling (in bytes) at which store will begin to throttle sessions producing messages', + promptMessage: 'Ceiling (in bytes) at which store will begin to throttle sessions producing messages'" /> </div> </div> <div class="clear"> @@ -50,7 +52,8 @@ name: 'storeUnderfullSize', placeHolder: 'size in bytes', required: false, - title: 'Enter floor (in bytes) at which store will cease to throttle sessions producing messages'" /> + title: 'Enter floor (in bytes) at which store will cease to throttle sessions producing messages', + promptMessage: 'Floor (in bytes) at which store will cease to throttle sessions producing messages'" /> </div> </div> <div class="clear"></div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/edit.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/edit.html index 60b8faef56..2486cdcf42 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/edit.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/edit.html @@ -26,7 +26,6 @@ data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props=" name: 'storePath', - placeHolder: 'path/to/store', disabled: true, title: 'Enter message store path'" /> </div> @@ -41,7 +40,8 @@ name: 'storeOverfullSize', placeHolder: 'size in bytes', required: false, - title: 'Enter ceiling (in bytes) at which store will begin to throttle sessions producing messages'" + title: 'Enter ceiling (in bytes) at which store will begin to throttle sessions producing messages', + promptMessage: 'Ceiling (in bytes) at which store will begin to throttle sessions producing messages'" /> </div> </div> @@ -54,7 +54,8 @@ name: 'storeUnderfullSize', placeHolder: 'size in bytes', required: false, - title: 'Enter floor (in bytes) at which store will cease to throttle sessions producing messages'" + title: 'Enter floor (in bytes) at which store will cease to throttle sessions producing messages', + promptMessage: 'Floor (in bytes) at which store will cease to throttle sessions producing messages'" /> </div> </div> |
