You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2013/04/24 15:41:29 UTC

svn commit: r1471414 - in /qpid/branches/0.22/qpid/java: ./ broker-plugins/management-http/src/main/java/resources/ broker-plugins/management-http/src/main/java/resources/js/qpid/common/ broker-plugins/management-http/src/main/java/resources/js/qpid/ma...

Author: orudyy
Date: Wed Apr 24 13:41:29 2013
New Revision: 1471414

URL: http://svn.apache.org/r1471414
Log:
QPID-4773: Add functionality to display information about http errors which might occur when communicating with the broker

merged from trunk r1471409 

Modified:
    qpid/branches/0.22/qpid/java/   (props changed)
    qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html
    qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js
    qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js

Propchange: qpid/branches/0.22/qpid/java/
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java:r1471409

Modified: qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html?rev=1471414&r1=1471413&r2=1471414&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html (original)
+++ qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html Wed Apr 24 13:41:29 2013
@@ -85,6 +85,22 @@
     <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'bottom'">
         <div qpid-type="footer"></div>
     </div>
+
+    <div class="dijitHidden">
+        <div data-dojo-type="dijit.Dialog" data-dojo-props="title: 'Connection Error'" id="errorDialog">
+            <div style="width:400px; overflow: auto">
+                <div><strong><span id="errorMessage">An error occurred when communicating with the broker.</span></strong></div>
+                <div><span id="statusMessage"></span></div>
+                <div style="margin-top: 10px; margin-bottom: 8px"><span id="reloadMessage">Please try to reload.</span></div>
+                <div id="errorDetails" data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Details', open:false">
+                    <span id="errorDetailsMessage"></span>
+                </div>
+            </div>
+            <div class="dijitDialogPaneActionBar">
+                <input type="button" value="Close" label="Close" dojoType="dijit.form.Button" onClick="dijit.byId('errorDialog').hide();"/>
+            </div>
+        </div>
+    </div>
 </div>
 
 </body>

Modified: qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js?rev=1471414&r1=1471413&r2=1471414&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js (original)
+++ qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js Wed Apr 24 13:41:29 2013
@@ -309,8 +309,49 @@ define(["dojo/_base/xhr",
              var maxHeight = Math.max(Math.floor(viewport.h * 0.6), 100);
              dialogContentArea.style.overflow= "auto";
              dialogContentArea.style.height = Math.min(aproximateHeight, maxHeight ) + "px";
+             setAttributesDialog.on("hide", function(e){setAttributesDialog.destroy();});
              setAttributesDialog.show();
            };
 
+           util.xhrErrorHandler = function(error)
+           {
+             if (error)
+             {
+               if (error.hasOwnProperty("status"))
+               {
+                 if (error.status == 401)
+                 {
+                   dojo.byId("statusMessage").innerHTML = "401 - Authentication required.";
+                 }
+                 else if (error.status == 403)
+                 {
+                   dojo.byId("statusMessage").innerHTML = "403 - Access denied.";
+                 }
+                 else
+                 {
+                   dojo.byId("statusMessage").innerHTML = "HTTP status code: " + error.status;
+                 }
+               }
+               else
+               {
+                 dojo.byId("statusMessage").innerHTML = "";
+               }
+               if (error.hasOwnProperty("message"))
+               {
+                 dojo.byId("errorDetailsMessage").innerHTML = error.message;
+                 dojo.byId("errorDetails").style.display = "block";
+               }
+               else
+               {
+                 dojo.byId("errorDetails").style.display = "none";
+               }
+               var dialog = dijit.byId("errorDialog");
+               if (!dialog.open)
+               {
+                 dialog.show();
+               }
+             }
+           };
+
            return util;
        });
\ No newline at end of file

Modified: qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js?rev=1471414&r1=1471413&r2=1471414&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js (original)
+++ qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js Wed Apr 24 13:41:29 2013
@@ -42,7 +42,6 @@ define(["dojo/_base/xhr",
                this.onDelete = function (object) {
                    // fired when an object is deleted
                };
-
            }
 
 
@@ -297,7 +296,7 @@ define(["dojo/_base/xhr",
                              else {
                                  thisObj.buildModel(data);
                              }
-                         });
+                         }, util.xhrErrorHandler);
 
            };
 



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