qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject svn commit: r1677590 [6/6] - in /qpid/java/trunk: bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb_ha/ bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/ broker-plugins/jdbc-store/src/main/java/resources/js/q...
Date Mon, 04 May 2015 12:17:25 GMT
Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementhttp.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementhttp.js?rev=1677590&r1=1677589&r2=1677590&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementhttp.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementhttp.js Mon May  4 12:17:23 2015
@@ -18,8 +18,7 @@
  * under the License.
  *
  */
-define(["dojo/_base/xhr",
-        "dojo/dom",
+define(["dojo/dom",
         "dojo/parser",
         "dojo/query",
         "dojo/dom-construct",
@@ -31,32 +30,30 @@ define(["dojo/_base/xhr",
         "qpid/common/util",
         "qpid/common/properties",
         "qpid/common/updater",
+        "dojo/text!plugin/showManagementHttp.html",
+        "qpid/management/plugin/managementhttp/edit",
         "dijit/form/Button",
         "dijit/form/ValidationTextBox",
         "dijit/form/CheckBox",
         "dijit/form/NumberSpinner",
         "dojo/domReady!"],
-    function (xhr, dom, parser, query, construct, connect, win, event, json, registry, util, properties, updater) {
+    function (dom, parser, query, construct, connect, win, event, json, registry, util, properties, updater, template, editor) {
 
         function ManagementHttp(containerNode, pluginObject, controller) {
             var node = construct.create("div", null, containerNode, "last");
             var that = this;
             this.name = pluginObject.name;
-            xhr.get({
-                      url: "plugin/showManagementHttp.html",
-                      sync: true,
-                      load:  function(data) {
-                          node.innerHTML = data;
-                          parser.parse(node).then(function(instances)
-                          {
+            this.modelObj = pluginObject;
+            this.management = controller.management;
+            node.innerHTML = template;
+            parser.parse(node).then(function(instances)
+            {
                           that.managementHttpUpdater= new ManagementHttpUpdater(node, pluginObject, controller);
-                          that.managementHttpUpdater.update(true);
-                          updater.add( that.managementHttpUpdater);
+                          that.managementHttpUpdater.update(function(){updater.add( that.managementHttpUpdater)});
 
                           var editButton = query(".editPluginButton", node)[0];
                           connect.connect(registry.byNode(editButton), "onClick", function(evt){ that.edit(); });
-                          });
-                      }});
+            });
         }
 
         ManagementHttp.prototype.close = function() {
@@ -64,91 +61,13 @@ define(["dojo/_base/xhr",
         };
 
         ManagementHttp.prototype.edit = function() {
-          var widgetFactories = [{
-                  name: "name",
-                  createWidget: function(plugin) {
-                      return new dijit.form.ValidationTextBox({
-                        required: true,
-                        value: plugin.name,
-                        disabled: true,
-                        label: "Name:",
-                        regexp: "^[\x20-\x2e\x30-\x7F]{1,255}$",
-                        name: "name"});
-                  }
-              }, {
-                    name: "httpBasicAuthenticationEnabled",
-                    createWidget: function(plugin) {
-                        return new dijit.form.CheckBox({
-                          required: false,
-                          checked: plugin.httpBasicAuthenticationEnabled,
-                          label: "HTTP Basic Authentication Enabled:",
-                          name: "httpBasicAuthenticationEnabled"});
-                }
-              }, {
-                    name: "httpsBasicAuthenticationEnabled",
-                    createWidget: function(plugin) {
-                        return new dijit.form.CheckBox({
-                          required: false,
-                          checked: plugin.httpsBasicAuthenticationEnabled,
-                          label: "HTTPS Basic Authentication Enabled:",
-                          name: "httpsBasicAuthenticationEnabled"});
-                    }
-              }, {
-                    name: "httpSaslAuthenticationEnabled",
-                    createWidget: function(plugin) {
-                        return new dijit.form.CheckBox({
-                          required: false,
-                          checked: plugin.httpSaslAuthenticationEnabled,
-                          label: "HTTP SASL Authentication Enabled:",
-                          name: "httpSaslAuthenticationEnabled"});
-                    }
-              }, {
-                    name: "httpsSaslAuthenticationEnabled",
-                    createWidget: function(plugin) {
-                        return new dijit.form.CheckBox({
-                          required: false,
-                          checked: plugin.httpsSaslAuthenticationEnabled,
-                          label: "HTTPS SASL Authentication Enabled:",
-                          name: "httpsSaslAuthenticationEnabled"});
-                    }
-              }, {
-                    name: "sessionTimeout",
-                    createWidget: function(plugin) {
-                        return new dijit.form.NumberSpinner({
-                          invalidMessage: "Invalid value",
-                          required: false,
-                          value: plugin.sessionTimeout,
-                          smallDelta: 1,
-                          constraints: {min:1,places:0, pattern: "#####"},
-                          label: "Session timeout (s):",
-                          name: "sessionTimeout"
-                        });
-                    }
-              }, {
-              name: "compressResponses",
-              createWidget: function(plugin) {
-                  return new dijit.form.CheckBox({
-                      required: false,
-                      checked: plugin.compressResponses,
-                      label: "Compress responses:",
-                      name: "compressResponses"});
-              }
-          }
-          ];
-          var data = this.managementHttpUpdater.pluginData;
-          util.showSetAttributesDialog(
-              widgetFactories,
-              data,
-              "api/latest/plugin/" + encodeURIComponent(data.name),
-              "Edit plugin - " + data.name,
-              "Plugin",
-              "MANAGEMENT-HTTP");
+              editor.show(this.management, this.modelObj, this.managementHttpUpdater.pluginData);
         };
 
         function ManagementHttpUpdater(node, pluginObject, controller)
         {
             this.controller = controller;
-            this.query = "api/latest/plugin/"+encodeURIComponent(pluginObject.name);
+            this.modelObj = pluginObject;
             this.name = pluginObject.name;
             this.httpBasicAuthenticationEnabled = query(".httpBasicAuthenticationEnabled", node)[0];
             this.httpsBasicAuthenticationEnabled = query(".httpsBasicAuthenticationEnabled", node)[0];
@@ -156,10 +75,10 @@ define(["dojo/_base/xhr",
             this.httpsSaslAuthenticationEnabled = query(".httpsSaslAuthenticationEnabled", node)[0];
             this.httpSaslAuthenticationEnabled = query(".httpSaslAuthenticationEnabled", node)[0];
             this.compressResponses = query(".compressResponses", node)[0];
-
+            this.management = controller.management;
         }
 
-        ManagementHttpUpdater.prototype.update = function(syncRequest)
+        ManagementHttpUpdater.prototype.update = function(callback)
         {
             var that = this;
 
@@ -168,7 +87,7 @@ define(["dojo/_base/xhr",
               return "<input type='checkbox' disabled='disabled' "+(val ? "checked='checked'": "")+" />" ;
             }
 
-            xhr.get({url: this.query, sync: syncRequest ? syncRequest : properties.useSyncGet, handleAs: "json"})
+            this.management.load(this.modelObj)
                 .then(function(data) {
                     that.pluginData = data[0];
                     that.httpBasicAuthenticationEnabled.innerHTML = showBoolean(that.pluginData.httpBasicAuthenticationEnabled);
@@ -177,6 +96,10 @@ define(["dojo/_base/xhr",
                     that.httpSaslAuthenticationEnabled.innerHTML = showBoolean(that.pluginData.httpSaslAuthenticationEnabled);
                     that.compressResponses.innerHTML = showBoolean(that.pluginData.compressResponses);
                     that.sessionTimeout.innerHTML = that.pluginData.sessionTimeout;
+                    if (callback)
+                    {
+                        callback();
+                    }
                 });
 
         };

Added: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementhttp/edit.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementhttp/edit.js?rev=1677590&view=auto
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementhttp/edit.js (added)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementhttp/edit.js Mon May  4 12:17:23 2015
@@ -0,0 +1,124 @@
+/*
+ *
+ * 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/event",
+        "dojo/dom",
+        "dojo/dom-construct",
+        'dojo/json',
+        "dojo/query",
+        "dojo/parser",
+        "dijit/registry",
+        "qpid/common/util",
+        "dojo/text!plugin/managementhttp/edit.html",
+        "dojox/html/entities",
+        "dijit/Dialog",
+        "dijit/form/CheckBox",
+        "dijit/form/ValidationTextBox",
+        "dijit/form/Button",
+        "dijit/form/Form",
+        "dijit/form/NumberSpinner",
+        "dojox/validate/us",
+        "dojox/validate/web",
+        "dojo/domReady!"],
+  function (event, dom, domConstruct, json, query, parser,  registry, util, template, entities)
+  {
+
+    var httpManagementEditor =
+    {
+      init: function()
+      {
+        var that=this;
+        this.containerNode = domConstruct.create("div", {innerHTML: template});
+        parser.parse(this.containerNode).then(function(instances){ that._postParse();});
+      },
+      _postParse: function()
+      {
+        var that=this;
+        this.allFieldsContainer = dom.byId("editHttpManagement.contentPane");
+        this.dialog = registry.byId("editHttpManagementDialog");
+        this.saveButton = registry.byId("editHttpManagement.saveButton");
+        this.cancelButton = registry.byId("editHttpManagement.cancelButton");
+        this.cancelButton.on("click", function(e){that._cancel(e);});
+        this.saveButton.on("click", function(e){that._save(e);});
+        this.form = registry.byId("editHttpManagementForm");
+        this.form.on("submit", function(){return false;});
+      },
+      show: function(management, modelObj, data)
+      {
+        this.management = management;
+        this.modelObj = modelObj;
+        var that=this;
+        management.load(modelObj,  { actuals: true },
+            function(actualData)
+            {
+                that._show(actualData[0]);
+            });
+      },
+      destroy: function()
+      {
+        if (this.dialog)
+        {
+            this.dialog.destroyRecursive();
+            this.dialog = null;
+        }
+
+        if (this.containerNode)
+        {
+            domConstruct.destroy(this.containerNode);
+            this.containerNode = null;
+        }
+      },
+      _cancel: function(e)
+      {
+          this.dialog.hide();
+      },
+      _save: function(e)
+      {
+          event.stop(e);
+          if(this.form.validate())
+          {
+              var data = util.getFormWidgetValues(this.form, this.initialData);
+              var that=this;
+              this.management.update(this.modelObj, data, function(x){ that.dialog.hide();} );
+          }
+          else
+          {
+              alert('Form contains invalid data.  Please correct first');
+          }
+      },
+      _show:function(actualData)
+      {
+          this.initialData = actualData;
+          util.applyToWidgets(this.allFieldsContainer,  "Plugin", "MANAGEMENT-HTTP", actualData, this.management.metadata);
+          this.dialog.startup();
+          this.dialog.show();
+          if (!this.resizeEventRegistered)
+          {
+            this.resizeEventRegistered = true;
+            util.resizeContentAreaAndRepositionDialog(dom.byId("editHttpManagement.contentPane"), this.dialog);
+          }
+      }
+    };
+
+    httpManagementEditor.init();
+
+    return httpManagementEditor;
+  }
+);

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementjmx.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementjmx.js?rev=1677590&r1=1677589&r2=1677590&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementjmx.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementjmx.js Mon May  4 12:17:23 2015
@@ -18,8 +18,7 @@
  * under the License.
  *
  */
-define(["dojo/_base/xhr",
-        "dojo/dom",
+define(["dojo/dom",
         "dojo/parser",
         "dojo/query",
         "dojo/dom-construct",
@@ -31,28 +30,27 @@ define(["dojo/_base/xhr",
         "qpid/common/util",
         "qpid/common/properties",
         "qpid/common/updater",
+        "dojo/text!plugin/showManagementJmx.html",
+        "qpid/management/plugin/managementjmx/edit",
         "dojo/domReady!"],
-    function (xhr, dom, parser, query, construct, connect, win, event, json, registry, util, properties, updater) {
+    function (dom, parser, query, construct, connect, win, event, json, registry, util, properties, updater, template, edit) {
 
         function ManagementJmx(containerNode, pluginObject, controller) {
             var node = construct.create("div", null, containerNode, "last");
             var that = this;
             this.name = pluginObject.name;
-            xhr.get({
-                      url: "plugin/showManagementJmx.html",
-                      sync: true,
-                      load:  function(data) {
-                          node.innerHTML = data;
-                          parser.parse(node).then(function(instances)
-                          {
+            this.modelObj = pluginObject;
+            this.management = controller.management;
+            node.innerHTML = template;
+            parser.parse(node).then(function(instances)
+            {
                           that.managementJmxUpdater= new ManagementJmxUpdater(node, pluginObject, controller);
-                          that.managementJmxUpdater.update(true);
-                          updater.add( that.managementJmxUpdater);
+                          that.managementJmxUpdater.update(function(){updater.add( that.managementJmxUpdater);});
+
 
                           var editButton = query(".editPluginButton", node)[0];
                           connect.connect(registry.byNode(editButton), "onClick", function(evt){ that.edit(); });
-                          });
-                      }});
+            });
         }
 
         ManagementJmx.prototype.close = function() {
@@ -60,47 +58,19 @@ define(["dojo/_base/xhr",
         };
 
         ManagementJmx.prototype.edit = function() {
-          var widgetFactories = [{
-                  name: "name",
-                  createWidget: function(plugin) {
-                      return new dijit.form.ValidationTextBox({
-                        required: true,
-                        value: plugin.name,
-                        disabled: true,
-                        label: "Name:",
-                        regexp: "^[\x20-\x2e\x30-\x7F]{1,255}$",
-                        name: "name"});
-                  }
-              }, {
-                    name: "usePlatformMBeanServer",
-                    createWidget: function(plugin) {
-                        return new dijit.form.CheckBox({
-                          required: false,
-                          checked: plugin.usePlatformMBeanServer,
-                          label: "Use Platform MBean Server:",
-                          name: "usePlatformMBeanServer"});
-                }
-              }
-          ];
-          var data = this.managementJmxUpdater.pluginData;
-          util.showSetAttributesDialog(
-              widgetFactories,
-              data,
-              "api/latest/plugin/" + encodeURIComponent(data.name),
-              "Edit plugin - " + data.name,
-              "Plugin",
-              "MANAGEMENT-JMX");
+          edit.show(this.management, this.modelObj, this.managementJmxUpdater.pluginData);
         };
 
         function ManagementJmxUpdater(node, pluginObject, controller)
         {
             this.controller = controller;
-            this.query = "api/latest/plugin/"+encodeURIComponent(pluginObject.name);
+            this.modelObj = pluginObject;
             this.name = pluginObject.name;
             this.usePlatformMBeanServer = query(".usePlatformMBeanServer", node)[0];
+            this.management = controller.management;
         }
 
-        ManagementJmxUpdater.prototype.update = function(syncRequest)
+        ManagementJmxUpdater.prototype.update = function(callback)
         {
             var that = this;
 
@@ -109,10 +79,14 @@ define(["dojo/_base/xhr",
               return "<input type='checkbox' disabled='disabled' "+(val ? "checked='checked'": "")+" />" ;
             }
 
-            xhr.get({url: this.query, sync: syncRequest ? syncRequest : properties.useSyncGet, handleAs: "json"})
+            this.management.load(this.modelObj)
                 .then(function(data) {
                     that.pluginData = data[0];
                     that.usePlatformMBeanServer.innerHTML = showBoolean(that.pluginData.usePlatformMBeanServer);
+                    if (callback)
+                    {
+                        callback();
+                    }
                 });
 
         };

Added: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementjmx/edit.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementjmx/edit.js?rev=1677590&view=auto
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementjmx/edit.js (added)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementjmx/edit.js Mon May  4 12:17:23 2015
@@ -0,0 +1,124 @@
+/*
+ *
+ * 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/event",
+        "dojo/dom",
+        "dojo/dom-construct",
+        'dojo/json',
+        "dojo/query",
+        "dojo/parser",
+        "dijit/registry",
+        "qpid/common/util",
+        "dojo/text!plugin/managementjmx/edit.html",
+        "dojox/html/entities",
+        "dijit/Dialog",
+        "dijit/form/CheckBox",
+        "dijit/form/ValidationTextBox",
+        "dijit/form/Button",
+        "dijit/form/Form",
+        "dijit/form/NumberSpinner",
+        "dojox/validate/us",
+        "dojox/validate/web",
+        "dojo/domReady!"],
+  function (event, dom, domConstruct, json, query, parser,  registry, util, template, entities)
+  {
+
+    var jmxManagementEditor =
+    {
+      init: function()
+      {
+        var that=this;
+        this.containerNode = domConstruct.create("div", {innerHTML: template});
+        parser.parse(this.containerNode).then(function(instances){ that._postParse();});
+      },
+      _postParse: function()
+      {
+        var that=this;
+        this.allFieldsContainer = dom.byId("editJmxManagement.contentPane");
+        this.dialog = registry.byId("editJmxManagementDialog");
+        this.saveButton = registry.byId("editJmxManagement.saveButton");
+        this.cancelButton = registry.byId("editJmxManagement.cancelButton");
+        this.cancelButton.on("click", function(e){that._cancel(e);});
+        this.saveButton.on("click", function(e){that._save(e);});
+        this.form = registry.byId("editJmxManagementForm");
+        this.form.on("submit", function(){return false;});
+      },
+      show: function(management, modelObj, data)
+      {
+        this.management = management;
+        this.modelObj = modelObj;
+        var that=this;
+        management.load(modelObj,  { actuals: true },
+            function(actualData)
+            {
+                that._show(actualData[0]);
+            });
+      },
+      destroy: function()
+      {
+        if (this.dialog)
+        {
+            this.dialog.destroyRecursive();
+            this.dialog = null;
+        }
+
+        if (this.containerNode)
+        {
+            domConstruct.destroy(this.containerNode);
+            this.containerNode = null;
+        }
+      },
+      _cancel: function(e)
+      {
+          this.dialog.hide();
+      },
+      _save: function(e)
+      {
+          event.stop(e);
+          if(this.form.validate())
+          {
+              var data = util.getFormWidgetValues(this.form, this.initialData);
+              var that=this;
+              this.management.update(this.modelObj, data, function(x){ that.dialog.hide();} );
+          }
+          else
+          {
+              alert('Form contains invalid data.  Please correct first');
+          }
+      },
+      _show:function(actualData)
+      {
+          this.initialData = actualData;
+          util.applyToWidgets(this.allFieldsContainer,  "Plugin", "MANAGEMENT-JMX", actualData, this.management.metadata);
+          this.dialog.startup();
+          this.dialog.show();
+          if (!this.resizeEventRegistered)
+          {
+            this.resizeEventRegistered = true;
+            util.resizeContentAreaAndRepositionDialog(dom.byId("editJmxManagement.contentPane"), this.dialog);
+          }
+      }
+    };
+
+    jmxManagementEditor.init();
+
+    return jmxManagementEditor;
+  }
+);

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/preferencesprovider/PreferencesProviderForm.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/preferencesprovider/PreferencesProviderForm.js?rev=1677590&r1=1677589&r2=1677590&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/preferencesprovider/PreferencesProviderForm.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/preferencesprovider/PreferencesProviderForm.js Mon May  4 12:17:23 2015
@@ -20,8 +20,6 @@
  */
 define([
         "qpid/common/util",
-        "qpid/common/metadata",
-        "dojo/_base/xhr",
         "dojo/_base/declare",
         "dojo/_base/array",
         "dojo/dom-construct",
@@ -40,7 +38,7 @@ define([
         "dojox/validate/us",
         "dojox/validate/web",
         "dojo/domReady!"],
-function (util, metadata, xhr, declare, array, domConstruct, win, query, json, _WidgetBase,
+function (util, declare, array, domConstruct, win, query, json, _WidgetBase,
             _OnDijitClickMixin, _TemplatedMixin, _WidgetsInTemplateMixin, registry, template, entities)
  {
 
@@ -53,6 +51,7 @@ function (util, metadata, xhr, declare,
     preferencesProviderNameWidget : null,
     preferencesProviderTypeWidget : null,
     preferencesProviderTypeFieldsContainer: null,
+    metadata: null,
 
     buildRendering: function()
     {
@@ -67,11 +66,10 @@ function (util, metadata, xhr, declare,
 
         this.preferencesProviderNameWidget.set("regExpGen", util.nameOrContextVarRegexp);
 
-        var supportedPreferencesProviderTypes = metadata.getTypesForCategory("PreferencesProvider");
-        supportedPreferencesProviderTypes.sort();
-        supportedPreferencesProviderTypes.splice(0,0,"None");
-        var preferencesProviderTypeStore = util.makeTypeStore(supportedPreferencesProviderTypes);
-        this.preferencesProviderTypeWidget.set("store", preferencesProviderTypeStore);
+        if (this.metadata)
+        {
+            setMetadata(this.metadata);
+        }
         this.preferencesProviderTypeWidget.on("change", function(type){that._preferencesProviderTypeChanged(type);});
         this.preferencesProviderForm.on("submit", function() { return false; })
     },
@@ -81,33 +79,34 @@ function (util, metadata, xhr, declare,
         this.preferencesProviderForm.reset();
         this.preferencesProviderTypeWidget.set("value", "None");
     },
-    submit: function(encodedAuthenticationProviderName)
+    submit: function(submitFunction, providerNotDefinedCallback)
     {
         if (this.preferencesProviderTypeWidget.get("value") != "None")
         {
             var preferencesProviderData = util.getFormWidgetValues(this.preferencesProviderForm, this.data)
-            var encodedPreferencesProviderName = encodeURIComponent(this.preferencesProviderNameWidget.get("value"));
-            var url = "api/latest/preferencesprovider/" + encodedAuthenticationProviderName;
-            if (this.data)
-            {
-                // update request
-                url += "/" + encodedPreferencesProviderName;
-            }
-            return util.post(url, preferencesProviderData);
+            submitFunction(preferencesProviderData);
+        }
+        else
+        {
+            providerNotDefinedCallback();
         }
-        return { success: true, failureReason: null };
     },
-    validate: function()
+    getPreferencesProviderName: function()
     {
-        return this.preferencesProviderForm.validate();
+        return this.preferencesProviderNameWidget.get("value");
     },
-    load: function(authenticationProviderName, providerName)
+    setMetadata: function(metadata)
     {
-        var that = this;
-        xhr.get({
-            url: "api/latest/preferencesprovider/" + encodeURIComponent(authenticationProviderName) + "/" + encodeURIComponent(providerName),
-            handleAs: "json"
-        }).then(function(data){that._load(data[0])});
+        this.metadata = metadata;
+        var supportedPreferencesProviderTypes = metadata.getTypesForCategory("PreferencesProvider");
+        supportedPreferencesProviderTypes.sort();
+        supportedPreferencesProviderTypes.splice(0,0,"None");
+        var preferencesProviderTypeStore = util.makeTypeStore(supportedPreferencesProviderTypes);
+        this.preferencesProviderTypeWidget.set("store", preferencesProviderTypeStore);
+    },
+    validate: function()
+    {
+        return this.preferencesProviderForm.validate();
     },
     setData: function(data)
     {
@@ -149,7 +148,10 @@ function (util, metadata, xhr, declare,
                     try
                     {
                         typeUI.show({containerNode:typeFieldsContainer, parent: that, data: that.data});
-                        util.applyMetadataToWidgets(typeFieldsContainer, "PreferencesProvider", type);
+                        if (that.metadata)
+                        {
+                            util.applyMetadataToWidgets(typeFieldsContainer, "PreferencesProvider", type, that.metadata);
+                        }
                     }
                     catch(e)
                     {

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/showMessage.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/showMessage.js?rev=1677590&r1=1677589&r2=1677590&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/showMessage.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/showMessage.js Mon May  4 12:17:23 2015
@@ -15,8 +15,7 @@
  * limitations under the License.
  */
 
-define(["dojo/_base/xhr",
-        "dojo/dom",
+define(["dojo/dom",
         "dojo/dom-construct",
         "dojo/dom-class",
         "dojo/_base/window",
@@ -29,9 +28,10 @@ define(["dojo/_base/xhr",
         "dojo/_base/connect",
         "qpid/common/properties",
         "dojox/html/entities",
-        "qpid/management/UserPreferences",
+        "qpid/common/util",
+        "dojo/text!showMessage.html",
         "dojo/domReady!"],
-    function (xhr, dom, construct, domClass, win, registry, parser, array, event, json, query, connect, properties, entities, UserPreferences) {
+    function (dom, construct, domClass, win, registry, parser, array, event, json, query, connect, properties, entities, util, template) {
 
 
         function encode(val){
@@ -89,7 +89,7 @@ define(["dojo/_base/xhr",
                                 }
                                 tableStr += "</table>";
                             } else if(domClass.contains(field,"datetime")) {
-                                field.innerHTML = UserPreferences.formatDateTime(val, {addOffset: true, appendTimeZone: true});
+                                field.innerHTML = showMessage.management.userPreferences.formatDateTime(val, {addOffset: true, appendTimeZone: true});
                             } else {
                                 field.innerHTML = encode(val);
                             }
@@ -100,16 +100,16 @@ define(["dojo/_base/xhr",
             var contentField = query(".message-content", this.dialogNode)[0];
 
             if(data.mimeType && data.mimeType.match(/text\/.*/)) {
-                xhr.get({url: "service/message-content/" + encodeURIComponent(showMessage.virtualhost)
+                showMessage.management.get({url: "service/message-content/" + encodeURIComponent(showMessage.virtualhost)
                                             + "/" + encodeURIComponent(showMessage.queue)
                                             + "/" + encodeURIComponent(showMessage.messageNumber),
-                                     sync: true
-
-                                    }).then(function(obj) { contentField.innerHTML = encode(obj) });
+                                            headers: { "Content-Type": "text/html"},
+                                            handleAs: "text"
+                                    }).then(function(obj) { contentField.innerHTML = encode(obj); }, util.xhrErrorHandler);
             } else {
-                contentField.innerHTML = "<a href=\"" + "service/message-content/" + encodeURIComponent(showMessage.virtualhost)
+                contentField.innerHTML = "<a href=\"" + showMessage.management.getFullUrl("service/message-content/" + encodeURIComponent(showMessage.virtualhost)
                                                             + "/" + encodeURIComponent(showMessage.queue)
-                                                            + "/" + encodeURIComponent(showMessage.messageNumber)
+                                                            + "/" + encodeURIComponent(showMessage.messageNumber))
                                         + "\" target=\"_blank\">Download</a>";
             }
             populatedFields.push(contentField);
@@ -117,26 +117,22 @@ define(["dojo/_base/xhr",
             registry.byId("showMessage").show();
         };
 
-        showMessage.show = function(obj) {
+        showMessage.show = function(management, obj) {
+            showMessage.management = management;
             showMessage.virtualhost = obj.virtualhost;
             showMessage.queue = obj.queue;
             showMessage.messageNumber = obj.messageNumber;
 
-            xhr.get({url: "service/message/" + encodeURIComponent(obj.virtualhost)
+            showMessage.management.get({url: "service/message/" + encodeURIComponent(obj.virtualhost)
                             + "/" + encodeURIComponent(obj.queue)
-                            + "/" + encodeURIComponent(obj.messageNumber),
-                     sync: properties.useSyncGet,
-                     handleAs: "json",
-                     load: this.populateShowMessage
-                    });
+                            + "/" + encodeURIComponent(obj.messageNumber)},
+                     showMessage.populateShowMessage, util.xhrErrorHandler
+                    );
         };
 
         var node = construct.create("div", null, win.body(), "last");
 
-        xhr.get({url: "showMessage.html",
-                 sync: true,
-                 load: showMessage.loadViewMessage
-                });
+        showMessage.loadViewMessage(template);
 
         return showMessage;
     });

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filekeystore/add.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filekeystore/add.js?rev=1677590&r1=1677589&r2=1677590&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filekeystore/add.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filekeystore/add.js Mon May  4 12:17:23 2015
@@ -23,17 +23,17 @@ define(["dojo/dom",
         "dojo/_base/array",
         "dijit/registry",
         "qpid/common/util",
-        "qpid/common/metadata",
         "dojo/parser",
         "dojo/text!store/filekeystore/add.html",
         "dojo/domReady!"],
-    function (dom, query, array, registry, util, metadata, parser, template)
+    function (dom, query, array, registry, util, parser, template)
     {
         var addKeyStore =
         {
             show: function(data)
             {
                 var that=this;
+                this.metadata = data.metadata;
                 this.containerNode = data.containerNode;
                 data.containerNode.innerHTML = template;
                 parser.parse(this.containerNode).then(function(instances)
@@ -51,12 +51,12 @@ define(["dojo/dom",
                         that.update(data.effectiveData);
                     }
 
-                    util.applyMetadataToWidgets(data.containerNode, "KeyStore", "FileKeyStore");
+                    util.applyMetadataToWidgets(data.containerNode, "KeyStore", "FileKeyStore", data.metadata);
                 });
             },
             update: function(effectiveData)
             {
-                var attributes = metadata.getMetaData("KeyStore", "FileKeyStore").attributes;
+                var attributes = this.metadata.getMetaData("KeyStore", "FileKeyStore").attributes;
                 var widgets = registry.findWidgets(this.containerNode);
                 array.forEach(widgets, function(item)
                     {

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filekeystore/show.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filekeystore/show.js?rev=1677590&r1=1677589&r2=1677590&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filekeystore/show.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filekeystore/show.js Mon May  4 12:17:23 2015
@@ -17,14 +17,14 @@
  * under the License.
  */
 
-define(["qpid/common/util", "qpid/common/metadata", "dojo/domReady!"],
-  function (util, metadata)
+define(["qpid/common/util", "dojo/domReady!"],
+  function (util)
   {
 
     function FileKeyStoreProvider(data)
     {
         this.fields = [];
-        var attributes = metadata.getMetaData("KeyStore", "FileKeyStore").attributes;
+        var attributes = data.parent.management.metadata.getMetaData("KeyStore", "FileKeyStore").attributes;
         for(var name in attributes)
         {
             this.fields.push(name);

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filetruststore/add.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filetruststore/add.js?rev=1677590&r1=1677589&r2=1677590&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filetruststore/add.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filetruststore/add.js Mon May  4 12:17:23 2015
@@ -23,17 +23,17 @@ define(["dojo/dom",
         "dojo/_base/array",
         "dijit/registry",
         "qpid/common/util",
-        "qpid/common/metadata",
         "dojo/parser",
         "dojo/text!store/filetruststore/add.html",
         "dojo/domReady!"],
-    function (dom, query, array, registry, util, metadata, parser, template)
+    function (dom, query, array, registry, util, parser, template)
     {
         var addTrustStore =
         {
             show: function(data)
             {
                 var that=this;
+                this.metadata = data.metadata;
                 this.containerNode = data.containerNode;
                 data.containerNode.innerHTML = template;
                 parser.parse(this.containerNode).then(function(instances)
@@ -52,12 +52,12 @@ define(["dojo/dom",
                         that.update(data.effectiveData);
                     }
 
-                    util.applyMetadataToWidgets(data.containerNode, "TrustStore", "FileTrustStore");
+                    util.applyMetadataToWidgets(data.containerNode, "TrustStore", "FileTrustStore", data.metadata);
                 });
             },
             update: function(effectiveData)
             {
-                var attributes = metadata.getMetaData("TrustStore", "FileTrustStore").attributes;
+                var attributes = this.metadata.getMetaData("TrustStore", "FileTrustStore").attributes;
                 var widgets = registry.findWidgets(this.containerNode);
                 array.forEach(widgets, function(item)
                     {

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filetruststore/show.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filetruststore/show.js?rev=1677590&r1=1677589&r2=1677590&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filetruststore/show.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filetruststore/show.js Mon May  4 12:17:23 2015
@@ -17,14 +17,14 @@
  * under the License.
  */
 
-define(["qpid/common/util", "qpid/common/metadata", "dojo/domReady!"],
-  function (util, metadata)
+define(["qpid/common/util", "dojo/domReady!"],
+  function (util)
   {
 
     function FileTrustStoreProvider(data)
     {
         this.fields = [];
-        var attributes = metadata.getMetaData("TrustStore", "FileTrustStore").attributes;
+        var attributes = data.parent.management.metadata.getMetaData("TrustStore", "FileTrustStore").attributes;
         for(var name in attributes)
         {
             this.fields.push(name);

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavakeystore/add.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavakeystore/add.js?rev=1677590&r1=1677589&r2=1677590&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavakeystore/add.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavakeystore/add.js Mon May  4 12:17:23 2015
@@ -23,18 +23,18 @@ define(["dojo/dom",
         "dojo/_base/array",
         "dijit/registry",
         "qpid/common/util",
-        "qpid/common/metadata",
         "dojo/parser",
         "dojo/text!store/nonjavakeystore/add.html",
         "qpid/common/ResourceWidget",
         "dojo/domReady!"],
-    function (dom, query, array, registry, util, metadata, parser, template)
+    function (dom, query, array, registry, util, parser, template)
     {
         var addKeyStore =
         {
             show: function(data)
             {
                 var that=this;
+                this.metadata=data.metadata;
                 this.containerNode = data.containerNode;
                 data.containerNode.innerHTML = template;
                 parser.parse(this.containerNode).then(function(instances)
@@ -52,12 +52,12 @@ define(["dojo/dom",
                         that.update(data.effectiveData);
                     }
 
-                    util.applyMetadataToWidgets(data.containerNode, "KeyStore", "NonJavaKeyStore");
+                    util.applyMetadataToWidgets(data.containerNode, "KeyStore", "NonJavaKeyStore", data.metadata);
                 });
             },
             update: function(effectiveData)
             {
-                var attributes = metadata.getMetaData("KeyStore", "NonJavaKeyStore").attributes;
+                var attributes = this.metadata.getMetaData("KeyStore", "NonJavaKeyStore").attributes;
                 var widgets = registry.findWidgets(this.containerNode);
                 array.forEach(widgets, function(item)
                     {

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavakeystore/show.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavakeystore/show.js?rev=1677590&r1=1677589&r2=1677590&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavakeystore/show.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavakeystore/show.js Mon May  4 12:17:23 2015
@@ -17,13 +17,13 @@
  * under the License.
  */
 
-define(["qpid/common/util", "qpid/common/metadata", "qpid/management/UserPreferences", "dojox/html/entities", "dojo/domReady!"],
-  function (util, metadata, UserPreferences, entities)
+define(["qpid/common/util", "dojox/html/entities", "dojo/domReady!"],
+  function (util, entities)
   {
 
-    function toDate(value)
+    function toDate(value, userPreferences)
     {
-        return value ? entities.encode(String(UserPreferences.formatDateTime(value, {addOffset: true, appendTimeZone: true}))) : "";
+        return value ? entities.encode(String(userPreferences.formatDateTime(value, {addOffset: true, appendTimeZone: true}))) : "";
     }
 
     var dateFields = ["certificateValidEnd","certificateValidStart"];
@@ -31,7 +31,8 @@ define(["qpid/common/util", "qpid/common
     function NonJavaKeyStore(data)
     {
         this.fields = [];
-        var attributes = metadata.getMetaData("KeyStore", "NonJavaKeyStore").attributes;
+        this.management = data.parent.management;
+        var attributes = this.management.metadata.getMetaData("KeyStore", "NonJavaKeyStore").attributes;
         for(var name in attributes)
         {
             if (dateFields.indexOf(name) == -1)
@@ -51,7 +52,7 @@ define(["qpid/common/util", "qpid/common
             for(var idx in dateFields)
             {
                 var name = dateFields[idx];
-                this[name].innerHTML = toDate(data[name]);
+                this[name].innerHTML = toDate(data[name], this.management.userPreferences);
             }
         }
     }

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavatruststore/add.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavatruststore/add.js?rev=1677590&r1=1677589&r2=1677590&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavatruststore/add.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavatruststore/add.js Mon May  4 12:17:23 2015
@@ -23,17 +23,17 @@ define(["dojo/dom",
         "dojo/_base/array",
         "dijit/registry",
         "qpid/common/util",
-        "qpid/common/metadata",
         "dojo/parser",
         "dojo/text!store/nonjavatruststore/add.html",
         "dojo/domReady!"],
-    function (dom, query, array, registry, util, metadata, parser, template)
+    function (dom, query, array, registry, util, parser, template)
     {
         var addKeyStore =
         {
             show: function(data)
             {
                 var that=this;
+                this.metadata = data.metadata
                 this.containerNode = data.containerNode;
                 data.containerNode.innerHTML = template;
                 parser.parse(this.containerNode).then(function(instances)
@@ -51,12 +51,12 @@ define(["dojo/dom",
                         that.update(data.effectiveData);
                     }
 
-                    util.applyMetadataToWidgets(data.containerNode, "TrustStore", "NonJavaTrustStore");
+                    util.applyMetadataToWidgets(data.containerNode, "TrustStore", "NonJavaTrustStore", data.metadata);
                 });
             },
             update: function(effectiveData)
             {
-                var attributes = metadata.getMetaData("TrustStore", "NonJavaTrustStore").attributes;
+                var attributes = this.metadata.getMetaData("TrustStore", "NonJavaTrustStore").attributes;
                 var widgets = registry.findWidgets(this.containerNode);
                 array.forEach(widgets, function(item)
                     {

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavatruststore/show.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavatruststore/show.js?rev=1677590&r1=1677589&r2=1677590&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavatruststore/show.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavatruststore/show.js Mon May  4 12:17:23 2015
@@ -19,19 +19,18 @@
 
 define(["dojo/query",
         "qpid/common/util",
-        "qpid/common/metadata",
         "dojox/grid/DataGrid",
         "qpid/common/UpdatableStore",
-        "qpid/management/UserPreferences",
         "dojo/domReady!"],
-  function (query, util, metadata, DataGrid, UpdatableStore, UserPreferences)
+  function (query, util, DataGrid, UpdatableStore)
   {
 
 
     function NonJavaTrustStore(data)
     {
         this.fields = [];
-        var attributes = metadata.getMetaData("TrustStore", "NonJavaTrustStore").attributes;
+        this.management = data.parent.management;
+        var attributes = this.management.metadata.getMetaData("TrustStore", "NonJavaTrustStore").attributes;
         for(var name in attributes)
         {
             this.fields.push(name);
@@ -40,7 +39,7 @@ define(["dojo/query",
         util.buildUI(data.containerNode, data.parent, "store/nonjavatruststore/show.html", this.fields, this, function()
         {
             var gridNode = query(".details", data.containerNode)[0];
-            var dateTimeFormatter = function(value){ return value ? UserPreferences.formatDateTime(value, {addOffset: true, appendTimeZone: true}) : "";};
+            var dateTimeFormatter = function(value){ return value ? that.management.userPreferences.formatDateTime(value, {addOffset: true, appendTimeZone: true}) : "";};
             that.detailsGrid = new UpdatableStore([],
                   gridNode,
                   [

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js?rev=1677590&r1=1677589&r2=1677590&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js Mon May  4 12:17:23 2015
@@ -18,20 +18,20 @@
  * under the License.
  *
  */
-define(["dojo/_base/xhr",
+define([
         "dojo/query",
         "dojo/io-query",
         "dijit/Tree",
         "qpid/common/util",
         "qpid/common/updater",
         "qpid/management/controller",
-        "qpid/management/UserPreferences",
         "dojo/ready",
         "dojo/domReady!"],
-       function (xhr, query, ioQuery, Tree, util, updater, controller, UserPreferences, ready) {
+       function (query, ioQuery, Tree, util, updater, controller, ready) {
 
-           function TreeViewModel(queryString) {
+           function TreeViewModel(queryString, management) {
                this.query = queryString;
+               this.management = management;
 
                this.onChildrenChange = function (parent, children) {
                    // fired when the set of children for an object change
@@ -299,39 +299,62 @@ define(["dojo/_base/xhr",
                }
            };
 
-           TreeViewModel.prototype.update = function () {
+           TreeViewModel.prototype.update = function (callback) {
                var thisObj = this;
 
-               xhr.get({url:this.query, sync: true, handleAs:"json"})
+               this.management.get({url: this.query})
                    .then(function (data) {
+                           try
+                           {
                              if (thisObj.model) {
                                  thisObj.updateModel(data);
                              }
                              else {
                                  thisObj.buildModel(data);
                              }
+
+                             if (callback)
+                             {
+                                callback();
+                             }
+                           }
+                           catch(e)
+                           {
+                             console.error(e);
+                           }
                          }, util.xhrErrorHandler);
 
            };
 
-           query('div[qpid-type="treeView"]').forEach(function(node, index, arr) {
-               var treeModel = new TreeViewModel("service/structure");
-               treeModel.update();
-               var tree = new Tree({ model: treeModel }, node);
-               tree.on("dblclick",
-                       function (object) {
-                           if (object && !object._dummyChild) {
-                               treeModel.relocate(object);
-                           }
 
-                       }, true);
-               tree.startup();
-               updater.add( treeModel );
+           TreeViewModel.create = function(structureUrl, management, node )
+           {
+               var treeModel = new TreeViewModel(structureUrl, management);
+               treeModel.update(function(){
+                    var tree = new Tree({ model: treeModel }, node);
+                    tree.on("dblclick",
+                           function (object) {
+                               if (object && !object._dummyChild) {
+                                   treeModel.relocate(object);
+                               }
+
+                           }, true);
+                    tree.startup();
+                    updater.add( treeModel );
+                    try
+                    {
+                        onReady();
+                    }
+                    catch(e)
+                    {
+                        console.error(e);
+                    }
+               });
 
-               ready(function() {
+               var onReady =function() {
                  controller.show("broker","");
 
-                 var tabs = UserPreferences.tabs;
+                 var tabs = management.userPreferences.tabs;
                  if (tabs)
                  {
                    for(var i in tabs)
@@ -348,7 +371,7 @@ define(["dojo/_base/xhr",
                          }
                          else
                          {
-                           UserPreferences.removeTab(tab);
+                           management.userPreferences.removeTab(tab);
                          }
                        }
                        else
@@ -358,8 +381,8 @@ define(["dojo/_base/xhr",
                      }
                    }
                  }
-             });
-           });
+             };
+           };
 
            return TreeViewModel;
        });
\ No newline at end of file

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/login.html
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/login.html?rev=1677590&r1=1677589&r2=1677590&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/login.html (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/login.html Mon May  4 12:17:23 2015
@@ -54,9 +54,7 @@
     </script>
 
     <script>
-          require(["dojo/_base/xhr",
-                   "dojo/parser",
-                   "dijit/form/Form",
+          require(["dijit/form/Form",
                    "dijit/form/Button",
                    "dijit/form/TextBox",
                    "dijit/form/ValidationTextBox",
@@ -83,16 +81,17 @@
                 <script type="dojo/on" data-dojo-event="submit" data-dojo-args="e">
                     e.preventDefault()
                     if(this.validate()){
-                        require(["qpid/authorization/sasl"], function(sasl){
+                        require(["qpid/authorization/sasl","qpid/management/Management"], function(sasl, Management){
+                            var management = new Management();
                             var redirectIfAuthenticated = function redirectIfAuthenticated(){
-                                sasl.getUser(function(data){
+                                sasl.getUser(management, function(data){
                                     if(data.user){
                                         window.location = "index.html";
                                     }
                                 });
                             };
 
-                            sasl.authenticate(dijit.byId("username").value, dijit.byId("password").value, redirectIfAuthenticated);
+                            sasl.authenticate(management, dijit.byId("username").value, dijit.byId("password").value, redirectIfAuthenticated);
                         });
                     }
                     return false;

Added: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/plugin/managementhttp/edit.html
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/plugin/managementhttp/edit.html?rev=1677590&view=auto
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/plugin/managementhttp/edit.html (added)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/plugin/managementhttp/edit.html Mon May  4 12:17:23 2015
@@ -0,0 +1,131 @@
+<!--
+  ~ 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 class="dijitHidden">
+    <div data-dojo-type="dijit/Dialog" data-dojo-props="title:'Edit HTTP Management Settings'" id="editHttpManagementDialog">
+        <form id="editHttpManagementForm" method="post" data-dojo-type="dijit/form/Form">
+                <div id="editHttpManagement.contentPane">
+                    <div class="editNoteBanner">NOTE: All changes will only take effect after Broker restart.</div>
+                    <div class="clear">
+                        <div class="formLabel-labelCell tableContainer-labelCell">Name*:</div>
+                        <div class="formLabel-controlCell tableContainer-valueCell">
+                            <input type="text" id="editHttpManagement.name"
+                                   data-dojo-type="dijit/form/ValidationTextBox"
+                                   data-dojo-props="
+                              name: 'name',
+                              placeHolder: 'name',
+                              required: true,
+                              disabled: true,
+                              title: 'Enter http management plugin name'" />
+                        </div>
+                    </div>
+
+                    <div class="clear">
+                        <div class="formLabel-labelCell tableContainer-labelCell">HTTP Basic Authentication Enabled:</div>
+                        <div class="tableContainer-valueCell formLabel-controlCell">
+                            <input type="checkbox" id="editHttpManagement.httpBasicAuthenticationEnabled"
+                                   data-dojo-type="dijit/form/CheckBox"
+                                   data-dojo-props="name: 'httpBasicAuthenticationEnabled'">
+                            </input>
+                            <div data-dojo-type="dijit/Tooltip"
+                                 data-dojo-props="connectId: ['editHttpManagement.httpBasicAuthenticationEnabled'],
+                                      label: 'If selected, it enables basic Authentication over HTTP'">
+                            </div>
+                        </div>
+                    </div>
+
+                    <div class="clear">
+                        <div class="formLabel-labelCell tableContainer-labelCell">HTTPS Basic Authentication Enabled:</div>
+                        <div class="tableContainer-valueCell formLabel-controlCell">
+                            <input type="checkbox" id="editHttpManagement.httpsBasicAuthenticationEnabled"
+                                   data-dojo-type="dijit/form/CheckBox"
+                                   data-dojo-props="name: 'httpsBasicAuthenticationEnabled'">
+                            </input>
+                            <div data-dojo-type="dijit/Tooltip"
+                                 data-dojo-props="connectId: ['editHttpManagement.httpsBasicAuthenticationEnabled'],
+                                      label: 'If selected, it enables basic Authentication over HTTPS'">
+                            </div>
+                        </div>
+                    </div>
+
+                    <div class="clear">
+                        <div class="formLabel-labelCell tableContainer-labelCell">HTTP SASL Authentication Enabled:</div>
+                        <div class="tableContainer-valueCell formLabel-controlCell">
+                            <input type="checkbox" id="editHttpManagement.httpSaslAuthenticationEnabled"
+                                   data-dojo-type="dijit/form/CheckBox"
+                                   data-dojo-props="name: 'httpSaslAuthenticationEnabled'">
+                            </input>
+                            <div data-dojo-type="dijit/Tooltip"
+                                 data-dojo-props="connectId: ['editHttpManagement.httpSaslAuthenticationEnabled'],
+                                      label: 'If selected, enables SASL Authentication over HTTP'">
+                            </div>
+                        </div>
+                    </div>
+
+                    <div class="clear">
+                        <div class="formLabel-labelCell tableContainer-labelCell">HTTPS SASL Authentication Enabled:</div>
+                        <div class="tableContainer-valueCell formLabel-controlCell">
+                            <input type="checkbox" id="editHttpManagement.httpsSaslAuthenticationEnabled"
+                                   data-dojo-type="dijit/form/CheckBox"
+                                   data-dojo-props="name: 'httpsSaslAuthenticationEnabled'">
+                            </input>
+                            <div data-dojo-type="dijit/Tooltip"
+                                 data-dojo-props="connectId: ['editHttpManagement.httpsSaslAuthenticationEnabled'],
+                                      label: 'If selected, enables SASL Authentication over HTTPS'">
+                            </div>
+                        </div>
+                    </div>
+
+                    <div class="clear">
+                        <div class="formLabel-labelCell tableContainer-labelCell">Session timeout (s)*:</div>
+                        <div class="formLabel-controlCell tableContainer-valueCell">
+                            <input type="text" id="editHttpManagement.sessionTimeout"
+                                   data-dojo-type="dijit/form/NumberSpinner"
+                                   data-dojo-props="
+                              name: 'sessionTimeout',
+                              placeHolder: 'sessionTimeout',
+                              required: false,
+                              disabled: false,
+                              invalidMessage: 'Invalid value',
+                              smallDelta: 1,
+                              constraints: {min:1,places:0, pattern: '#####'}," />
+                        </div>
+                    </div>
+
+                    <div class="clear">
+                        <div class="formLabel-labelCell tableContainer-labelCell">Compress responses:</div>
+                        <div class="tableContainer-valueCell formLabel-controlCell">
+                            <input type="checkbox" id="editHttpManagement.compressResponses"
+                                   data-dojo-type="dijit/form/CheckBox"
+                                   data-dojo-props="name: 'compressResponses'">
+                            </input>
+                            <div data-dojo-type="dijit/Tooltip"
+                                 data-dojo-props="connectId: ['editHttpManagement.compressResponses'],
+                                      label: 'If selected, enables compression of HTTP responses'">
+                            </div>
+                        </div>
+                    </div>
+
+                </div>
+                <div class="dijitDialogPaneActionBar qpidDialogPaneActionBar">
+                    <button data-dojo-type="dijit/form/Button" id="editHttpManagement.saveButton" data-dojo-props="label: 'Save'">Save</button>
+                    <button data-dojo-type="dijit/form/Button" id="editHttpManagement.cancelButton" data-dojo-props="label: 'Cancel'" ></button>
+                </div>
+        </form>
+    </div>
+</div>
\ No newline at end of file

Added: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/plugin/managementjmx/edit.html
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/plugin/managementjmx/edit.html?rev=1677590&view=auto
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/plugin/managementjmx/edit.html (added)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/plugin/managementjmx/edit.html Mon May  4 12:17:23 2015
@@ -0,0 +1,58 @@
+<!--
+  ~ 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 class="dijitHidden">
+    <div data-dojo-type="dijit/Dialog" data-dojo-props="title:'Edit JMX Management Settings'" id="editJmxManagementDialog">
+        <form id="editJmxManagementForm" method="post" data-dojo-type="dijit/form/Form">
+                <div id="editJmxManagement.contentPane">
+                    <div class="editNoteBanner">NOTE: All changes will only take effect after Broker restart.</div>
+                    <div class="clear">
+                        <div class="formLabel-labelCell tableContainer-labelCell">Name*:</div>
+                        <div class="formLabel-controlCell tableContainer-valueCell">
+                            <input type="text" id="editJmxManagement.name"
+                                   data-dojo-type="dijit/form/ValidationTextBox"
+                                   data-dojo-props="
+                              name: 'name',
+                              placeHolder: 'name',
+                              required: true,
+                              disabled: true,
+                              title: 'Enter jmx management plugin name'" />
+                        </div>
+                    </div>
+
+                    <div class="clear">
+                        <div class="formLabel-labelCell tableContainer-labelCell">Use Platform MBean Server:</div>
+                        <div class="tableContainer-valueCell formLabel-controlCell">
+                            <input type="checkbox" id="editJmxManagement.usePlatformMBeanServer"
+                                   data-dojo-type="dijit/form/CheckBox"
+                                   data-dojo-props="name: 'usePlatformMBeanServer'">
+                            </input>
+                            <div data-dojo-type="dijit/Tooltip"
+                                 data-dojo-props="connectId: ['editJmxManagement.usePlatformMBeanServer'],
+                                      label: 'If selected, JMX management uses platform MBeanServer'">
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div class="dijitDialogPaneActionBar qpidDialogPaneActionBar">
+                    <button data-dojo-type="dijit/form/Button" id="editJmxManagement.saveButton" data-dojo-props="label: 'Save'">Save</button>
+                    <button data-dojo-type="dijit/form/Button" id="editJmxManagement.cancelButton" data-dojo-props="label: 'Cancel'" ></button>
+                </div>
+        </form>
+    </div>
+</div>
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message