diff options
Diffstat (limited to 'qpid/java/broker-plugins/management-http/src/main/java')
22 files changed, 220 insertions, 77 deletions
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html index 13960715a6..e90262f17b 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html @@ -26,8 +26,8 @@ <tr> <td class="tableContainer-labelCell">Name*:</td> <td class="tableContainer-valueCell"><input type="text" required="true" name="name" - id="formAddAuthenticationProvider.name" placeholder="Name" regexp="^[\x20-\x2e\x30-\x7F]{1,255}$" - dojoType="dijit.form.ValidationTextBox" missingMessage="A name must be supplied" /></div></td> + id="formAddAuthenticationProvider.name" placeholder="Name" + dojoType="dijit.form.ValidationTextBox" missingMessage="A name must be supplied" /></td> </tr> </table> <input type="hidden" id="formAddAuthenticationProvider.id" name="id"/> 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 dab8541b65..69d49248b8 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 @@ -26,10 +26,11 @@ <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" regexp="^[\x20-\x2e\x30-\x7F]{1,255}$"/> - <input data-dojo-type="dijit.form.NumberSpinner" id="formAddPort.port" required="true" data-dojo-props="label: 'Port Number*:', placeHolder: 'Enter port number'" - name="port" smallDelta="1" constraints="{min:1,max:65535,places:0, pattern: '#####'}" - missingMessage="A port number must be supplied" /> + missingMessage="A name must be supplied"/> + + <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*:'"> <option value="AMQP" selected="selected">AMQP</option> 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 11173571ab..d751a6c1cd 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 @@ -37,8 +37,7 @@ placeHolder: 'unique node name per broker', required: true, missingMessage: 'A node name must be supplied', - title: 'Enter a unique node name per broker', - pattern: '^[\x20-\x2e\x30-\x7F]{1,255}$'" /> + title: 'Enter a unique node name per broker'" /> </div> </div> <div class="clear"> 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 2ec1743d80..6f4db66c7d 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 @@ -43,11 +43,9 @@ <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/NumberSpinner" + <input data-dojo-type="dijit/form/ValidationTextBox" id="editVirtualHost.storeTransactionIdleTimeoutWarn" name="storeTransactionIdleTimeoutWarn" - smallDelta="1000" - constraints="{min: 0, places: 0, pattern: '#'}" placeHolder="idle timeout warn time in ms" missingMessage="An idle timeout warn time in ms must be supplied"/> </div> @@ -55,11 +53,9 @@ <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/NumberSpinner" + <input data-dojo-type="dijit/form/ValidationTextBox" id="editVirtualHost.storeTransactionIdleTimeoutClose" name="storeTransactionIdleTimeoutClose" - smallDelta="1000" - constraints="{min: 0, places: 0, pattern: '#'}" placeHolder="idle timeout close time in ms" missingMessage="An idle timeout close time in ms must be supplied"/> </div> @@ -67,11 +63,9 @@ <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/NumberSpinner" + <input data-dojo-type="dijit/form/ValidationTextBox" id="editVirtualHost.storeTransactionOpenTimeoutWarn" name="storeTransactionOpenTimeoutWarn" - smallDelta="1000" - constraints="{min: 0, places: 0, pattern: '#'}" placeHolder="open timeout warn time in ms" missingMessage="An open timeout warn time in ms must be supplied"/> </div> @@ -79,11 +73,9 @@ <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/NumberSpinner" + <input data-dojo-type="dijit/form/ValidationTextBox" id="editVirtualHost.storeTransactionOpenTimeoutClose" name="storeTransactionOpenTimeoutClose" - smallDelta="1000" - constraints="{min: 0, places: 0, pattern: '#'}" placeHolder="open timeout close time in ms" missingMessage="An open timeout close time in ms must be supplied"/> </div> @@ -97,11 +89,9 @@ <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/NumberSpinner" + <input data-dojo-type="dijit/form/ValidationTextBox" id="editVirtualHost.housekeepingCheckPeriod" name="housekeepingCheckPeriod" - smallDelta="1000" - constraints="{min: 1, places: 0, pattern: '#'}" placeHolder="house keeping check period in ms" missingMessage="A house keeping check period must be supplied"/> </div> @@ -109,11 +99,9 @@ <div class="clear"> <div class="formLabel-labelCell tableContainer-labelCell">Thread count:</div> <div class="tableContainer-valueCell formLabel-controlCell"> - <input data-dojo-type="dijit/form/NumberSpinner" + <input data-dojo-type="dijit/form/ValidationTextBox" id="editVirtualHost.housekeepingThreadCount" name="housekeepingThreadCount" - smallDelta="1" - constraints="{min: 1, places: 0, pattern: '#'}" placeHolder="house keeping thread count" missingMessage="A house keeping thread count must be supplied"/> </div> 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 e4b3ed5dbc..1a89bfb374 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 @@ -636,5 +636,27 @@ define(["dojo/_base/xhr", } } + var singleContextVarRegexp = "(\\${[\\w\\.\\-]+})"; + + util.numericOrContextVarRegexp = function(constraints) + { + return "^(\\d+)|" + singleContextVarRegexp + "$"; + } + + util.nameOrContextVarRegexp = function(constraints) + { + return "^(\\w+)|" + singleContextVarRegexp + "$"; + } + + util.jdbcUrlOrContextVarRegexp = function(constraints) + { + return "^(jdbc:.*:.*)|" + singleContextVarRegexp + "$"; + } + + util.nodeAddressOrContextVarRegexp = function(constraints) + { + return "^(([0-9a-zA-Z.-_]|::)+:[0-9]{1,5})|" + singleContextVarRegexp + "$"; + } + return util; }); 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 3ae4537807..11a79984b3 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 @@ -55,6 +55,7 @@ define(["dojo/_base/xhr", this.name = name; this.controller = controller; this.modelObj = { type: "broker", name: name }; + if(parent) { this.modelObj.parent = {}; this.modelObj.parent[ parent.type] = parent; @@ -64,6 +65,8 @@ define(["dojo/_base/xhr", createWidget: function(brokerData) { return new dijit.form.ValidationTextBox({ required: true, + trim: true, + regExpGen: util.nameOrContextVarRegexp, value: brokerData.name, label: "Name*:", name: "name"}) @@ -93,7 +96,7 @@ define(["dojo/_base/xhr", createWidget: function(brokerData) { return new dijit.form.ValidationTextBox({ trim: "true", - regexp: "[0-9]+", + regExpGen: util.numericOrContextVarRegexp, invalidMessage: "Invalid value", required: false, value: brokerData.statisticsReportingPeriod, @@ -117,12 +120,12 @@ define(["dojo/_base/xhr", groupName: "Global Connection Defaults", createWidget: function(brokerData) { - return new dijit.form.NumberSpinner({ + return new dijit.form.ValidationTextBox({ + trim: "true", + regExpGen: util.numericOrContextVarRegexp, invalidMessage: "Invalid value", required: false, value: brokerData["connection.sessionCountLimit"], - smallDelta: 1, - constraints: {min:1,max:65535,places:0, pattern: "#####"}, label: "Maximum number of sessions:", name: "connection.sessionCountLimit" }); @@ -132,7 +135,7 @@ define(["dojo/_base/xhr", createWidget: function(brokerData) { return new dijit.form.ValidationTextBox({ trim: "true", - regexp: "[0-9]+", + regExpGen: util.numericOrContextVarRegexp, invalidMessage: "Invalid value", required: false, value: brokerData["connection.heartBeatDelay"], @@ -221,11 +224,19 @@ define(["dojo/_base/xhr", var editButton = query(".editBroker", contentPane.containerNode)[0]; connect.connect(registry.byNode(editButton), "onClick", function(evt){ - util.showSetAttributesDialog( - that.attributeWidgetFactories, - that.brokerUpdater.brokerData, - "api/latest/broker", - "Set broker attributes"); + var query = "api/latest/broker"; + + xhr.get({url: query, sync: properties.useSyncGet, handleAs: "json", content: { actuals: true, depth: 2 }}) + .then(function(data) + { + var brokerData = data[0]; + + util.showSetAttributesDialog( + that.attributeWidgetFactories, + brokerData, + query, + "Set broker attributes"); + }); } ); 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 f73837ba7d..667c83c6ea 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 @@ -71,7 +71,11 @@ define(["dojo/dom", var node = registry.byNode(editKeyStoreButton); connect.connect(node, "onClick", function(evt){ - that.dialog(that.keyStoreUpdater.keyStoreData) + xhr.get({url: that.url, sync: properties.useSyncGet, handleAs: "json", content: { actuals: true }}) + .then(function(data) + { + that.dialog(data[0], that.url); + }); }); }}); }; diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProviderFields.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProviderFields.js index 1adcbd1ff1..1fa1d603de 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProviderFields.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProviderFields.js @@ -31,9 +31,10 @@ define(["dojo/_base/xhr", "dojox/html/entities", "dojo/text!../../showPreferencesProviderFields.html", "dojo/text!service/helper?action=ListPreferencesProvidersTypes", + "qpid/common/util", "dojox/validate/us", "dojox/validate/web", - "dojo/domReady!"], function (xhr, dom, query, parser, string, json, Memory, registry, FilteringSelect, ValidationTextBox, entities, template, preferencesProvidersTypes) { + "dojo/domReady!"], function (xhr, dom, query, parser, string, json, Memory, registry, FilteringSelect, ValidationTextBox, entities, template, preferencesProvidersTypes, util) { var PreferencesProviderFields = {}; @@ -114,6 +115,7 @@ define(["dojo/_base/xhr", this.fieldsContainer = query(".preferencesProviderFieldsContainer", node)[0]; this.type = registry.byNode(query(".preferencesProviderType", node)[0]); this.name = registry.byNode(query(".preferencesProviderName", node)[0]); + this.name.set("regExpGen", util.nameOrContextVarRegexp); this.id = query("input[name='preferencesProviderId']", node)[0]; this.id.value = null; this.type.set("store", new Memory({ data: types, idProperty: "id"})); @@ -132,6 +134,7 @@ define(["dojo/_base/xhr", xhr.get({ url: "api/latest/preferencesprovider/" +encodeURIComponent(authenticationProviderName) + "/" + encodeURIComponent(provider), sync: true, + content: { actuals: true }, handleAs: "json" }).then(function(data){if (data && data[0]) { that.init(data[0]);}}); } diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js index 14c51f3276..dfe276cae2 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js @@ -71,11 +71,17 @@ define(["dojo/dom", var node = registry.byNode(editTrustStoreButton); connect.connect(node, "onClick", function(evt){ - that.dialog(that.keyStoreUpdater.keyStoreData) + xhr.get({url: that.url, sync: properties.useSyncGet, handleAs: "json", content: { actuals: true }}) + .then(function(data) + { + that.dialog(data[0], that.url); + }); }); }}); }; + + TrustStore.prototype.close = function() { updater.remove( this.keyStoreUpdater ); }; diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js index 969a8ffd90..30bd4c22d0 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js @@ -32,6 +32,7 @@ define(["dojo/_base/xhr", "dojo/_base/connect", "dojo/dom-style", "qpid/management/PreferencesProviderFields", + "qpid/common/util", /* dojox/ validate resources */ "dojox/validate/us", "dojox/validate/web", /* basic dijit classes */ @@ -45,7 +46,7 @@ define(["dojo/_base/xhr", "dojox/form/BusyButton", "dojox/form/CheckedMultiSelect", "dojox/layout/TableContainer", "dojo/domReady!"], - function (xhr, dom, construct, win, registry, parser, array, event, json, Memory, FilteringSelect, connect, domStyle, PreferencesProviderFields) { + function (xhr, dom, construct, win, registry, parser, array, event, json, Memory, FilteringSelect, connect, domStyle, PreferencesProviderFields, util) { var addAuthenticationProvider = {}; @@ -126,6 +127,7 @@ define(["dojo/_base/xhr", { xhr.get({ url: "api/latest/authenticationprovider/" + encodeURIComponent(providerName), + content: { actuals: true }, handleAs: "json" }).then( function(data) { @@ -134,6 +136,7 @@ define(["dojo/_base/xhr", var nameField = dijit.byId("formAddAuthenticationProvider.name"); nameField.set("value", provider.name); nameField.set("disabled", true); + nameField.set("regExpGen", util.nameOrContextVarRegexp); dialog.providerChooser.set("value", providerType); dialog.providerChooser.set("disabled", true); dojo.byId("formAddAuthenticationProvider.id").value=provider.id; 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 2d99f97837..0ec8fb6c6c 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 @@ -56,7 +56,7 @@ define(["dojo/_base/lang", value: keystore.name, disabled: keystore.name ? true : false, label: "Name:", - regexp: "^[\x20-\x2e\x30-\x7F]{1,255}$", + regExpGen: util.nameOrContextVarRegexp, name: "name"}); } }, { @@ -140,23 +140,23 @@ define(["dojo/_base/lang", return fields; } - addKeystore.showKeystoreDialog = function(keystore) { + addKeystore.showKeystoreDialog = function(keystore, putURL) { var keystoreAttributeWidgetFactories = addKeystore.createWidgetFactories(true); util.showSetAttributesDialog( keystoreAttributeWidgetFactories, keystore ? keystore : {}, - "api/latest/keystore" + (keystore ? "/" + encodeURIComponent(keystore.name) : ""), + keystore ? putURL : "api/latest/keystore", keystore ? "Edit keystore - " + keystore.name : "Add keystore", keystore ? false : true); }; - addKeystore.showTruststoreDialog = function(truststore) { + addKeystore.showTruststoreDialog = function(truststore, putURL) { var truststoreAttributeWidgetFactories = addKeystore.createWidgetFactories(false); util.showSetAttributesDialog( truststoreAttributeWidgetFactories, truststore ? truststore : {}, - "api/latest/truststore" + (truststore ? "/" + encodeURIComponent(truststore.name) : ""), + truststore ? putURL : "api/latest/truststore", truststore ? "Edit truststore - " + truststore.name : "Add truststore", truststore ? false : true); }; 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 a3e1160dc1..34e2d58afb 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 @@ -32,6 +32,7 @@ define(["dojo/_base/xhr", "dijit/form/FilteringSelect", "dojo/dom-style", "dojo/_base/lang", + "qpid/common/util", /* dojox/ validate resources */ "dojox/validate/us", "dojox/validate/web", @@ -54,7 +55,7 @@ define(["dojo/_base/xhr", "dojox/grid/EnhancedGrid", "dojox/grid/enhanced/plugins/IndirectSelection", "dojo/domReady!"], - function (xhr, dom, construct, win, registry, parser, array, event, json, Memory, ObjectStore, FilteringSelect, domStyle, lang) { + function (xhr, dom, construct, win, registry, parser, array, event, json, Memory, ObjectStore, FilteringSelect, domStyle, lang, util) { var addPort = {}; @@ -314,7 +315,7 @@ define(["dojo/_base/xhr", var newPort = convertToPort(theForm.getValues()); if ((newPort.needClientAuth || newPort.wantClientAuth) && (!newPort.hasOwnProperty("trustStores") || newPort.trustStores.length==0)) { - alert("A trustore must be selected when requesting client certificates."); + alert("A trust store must be selected when requesting client certificates."); return false; } var that = this; @@ -399,13 +400,15 @@ define(["dojo/_base/xhr", xhr.get({ url: "api/latest/port/" + encodeURIComponent(portName), + content: { actuals: true }, handleAs: "json" }).then( function(data){ var port = data[0]; - var nameField = registry.byId("formAddPort.name"); - nameField.set("value", port.name); - nameField.set("disabled", true); + var nameWidget = registry.byId("formAddPort.name"); + nameWidget.set("value", port.name); + nameWidget.set("disabled", true); + nameWidget.set("regExpGen", util.nameOrContextVarRegexp); dom.byId("formAddPort.id").value=port.id; providerWidget.set("value", port.authenticationProvider ? port.authenticationProvider : ""); keystoreWidget.set("value", port.keyStore ? port.keyStore : ""); @@ -430,7 +433,11 @@ define(["dojo/_base/xhr", var transportWidget = registry.byId("formAddPort.transports"); transportWidget.set("value", port.transports); - registry.byId("formAddPort.port").set("value", port.port); + + var portWidget = registry.byId("formAddPort.port"); + portWidget.set("value", port.port); + portWidget.set("regExpGen", util.numericOrContextVarRegexp); + var protocols = port.protocols; var typeWidget = registry.byId("formAddPort.type"); 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 884290eed4..2eac2094e5 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 @@ -33,6 +33,7 @@ define(["dojo/_base/xhr", "dijit/form/Button", "dijit/form/FilteringSelect", "qpid/common/properties", + "qpid/common/util", "dojo/text!addVirtualHostNodeAndVirtualHost.html", "dijit/form/Form", "dijit/form/CheckBox", @@ -40,7 +41,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, template) + function (xhr, event, lang, array, dom, domConstruct, json, parser, Memory, fobject, registry, Dialog, Button, FilteringSelect, properties, util, template) { var addVirtualHostNodeAndVirtualHost = @@ -51,6 +52,9 @@ define(["dojo/_base/xhr", this.containerNode = domConstruct.create("div", {innerHTML: template}); parser.parse(this.containerNode); + var virtualHostNodeName = registry.byId("addVirtualHostNode.nodeName"); + virtualHostNodeName.set("regExpGen", util.nameOrContextVarRegexp); + this.dialog = registry.byId("addVirtualHostNodeAndVirtualHost"); this.addButton = registry.byId("addVirtualHostNodeAndVirtualHost.addButton"); this.cancelButton = registry.byId("addVirtualHostNodeAndVirtualHost.cancelButton"); 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 c2f35ac9ec..1a24e5e770 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 @@ -40,13 +40,14 @@ define(["dojo/_base/xhr", "dijit/form/ValidationTextBox", "dijit/form/Button", "dijit/form/Form", - "dijit/form/NumberSpinner", "dojox/validate/us", "dojox/validate/web", "dojo/domReady!"], function (xhr, entities, array, event, lang, win, dom, domConstruct, registry, parser, json, query, Memory, ObjectStore, util, template) { var fields = [ "name", "queue.deadLetterQueueEnabled", "storeTransactionIdleTimeoutWarn", "storeTransactionIdleTimeoutClose", "storeTransactionOpenTimeoutWarn", "storeTransactionOpenTimeoutClose", "housekeepingCheckPeriod", "housekeepingThreadCount"]; + var numericFieldNames = ["storeTransactionIdleTimeoutWarn", "storeTransactionIdleTimeoutClose", "storeTransactionOpenTimeoutWarn", "storeTransactionOpenTimeoutClose", "housekeepingCheckPeriod", "housekeepingThreadCount"]; + var virtualHostEditor = { @@ -77,6 +78,7 @@ define(["dojo/_base/xhr", { url: this.query, sync: true, + content: { actuals: true }, handleAs: "json", load: function(data) { @@ -137,20 +139,30 @@ define(["dojo/_base/xhr", }, _show:function(virtualHostData) { + this.initialData = virtualHostData; for(var i = 0; i < fields.length; i++) { var fieldName = fields[i]; - if (this[fieldName] instanceof dijit.form.CheckBox) + var widget = this[fieldName]; + widget.reset(); + + if (widget instanceof dijit.form.CheckBox) { - this[fieldName].set("checked", virtualHostData[fieldName]); + widget.set("checked", virtualHostData[fieldName]); } else { - this[fieldName].set("value", virtualHostData[fieldName]); + widget.set("value", virtualHostData[fieldName]); } } + // Add regexp to the numeric fields + for(var i = 0; i < numericFieldNames.length; i++) + { + this[numericFieldNames[i]].set("regExpGen", util.numericOrContextVarRegexp); + } + var that = this; var widgets = registry.findWidgets(this.typeFieldsContainer); 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 e56e34ef41..704063ae16 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 @@ -40,7 +40,6 @@ define(["dojo/_base/xhr", "dijit/form/ValidationTextBox", "dijit/form/Button", "dijit/form/Form", - "dijit/form/NumberSpinner", "dojox/validate/us", "dojox/validate/web", "dojo/domReady!"], @@ -71,6 +70,7 @@ define(["dojo/_base/xhr", { url: this.query, sync: true, + content: { actuals: true }, handleAs: "json", load: function(data) { diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/providedstore/add.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/providedstore/add.js index e2f3fe35b7..7d14c6450f 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/providedstore/add.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/providedstore/add.js @@ -24,9 +24,10 @@ define(["dojo/_base/xhr", "dojo/json", "dijit/registry", "dojo/text!virtualhost/providedstore/add.html", + "qpid/common/util", "dijit/form/ValidationTextBox", "dojo/domReady!"], - function (xhr, parser, dom, domConstruct, json, registry, template) + function (xhr, parser, dom, domConstruct, json, registry, template, util) { return { show: function (data) @@ -34,6 +35,9 @@ define(["dojo/_base/xhr", this.containerNode = domConstruct.create("div", {innerHTML: template}, data.containerNode); parser.parse(this.containerNode); + registry.byId("addVirtualHost.storeUnderfullSize").set("regExpGen", util.numericOrContextVarRegexp); + registry.byId("addVirtualHost.storeOverfullSize").set("regExpGen", util.numericOrContextVarRegexp); + if (data.parent.virtualHostNodeType.value == "JDBC") { dom.byId("addVirtualHost.diskFlowControls").style.display = "none"; diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/providedstore/edit.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/providedstore/edit.js new file mode 100644 index 0000000000..6264d81335 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/providedstore/edit.js @@ -0,0 +1,34 @@ +/* + * 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(["dijit/registry", "qpid/common/util", "dojo/domReady!"], + function (registry, util) + { + var fieldNames = ["storeUnderfullSize", "storeOverfullSize"]; + return { + show: function(data) + { + util.buildEditUI(data.containerNode, "virtualhost/providedstore/edit.html", "editVirtualHost.", fieldNames, data.data); + + registry.byId("editVirtualHost.storeUnderfullSize").set("regExpGen", util.numericOrContextVarRegexp); + registry.byId("editVirtualHost.storeOverfullSize").set("regExpGen", util.numericOrContextVarRegexp); + } + }; + } +); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferencesProviderFields.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferencesProviderFields.html index 5c5bdaefef..f15a3a71b8 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferencesProviderFields.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferencesProviderFields.html @@ -33,7 +33,7 @@ <td class="tableContainer-labelCell"><strong>Name*:</strong></td> <td class="tableContainer-valueCell"><input type="text" name="preferencesProviderName" class="preferencesProviderName" data-dojo-type="dijit/form/ValidationTextBox" - data-dojo-props="placeHolder: 'Name', required: true, missingMessage: 'A name must be supplied', title: 'Enter name', pattern: '^[\x20-\x2e\x30-\x7F]{1,255}$'" /></td> + data-dojo-props="placeHolder: 'Name', required: true, missingMessage: 'A name must be supplied', title: 'Enter name'" /></td> </tr> </table> <div class="preferencesProviderFieldsContainer"></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 de0c2aaa21..320f056cef 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 @@ -23,26 +23,24 @@ <div class="formLabel-labelCell tableContainer-labelCell">Store overfull size:</div> <div class="formLabel-controlCell tableContainer-valueCell"> <input type="text" id="addVirtualHost.storeOverfullSize" - data-dojo-type="dijit/form/NumberTextBox" + data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props=" name: 'storeOverfullSize', placeHolder: 'size in bytes', required: false, - title: 'Enter ceiling (in bytes) at which store will begin to throttle sessions producing messages', - constraints:{min:0,places:0}" /> + title: 'Enter ceiling (in bytes) at which store will begin to throttle sessions producing messages'" /> </div> </div> <div class="clear"> <div class="formLabel-labelCell tableContainer-labelCell">Store underfull size:</div> <div class="formLabel-controlCell tableContainer-valueCell"> <input type="text" id="addVirtualHost.storeUnderfullSize" - data-dojo-type="dijit/form/NumberTextBox" + data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props=" name: 'storeUnderfullSize', placeHolder: 'size in bytes', required: false, - title: 'Enter floor (in bytes) at which store will cease to throttle sessions producing messages', - constraints:{min:0,places:0}" /> + title: 'Enter 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 new file mode 100644 index 0000000000..ec02c67ff4 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/edit.html @@ -0,0 +1,51 @@ +<!-- + ~ 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 class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Store overfull size (bytes):</div> + <div class="tableContainer-valueCell formLabel-controlCell"> + <input data-dojo-type="dijit/form/ValidationTextBox" + id="editVirtualHost.storeOverfullSize" + data-dojo-props=" + name: 'storeOverfullSize', + placeHolder: 'size in bytes', + required: false, + title: 'Enter ceiling (in bytes) at which store will begin to throttle sessions producing messages'" + /> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Store underfull size (bytes):</div> + <div class="tableContainer-valueCell formLabel-controlCell"> + <input data-dojo-type="dijit/form/ValidationTextBox" + id="editVirtualHost.storeUnderfullSize" + data-dojo-props=" + name: 'storeUnderfullSize', + placeHolder: 'size in bytes', + required: false, + title: 'Enter floor (in bytes) at which store will cease to throttle sessions producing messages'" + /> + </div> + </div> + + <div class="clear"></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 522d2b3abf..7cf789e520 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 @@ -35,26 +35,24 @@ <div class="formLabel-labelCell tableContainer-labelCell">Store overfull size:</div> <div class="formLabel-controlCell tableContainer-valueCell"> <input type="text" id="addVirtualHost.storeOverfullSize" - data-dojo-type="dijit/form/NumberTextBox" + data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props=" name: 'storeOverfullSize', placeHolder: 'size in bytes', required: false, - title: 'Enter ceiling (in bytes) at which store will begin to throttle sessions producing messages', - constraints:{min:0,places:0}" /> + title: 'Enter ceiling (in bytes) at which store will begin to throttle sessions producing messages'" /> </div> </div> <div class="clear"> <div class="formLabel-labelCell tableContainer-labelCell">Store underfull size:</div> <div class="formLabel-controlCell tableContainer-valueCell"> <input type="text" id="addVirtualHost.storeUnderfullSize" - data-dojo-type="dijit/form/NumberTextBox" + data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props=" name: 'storeUnderfullSize', placeHolder: 'size in bytes', required: false, - title: 'Enter floor (in bytes) at which store will cease to throttle sessions producing messages', - constraints:{min:0,places:0}" /> + title: 'Enter 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 937f036445..9e240a83c4 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 @@ -37,28 +37,26 @@ <div class="clear"> <div class="formLabel-labelCell tableContainer-labelCell">Store overfull size (bytes):</div> <div class="tableContainer-valueCell formLabel-controlCell"> - <input data-dojo-type="dijit/form/NumberSpinner" + <input data-dojo-type="dijit/form/ValidationTextBox" id="editVirtualHost.storeOverfullSize" data-dojo-props=" name: 'storeOverfullSize', placeHolder: 'size in bytes', required: false, - title: 'Enter ceiling (in bytes) at which store will begin to throttle sessions producing messages', - constraints:{min:0,places:0}" + title: 'Enter ceiling (in bytes) at which store will begin to throttle sessions producing messages'" /> </div> </div> <div class="clear"> <div class="formLabel-labelCell tableContainer-labelCell">Store underfull size (bytes):</div> <div class="tableContainer-valueCell formLabel-controlCell"> - <input data-dojo-type="dijit/form/NumberSpinner" + <input data-dojo-type="dijit/form/ValidationTextBox" id="editVirtualHost.storeUnderfullSize" data-dojo-props=" name: 'storeUnderfullSize', placeHolder: 'size in bytes', required: false, - title: 'Enter floor (in bytes) at which store will cease to throttle sessions producing messages', - constraints:{min:0,places:0}" + title: 'Enter floor (in bytes) at which store will cease to throttle sessions producing messages'" /> </div> </div> |