You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by lq...@apache.org on 2016/04/29 13:04:44 UTC

svn commit: r1741609 [19/31] - in /qpid/java/trunk: bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb/ bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb_ha/ bdbstore/src/main/java/resources/js/qpid/management/virtual...

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js Fri Apr 29 11:04:40 2016
@@ -18,8 +18,7 @@
  * under the License.
  *
  */
-define([
-        "dojo/_base/event",
+define(["dojo/_base/event",
         "dojo/_base/lang",
         "dojo/_base/array",
         "dojo/dom",
@@ -47,313 +46,363 @@ define([
         "dojox/validate/us",
         "dojox/validate/web",
         "dojo/domReady!"],
-  function (event, lang, array, dom, domConstruct, json, parser, Memory, win, on, fobject, registry, Dialog, Button, FilteringSelect, properties, util, template)
-  {
+       function (event, lang, array, dom, domConstruct, json, parser, Memory, win, on, fobject, registry, Dialog, Button, FilteringSelect, properties, util, template)
+       {
 
-    var addVirtualHostNodeAndVirtualHost =
-    {
-      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;
-        var virtualHostNodeName = registry.byId("addVirtualHostNode.nodeName");
-        virtualHostNodeName.set("regExpGen", util.nameOrContextVarRegexp);
-
-        // Readers are HTML5
-        this.reader = window.FileReader ? new FileReader() : undefined;
-
-        this.dialog = registry.byId("addVirtualHostNodeAndVirtualHost");
-        this.addButton = registry.byId("addVirtualHostNodeAndVirtualHost.addButton");
-        this.cancelButton = registry.byId("addVirtualHostNodeAndVirtualHost.cancelButton");
-        this.cancelButton.on("click", function(e){that._cancel(e);});
-        this.addButton.on("click", function(e){that._add(e);});
-
-        this.virtualHostNodeTypeFieldsContainer = dom.byId("addVirtualHostNode.typeFields");
-        this.virtualHostNodeSelectedFileContainer = dom.byId("addVirtualHostNode.selectedFile");
-        this.virtualHostNodeSelectedFileStatusContainer = dom.byId("addVirtualHostNode.selectedFileStatus");
-        this.virtualHostNodeUploadFields = dom.byId("addVirtualHostNode.uploadFields");
-        this.virtualHostNodeFileFields = dom.byId("addVirtualHostNode.fileFields");
-
-        this.virtualHostNodeForm = registry.byId("addVirtualHostNode.form");
-        this.virtualHostNodeType = registry.byId("addVirtualHostNode.type");
-        this.virtualHostNodeFileCheck = registry.byId("addVirtualHostNode.upload");
-        this.virtualHostNodeFile = registry.byId("addVirtualHostNode.file");
-
-        this.virtualHostNodeType.set("disabled", true);
-
-        this.virtualHostTypeFieldsContainer = dom.byId("addVirtualHost.typeFields");
-        this.virtualHostForm = registry.byId("addVirtualHost.form");
-        this.virtualHostType = registry.byId("addVirtualHost.type");
-
-        this.virtualHostType.set("disabled", true);
-
-        this.virtualHostNodeType.set("disabled", false);
-        this.virtualHostNodeType.on("change", function(type){that._vhnTypeChanged(type, that.virtualHostNodeTypeFieldsContainer, "qpid/management/virtualhostnode/");});
-
-        this.virtualHostType.set("disabled", true);
-        this.virtualHostType.on("change", function(type){that._vhTypeChanged(type, that.virtualHostTypeFieldsContainer, "qpid/management/virtualhost/");});
-
-        if (this.reader)
-        {
-          this.reader.onload = function(evt) {that._vhnUploadFileComplete(evt);};
-          this.reader.onerror = function(ex) {console.error("Failed to load JSON file", ex);};
-          this.virtualHostNodeFile.on("change",  function(selected){that._vhnFileChanged(selected)});
-          this.virtualHostNodeFileCheck.on("change",  function(selected){that._vhnFileFlagChanged(selected)});
-        }
-        else
-        {
-          // Fall back for IE8/9 which do not support FileReader
-          this.virtualHostNodeFileCheck.set("disabled", "disabled");
-          this.virtualHostNodeFileCheck.set("title", "Requires a more recent browser with HTML5 support");
-        }
-
-        this.virtualHostNodeUploadFields.style.display = "none";
-        this.virtualHostNodeFileFields.style.display = "none";
-      },
-      show: function(management)
-      {
-        this.management = management;
-        this.virtualHostNodeForm.reset();
-        this.virtualHostNodeType.set("value", null);
-
-        this.virtualHostForm.reset();
-        this.virtualHostType.set("value", null);
-
-        var supportedVirtualHostNodeTypes = management.metadata.getTypesForCategory("VirtualHostNode");
-        supportedVirtualHostNodeTypes.sort();
-
-        var virtualHostNodeTypeStore = util.makeTypeStore(supportedVirtualHostNodeTypes);
-        this.virtualHostNodeType.set("store", virtualHostNodeTypeStore);
-
-        if (!this.virtualHostNodeContext)
-        {
-                this.virtualHostNodeContext = new qpid.common.ContextVariablesEditor({name: 'context', title: 'Context variables'});
-                this.virtualHostNodeContext.placeAt(dom.byId("addVirtualHostNode.context"));
-                var that = this;
-                this.virtualHostNodeContext.on("change", function(value){
-                    var inherited = that.virtualHostContext.inheritedActualValues;
-                    var effective = that.virtualHostContext.effectiveValues;
-                    var actuals = that.virtualHostContext.value;
-                    for(var key in value)
-                    {
-                        var val = value[key];
-                        if (!(key in actuals))
-                        {
-                            inherited[key] = val;
-                            if (!(key in effective))
-                            {
-                                effective[key] = val.indexOf("${") == -1 ? val : "";
-                            }
-                        }
-                    }
-                    that.virtualHostContext.setData(that.virtualHostContext.value,effective,inherited);
-                });
-        }
-        if (!this.virtualHostContext)
-        {
-                this.virtualHostContext = new qpid.common.ContextVariablesEditor({name: 'context', title: 'Context variables'});
-                this.virtualHostContext.placeAt(dom.byId("addVirtualHost.context"));
-
-        }
-
-        var that = this;
-        management.load({ type: "broker"}).then(
-             function(effectiveData)
-             {
-                util.setContextData(that.virtualHostNodeContext, management, {type: "broker"}, {}, effectiveData[0],
-                     function()
-                     {
-                        that.virtualHostContext.setData({}, that.virtualHostNodeContext.effectiveValues,that.virtualHostNodeContext.inheritedActualValues);
-                     });
-             },
-             util.xhrErrorHandler);
-
-        this.dialog.show();
-        if (!this.resizeEventRegistered)
-        {
-            this.resizeEventRegistered = true;
-            util.resizeContentAreaAndRepositionDialog(dom.byId("addVirtualHostNodeAndVirtualHost.contentPane"), this.dialog);
-        }
-      },
-      destroy: function()
-      {
-        if (this.dialog)
-        {
-            this.dialog.destroyRecursive();
-            this.dialog = null;
-        }
-
-        if (this.containerNode)
-        {
-            domConstruct.destroy(this.containerNode);
-            this.containerNode = null;
-        }
-      },
-      _vhnTypeChanged: function (type, typeFieldsContainer, urlStem)
-      {
-        var validChildTypes = this.management ? this.management.metadata.validChildTypes("VirtualHostNode", type, "VirtualHost") : [];
-        validChildTypes.sort();
-
-        var virtualHostTypeStore = util.makeTypeStore( validChildTypes );
-
-        this.virtualHostType.set("store", virtualHostTypeStore);
-        this.virtualHostType.set("disabled", validChildTypes.length <= 1);
-        if (validChildTypes.length == 1)
-        {
-          this.virtualHostType.set("value", validChildTypes[0]);
-        }
-        else
-        {
-          this.virtualHostType.reset();
-        }
-
-        var vhnTypeSelected =  !(type == '');
-        this.virtualHostNodeUploadFields.style.display = vhnTypeSelected ? "block" : "none";
-
-        if (!vhnTypeSelected)
-        {
-          this._vhnFileFlagChanged(false);
-        }
-
-        this._typeChanged(type, typeFieldsContainer, urlStem, "VirtualHostNode");
-      },
-      _vhTypeChanged: function (type, typeFieldsContainer, urlStem)
-      {
-        this._typeChanged(type, typeFieldsContainer, urlStem, "VirtualHost");
-      },
-      _typeChanged: function (type, typeFieldsContainer, urlStem, category)
-      {
-          var widgets = registry.findWidgets(typeFieldsContainer);
-          array.forEach(widgets, function(item) { item.destroyRecursive();});
-          domConstruct.empty(typeFieldsContainer);
-          if (category)
-          {
-              var context = this["v" + category.substring(1) + "Context"];
-              if (context)
-              {
-                context.removeDynamicallyAddedInheritedContext();
-              }
-          }
-          if (type)
-          {
-            var that = this;
-            require([urlStem + type.toLowerCase() + "/add"],
-              function(typeUI)
-              {
-                  try
-                  {
-                      var metadata = that.management.metadata;
-                      typeUI.show({containerNode:typeFieldsContainer, parent: that, metadata:metadata});
-                      util.applyMetadataToWidgets(typeFieldsContainer,category, type, metadata);
-                  }
-                  catch(e)
-                  {
-                      console.warn(e);
-                  }
-              }
-            );
-          }
-      },
-      _vhnFileFlagChanged: function (selected)
-      {
-        this.virtualHostForm.domNode.style.display = selected ?  "none" : "block";
-        this.virtualHostNodeFileFields.style.display = selected ?  "block" : "none";
-        this.virtualHostType.set("required", !selected);
-        this.virtualHostNodeFile.reset();
-        this.virtualHostInitialConfiguration = undefined;
-        this.virtualHostNodeSelectedFileContainer.innerHTML = "";
-        this.virtualHostNodeSelectedFileStatusContainer.className = "";
-      },
-      _vhnFileChanged: function (evt)
-      {
-        // We only ever expect a single file
-        var file = this.virtualHostNodeFile.domNode.children[0].files[0];
-
-        this.addButton.set("disabled", true);
-        this.virtualHostNodeSelectedFileContainer.innerHTML = file.name;
-        this.virtualHostNodeSelectedFileStatusContainer.className = "loadingIcon";
-
-        console.log("Beginning to read file " + file.name);
-        this.reader.readAsDataURL(file);
-      },
-      _vhnUploadFileComplete: function(evt)
-      {
-        var reader = evt.target;
-        var result = reader.result;
-        console.log("File read complete, contents " + result);
-        this.virtualHostInitialConfiguration = result;
-        this.addButton.set("disabled", false);
-        this.virtualHostNodeSelectedFileStatusContainer.className = "loadedIcon";
-      },
-      _cancel: function(e)
-      {
-          util.abortReaderSafely(this.reader);
-          this.dialog.hide();
-      },
-      _add: function(e)
-      {
-        event.stop(e);
-        this._submit();
-      },
-      _submit: function()
-      {
-
-        var uploadVHConfig = this.virtualHostNodeFileCheck.get("checked");
-        var virtualHostNodeData = undefined;
-
-        if (uploadVHConfig && this.virtualHostNodeFile.getFileList().length > 0 && this.virtualHostNodeForm.validate())
-        {
-          // VH config is being uploaded
-          virtualHostNodeData = util.getFormWidgetValues(this.virtualHostNodeForm);
-          var virtualHostNodeContext = this.virtualHostNodeContext.get("value");
-          if (virtualHostNodeContext)
-          {
-            virtualHostNodeData["context"] = virtualHostNodeContext;
-          }
-
-          // Add the loaded virtualhost configuration
-          virtualHostNodeData["virtualHostInitialConfiguration"] = this.virtualHostInitialConfiguration;
-        }
-        else if (!uploadVHConfig && this.virtualHostNodeForm.validate() && this.virtualHostForm.validate())
-        {
-          virtualHostNodeData = util.getFormWidgetValues(this.virtualHostNodeForm);
-          var virtualHostNodeContext = this.virtualHostNodeContext.get("value");
-          if (virtualHostNodeContext)
-          {
-            virtualHostNodeData["context"] = virtualHostNodeContext;
-          }
-
-          var virtualHostData = util.getFormWidgetValues(this.virtualHostForm);
-          var virtualHostContext = this.virtualHostContext.get("value");
-          if (virtualHostContext)
-          {
-            virtualHostData["context"] = virtualHostContext;
-          }
-
-          //Default the VH name to be the same as the VHN name.
-          virtualHostData["name"] = virtualHostNodeData["name"];
-
-          virtualHostNodeData["virtualHostInitialConfiguration"] = json.stringify(virtualHostData)
-
-        }
-        else
-        {
-          alert('Form contains invalid data. Please correct first');
-          return;
-        }
-
-        var that = this;
-        that.management.create("virtualhostnode", {type: "broker"}, virtualHostNodeData).then(function(x){that.dialog.hide();});
-      }
-    };
-
-    addVirtualHostNodeAndVirtualHost.init();
-
-    return addVirtualHostNodeAndVirtualHost;
-  }
-);
+           var addVirtualHostNodeAndVirtualHost = {
+               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;
+                   var virtualHostNodeName = registry.byId("addVirtualHostNode.nodeName");
+                   virtualHostNodeName.set("regExpGen", util.nameOrContextVarRegexp);
+
+                   // Readers are HTML5
+                   this.reader = window.FileReader ? new FileReader() : undefined;
+
+                   this.dialog = registry.byId("addVirtualHostNodeAndVirtualHost");
+                   this.addButton = registry.byId("addVirtualHostNodeAndVirtualHost.addButton");
+                   this.cancelButton = registry.byId("addVirtualHostNodeAndVirtualHost.cancelButton");
+                   this.cancelButton.on("click", function (e)
+                   {
+                       that._cancel(e);
+                   });
+                   this.addButton.on("click", function (e)
+                   {
+                       that._add(e);
+                   });
+
+                   this.virtualHostNodeTypeFieldsContainer = dom.byId("addVirtualHostNode.typeFields");
+                   this.virtualHostNodeSelectedFileContainer = dom.byId("addVirtualHostNode.selectedFile");
+                   this.virtualHostNodeSelectedFileStatusContainer = dom.byId("addVirtualHostNode.selectedFileStatus");
+                   this.virtualHostNodeUploadFields = dom.byId("addVirtualHostNode.uploadFields");
+                   this.virtualHostNodeFileFields = dom.byId("addVirtualHostNode.fileFields");
+
+                   this.virtualHostNodeForm = registry.byId("addVirtualHostNode.form");
+                   this.virtualHostNodeType = registry.byId("addVirtualHostNode.type");
+                   this.virtualHostNodeFileCheck = registry.byId("addVirtualHostNode.upload");
+                   this.virtualHostNodeFile = registry.byId("addVirtualHostNode.file");
+
+                   this.virtualHostNodeType.set("disabled", true);
+
+                   this.virtualHostTypeFieldsContainer = dom.byId("addVirtualHost.typeFields");
+                   this.virtualHostForm = registry.byId("addVirtualHost.form");
+                   this.virtualHostType = registry.byId("addVirtualHost.type");
+
+                   this.virtualHostType.set("disabled", true);
+
+                   this.virtualHostNodeType.set("disabled", false);
+                   this.virtualHostNodeType.on("change", function (type)
+                   {
+                       that._vhnTypeChanged(type,
+                                            that.virtualHostNodeTypeFieldsContainer,
+                                            "qpid/management/virtualhostnode/");
+                   });
+
+                   this.virtualHostType.set("disabled", true);
+                   this.virtualHostType.on("change", function (type)
+                   {
+                       that._vhTypeChanged(type, that.virtualHostTypeFieldsContainer, "qpid/management/virtualhost/");
+                   });
+
+                   if (this.reader)
+                   {
+                       this.reader.onload = function (evt)
+                       {
+                           that._vhnUploadFileComplete(evt);
+                       };
+                       this.reader.onerror = function (ex)
+                       {
+                           console.error("Failed to load JSON file", ex);
+                       };
+                       this.virtualHostNodeFile.on("change", function (selected)
+                       {
+                           that._vhnFileChanged(selected)
+                       });
+                       this.virtualHostNodeFileCheck.on("change", function (selected)
+                       {
+                           that._vhnFileFlagChanged(selected)
+                       });
+                   }
+                   else
+                   {
+                       // Fall back for IE8/9 which do not support FileReader
+                       this.virtualHostNodeFileCheck.set("disabled", "disabled");
+                       this.virtualHostNodeFileCheck.set("title", "Requires a more recent browser with HTML5 support");
+                   }
+
+                   this.virtualHostNodeUploadFields.style.display = "none";
+                   this.virtualHostNodeFileFields.style.display = "none";
+               },
+               show: function (management)
+               {
+                   this.management = management;
+                   this.virtualHostNodeForm.reset();
+                   this.virtualHostNodeType.set("value", null);
+
+                   this.virtualHostForm.reset();
+                   this.virtualHostType.set("value", null);
+
+                   var supportedVirtualHostNodeTypes = management.metadata.getTypesForCategory("VirtualHostNode");
+                   supportedVirtualHostNodeTypes.sort();
+
+                   var virtualHostNodeTypeStore = util.makeTypeStore(supportedVirtualHostNodeTypes);
+                   this.virtualHostNodeType.set("store", virtualHostNodeTypeStore);
+
+                   if (!this.virtualHostNodeContext)
+                   {
+                       this.virtualHostNodeContext = new qpid.common.ContextVariablesEditor({
+                           name: 'context',
+                           title: 'Context variables'
+                       });
+                       this.virtualHostNodeContext.placeAt(dom.byId("addVirtualHostNode.context"));
+                       var that = this;
+                       this.virtualHostNodeContext.on("change", function (value)
+                       {
+                           var inherited = that.virtualHostContext.inheritedActualValues;
+                           var effective = that.virtualHostContext.effectiveValues;
+                           var actuals = that.virtualHostContext.value;
+                           for (var key in value)
+                           {
+                               var val = value[key];
+                               if (!(key in actuals))
+                               {
+                                   inherited[key] = val;
+                                   if (!(key in effective))
+                                   {
+                                       effective[key] = val.indexOf("${") == -1 ? val : "";
+                                   }
+                               }
+                           }
+                           that.virtualHostContext.setData(that.virtualHostContext.value, effective, inherited);
+                       });
+                   }
+                   if (!this.virtualHostContext)
+                   {
+                       this.virtualHostContext = new qpid.common.ContextVariablesEditor({
+                           name: 'context',
+                           title: 'Context variables'
+                       });
+                       this.virtualHostContext.placeAt(dom.byId("addVirtualHost.context"));
+
+                   }
+
+                   var that = this;
+                   management.load({type: "broker"}).then(function (effectiveData)
+                                                          {
+                                                              util.setContextData(that.virtualHostNodeContext,
+                                                                                  management,
+                                                                                  {type: "broker"},
+                                                                                  {},
+                                                                                  effectiveData[0],
+                                                                                  function ()
+                                                                                  {
+                                                                                      that.virtualHostContext.setData({},
+                                                                                                                      that.virtualHostNodeContext.effectiveValues,
+                                                                                                                      that.virtualHostNodeContext.inheritedActualValues);
+                                                                                  });
+                                                          }, util.xhrErrorHandler);
+
+                   this.dialog.show();
+                   if (!this.resizeEventRegistered)
+                   {
+                       this.resizeEventRegistered = true;
+                       util.resizeContentAreaAndRepositionDialog(dom.byId("addVirtualHostNodeAndVirtualHost.contentPane"),
+                                                                 this.dialog);
+                   }
+               },
+               destroy: function ()
+               {
+                   if (this.dialog)
+                   {
+                       this.dialog.destroyRecursive();
+                       this.dialog = null;
+                   }
+
+                   if (this.containerNode)
+                   {
+                       domConstruct.destroy(this.containerNode);
+                       this.containerNode = null;
+                   }
+               },
+               _vhnTypeChanged: function (type, typeFieldsContainer, urlStem)
+               {
+                   var validChildTypes = this.management ? this.management.metadata.validChildTypes("VirtualHostNode",
+                                                                                                    type,
+                                                                                                    "VirtualHost") : [];
+                   validChildTypes.sort();
+
+                   var virtualHostTypeStore = util.makeTypeStore(validChildTypes);
+
+                   this.virtualHostType.set("store", virtualHostTypeStore);
+                   this.virtualHostType.set("disabled", validChildTypes.length <= 1);
+                   if (validChildTypes.length == 1)
+                   {
+                       this.virtualHostType.set("value", validChildTypes[0]);
+                   }
+                   else
+                   {
+                       this.virtualHostType.reset();
+                   }
+
+                   var vhnTypeSelected = !(type == '');
+                   this.virtualHostNodeUploadFields.style.display = vhnTypeSelected ? "block" : "none";
+
+                   if (!vhnTypeSelected)
+                   {
+                       this._vhnFileFlagChanged(false);
+                   }
+
+                   this._typeChanged(type, typeFieldsContainer, urlStem, "VirtualHostNode");
+               },
+               _vhTypeChanged: function (type, typeFieldsContainer, urlStem)
+               {
+                   this._typeChanged(type, typeFieldsContainer, urlStem, "VirtualHost");
+               },
+               _typeChanged: function (type, typeFieldsContainer, urlStem, category)
+               {
+                   var widgets = registry.findWidgets(typeFieldsContainer);
+                   array.forEach(widgets, function (item)
+                   {
+                       item.destroyRecursive();
+                   });
+                   domConstruct.empty(typeFieldsContainer);
+                   if (category)
+                   {
+                       var context = this["v" + category.substring(1) + "Context"];
+                       if (context)
+                       {
+                           context.removeDynamicallyAddedInheritedContext();
+                       }
+                   }
+                   if (type)
+                   {
+                       var that = this;
+                       require([urlStem + type.toLowerCase() + "/add"], function (typeUI)
+                       {
+                           try
+                           {
+                               var metadata = that.management.metadata;
+                               typeUI.show({
+                                               containerNode: typeFieldsContainer,
+                                               parent: that,
+                                               metadata: metadata
+                                           });
+                               util.applyMetadataToWidgets(typeFieldsContainer, category, type, metadata);
+                           }
+                           catch (e)
+                           {
+                               console.warn(e);
+                           }
+                       });
+                   }
+               },
+               _vhnFileFlagChanged: function (selected)
+               {
+                   this.virtualHostForm.domNode.style.display = selected ? "none" : "block";
+                   this.virtualHostNodeFileFields.style.display = selected ? "block" : "none";
+                   this.virtualHostType.set("required", !selected);
+                   this.virtualHostNodeFile.reset();
+                   this.virtualHostInitialConfiguration = undefined;
+                   this.virtualHostNodeSelectedFileContainer.innerHTML = "";
+                   this.virtualHostNodeSelectedFileStatusContainer.className = "";
+               },
+               _vhnFileChanged: function (evt)
+               {
+                   // We only ever expect a single file
+                   var file = this.virtualHostNodeFile.domNode.children[0].files[0];
+
+                   this.addButton.set("disabled", true);
+                   this.virtualHostNodeSelectedFileContainer.innerHTML = file.name;
+                   this.virtualHostNodeSelectedFileStatusContainer.className = "loadingIcon";
+
+                   console.log("Beginning to read file " + file.name);
+                   this.reader.readAsDataURL(file);
+               },
+               _vhnUploadFileComplete: function (evt)
+               {
+                   var reader = evt.target;
+                   var result = reader.result;
+                   console.log("File read complete, contents " + result);
+                   this.virtualHostInitialConfiguration = result;
+                   this.addButton.set("disabled", false);
+                   this.virtualHostNodeSelectedFileStatusContainer.className = "loadedIcon";
+               },
+               _cancel: function (e)
+               {
+                   util.abortReaderSafely(this.reader);
+                   this.dialog.hide();
+               },
+               _add: function (e)
+               {
+                   event.stop(e);
+                   this._submit();
+               },
+               _submit: function ()
+               {
+
+                   var uploadVHConfig = this.virtualHostNodeFileCheck.get("checked");
+                   var virtualHostNodeData = undefined;
+
+                   if (uploadVHConfig && this.virtualHostNodeFile.getFileList().length > 0
+                       && this.virtualHostNodeForm.validate())
+                   {
+                       // VH config is being uploaded
+                       virtualHostNodeData = util.getFormWidgetValues(this.virtualHostNodeForm);
+                       var virtualHostNodeContext = this.virtualHostNodeContext.get("value");
+                       if (virtualHostNodeContext)
+                       {
+                           virtualHostNodeData["context"] = virtualHostNodeContext;
+                       }
+
+                       // Add the loaded virtualhost configuration
+                       virtualHostNodeData["virtualHostInitialConfiguration"] = this.virtualHostInitialConfiguration;
+                   }
+                   else if (!uploadVHConfig && this.virtualHostNodeForm.validate() && this.virtualHostForm.validate())
+                   {
+                       virtualHostNodeData = util.getFormWidgetValues(this.virtualHostNodeForm);
+                       var virtualHostNodeContext = this.virtualHostNodeContext.get("value");
+                       if (virtualHostNodeContext)
+                       {
+                           virtualHostNodeData["context"] = virtualHostNodeContext;
+                       }
+
+                       var virtualHostData = util.getFormWidgetValues(this.virtualHostForm);
+                       var virtualHostContext = this.virtualHostContext.get("value");
+                       if (virtualHostContext)
+                       {
+                           virtualHostData["context"] = virtualHostContext;
+                       }
+
+                       //Default the VH name to be the same as the VHN name.
+                       virtualHostData["name"] = virtualHostNodeData["name"];
+
+                       virtualHostNodeData["virtualHostInitialConfiguration"] = json.stringify(virtualHostData)
+
+                   }
+                   else
+                   {
+                       alert('Form contains invalid data. Please correct first');
+                       return;
+                   }
+
+                   var that = this;
+                   that.management.create("virtualhostnode", {type: "broker"}, virtualHostNodeData).then(function (x)
+                                                                                                         {
+                                                                                                             that.dialog.hide();
+                                                                                                         });
+               }
+           };
+
+           addVirtualHostNodeAndVirtualHost.init();
+
+           return addVirtualHostNodeAndVirtualHost;
+       });

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/PrincipalDatabaseAuthenticationManager.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/PrincipalDatabaseAuthenticationManager.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/PrincipalDatabaseAuthenticationManager.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/PrincipalDatabaseAuthenticationManager.js Fri Apr 29 11:04:40 2016
@@ -36,223 +36,259 @@ define(["dojo/dom",
         "dojo/text!authenticationprovider/setPassword.html",
         "dojox/grid/enhanced/plugins/Pagination",
         "dojox/grid/enhanced/plugins/IndirectSelection",
-        "dojox/validate/us", "dojox/validate/web",
+        "dojox/validate/us",
+        "dojox/validate/web",
         "dijit/Dialog",
         "dijit/form/TextBox",
         "dijit/form/ValidationTextBox",
-        "dijit/form/TimeTextBox", "dijit/form/Button",
+        "dijit/form/TimeTextBox",
+        "dijit/form/Button",
         "dijit/form/Form",
         "dijit/form/DateTextBox",
         "dojo/domReady!"],
-    function (dom, parser, query, construct, connect, win, event, json, registry, util, properties, UpdatableStore, EnhancedGrid, template, addUserTemplate, setPasswordTemplate) {
-        function DatabaseAuthManager(containerNode, authProviderObj, controller) {
-            var node = construct.create("div", null, containerNode, "last");
-            var that = this;
-            this.name = authProviderObj.name;
-            this.modelObj = authProviderObj;
-            this.management = controller.management;
-            node.innerHTML = template;
-            parser.parse(node).then(function(instances)
-            {
-                that.init(node, authProviderObj, controller);
-            });
-        }
-
-        DatabaseAuthManager.prototype.update = function() {
-            this.authDatabaseUpdater.update();
-        };
-
-        DatabaseAuthManager.prototype.close = function() {
-            updater.remove( this.authDatabaseUpdater );
-        };
-
-        DatabaseAuthManager.prototype.init = function(node, authProviderObj, controller)
-        {
-            this.controller = controller;
-            var that = this;
-
-                     that.authProviderData = {};
-
-                     var userDiv = query(".users")[0];
-
-                     var gridProperties = {
-                                            height: 400,
-                                            keepSelection: true,
-                                            plugins: {
-                                                      pagination: {
-                                                          pageSizes: ["10", "25", "50", "100"],
-                                                          description: true,
-                                                          sizeSwitch: true,
-                                                          pageStepper: true,
-                                                          gotoButton: true,
-                                                          maxPageStep: 4,
-                                                          position: "bottom"
-                                                      },
-                                                      indirectSelection: true
-
-                                             }};
-
-
-                     that.usersGrid =
-                        new UpdatableStore(that.authProviderData.users, userDiv,
-                                        [ { name: "User Name",    field: "name",      width: "100%" }
-                                        ], function(obj) {
-                                                connect.connect(obj.grid, "onRowDblClick", obj.grid,
-                                                function(evt){
-                                                    var idx = evt.rowIndex,
-                                                    theItem = this.getItem(idx);
-                                                    var name = obj.dataStore.getValue(theItem,"name");
-                                                    var id = obj.dataStore.getValue(theItem,"id");
-                                                    setPassword.show(that.management, that.modelObj, {name: name, id: id});
-                                                });
-                                        }, gridProperties, EnhancedGrid);
-
-
-                     var addUserButton = query(".addUserButton", node)[0];
-                     connect.connect(registry.byNode(addUserButton), "onClick", function(evt){ addUser.show(that.management, that.modelObj) });
-
-                     var deleteUserButton = query(".deleteUserButton", node)[0];
-                     var deleteWidget = registry.byNode(deleteUserButton);
-                     connect.connect(deleteWidget, "onClick",
-                                    function(evt){
-                                        event.stop(evt);
-                                        that.deleteUsers();
-                                    });
-}
-
-        DatabaseAuthManager.prototype.deleteUsers = function()
-        {
-            var grid = this.usersGrid.grid;
-            var data = grid.selection.getSelected();
-            if(data.length) {
-                var that = this;
-                if(confirm("Delete " + data.length + " users?")) {
-                    var i;
-                    var parameters ={id:[]};
-                    for(i = 0; i<data.length; i++) {
-                        parameters.id.push(data[i].id);
-                    }
-
-                    that.success = true
-                    this.management.remove({type: "user", parent: this.modelObj}, parameters).then(
-                        function(data) {
-                            grid.setQuery({id: "*"});
-                            grid.selection.deselectAll();
-                        },
-                        util.xhrErrorHandler);
-                }
-}
-        };
-
-        DatabaseAuthManager.prototype.update = function(data)
-        {
-            this.authProviderData = data;
-            this.name = data.name
-            this.usersGrid.update(this.authProviderData.users);
-        };
-
-        var addUser = {};
-
-        var node = construct.create("div", null, win.body(), "last");
-
-        var convertToUser = function convertToUser(formValues) {
-                var newUser = {};
-                newUser.name = formValues.name;
-                for(var propName in formValues)
-                {
-                    if(formValues.hasOwnProperty(propName)) {
-                            if(formValues[ propName ] !== "") {
-                                newUser[ propName ] = formValues[propName];
-                            }
-                    }
-                }
-
-                return newUser;
-            };
-
-
-        node.innerHTML = addUserTemplate;
-        addUser.dialogNode = dom.byId("addUser");
-        parser.parse(node).then(
-                function(instances)
-                {
-                            var theForm;
-                            theForm = registry.byId("formAddUser");
-                            theForm.on("submit", function(e) {
-
-                                event.stop(e);
-                                if(theForm.validate()){
-
-                                    var newUser = convertToUser(theForm.getValues());
-
-                                    addUser.management.create("user", addUser.authProvider, newUser).then(function(x){registry.byId("addUser").hide();});
-                                    return false;
-
-
-                                }else{
-                                    alert('Form contains invalid data.  Please correct first');
-                                    return false;
-                                }
-
-                            });
-                });
-
-        addUser.show = function(management, authProvider) {
-            addUser.management=management;
-            addUser.authProvider = authProvider;
-            registry.byId("formAddUser").reset();
-            registry.byId("addUser").show();
-        };
-
-
-        var setPassword = {};
-
-        var setPasswordNode = construct.create("div", null, win.body(), "last");
-
-        setPasswordNode.innerHTML = setPasswordTemplate;
-        setPassword.dialogNode = dom.byId("setPassword");
-        parser.parse(setPasswordNode).then(
-                function(instances)
-                {
-                    var theForm = registry.byId("formSetPassword");
-                    theForm.on("submit", function(e) {
-
-                        event.stop(e);
-                        if(theForm.validate()){
-
-                            var newUser = convertToUser(theForm.getValues());
-                            newUser.name = setPassword.name;
-                            newUser.id = setPassword.id;
-
-                            var model = {type: "user", name: setPassword.name, parent: setPassword.authProvider};
-                            setPassword.management.update(model, newUser).then(function(x){registry.byId("setPassword").hide();});
-                            return false;
-
-
-                        }else{
-                            alert('Form contains invalid data.  Please correct first');
-                            return false;
-                        }
-
-                    });
-                });
-
-        setPassword.show = function(management, authProvider, user) {
-            setPassword.management = management;
-            setPassword.authProvider = authProvider;
-            setPassword.name = user.name;
-            setPassword.id = user.id;
-            registry.byId("formSetPassword").reset();
-
-            var namebox = registry.byId("formSetPassword.name");
-            namebox.set("value", user.name);
-            namebox.set("disabled", true);
+       function (dom, parser, query, construct, connect, win, event, json, registry, util, properties, UpdatableStore, EnhancedGrid, template, addUserTemplate, setPasswordTemplate)
+       {
+           function DatabaseAuthManager(containerNode, authProviderObj, controller)
+           {
+               var node = construct.create("div", null, containerNode, "last");
+               var that = this;
+               this.name = authProviderObj.name;
+               this.modelObj = authProviderObj;
+               this.management = controller.management;
+               node.innerHTML = template;
+               parser.parse(node).then(function (instances)
+                                       {
+                                           that.init(node, authProviderObj, controller);
+                                       });
+           }
+
+           DatabaseAuthManager.prototype.update = function ()
+           {
+               this.authDatabaseUpdater.update();
+           };
+
+           DatabaseAuthManager.prototype.close = function ()
+           {
+               updater.remove(this.authDatabaseUpdater);
+           };
+
+           DatabaseAuthManager.prototype.init = function (node, authProviderObj, controller)
+           {
+               this.controller = controller;
+               var that = this;
+
+               that.authProviderData = {};
+
+               var userDiv = query(".users")[0];
+
+               var gridProperties = {
+                   height: 400,
+                   keepSelection: true,
+                   plugins: {
+                       pagination: {
+                           pageSizes: ["10", "25", "50", "100"],
+                           description: true,
+                           sizeSwitch: true,
+                           pageStepper: true,
+                           gotoButton: true,
+                           maxPageStep: 4,
+                           position: "bottom"
+                       },
+                       indirectSelection: true
+
+                   }
+               };
+
+               that.usersGrid = new UpdatableStore(that.authProviderData.users, userDiv, [{
+                   name: "User Name",
+                   field: "name",
+                   width: "100%"
+               }], function (obj)
+               {
+                   connect.connect(obj.grid, "onRowDblClick", obj.grid, function (evt)
+                   {
+                       var idx = evt.rowIndex, theItem = this.getItem(idx);
+                       var name = obj.dataStore.getValue(theItem, "name");
+                       var id = obj.dataStore.getValue(theItem, "id");
+                       setPassword.show(that.management,
+                                        that.modelObj,
+                                        {
+                                            name: name,
+                                            id: id
+                                        });
+                   });
+               }, gridProperties, EnhancedGrid);
+
+               var addUserButton = query(".addUserButton", node)[0];
+               connect.connect(registry.byNode(addUserButton), "onClick", function (evt)
+               {
+                   addUser.show(that.management, that.modelObj)
+               });
+
+               var deleteUserButton = query(".deleteUserButton", node)[0];
+               var deleteWidget = registry.byNode(deleteUserButton);
+               connect.connect(deleteWidget, "onClick", function (evt)
+               {
+                   event.stop(evt);
+                   that.deleteUsers();
+               });
+           }
+
+           DatabaseAuthManager.prototype.deleteUsers = function ()
+           {
+               var grid = this.usersGrid.grid;
+               var data = grid.selection.getSelected();
+               if (data.length)
+               {
+                   var that = this;
+                   if (confirm("Delete " + data.length + " users?"))
+                   {
+                       var i;
+                       var parameters = {id: []};
+                       for (i = 0; i < data.length; i++)
+                       {
+                           parameters.id.push(data[i].id);
+                       }
+
+                       that.success = true
+                       this.management.remove({
+                                                  type: "user",
+                                                  parent: this.modelObj
+                                              }, parameters).then(function (data)
+                                                                  {
+                                                                      grid.setQuery({id: "*"});
+                                                                      grid.selection.deselectAll();
+                                                                  }, util.xhrErrorHandler);
+                   }
+               }
+           };
+
+           DatabaseAuthManager.prototype.update = function (data)
+           {
+               this.authProviderData = data;
+               this.name = data.name
+               this.usersGrid.update(this.authProviderData.users);
+           };
+
+           var addUser = {};
+
+           var node = construct.create("div", null, win.body(), "last");
+
+           var convertToUser = function convertToUser(formValues)
+           {
+               var newUser = {};
+               newUser.name = formValues.name;
+               for (var propName in formValues)
+               {
+                   if (formValues.hasOwnProperty(propName))
+                   {
+                       if (formValues[propName] !== "")
+                       {
+                           newUser[propName] = formValues[propName];
+                       }
+                   }
+               }
+
+               return newUser;
+           };
+
+           node.innerHTML = addUserTemplate;
+           addUser.dialogNode = dom.byId("addUser");
+           parser.parse(node).then(function (instances)
+                                   {
+                                       var theForm;
+                                       theForm = registry.byId("formAddUser");
+                                       theForm.on("submit", function (e)
+                                       {
+
+                                           event.stop(e);
+                                           if (theForm.validate())
+                                           {
+
+                                               var newUser = convertToUser(theForm.getValues());
+
+                                               addUser.management.create("user", addUser.authProvider, newUser)
+                                                      .then(function (x)
+                                                            {
+                                                                registry.byId("addUser").hide();
+                                                            });
+                                               return false;
+
+                                           }
+                                           else
+                                           {
+                                               alert('Form contains invalid data.  Please correct first');
+                                               return false;
+                                           }
+
+                                       });
+                                   });
+
+           addUser.show = function (management, authProvider)
+           {
+               addUser.management = management;
+               addUser.authProvider = authProvider;
+               registry.byId("formAddUser").reset();
+               registry.byId("addUser").show();
+           };
+
+           var setPassword = {};
+
+           var setPasswordNode = construct.create("div", null, win.body(), "last");
+
+           setPasswordNode.innerHTML = setPasswordTemplate;
+           setPassword.dialogNode = dom.byId("setPassword");
+           parser.parse(setPasswordNode).then(function (instances)
+                                              {
+                                                  var theForm = registry.byId("formSetPassword");
+                                                  theForm.on("submit", function (e)
+                                                  {
+
+                                                      event.stop(e);
+                                                      if (theForm.validate())
+                                                      {
+
+                                                          var newUser = convertToUser(theForm.getValues());
+                                                          newUser.name = setPassword.name;
+                                                          newUser.id = setPassword.id;
+
+                                                          var model = {
+                                                              type: "user",
+                                                              name: setPassword.name,
+                                                              parent: setPassword.authProvider
+                                                          };
+                                                          setPassword.management.update(model, newUser)
+                                                                     .then(function (x)
+                                                                           {
+                                                                               registry.byId("setPassword").hide();
+                                                                           });
+                                                          return false;
+
+                                                      }
+                                                      else
+                                                      {
+                                                          alert('Form contains invalid data.  Please correct first');
+                                                          return false;
+                                                      }
+
+                                                  });
+                                              });
+
+           setPassword.show = function (management, authProvider, user)
+           {
+               setPassword.management = management;
+               setPassword.authProvider = authProvider;
+               setPassword.name = user.name;
+               setPassword.id = user.id;
+               registry.byId("formSetPassword").reset();
+
+               var namebox = registry.byId("formSetPassword.name");
+               namebox.set("value", user.name);
+               namebox.set("disabled", true);
 
-            registry.byId("setPassword").show();
+               registry.byId("setPassword").show();
 
-        };
+           };
 
-
-
-        return DatabaseAuthManager;
-    });
+           return DatabaseAuthManager;
+       });

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/anonymous/add.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/anonymous/add.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/anonymous/add.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/anonymous/add.js Fri Apr 29 11:04:40 2016
@@ -18,4 +18,11 @@
  * under the License.
  *
  */
-define([], function () { return { show: function(data){} }; });
+define([], function ()
+{
+    return {
+        show: function (data)
+        {
+        }
+    };
+});

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/anonymous/show.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/anonymous/show.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/anonymous/show.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/anonymous/show.js Fri Apr 29 11:04:40 2016
@@ -18,18 +18,16 @@
  * under the License.
  *
  */
-define([],
-  function ()
-  {
+define([], function ()
+{
 
     function NoFieldAuthenticationProvider(data)
     {
     }
 
-    NoFieldAuthenticationProvider.prototype.update = function(data)
+    NoFieldAuthenticationProvider.prototype.update = function (data)
     {
     }
 
     return NoFieldAuthenticationProvider;
-  }
-);
+});

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/add.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/add.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/add.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/add.js Fri Apr 29 11:04:40 2016
@@ -18,23 +18,20 @@
  * under the License.
  *
  */
-define(["dojo/query","dijit/registry","qpid/common/util"],
-    function (query, registry, util)
-    {
-        return {
-            show: function(data)
+define(["dojo/query", "dijit/registry", "qpid/common/util"], function (query, registry, util)
+{
+    return {
+        show: function (data)
+        {
+            util.parseHtmlIntoDiv(data.containerNode, "authenticationprovider/filebased/add.html", function ()
             {
-                util.parseHtmlIntoDiv(data.containerNode, "authenticationprovider/filebased/add.html",
-                function()
+                if (data.data)
                 {
-                    if (data.data)
-                    {
-                        var path = registry.byNode(query(".path", data.containerNode)[0]);
-                        path.set("value", data.data.path);
-                    }
-                });
-            }
-        };
-    }
-);
+                    var path = registry.byNode(query(".path", data.containerNode)[0]);
+                    path.set("value", data.data.path);
+                }
+            });
+        }
+    };
+});
 

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/show.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/show.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/show.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/show.js Fri Apr 29 11:04:40 2016
@@ -18,20 +18,18 @@
  * under the License.
  *
  */
-define(["qpid/common/util", "dojo/domReady!"],
-  function (util)
-  {
+define(["qpid/common/util", "dojo/domReady!"], function (util)
+{
 
     function Base64MD5PasswordFile(data)
     {
         util.buildUI(data.containerNode, data.parent, "authenticationprovider/filebased/show.html", ["path"], this);
     }
 
-    Base64MD5PasswordFile.prototype.update = function(data)
+    Base64MD5PasswordFile.prototype.update = function (data)
     {
         util.updateUI(data, ["path"], this);
     }
 
     return Base64MD5PasswordFile;
-  }
-);
+});

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/external/add.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/external/add.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/external/add.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/external/add.js Fri Apr 29 11:04:40 2016
@@ -18,24 +18,21 @@
  * under the License.
  *
  */
-define(["dojo/query","dijit/registry","qpid/common/util"],
-    function (query, registry, util)
-    {
-        return {
-            show: function(data)
+define(["dojo/query", "dijit/registry", "qpid/common/util"], function (query, registry, util)
+{
+    return {
+        show: function (data)
+        {
+            util.parseHtmlIntoDiv(data.containerNode, "authenticationprovider/external/add.html", function ()
             {
-                util.parseHtmlIntoDiv(data.containerNode, "authenticationprovider/external/add.html",
-                function()
+                if (data.data)
                 {
-                    if (data.data)
-                    {
-                        var useFullDN = registry.byNode(query(".useFullDN", data.containerNode)[0]);
-                        useFullDN.set("value", data.data.useFullDN);
-                        useFullDN.set("checked", data.data.useFullDN);
-                    }
-                });
-            }
-        };
-    }
-);
+                    var useFullDN = registry.byNode(query(".useFullDN", data.containerNode)[0]);
+                    useFullDN.set("value", data.data.useFullDN);
+                    useFullDN.set("checked", data.data.useFullDN);
+                }
+            });
+        }
+    };
+});
 

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/external/show.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/external/show.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/external/show.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/external/show.js Fri Apr 29 11:04:40 2016
@@ -18,20 +18,18 @@
  * under the License.
  *
  */
-define(["qpid/common/util", "dojo/domReady!"],
-  function (util)
-  {
+define(["qpid/common/util", "dojo/domReady!"], function (util)
+{
 
     function External(data)
     {
         util.buildUI(data.containerNode, data.parent, "authenticationprovider/external/show.html", ["useFullDN"], this);
     }
 
-    External.prototype.update = function(data)
+    External.prototype.update = function (data)
     {
         util.updateUI(data, ["useFullDN"], this);
     }
 
     return External;
-  }
-);
+});

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/kerberos/add.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/kerberos/add.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/kerberos/add.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/kerberos/add.js Fri Apr 29 11:04:40 2016
@@ -18,5 +18,12 @@
  * under the License.
  *
  */
-define([], function () { return { show: function(data){} }; });
+define([], function ()
+{
+    return {
+        show: function (data)
+        {
+        }
+    };
+});
 

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/kerberos/show.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/kerberos/show.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/kerberos/show.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/kerberos/show.js Fri Apr 29 11:04:40 2016
@@ -18,18 +18,16 @@
  * under the License.
  *
  */
-define([],
-  function ()
-  {
+define([], function ()
+{
 
     function NoFieldAuthenticationProvider(data)
     {
     }
 
-    NoFieldAuthenticationProvider.prototype.update = function(data)
+    NoFieldAuthenticationProvider.prototype.update = function (data)
     {
     }
 
     return NoFieldAuthenticationProvider;
-  }
-);
+});

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/md5/add.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/md5/add.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/md5/add.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/md5/add.js Fri Apr 29 11:04:40 2016
@@ -18,4 +18,11 @@
  * under the License.
  *
  */
-define([], function () { return { show: function(data){} }; });
+define([], function ()
+{
+    return {
+        show: function (data)
+        {
+        }
+    };
+});

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/md5/show.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/md5/show.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/md5/show.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/md5/show.js Fri Apr 29 11:04:40 2016
@@ -18,18 +18,16 @@
  * under the License.
  *
  */
-define([],
-  function ()
-  {
+define([], function ()
+{
 
     function NoFieldAuthenticationProvider(data)
     {
     }
 
-    NoFieldAuthenticationProvider.prototype.update = function(data)
+    NoFieldAuthenticationProvider.prototype.update = function (data)
     {
     }
 
     return NoFieldAuthenticationProvider;
-  }
-);
+});

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/oauth2/add.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/oauth2/add.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/oauth2/add.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/oauth2/add.js Fri Apr 29 11:04:40 2016
@@ -25,34 +25,40 @@ define(["dojo/dom",
         "qpid/common/util",
         "dojo/parser",
         "dojo/text!authenticationprovider/oauth2/add.html",
-        "dojo/domReady!"],
-    function (dom, query, array, registry, util, parser, template)
-    {
-        var addAuthenticationProvier =
-        {
-            show: function (data) {
-                var that = this;
-                util.parse(data.containerNode, template, function(){that._postParse(data);});
-            },
-            _postParse: function(data)
-            {
-                var identityResolverType = registry.byId("addAuthenticationProvider.identityResolverType");
-                var validValues = data.metadata.getMetaData(data.category, data.type).attributes.identityResolverType.validValues;
-                var validValueStore = util.makeTypeStore(validValues);
-                identityResolverType.set("store", validValueStore);
+        "dojo/domReady!"], function (dom, query, array, registry, util, parser, template)
+       {
+           var addAuthenticationProvier = {
+               show: function (data)
+               {
+                   var that = this;
+                   util.parse(data.containerNode, template, function ()
+                   {
+                       that._postParse(data);
+                   });
+               },
+               _postParse: function (data)
+               {
+                   var identityResolverType = registry.byId("addAuthenticationProvider.identityResolverType");
+                   var validValues = data.metadata.getMetaData(data.category,
+                                                               data.type).attributes.identityResolverType.validValues;
+                   var validValueStore = util.makeTypeStore(validValues);
+                   identityResolverType.set("store", validValueStore);
 
-                util.makeInstanceStore(data.parent.management, "Broker", "TrustStore", function(trustStoresStore)
-                {
-                    var trustStore = registry.byNode(query(".trustStore", data.containerNode)[0]);
-                    trustStore.set("store", trustStoresStore);
-                    if (data.data)
-                    {
-                        util.initialiseFields(data.data, data.containerNode, data.metadata, "AuthenticationProvider", "OAuth2");
-                    }
-                });
-            }
-        };
+                   util.makeInstanceStore(data.parent.management, "Broker", "TrustStore", function (trustStoresStore)
+                   {
+                       var trustStore = registry.byNode(query(".trustStore", data.containerNode)[0]);
+                       trustStore.set("store", trustStoresStore);
+                       if (data.data)
+                       {
+                           util.initialiseFields(data.data,
+                                                 data.containerNode,
+                                                 data.metadata,
+                                                 "AuthenticationProvider",
+                                                 "OAuth2");
+                       }
+                   });
+               }
+           };
 
-        return addAuthenticationProvier;
-    }
-);
+           return addAuthenticationProvier;
+       });

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/oauth2/show.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/oauth2/show.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/oauth2/show.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/oauth2/show.js Fri Apr 29 11:04:40 2016
@@ -22,22 +22,32 @@ define(["qpid/common/util",
         "dojo/query",
         "dojo/_base/lang",
         "dojo/text!authenticationprovider/oauth2/show.html",
-        "dojo/domReady!"],
-    function (util, query, lang, template)
-    {
-        var fieldNames = ["authorizationEndpointURI", "tokenEndpointURI", "tokenEndpointNeedsAuth", "identityResolverEndpointURI", "identityResolverType", "clientId", "scope", "trustStore", "postLogoutURI"];
+        "dojo/domReady!"], function (util, query, lang, template)
+       {
+           var fieldNames = ["authorizationEndpointURI",
+                             "tokenEndpointURI",
+                             "tokenEndpointNeedsAuth",
+                             "identityResolverEndpointURI",
+                             "identityResolverType",
+                             "clientId",
+                             "scope",
+                             "trustStore",
+                             "postLogoutURI"];
 
-        function AuthenticationProvider(params)
-        {
-            util.buildUI(params.containerNode, params.parent, "authenticationprovider/oauth2/show.html", fieldNames, this);
-        }
+           function AuthenticationProvider(params)
+           {
+               util.buildUI(params.containerNode,
+                            params.parent,
+                            "authenticationprovider/oauth2/show.html",
+                            fieldNames,
+                            this);
+           }
 
-        AuthenticationProvider.prototype.update = function(restData)
-        {
-            var data = restData || {};
-            util.updateUI(data, fieldNames, this);
-        }
+           AuthenticationProvider.prototype.update = function (restData)
+           {
+               var data = restData || {};
+               util.updateUI(data, fieldNames, this);
+           }
 
-        return AuthenticationProvider;
-    }
-);
+           return AuthenticationProvider;
+       });

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plain/add.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plain/add.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plain/add.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plain/add.js Fri Apr 29 11:04:40 2016
@@ -18,4 +18,11 @@
  * under the License.
  *
  */
-define([], function () { return { show: function(data){} }; });
+define([], function ()
+{
+    return {
+        show: function (data)
+        {
+        }
+    };
+});

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plain/show.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plain/show.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plain/show.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plain/show.js Fri Apr 29 11:04:40 2016
@@ -18,18 +18,16 @@
  * under the License.
  *
  */
-define([],
-  function ()
-  {
+define([], function ()
+{
 
     function NoFieldAuthenticationProvider(data)
     {
     }
 
-    NoFieldAuthenticationProvider.prototype.update = function(data)
+    NoFieldAuthenticationProvider.prototype.update = function (data)
     {
     }
 
     return NoFieldAuthenticationProvider;
-  }
-);
+});

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/add.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/add.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/add.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/add.js Fri Apr 29 11:04:40 2016
@@ -18,23 +18,20 @@
  * under the License.
  *
  */
-define(["dojo/query","dijit/registry","qpid/common/util"],
-    function (query, registry, util)
-    {
-        return {
-            show: function(data)
+define(["dojo/query", "dijit/registry", "qpid/common/util"], function (query, registry, util)
+{
+    return {
+        show: function (data)
+        {
+            util.parseHtmlIntoDiv(data.containerNode, "authenticationprovider/filebased/add.html", function ()
             {
-                util.parseHtmlIntoDiv(data.containerNode, "authenticationprovider/filebased/add.html",
-                function()
+                if (data.data)
                 {
-                    if (data.data)
-                    {
-                        var path = registry.byNode(query(".path", data.containerNode)[0]);
-                        path.set("value", data.data.path);
-                    }
-                });
-            }
-        };
-    }
-);
+                    var path = registry.byNode(query(".path", data.containerNode)[0]);
+                    path.set("value", data.data.path);
+                }
+            });
+        }
+    };
+});
 

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/show.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/show.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/show.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/show.js Fri Apr 29 11:04:40 2016
@@ -18,20 +18,18 @@
  * under the License.
  *
  */
-define(["qpid/common/util", "dojo/domReady!"],
-  function (util)
-  {
+define(["qpid/common/util", "dojo/domReady!"], function (util)
+{
 
     function PlainPasswordFile(data)
     {
         util.buildUI(data.containerNode, data.parent, "authenticationprovider/filebased/show.html", ["path"], this);
     }
 
-    PlainPasswordFile.prototype.update = function(data)
+    PlainPasswordFile.prototype.update = function (data)
     {
         util.updateUI(data, ["path"], this);
     }
 
     return PlainPasswordFile;
-  }
-);
+});

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-1/add.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-1/add.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-1/add.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-1/add.js Fri Apr 29 11:04:40 2016
@@ -18,4 +18,11 @@
  * under the License.
  *
  */
-define([], function () { return { show: function(data){} }; });
+define([], function ()
+{
+    return {
+        show: function (data)
+        {
+        }
+    };
+});

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-1/show.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-1/show.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-1/show.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-1/show.js Fri Apr 29 11:04:40 2016
@@ -18,18 +18,16 @@
  * under the License.
  *
  */
-define([],
-  function ()
-  {
+define([], function ()
+{
 
     function NoFieldAuthenticationProvider(data)
     {
     }
 
-    NoFieldAuthenticationProvider.prototype.update = function(data)
+    NoFieldAuthenticationProvider.prototype.update = function (data)
     {
     }
 
     return NoFieldAuthenticationProvider;
-  }
-);
+});

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-256/add.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-256/add.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-256/add.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-256/add.js Fri Apr 29 11:04:40 2016
@@ -18,4 +18,11 @@
  * under the License.
  *
  */
-define([], function () { return { show: function(data){} }; });
+define([], function ()
+{
+    return {
+        show: function (data)
+        {
+        }
+    };
+});

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-256/show.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-256/show.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-256/show.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-256/show.js Fri Apr 29 11:04:40 2016
@@ -18,18 +18,16 @@
  * under the License.
  *
  */
-define([],
-  function ()
-  {
+define([], function ()
+{
 
     function NoFieldAuthenticationProvider(data)
     {
     }
 
-    NoFieldAuthenticationProvider.prototype.update = function(data)
+    NoFieldAuthenticationProvider.prototype.update = function (data)
     {
     }
 
     return NoFieldAuthenticationProvider;
-  }
-);
+});



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