You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2012/06/04 00:56:14 UTC

svn commit: r1345796 - in /qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java: org/apache/qpid/server/management/plugin/ resources/ resources/css/ resources/js/qpid/common/ resources/js/qpid/management/

Author: rgodfrey
Date: Sun Jun  3 22:56:14 2012
New Revision: 1345796

URL: http://svn.apache.org/viewvc?rev=1345796&view=rev
Log:
QPID-3999 : Initial checkin of single screen management page

Added:
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/common/properties.js
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/common/util.js
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/Broker.js
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/VirtualHost.js
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/controller.js
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/treeView.js
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/management.html
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/showBroker.html
      - copied, changed from r1345643, qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/broker.html
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/showVirtualHost.html
      - copied, changed from r1345643, qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/vhost.html
Modified:
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/org/apache/qpid/server/management/plugin/Management.java
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/broker.html
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/css/common.css

Modified: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/org/apache/qpid/server/management/plugin/Management.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/org/apache/qpid/server/management/plugin/Management.java?rev=1345796&r1=1345795&r2=1345796&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/org/apache/qpid/server/management/plugin/Management.java (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/org/apache/qpid/server/management/plugin/Management.java Sun Jun  3 22:56:14 2012
@@ -108,6 +108,8 @@ public class Management
         root.addServlet(new ServletHolder(new DefinedFileServlet("vhost.html")),"/vhost");
         root.addServlet(new ServletHolder(new DefinedFileServlet("broker.html")),"/broker");
         root.addServlet(new ServletHolder(new DefinedFileServlet("connection.html")),"/connection");
+        root.addServlet(new ServletHolder(new DefinedFileServlet("management.html")),"/management");
+
 
 
         root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.js");

Modified: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/broker.html
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/broker.html?rev=1345796&r1=1345795&r2=1345796&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/broker.html (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/broker.html Sun Jun  3 22:56:14 2012
@@ -27,7 +27,7 @@
 		<link rel="stylesheet" href="/dojo/dijit/themes/claro/claro.css">
 		<link rel="stylesheet" href="/dojo/dojox/grid/resources/claroGrid.css">
 
-        <link rel="stylesheet" href="../css/broker.css" media="screen">
+        <link rel="stylesheet" href="css/broker.css" media="screen">
 
 		<link rel="stylesheet" href="css/common.css" media="screen">
 

Modified: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/css/common.css
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/css/common.css?rev=1345796&r1=1345795&r2=1345796&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/css/common.css (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/css/common.css Sun Jun  3 22:56:14 2012
@@ -43,7 +43,7 @@ button {
 	-moz-border-radius: 4px 4px 4px 4px;
 	-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
 	background-color: #E4F2FF;
-	background-image: url("http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dijit/themes/claro/form/images/button.png");
+	background-image: url("/dojo/dijit/themes/claro/form/images/button.png");
 	background-position: center top;
 	background-repeat: repeat-x;
 	border: 1px solid #769DC0;
@@ -62,7 +62,7 @@ h1 {
 
 .header {
     height:100px;
-    background:url(/images/qpid-logo.png) left center no-repeat
+    background:url("/images/qpid-logo.png") left center no-repeat
 }
 
 .logo {

Added: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/common/properties.js
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/common/properties.js?rev=1345796&view=auto
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/common/properties.js (added)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/common/properties.js Sun Jun  3 22:56:14 2012
@@ -0,0 +1,26 @@
+/*
+ *
+ * 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/has", "dojo/_base/sniff", "dojo/domReady!"],
+       function (has) {
+           var properties = {};
+           properties.useSyncGet = (has("ie") <= 8);
+           return properties;
+       });
\ No newline at end of file

Added: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/common/util.js
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/common/util.js?rev=1345796&view=auto
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/common/util.js (added)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/common/util.js Sun Jun  3 22:56:14 2012
@@ -0,0 +1,56 @@
+/*
+ *
+ * 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([],
+       function () {
+           var util = {};
+           if (Array.isArray) {
+               util.isArray = function (object) {
+                   return Array.isArray(object);
+               };
+           } else {
+               util.isArray = function (object) {
+                   return object instanceof Array;
+               };
+           }
+
+           util.flattenStatistics = function (data) {
+               var attrName, stats, propName, theList;
+               for(attrName in data) {
+                   if(data.hasOwnProperty(attrName)) {
+                       if(attrName == "statistics") {
+                           stats = data.statistics;
+                           for(propName in stats) {
+                               if(stats.hasOwnProperty( propName )) {
+                                   data[ propName ] = stats[ propName ];
+                               }
+                           }
+                       } else if(data[ attrName ] instanceof Array) {
+                           theList = data[ attrName ];
+
+                           for(var i=0; i < theList.length; i++) {
+                               util.flattenStatistics( theList[i] );
+                           }
+                       }
+                   }
+               }
+           };
+           return util;
+       });
\ No newline at end of file

Added: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/Broker.js
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/Broker.js?rev=1345796&view=auto
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/Broker.js (added)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/Broker.js Sun Jun  3 22:56:14 2012
@@ -0,0 +1,176 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+define(["dojo/_base/xhr",
+        "dojo/parser",
+        "dojo/query",
+        "dojo/_base/connect",
+        "qpid/common/properties",
+        "qpid/common/updater",
+        "qpid/common/util",
+        "qpid/common/UpdatableStore",
+        "dojo/domReady!"],
+       function (xhr, parser, query, connect, properties, updater, util, UpdatableStore) {
+
+           function Broker(name, controller) {
+               this.name = name;
+               this.controller = controller;
+           }
+
+           Broker.prototype.getTitle = function()
+           {
+               return "Broker";
+           };
+
+           Broker.prototype.open = function(parent) {
+               var that = this;
+               this.contentPane = parent;
+               xhr.get({url: "showBroker.html",
+                        sync: true,
+                        load:  function(data) {
+                            parent.containerNode.innerHTML = data;
+                            parser.parse(parent.containerNode);
+
+                            var brokerUpdater = new BrokerUpdater(parent.containerNode, that.controller);
+
+                            updater.add( brokerUpdater );
+
+                            brokerUpdater.update();
+
+                        }});
+           };
+
+           Broker.prototype.close = function() {
+
+           };
+
+           Broker.prototype.bringToFront = function() {
+
+           };
+
+
+           function BrokerUpdater(node, controller)
+           {
+               this.controller = controller;
+               this.name = query(".broker-name", node)[0];
+               /*this.state = dom.byId("state");
+               this.durable = dom.byId("durable");
+               this.lifetimePolicy = dom.byId("lifetimePolicy");
+               */
+               this.query = "/rest/broker";
+
+               var that = this;
+
+               xhr.get({url: this.query, sync: properties.useSyncGet, handleAs: "json"})
+                   .then(function(data)
+                         {
+                             that.brokerData = data[0];
+
+                             util.flattenStatistics( that.brokerData );
+
+                             that.updateHeader();
+                             that.vhostsGrid =
+                                new UpdatableStore(that.brokerData.vhosts, query(".broker-virtualhosts")[0],
+                                                [ { name: "Virtual Host",    field: "name",      width: "100%"}
+                                                ], function(obj) {
+                                                        connect.connect(obj.grid, "onRowDblClick", obj.grid,
+                                                        function(evt){
+                                                            var idx = evt.rowIndex,
+                                                                theItem = this.getItem(idx);
+                                                            var vhostName = obj.dataStore.getValue(theItem,"name");
+                                                            controller.show("virtualhost", vhostName);
+                                                        });
+                                                });
+
+                             that.portsGrid =
+                                new UpdatableStore(that.brokerData.ports, query(".broker-ports")[0],
+                                                [ { name: "Address",    field: "bindingAddress",      width: "70px"},
+                                                    { name: "Port", field: "port", width: "70px"},
+                                                    { name: "Transports", field: "transports", width: "150px"},
+                                                    { name: "Protocols", field: "protocols", width: "100%"}
+                                                ]);
+
+                         });
+
+  /*             xhr.get({url: "/rest/logrecords", sync: useSyncGet, handleAs: "json"})
+                   .then(function(data)
+                         {
+                             this.logData = data;
+
+                             that.logfileGrid =
+                             new UpdatableStore(Observable, Memory, ObjectStore, DataGrid,
+                                                that.logData, "logfile",
+                                                [   { name: "ID", field: "id", width: "30px"},
+                                                    { name: "Level", field: "level", width: "60px"},
+                                                    { name: "Logger", field: "logger", width: "100px"},
+                                                    { name: "Thread", field: "thread", width: "60px"},
+                                                    { name: "Log Message", field: "message", width: "100%"}
+
+                                                ]);
+                         });
+  */         }
+
+           BrokerUpdater.prototype.updateHeader = function()
+           {
+               this.name.innerHTML = this.brokerData[ "name" ];
+    /*           this.state.innerHTML = this.brokerData[ "state" ];
+               this.durable.innerHTML = this.brokerData[ "durable" ];
+               this.lifetimePolicy.innerHTML = this.brokerData[ "lifetimePolicy" ];
+*/
+           };
+
+           BrokerUpdater.prototype.update = function()
+           {
+
+               var that = this;
+
+               xhr.get({url: this.query, sync: properties.useSyncGet, handleAs: "json"}).then(function(data)
+                                                                                   {
+                                                                                       that.brokerData = data[0];
+                                                                                       util.flattenStatistics( that.brokerData );
+
+                                                                                       var virtualhosts = that.brokerData[ "virtualhosts" ];
+                                                                                       var ports = that.brokerData[ "ports" ];
+
+
+                                                                                       that.updateHeader();
+
+
+                                                                                       that.vhostsGrid.update(that.brokerData.virtualhosts);
+
+                                                                                       that.portsGrid.update(that.brokerData.ports);
+
+
+                                                                                   });
+
+
+      /*         xhr.get({url: "/rest/logrecords", sync: useSyncGet, handleAs: "json"})
+                   .then(function(data)
+                         {
+                             this.logData = data;
+                             that.logfileGrid.update(this.logData);
+                         });
+      */
+           };
+
+
+
+           return Broker;
+       });
\ No newline at end of file

Added: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/VirtualHost.js
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/VirtualHost.js?rev=1345796&view=auto
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/VirtualHost.js (added)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/VirtualHost.js Sun Jun  3 22:56:14 2012
@@ -0,0 +1,313 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+define(["dojo/_base/xhr",
+        "dojo/parser",
+        "dojo/query",
+        "dojo/_base/connect",
+        "qpid/common/properties",
+        "qpid/common/updater",
+        "qpid/common/util",
+        "qpid/common/formatter",
+        "qpid/common/UpdatableStore",
+        "dojo/domReady!"],
+       function (xhr, parser, query, connect, properties, updater, util, formatter, UpdatableStore) {
+
+           function VirtualHost(name, controller) {
+               this.name = name;
+               this.controller = controller;
+           }
+
+           VirtualHost.prototype.getTitle = function()
+           {
+               return "VirtualHost: " + this.name;
+           };
+
+           VirtualHost.prototype.open = function(parent) {
+               var that = this;
+               this.contentPane = parent;
+               xhr.get({url: "showVirtualHost.html",
+                        sync: true,
+                        load:  function(data) {
+                            parent.containerNode.innerHTML = data;
+                            parser.parse(parent.containerNode);
+
+                            var vhostUpdater = new Updater(parent.containerNode, that.name);
+
+                            updater.add( vhostUpdater );
+
+                            vhostUpdater.update();
+                        }});
+           };
+
+           VirtualHost.prototype.close = function() {
+
+           };
+
+
+           function Updater(node, vhostName)
+           {
+
+               var that = this;
+
+               function findNode(name) {
+                   return query("." + name, node)[0];
+               }
+
+               function storeNodes(names)
+               {
+                   for(var i = 0; i < names.length; i++) {
+                       that[names[i]] = findNode(names[i]);
+                   }
+               }
+
+               storeNodes(["name",
+                           "state",
+                           "durable",
+                           "lifetimePolicy",
+                           "alertRepeatGap",
+                           "alertRepeatGapUnits",
+                           "alertThresholdMessageAge",
+                           "alertThresholdMessageAgeUnits",
+                           "alertThresholdMessageSize",
+                           "alertThresholdMessageSizeUnits",
+                           "alertThresholdQueueDepthBytes",
+                           "alertThresholdQueueDepthBytesUnits",
+                           "alertThresholdQueueDepthMessages",
+                           "msgInRate",
+                           "bytesInRate",
+                           "bytesInRateUnits",
+                           "msgOutRate",
+                           "bytesOutRate",
+                           "bytesOutRateUnits"]);
+
+               this.query = "/rest/virtualhost/"+ vhostName ;
+
+
+               var that = this;
+
+               xhr.get({url: this.query, sync: properties.useSyncGet, handleAs: "json"}).then(function(data) {
+                   that.vhostData = data[0];
+
+                       // flatten statistics into attributes
+                       util.flattenStatistics( that.vhostData );
+
+                   that.updateHeader();
+                   that.queuesGrid = new UpdatableStore(that.vhostData.queues, findNode("queues"),
+                                                        [ { name: "Name",    field: "name",      width: "90px"},
+                                                            { name: "Messages", field: "queueDepthMessages", width: "90px"},
+                                                            { name: "Arguments",   field: "arguments",     width: "100%"}
+                                                        ],
+                                                        function(obj)
+                                                        {
+                                                            connect.connect(obj.grid, "onRowDblClick", obj.grid,
+                                                                         function(evt){
+                                                                             var idx = evt.rowIndex,
+                                                                                 theItem = this.getItem(idx);
+                                                                             var queueName = obj.dataStore.getValue(theItem,"name");
+
+                                                                         });
+                                                        } );
+
+                   that.exchangesGrid = new UpdatableStore(that.vhostData.exchanges, findNode("exchanges"),
+                                                           [ { name: "Name",    field: "name",      width: "120px"},
+                                                               { name: "Type", field: "type", width: "120px"},
+                                                               { name: "Binding Count", field: "bindingCount",
+                                                                   width: "100%"}
+                                                           ],
+                                                           function(obj)
+                                                           {
+                                                               connect.connect(obj.grid, "onRowDblClick", obj.grid,
+                                                                            function(evt){
+                                                                                var idx = evt.rowIndex,
+                                                                                    theItem = this.getItem(idx);
+                                                                                var exchangeName = obj.dataStore.getValue(theItem,"name");
+
+                                                                            });
+                                                           } );
+
+
+                   that.connectionsGrid = new UpdatableStore(that.vhostData.connections,
+                                                             findNode("connections"),
+                                                             [ { name: "Name",    field: "name",      width: "150px"},
+                                                                 { name: "Sessions", field: "sessionCount", width: "70px"},
+                                                                 { name: "Msgs In", field: "msgInRate",
+                                                                     width: "80px"},
+                                                                 { name: "Bytes In", field: "bytesInRate",
+                                                                     width: "80px"},
+                                                                 { name: "Msgs Out", field: "msgOutRate",
+                                                                     width: "80px"},
+                                                                 { name: "Bytes Out", field: "bytesOutRate",
+                                                                     width: "100%"}
+                                                             ],
+                                                             function(obj)
+                                                             {
+                                                                 connect.connect(obj.grid, "onRowDblClick", obj.grid,
+                                                                              function(evt){
+                                                                                  var idx = evt.rowIndex,
+                                                                                      theItem = this.getItem(idx);
+                                                                                  var connectionName = obj.dataStore.getValue(theItem,"name");
+
+                                                                              });
+                                                             } );
+
+
+
+               });
+
+           }
+
+           Updater.prototype.updateHeader = function()
+           {
+               this.name.innerHTML = this.vhostData[ "name" ];
+               this.state.innerHTML = this.vhostData[ "state" ];
+               this.durable.innerHTML = this.vhostData[ "durable" ];
+               this.lifetimePolicy.innerHTML = this.vhostData[ "lifetimePolicy" ];
+
+
+           };
+
+           Updater.prototype.update = function()
+           {
+
+               var thisObj = this;
+
+               xhr.get({url: this.query, sync: properties.useSyncGet, handleAs: "json"})
+                   .then(function(data) {
+                       thisObj.vhostData = data[0];
+                       util.flattenStatistics( thisObj.vhostData );
+                       var connections = thisObj.vhostData[ "connections" ];
+                       var queues = thisObj.vhostData[ "queues" ];
+                       var exchanges = thisObj.vhostData[ "exchanges" ];
+
+                       thisObj.updateHeader();
+
+
+                       // update alerting info
+                       var alertRepeatGap = formatter.formatTime( thisObj.vhostData["alertRepeatGap"] );
+
+                       thisObj.alertRepeatGap.innerHTML = alertRepeatGap.value;
+                       thisObj.alertRepeatGapUnits.innerHTML = alertRepeatGap.units;
+
+
+                       var alertMsgAge = formatter.formatTime( thisObj.vhostData["alertThresholdMessageAge"] );
+
+                       thisObj.alertThresholdMessageAge.innerHTML = alertMsgAge.value;
+                       thisObj.alertThresholdMessageAgeUnits.innerHTML = alertMsgAge.units;
+
+                       var alertMsgSize = formatter.formatBytes( thisObj.vhostData["alertThresholdMessageSize"] );
+
+                       thisObj.alertThresholdMessageSize.innerHTML = alertMsgSize.value;
+                       thisObj.alertThresholdMessageSizeUnits.innerHTML = alertMsgSize.units;
+
+                       var alertQueueDepth = formatter.formatBytes( thisObj.vhostData["alertThresholdQueueDepthBytes"] );
+
+                       thisObj.alertThresholdQueueDepthBytes.innerHTML = alertQueueDepth.value;
+                       thisObj.alertThresholdQueueDepthBytesUnits.innerHTML = alertQueueDepth.units;
+
+                       thisObj.alertThresholdQueueDepthMessages.innerHTML = thisObj.vhostData["alertThresholdQueueDepthMessages"];
+
+                       var stats = thisObj.vhostData[ "statistics" ];
+
+                       var sampleTime = new Date();
+                       var messageIn = stats["messagesIn"];
+                       var bytesIn = stats["bytesIn"];
+                       var messageOut = stats["messagesOut"];
+                       var bytesOut = stats["bytesOut"];
+
+                       if(thisObj.sampleTime)
+                       {
+                           var samplePeriod = sampleTime.getTime() - thisObj.sampleTime.getTime();
+
+                           var msgInRate = (1000 * (messageIn - thisObj.messageIn)) / samplePeriod;
+                           var msgOutRate = (1000 * (messageOut - thisObj.messageOut)) / samplePeriod;
+                           var bytesInRate = (1000 * (bytesIn - thisObj.bytesIn)) / samplePeriod;
+                           var bytesOutRate = (1000 * (bytesOut - thisObj.bytesOut)) / samplePeriod;
+
+                           thisObj.msgInRate.innerHTML = msgInRate.toFixed(0);
+                           var bytesInFormat = formatter.formatBytes( bytesInRate );
+                           thisObj.bytesInRate.innerHTML = "(" + bytesInFormat.value;
+                           thisObj.bytesInRateUnits.innerHTML = bytesInFormat.units + "/s)";
+
+                           thisObj.msgOutRate.innerHTML = msgOutRate.toFixed(0);
+                           var bytesOutFormat = formatter.formatBytes( bytesOutRate );
+                           thisObj.bytesOutRate.innerHTML = "(" + bytesOutFormat.value;
+                           thisObj.bytesOutRateUnits.innerHTML = bytesOutFormat.units + "/s)";
+
+                           if(connections && thisObj.connections)
+                           {
+                               for(var i=0; i < connections.length; i++)
+                               {
+                                   var connection = connections[i];
+                                   for(var j = 0; j < thisObj.connections.length; j++)
+                                   {
+                                       var oldConnection = thisObj.connections[j];
+                                       if(oldConnection.id == connection.id)
+                                       {
+                                           msgOutRate = (1000 * (connection.messagesOut - oldConnection.messagesOut)) /
+                                                        samplePeriod;
+                                           connection.msgOutRate = msgOutRate.toFixed(0) + "msg/s";
+
+                                           bytesOutRate = (1000 * (connection.bytesOut - oldConnection.bytesOut)) /
+                                                          samplePeriod;
+                                           var bytesOutRateFormat = formatter.formatBytes( bytesOutRate );
+                                           connection.bytesOutRate = bytesOutRateFormat.value + bytesOutRateFormat.units + "/s";
+
+
+                                           msgInRate = (1000 * (connection.messagesIn - oldConnection.messagesIn)) /
+                                                       samplePeriod;
+                                           connection.msgInRate = msgInRate.toFixed(0) + "msg/s";
+
+                                           bytesInRate = (1000 * (connection.bytesIn - oldConnection.bytesIn)) /
+                                                         samplePeriod;
+                                           var bytesInRateFormat = formatter.formatBytes( bytesInRate );
+                                           connection.bytesInRate = bytesInRateFormat.value + bytesInRateFormat.units + "/s";
+                                       }
+
+
+                                   }
+
+                               }
+                           }
+                       }
+
+                       thisObj.sampleTime = sampleTime;
+                       thisObj.messageIn = messageIn;
+                       thisObj.bytesIn = bytesIn;
+                       thisObj.messageOut = messageOut;
+                       thisObj.bytesOut = bytesOut;
+                       thisObj.connections = connections;
+
+                       // update queues
+                       thisObj.queuesGrid.update(thisObj.vhostData.queues);
+
+                       // update exchanges
+                       thisObj.exchangesGrid.update(thisObj.vhostData.exchanges);
+
+                       // update connections
+                       thisObj.connectionsGrid.update(thisObj.vhostData.connections)
+
+
+                   });
+           };
+
+
+           return VirtualHost;
+       });
\ No newline at end of file

Added: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/controller.js
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/controller.js?rev=1345796&view=auto
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/controller.js (added)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/controller.js Sun Jun  3 22:56:14 2012
@@ -0,0 +1,71 @@
+/*
+ *
+ * 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/dom",
+        "dijit/registry",
+        "dijit/layout/ContentPane",
+        "qpid/management/Broker",
+        "qpid/management/VirtualHost",
+        "dojo/ready",
+        "dojo/domReady!"],
+       function (dom, registry, ContentPane, Broker, VirtualHost, ready) {
+           var controller = {};
+
+           var constructors = { broker: Broker, virtualhost: VirtualHost };
+
+           var tabDiv = dom.byId("managedViews");
+
+           ready(function() {
+               controller.tabContainer = registry.byId("managedViews");
+           });
+
+
+           controller.viewedObjects = {};
+
+           controller.show = function(objType, name) {
+               var objId = objType+":"+name;
+               if( this.viewedObjects[ objId ] ) {
+                   this.tabContainer.selectChild(this.viewedObjects[ objId ].contentPane);
+               } else {
+                   var Constructor = constructors[ objType ];
+
+                   var obj = new Constructor(name, this);
+                   this.viewedObjects[ objId ] = obj;
+
+                   var contentPane = new ContentPane({ region: "center" , title: obj.getTitle()});
+                   this.tabContainer.addChild( contentPane );
+
+                   obj.open(contentPane);
+                   contentPane.startup();
+                   this.tabContainer.selectChild( contentPane );
+
+
+               }
+
+           };
+
+           ready(function() {
+               controller.show("broker","");
+               //controller.show("virtualhost","test");
+           });
+
+
+           return controller;
+       });
\ No newline at end of file

Added: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/treeView.js
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/treeView.js?rev=1345796&view=auto
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/treeView.js (added)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/qpid/management/treeView.js Sun Jun  3 22:56:14 2012
@@ -0,0 +1,313 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+define(["dojo/_base/xhr",
+        "dojo/query",
+        "dojo/io-query",
+        "dijit/Tree",
+        "qpid/common/util",
+        "dojo/domReady!"],
+       function (xhr, query, ioQuery, Tree, util) {
+
+           function TreeViewModel(queryString) {
+               this.query = queryString;
+
+               this.onChildrenChange = function (parent, children) {
+                   // fired when the set of children for an object change
+               };
+
+               this.onChange = function (object) {
+                   // fired when the properties of an object change
+               };
+
+               this.onDelete = function (object) {
+                   // fired when an object is deleted
+               };
+
+           }
+
+
+           TreeViewModel.prototype.buildModel = function (data) {
+               this.model = data;
+
+           };
+
+           TreeViewModel.prototype.updateModel = function (data) {
+               var that = this;
+
+               function checkForChanges(oldData, data) {
+                   var propName;
+                   if (oldData.name != data.name) {
+                       that.onChange(data);
+                   }
+
+                   var childChanges = false;
+                   // Iterate over old childTypes, check all are in new
+                   for (propName in oldData) {
+                       if (oldData.hasOwnProperty(propName)) {
+                           var oldChildren = oldData[ propName ];
+                           if (util.isArray(oldChildren)) {
+
+                               var newChildren = data[ propName ];
+
+                               if (!(newChildren && util.isArray(newChildren))) {
+                                   childChanges = true;
+                               } else {
+                                   var subChanges = false;
+                                   // iterate over elements in array, make sure in both, in which case recurse
+                                   for (var i = 0; i < oldChildren.length; i++) {
+                                       var matched = false;
+                                       for (var j = 0; j < newChildren.length; j++) {
+                                           if (oldChildren[i].id == newChildren[j].id) {
+                                               checkForChanges(oldChildren[i], newChildren[j]);
+                                               matched = true;
+                                               break;
+                                           }
+                                       }
+                                       if (!matched) {
+                                           subChanges = true;
+                                       }
+                                   }
+                                   if (subChanges == true || oldChildren.length != newChildren.length) {
+                                       that.onChildrenChange({ id:data.id + propName, _dummyChild:propName, data:data },
+                                                             newChildren);
+                                   }
+                               }
+                           }
+                       }
+                   }
+
+                   for (propName in data) {
+                       if (data.hasOwnProperty(propName)) {
+                           var prop = data[ propName ];
+                           if (util.isArray(prop)) {
+                               if (!(oldData[ propName ] && util.isArray(oldData[propName]))) {
+                                   childChanges = true;
+                               }
+                           }
+                       }
+                   }
+
+                   if (childChanges) {
+                       var children = [];
+                       that.getChildren(data, function (theChildren) {
+                           children = theChildren
+                       });
+                       that.onChildrenChange(data, children);
+                   }
+               }
+
+               var oldData = this.model;
+               this.model = data;
+
+               checkForChanges(oldData, data);
+           };
+
+
+           TreeViewModel.prototype.fetchItemByIdentity = function (id) {
+
+               function fetchItem(id, data) {
+                   var propName;
+
+                   if (data.id == id) {
+                       return data;
+                   } else if (id.indexOf(data.id) == 0) {
+                       return { id:id, _dummyChild:id.substring(id.length), data:data };
+                   } else {
+                       for (propName in data) {
+                           if (data.hasOwnProperty(propName)) {
+                               var prop = data[ propName ];
+                               if (util.isArray(prop)) {
+                                   for (var i = 0; i < prop.length; i++) {
+                                       var theItem = fetchItem(id, prop[i]);
+                                       if (theItem) {
+                                           return theItem;
+                                       }
+                                   }
+                               }
+                           }
+                       }
+                       return null;
+                   }
+               }
+
+               return fetchItem(id, this.model);
+           };
+
+           TreeViewModel.prototype.getChildren = function (parentItem, onComplete) {
+
+               if (parentItem) {
+                   if (parentItem._dummyChild) {
+                       onComplete(parentItem.data[ parentItem._dummyChild ]);
+                   } else {
+                       var children = [];
+                       for (var propName in parentItem) {
+                           if (parentItem.hasOwnProperty(propName)) {
+                               var prop = parentItem[ propName ];
+
+                               if (util.isArray(prop)) {
+                                   children.push({ id:parentItem.id
+                                       + propName, _dummyChild:propName, data:parentItem });
+                               }
+                           }
+                       }
+                       onComplete(children);
+                   }
+               } else {
+                   onComplete([]);
+               }
+           };
+
+           TreeViewModel.prototype.getIdentity = function (theItem) {
+               if (theItem) {
+                   return theItem.id;
+               }
+
+           };
+
+           TreeViewModel.prototype.getLabel = function (theItem) {
+               if (theItem) {
+                   if (theItem._dummyChild) {
+                       return theItem._dummyChild;
+                   } else {
+                       return theItem.name;
+                   }
+               } else {
+                   return "";
+               }
+           };
+
+           TreeViewModel.prototype.getRoot = function (onItem) {
+               onItem(this.model);
+           };
+
+           TreeViewModel.prototype.mayHaveChildren = function (theItem) {
+               if (theItem) {
+                   if (theItem._dummyChild) {
+                       return true;
+                   } else {
+                       for (var propName in theItem) {
+                           if (theItem.hasOwnProperty(propName)) {
+                               var prop = theItem[ propName ];
+                               if (util.isArray(prop)) {
+                                   return true;
+                               }
+                           }
+                       }
+                       return false;
+                   }
+               } else {
+                   return false;
+               }
+           };
+
+           TreeViewModel.prototype.relocate = function (theItem) {
+
+               function findItemDetails(theItem, details, type, object) {
+                   if (theItem.id == object.id) {
+                       details.type = type;
+                       details[ type ] = object.name;
+                   } else {
+                       details[ type ] = object.name;
+
+                       // iterate over children
+                       for (var propName in object) {
+                           if (object.hasOwnProperty(propName)) {
+                               var prop = object[ propName ];
+                               if (util.isArray(prop)) {
+                                   for (var i = 0; i < prop.length; i++) {
+                                       findItemDetails(theItem, details, propName.substring(0, propName.length - 1),
+                                                       prop[i]);
+
+                                       if (details.type) {
+                                           break;
+                                       }
+                                   }
+                               }
+                               if (details.type) {
+                                   break;
+                               }
+                           }
+                       }
+
+                       if (!details.type) {
+                           details[ type ] = null;
+                       }
+                   }
+               }
+
+               var details = new Object();
+
+               findItemDetails(theItem, details, "broker", this.model);
+
+               var uri;
+
+
+               if (details.type == "broker") {
+                   uri = "/broker";
+               } else if (details.type == "virtualhost") {
+                   uri = "/vhost?" + ioQuery.objectToQuery({ vhost:details.virtualhost });
+               } else if (details.type == "exchange") {
+                   uri = "/exchange?" + ioQuery.objectToQuery({ vhost:details.virtualhost, exchange:details.exchange });
+               } else if (details.type == "queue") {
+                   uri = "/queue?" + ioQuery.objectToQuery({ vhost:details.virtualhost, queue:details.queue});
+               } else if (details.type == "connection") {
+                   uri = "/connection?"
+                       + ioQuery.objectToQuery({ vhost:details.virtualhost, connection:details.connection});
+               } else if (details.type == 'port') {
+                   uri = "/port?" + ioQuery.objectToQuery({ port:details.port});
+               }
+
+               if (uri) {
+                   window.location = uri;
+               }
+           };
+
+           TreeViewModel.prototype.update = function () {
+               var thisObj = this;
+
+               xhr.get({url:this.query, sync: true, handleAs:"json"})
+                   .then(function (data) {
+                             if (thisObj.model) {
+                                 thisObj.updateModel(data);
+                             }
+                             else {
+                                 thisObj.buildModel(data);
+                             }
+                         });
+
+           };
+
+           query('div[qpid-type="treeView"]').forEach(function(node, index, arr) {
+               var treeModel = new TreeViewModel("/rest/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();
+           });
+
+           return TreeViewModel;
+       });
\ No newline at end of file

Added: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/management.html
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/management.html?rev=1345796&view=auto
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/management.html (added)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/management.html Sun Jun  3 22:56:14 2012
@@ -0,0 +1,75 @@
+<!DOCTYPE HTML>
+<!--
+  ~ 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.
+  -->
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>Qpid Management</title>
+    <link rel="stylesheet" href="/dojo/dojo/resources/dojo.css">
+    <link rel="stylesheet" href="/dojo/dijit/themes/claro/claro.css">
+    <link rel="stylesheet" href="/dojo/dojox/grid/resources/claroGrid.css">
+
+    <link rel="stylesheet" href="css/common.css" media="screen">
+    <script>
+        var dojoConfig = {
+            tlmSiblingOfDojo:false,
+            parseOnLoad:true,
+            async:true,
+            packages:[
+                { name:"dojo", location:"/dojo/dojo" },
+                { name:"dijit", location:"/dojo/dijit" },
+                { name:"dojox", location:"/dojo/dojox" },
+                { name:"qpid", location:"/js/qpid" }
+            ]
+        };
+
+    </script>
+    <script src="/dojo/dojo/dojo.js">
+    </script>
+
+    <script>
+        require(["dijit/layout/BorderContainer",
+                    "dijit/layout/TabContainer",
+                    "dijit/layout/ContentPane",
+                    "dijit/TitlePane",
+                    "dojo/parser",
+                    "qpid/management/treeView",
+                    "qpid/management/controller"]);
+    </script>
+
+</head>
+<body class="claro">
+
+<div id="pageLayout" data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design: 'headline', gutters: false">
+    <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">
+        <div id="header" class="header"></div>
+    </div>
+    <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">
+        <div id="login"></div>
+    </div>
+    <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'leading', splitter: true">
+        <div qpid-type="treeView" qpid-props="query: '/rest/structure'" ></div>
+    </div>
+    <div id="managedViews" data-dojo-type="dijit.layout.TabContainer" data-dojo-props="region:'center', tabPosition: 'top'">
+    </div>
+    <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'bottom'">
+        <div id="footer"></div>
+    </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file

Copied: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/showBroker.html (from r1345643, qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/broker.html)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/showBroker.html?p2=qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/showBroker.html&p1=qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/broker.html&r1=1345643&r2=1345796&rev=1345796&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/broker.html (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/showBroker.html Sun Jun  3 22:56:14 2012
@@ -1,103 +1,25 @@
-<!DOCTYPE HTML>
-<!--
- -
- - 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.
- -
- -->
-<html lang="en">
-	<head>
-		<meta charset="utf-8">
-		<title>Broker</title>
-		<link rel="stylesheet" href="/dojo/dojo/resources/dojo.css">
-		<link rel="stylesheet" href="/dojo/dijit/themes/claro/claro.css">
-		<link rel="stylesheet" href="/dojo/dojox/grid/resources/claroGrid.css">
-
-        <link rel="stylesheet" href="../css/broker.css" media="screen">
-
-		<link rel="stylesheet" href="css/common.css" media="screen">
-
-        <script src="/dojo/dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: true">
-        </script>
-
-            <script>
-                require(["dijit/layout/BorderContainer", "dijit/layout/TabContainer", "dijit/layout/ContentPane",
-                "dijit/TitlePane", "dojo/parser"]);
-
-
-            </script>
-
-        <script src="/js/common.js">
-        </script>
-        <script src="/js/broker.js">
-        </script>
-        <script src="/js/sasl.js">
-        </script>
-        <script src="/js/header.js"></script>
-        <script src="/js/footer.js"></script>
-        <script src="/js/structure.js"></script>
-
-        <script>
-
-            require(["dojo/domReady!"],
-                    function(){
-                      new Header("Broker");
-                });
-        </script>
-
-	</head>
-	<body class="claro">
-
-
-    <div id="pageLayout" data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design: 'headline', gutters: false">
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'"><div id="header" class="header"></div>
-        </div>
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">
-            <div id="login"></div>
-        </div>
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'leading', splitter: true">
-                    <div id="structure"></div>
-        </div>
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'">
-            <span style="">Queue:</span><span id="name" style="position:absolute; left:6em"></span>
-            <br/>
-            <span style="">State:</span><span id="state" style="position:absolute; left:6em"></span>
-            <br/>
-            <span style="">Durable:</span><span id="durable" style="position:absolute; left:6em"></span>
-            <br/>
-            <span style="">Lifespan:</span><span style="position:absolute; left:6em" id="lifetimePolicy"></span>
-            <br/>
-            <br/>
-            <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Virtual Hosts'">
-                <div id="virtualhosts"></div>
-            </div>
-            <br/>
-            <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Ports'">
-                <div id="ports"></div>
-            </div>
-            <br/>
+<div class="broker">
+    <span>Broker:</span><span class="broker-name" style="position:absolute; left:6em"></span>
+    <br/>
+<!--    <span>State:</span><span class="broker-state" style="position:absolute; left:6em"></span>
+    <br/>
+    <span>Durable:</span><span class="broker-durable" style="position:absolute; left:6em"></span>
+    <br/>
+    <span>Lifespan:</span><span class="broker-lifetimePolicy" style="position:absolute; left:6em" ></span>
+    <br/>                                                                                                 -->
+    <br/>
+    <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Virtual Hosts'">
+        <div class="broker-virtualhosts"></div>
+    </div>
+    <br/>
+    <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Ports'">
+        <div class="broker-ports"></div>
+    </div>
+    <br/>
 
-            <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Log File',  open: false">
-                <div id="logfile"></div>
-            </div>
-            <br/>
-        </div>
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'bottom'"><div id="footer"></div></div>
+    <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Log File',  open: false">
+        <div class="broker-logfile"></div>
     </div>
+    <br/>
+</div>
 
-	</body>
-</html>
\ No newline at end of file

Copied: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/showVirtualHost.html (from r1345643, qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/vhost.html)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/showVirtualHost.html?p2=qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/showVirtualHost.html&p1=qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/vhost.html&r1=1345643&r2=1345796&rev=1345796&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/vhost.html (original)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/showVirtualHost.html Sun Jun  3 22:56:14 2012
@@ -19,245 +19,65 @@
  - under the License.
  -
  -->
-<html lang="en">
-	<head>
-		<meta charset="utf-8">
-		<title>Virtual Host</title>
-		<link rel="stylesheet" href="/dojo/dojo/resources/dojo.css">
-        <link rel="stylesheet" href="/dojo/dijit/themes/claro/claro.css">
-        <link rel="stylesheet" href="/dojo/dojox/grid/resources/claroGrid.css">
 
-        <link rel="stylesheet" href="../css/vhost.css" media="screen">
-
-		<link rel="stylesheet" href="css/common.css" media="screen">
-
-        <script>
-            var dojoConfig = {
-                                tlmSiblingOfDojo: false,
-                                parseOnLoad: true,
-                                async: true,
-                                packages: [
-                                    { name: "dojo", location: "/dojo/dojo" },
-                                    { name: "dijit", location: "/dojo/dijit" },
-                                    { name: "dojox", location: "/dojo/dojox" },
-                                    { name: "qpid", location: "/js/qpid" }
-                                ]
-                            };
-
-        </script>
-        <script src="/dojo/dojo/dojo.js">
-        </script>
-
-            <script>
-                require(["dijit/layout/BorderContainer", "dijit/layout/TabContainer", "dijit/layout/ContentPane",
-                "dijit/TitlePane", "dojo/parser"]);
-            </script>
-
-        <script src="/js/common.js"></script>
-        <script src="/js/vhost.js"></script>
-        <script src="/js/sasl.js"></script>
-        <script src="/js/header.js"></script>
-        <script src="/js/footer.js"></script>
-        <script src="/js/structure.js"></script>
-
-        <script>
-            require(["dojo/parser",
-            /* dojox/ validate resources */
-            "dojox/validate/us", "dojox/validate/web",
-            /* basic dijit classes */
-            "dijit/form/CheckBox", "dijit/form/Textarea", "dijit/form/FilteringSelect", "dijit/form/TextBox", "dijit/form/ValidationTextBox", "dijit/form/DateTextBox", "dijit/form/TimeTextBox", "dijit/form/Button", "dijit/form/RadioButton", "dijit/form/Form", "dijit/form/DateTextBox",
-            /* basic dojox classes */
-            "dojox/form/BusyButton", "dojox/form/CheckedMultiSelect", "dojo/domReady!"]);
-
-            // Require the Dialog class
-            require(["dijit/registry", "dijit/Dialog"], function(registry) {
-                // Show the dialog
-                addExchangeDialog = function() {
-                    registry.byId("addExchange").show();
-                }
-                // Hide the dialog
-                hideAddExchange = function() {
-                    registry.byId("addExchange").hide();
-                }
-
-
-                var urlQuery = dojo.queryToObject(dojo.doc.location.search.substr((dojo.doc.location.search[0] === "?" ? 1 : 0)));
-
-                new Header("Virtual Host: "+urlQuery.vhost);
-            });
-
-            var showAddQueue = function showAddQueue() {
-                require(["qpid/management/addQueue", "dojo/_base/window", "dojo/io-query", "dojo/domReady!"],
-                    function(addQueue, win, ioQuery) {
-                        var urlQuery = ioQuery.queryToObject(win.doc.location.search.substr(win.doc.location.search[0] === "?" ? 1 : 0));
-                        addQueue.show(urlQuery.vhost);
-                    });
-            };
-        </script>
-	</head>
-	<body class="claro">
-
-
-    <div id="pageLayout" data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design: 'headline', gutters: false">
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'"><div id="header" class="header"></div>
-        </div>
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">
-            <div id="login"></div>
-        </div>
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'leading', splitter: true">
-                    <div id="structure"></div>
-        </div>
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'">
-            <span style="">Name:</span><span id="name" style="position:absolute; left:6em"></span>
-            <br/>
-            <span style="">State:</span><span id="state" style="position:absolute; left:6em"></span>
-            <br/>
-            <span style="">Durable:</span><span id="durable" style="position:absolute; left:6em"></span>
-            <span style="position:absolute; left:26em">Inbound:</span>
-            <span id="msgInRate" style="position:absolute; right:9.5em"></span>
-            <span style="position:absolute; right: 5em; width: 4em"> msg/s</span>
-            <span id="bytesInRate" style="position:absolute; right: 3.3em"></span>
-            <span id="bytesInRateUnits" style="position:absolute; right: 0em; width: 3em"></span>
-            <br/>
-            <span style="">Lifespan:</span><span style="position:absolute; left:6em" id="lifetimePolicy"></span>
-            <span style="position:absolute; left:26em">Outbound:</span>
-            <span id="msgOutRate" style="position:absolute; right:9.5em"></span>
-            <span style="position:absolute; right: 5em; width: 4em"> msg/s</span>
-            <span id="bytesOutRate" style="position:absolute; right: 3.3em"></span>
-            <span id="bytesOutRateUnits" style="position:absolute; right: 0em; width: 3em"></span>
-            <br/>
-            <br/>
-            <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Exchanges'">
-                <div id="exchanges"></div>
-                <br/>
-                <button onclick="addExchangeDialog();">Add Exchange</button>
-
-                <div class="dijitHidden">
-                    <div data-dojo-type="dijit.Dialog" style="width:600px;" data-dojo-props="title:'Add Exchange'" id="addExchange">
-                        <h1>Add a new Exchange</h1>
-                        <br/>
-                        <form dojoType="dijit.form.Form" method="post">
-                        <script type="dojo/method" event="onSubmit">
-                            if(this.validate())
-                            {
-                                var exchangeData = {};
-                                exchangeData.name = dojo.byId("addExchangeName").value;
-                                exchangeData.type = dijit.byId("addExchangeType").get('value');
-                                exchangeData.durable = dojo.byId("addExchangeDurable").checked;
-                                exchangeData.lifetimePolicy = dijit.byId("addExchangeLifetimePolicy").get('value');
-
-
-                                var urlQuery = dojo.queryToObject(dojo.doc.location.search.substr((dojo.doc.location.search[0] === "?" ? 1 : 0)));
-                                var postUrl = "/rest/exchange/" + urlQuery.vhost + "/" + exchangeData.name;
-
-
-                                dojo.xhrPut( { url: "/rest/exchange/" + urlQuery.vhost + "/" + exchangeData.name,
-                                             handleAs: "json",
-                                             headers: { "Content-Type": "application/json"},
-                                             putData: dojo.toJson( exchangeData )
-                                            }).then( function(data)
-                                                    {
-                                                        hideAddExchange();
-                                                    },
-                                                    function(error)
-                                                    {
-                                                        alert(error);
-                                                    }
-                                                  );
-                                return false;
-                            }
-                            else
-                            {
-                                alert('Form contains invalid data.  Please correct first');
-                                return false;
-                            }
-                            return false;
-                        </script>
-                        <table cellpadding="0" cellspacing="2">
-                            <tr>
-                                <td valign="top"><strong>Name: </strong></td>
-                                <td><input type="text" required="true" name="name" id="addExchangeName" placeholder="Exchange Name"
-                                           dojoType="dijit.form.ValidationTextBox"/></td>
-                            </tr>
-                            <tr>
-                                <td valign="top"><strong>Type: </strong></td>
-                                <td>
-                                    <select name="type" id="addExchangeType" dojoType="dijit.form.FilteringSelect">
-                                        <option value="direct">direct</option>
-                                        <option value="topic">topic</option>
-                                        <option value="headers">headers</option>
-                                        <option value="fanout">fanout</option>
-                                    </select>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td valign="top"><strong>Durable? </strong></td>
-                                <td><input type="checkbox" name="durable" id="addExchangeDurable" dojoType="dijit.form.CheckBox" /></td>
-                            </tr>
-                            <tr>
-                                <td valign="top"><strong>Lifetime Policy: </strong></td>
-                                <td>
-                                    <select name="lifetimePolicy" id="addExchangeLifetimePolicy" dojoType="dijit.form.FilteringSelect">
-                                        <option value="PERMANENT">permanent</option>
-                                        <option value="AUTO_DELETE">auto-delete</option>
-                                    </select>
-                                </td>
-                            </tr>
-                        </table>
-                        <br/>
-                        <input type="submit" value="Submit Form" id="addExchangeOk" dojoType="dojox.form.BusyButton"
-                               label="Add" busyLabel="Submitting Form..." timeout="2000" />
-                        <input type="button" value="Cancel" label="Cancel" id="addExchangeCancel" data-dojo-props="onClick:hideAddExchange" dojoType="dijit.form.Button" />
-
-                        </form>
-
-                    </div>
-                </div>
-            </div>
-            <br/>
-            <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Queues'">
-                <div id="queues"></div>
-                <button id="buttonAddQueue" data-dojo-type="dijit.form.Button" onclick="showAddQueue();">Add Queue</button>
-            </div>
-            <br/>
-            <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Connections'">
-                <div id="connections"></div>
-            </div>
-            <br/>
-            <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Alerting Thresholds', open: false">
-                <span style="">Max. Queue Size:</span>
-                <span id="alertThresholdQueueDepthMessages"
-                      style="position:absolute; left:8em; width:8em; text-align:right"></span>
-                <span style="position:absolute; left:16.2em">msgs</span>
-
-                <span id="alertThresholdQueueDepthBytes"
-                      style="position:absolute; left:20em; width:8em; text-align:right"></span>
-                <span id="alertThresholdQueueDepthBytesUnits" style="position:absolute; left:28.2em"></span>
-                <br>
-                <span style="">Max. Message Age:</span>
-                <span id="alertThresholdMessageAge"
-                      style="position:absolute; left:8em; width:8em; text-align:right"></span>
-                <span id="alertThresholdMessageAgeUnits" style="position:absolute; left:16.2em"></span>
-
-                <span style="position:absolute; left:21em">Size: </span>
-                <span id="alertThresholdMessageSize"
-                      style="position:absolute; left:23em; width:5em; text-align:right"></span>
-                <span id="alertThresholdMessageSizeUnits" style="position:absolute; left:28.2em"></span>
-                <br/>
-                <br/>
-                <span style="">Alert frequency:</span>
-                <span id="alertRepeatGap"
-                      style="position:absolute; left:8em; width:8em; text-align:right"></span>
-                <span id="alertRepeatGapUnits" style="position:absolute; left:16.2em"></span>
-
-
-
-            </div>
-        </div>
-        <!--<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'trailing'">Trailing pane</div>-->
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'bottom'"><div id="footer"></div></div>
+<div class="virtualhost">
+    <span style="">Name:</span><span class="name" style="position:absolute; left:6em"></span>
+    <br/>
+    <span style="">State:</span><span class="state" style="position:absolute; left:6em"></span>
+    <br/>
+    <span style="">Durable:</span><span class="durable" style="position:absolute; left:6em"></span>
+    <span style="position:absolute; left:26em">Inbound:</span>
+    <span class="msgInRate" style="position:absolute; right:9.5em"></span>
+    <span style="position:absolute; right: 5em; width: 4em"> msg/s</span>
+    <span class="bytesInRate" style="position:absolute; right: 3.3em"></span>
+    <span class="bytesInRateUnits" style="position:absolute; right: 0em; width: 3em"></span>
+    <br/>
+    <span style="">Lifespan:</span><span style="position:absolute; left:6em" class="lifetimePolicy"></span>
+    <span style="position:absolute; left:26em">Outbound:</span>
+    <span class="msgOutRate" style="position:absolute; right:9.5em"></span>
+    <span style="position:absolute; right: 5em; width: 4em"> msg/s</span>
+    <span class="bytesOutRate" style="position:absolute; right: 3.3em"></span>
+    <span class="bytesOutRateUnits" style="position:absolute; right: 0em; width: 3em"></span>
+    <br/>
+    <br/>
+    <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Exchanges'">
+        <div class="exchanges"></div>
     </div>
-
-	</body>
-</html>
+    <br/>
+    <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Queues'">
+        <div class="queues"></div>
+        <button data-dojo-type="dijit.form.Button" onclick="showAddQueue();">Add Queue</button>
+    </div>
+    <br/>
+    <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Connections'">
+        <div class="connections"></div>
+    </div>
+    <br/>
+    <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Alerting Thresholds', open: false">
+        <span style="">Max. Queue Size:</span>
+        <span class="alertThresholdQueueDepthMessages"
+              style="position:absolute; left:8em; width:8em; text-align:right"></span>
+        <span style="position:absolute; left:16.2em">msgs</span>
+
+        <span class="alertThresholdQueueDepthBytes"
+              style="position:absolute; left:20em; width:8em; text-align:right"></span>
+        <span class="alertThresholdQueueDepthBytesUnits" style="position:absolute; left:28.2em"></span>
+        <br>
+        <span style="">Max. Message Age:</span>
+        <span class="alertThresholdMessageAge"
+              style="position:absolute; left:8em; width:8em; text-align:right"></span>
+        <span class="alertThresholdMessageAgeUnits" style="position:absolute; left:16.2em"></span>
+
+        <span style="position:absolute; left:21em">Size: </span>
+        <span class="alertThresholdMessageSize"
+              style="position:absolute; left:23em; width:5em; text-align:right"></span>
+        <span class="alertThresholdMessageSizeUnits" style="position:absolute; left:28.2em"></span>
+        <br/>
+        <br/>
+        <span style="">Alert frequency:</span>
+        <span class="alertRepeatGap"
+              style="position:absolute; left:8em; width:8em; text-align:right"></span>
+        <span class="alertRepeatGapUnits" style="position:absolute; left:16.2em"></span>
+    </div>
+</div>
 



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