[rhq] 2 commits - modules/enterprise

Jay Shaughnessy jshaughn at fedoraproject.org
Thu Aug 9 13:22:46 UTC 2012


 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java |    3 +++
 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/TrackingRequestCallback.java                 |    8 +++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 396b48fde3613c359b49ca4b776ee18fa39f3865
Author: Jay Shaughnessy <jshaughn at redhat.com>
Date:   Thu Aug 9 09:12:57 2012 -0400

    [Bug 847014 - Resource tree not complete when more than 200 children]
    Allow an unlimited number of children when expanding the tree node. Although
    this may create a large vertical expansion, it may also be what the
    user wants.  See BZ comments for more on the approach and alternatives
    but basically, take this [easy] approach until it's clear that users, or UX,
    want something else.

diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java
index c072e13..2a5b827 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java
@@ -43,6 +43,7 @@ import org.rhq.core.domain.criteria.ResourceCriteria;
 import org.rhq.core.domain.resource.Resource;
 import org.rhq.core.domain.resource.ResourceSubCategory;
 import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.util.PageControl;
 import org.rhq.core.domain.util.PageList;
 import org.rhq.enterprise.gui.coregui.client.CoreGUI;
 import org.rhq.enterprise.gui.coregui.client.Messages;
@@ -152,6 +153,8 @@ public class ResourceTreeDatasource extends DataSource {
 
             ResourceCriteria criteria = new ResourceCriteria();
             criteria.addFilterParentResourceId(Integer.parseInt(parentResourceId));
+            // we don't need sorting since we get everything and the tree nodes are already sorted
+            criteria.setPageControl(PageControl.getUnlimitedInstance());
 
             resourceService.findResourcesByCriteria(criteria, new AsyncCallback<PageList<Resource>>() {
                 public void onFailure(Throwable caught) {


commit c1d401ff6c2b495cb599dfb66e0dd157b6442614
Author: Jay Shaughnessy <jshaughn at redhat.com>
Date:   Thu Aug 9 09:05:46 2012 -0400

    [Bug 838683 - If RHQ server is down, UI shows "Server returned FAILURE with no error message"]
    More recent versions of Firefox, and possibly other browsers, have changed
    the request's response code in this situation.  Added updated handling.
    Also, fixed an I18N issue.

diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/TrackingRequestCallback.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/TrackingRequestCallback.java
index f461f6e..2702814 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/TrackingRequestCallback.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/TrackingRequestCallback.java
@@ -18,7 +18,6 @@
  */
 package org.rhq.enterprise.gui.coregui.client.util.rpc;
 
-import java.util.logging.Logger;
 import com.google.gwt.http.client.Request;
 import com.google.gwt.http.client.RequestCallback;
 import com.google.gwt.http.client.Response;
@@ -38,6 +37,7 @@ public class TrackingRequestCallback implements RequestCallback {
     private long start = System.currentTimeMillis();
 
     private static final int STATUS_CODE_OK = 200;
+    private static final int STATUS_CODE_ERROR_INTERNET_NO_RESPONSE = 0;
     private static final int STATUS_CODE_ERROR_INTERNET_CANNOT_CONNECT = 12029;
     private static final int STATUS_CODE_ERROR_INTERNET_CONNECTION_ABORTED = 12030;
 
@@ -69,7 +69,7 @@ public class TrackingRequestCallback implements RequestCallback {
             statusCode = response.getStatusCode();
             statusText = response.getStatusText();
         } catch (Throwable t) {
-            // If the server is unreachable or has terminated firefox will generate a JavaScript exception
+            // If the server is unreachable or has terminated firefox may generate a JavaScript exception
             // when trying to read the response object. Let the user know the server is unreachable.
             // (http://helpful.knobs-dials.com/index.php/0x80004005_%28NS_ERROR_FAILURE%29_and_other_firefox_errors)) 
             if (UserSessionManager.isLoggedIn()) {
@@ -90,13 +90,15 @@ public class TrackingRequestCallback implements RequestCallback {
             callback.onResponseReceived(request, response);
             break;
 
+        // these status codes are known to be returned from various browsers when the server is lost or not responding
+        case STATUS_CODE_ERROR_INTERNET_NO_RESPONSE:
         case STATUS_CODE_ERROR_INTERNET_CANNOT_CONNECT:
         case STATUS_CODE_ERROR_INTERNET_CONNECTION_ABORTED:
             RPCTracker.getInstance().failCall(this);
             // If the server is unreachable or has terminated, and the user is still logged in,
             // let them know the server is now unreachable. 
             if (UserSessionManager.isLoggedIn()) {
-                CoreGUI.getErrorHandler().handleError("Server unreachable and may be down");
+                CoreGUI.getErrorHandler().handleError(CoreGUI.getMessages().view_core_serverUnreachable());
             }
             break;
 




More information about the rhq-commits mailing list