changeset 4127:1e9e7b7d9f15

More fixes for #897: missing resource exceptions when handling other exceptions
author Christian Lins <christian.lins@intevation.de>
date Sun, 14 Oct 2012 09:46:58 +0200
parents e0354aed0cd3
children 11c589d68f13
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java
diffstat 3 files changed, 31 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Sat Oct 13 21:29:45 2012 +0200
+++ b/flys-client/ChangeLog	Sun Oct 14 09:46:58 2012 +0200
@@ -1,3 +1,9 @@
+2012-10-14	Christian Lins	<christian.lins@intevation.de>
+
+	* flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java,
+	  flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java:
+	  More fixes for #897: missing resource exceptions when handling other exceptions.
+
 2012-10-12	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	* flys-client/src/main/java/de/intevation/flys/client/client/ui/UIProviderFactory.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Sat Oct 13 21:29:45 2012 +0200
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Sun Oct 14 09:46:58 2012 +0200
@@ -2,6 +2,7 @@
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.rpc.AsyncCallback;
+
 import com.smartgwt.client.types.Alignment;
 import com.smartgwt.client.types.VerticalAlignment;
 import com.smartgwt.client.util.SC;
@@ -262,7 +263,7 @@
                 @Override
                 public void onFailure(Throwable caught) {
                     GWT.log("Could not create the new collection.");
-                    SC.warn(messages.getString(caught.getMessage()));
+                    SC.warn(FLYS.getExceptionString(messages, caught));
                 }
 
                 @Override
@@ -441,7 +442,7 @@
                     @Override
                     public void onFailure(Throwable caught) {
                         GWT.log("Could not DESCRIBE collection.");
-                        SC.warn(messages.getString(caught.getMessage()));
+                        SC.warn(FLYS.getExceptionString(messages, caught));
                     }
 
 
@@ -664,7 +665,7 @@
                 @Override
                 public void onFailure(Throwable caught) {
                     GWT.log("An error occured while adding artifact.");
-                    SC.warn(messages.getString(caught.getMessage()));
+                    SC.warn(FLYS.getExceptionString(messages, caught));
                 }
 
                 @Override
@@ -692,7 +693,7 @@
                     setCollection(collection);
 
                     GWT.log("An error occured while saving recommendations.");
-                    // TODO POPUP WARNING
+                    SC.warn(FLYS.getExceptionString(messages, caught));
                 }
 
                 @Override
@@ -742,6 +743,7 @@
                 public void onFailure(Throwable caught) {
                     GWT.log("Error loading recommendations: " +
                         caught.getMessage());
+                    SC.warn(FLYS.getExceptionString(messages, caught));
                 }
 
                 @Override
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java	Sat Oct 13 21:29:45 2012 +0200
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java	Sun Oct 14 09:46:58 2012 +0200
@@ -1,45 +1,41 @@
 package de.intevation.flys.client.client.ui;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.rpc.AsyncCallback;
 
 import com.smartgwt.client.data.Record;
 import com.smartgwt.client.types.ListGridFieldType;
 import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.layout.HLayout;
-import com.smartgwt.client.widgets.layout.VLayout;
+import com.smartgwt.client.widgets.events.ClickEvent;
 import com.smartgwt.client.widgets.grid.ListGrid;
 import com.smartgwt.client.widgets.grid.ListGridField;
 import com.smartgwt.client.widgets.grid.ListGridRecord;
-import com.smartgwt.client.widgets.events.ClickEvent;
 import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
 import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
+import com.smartgwt.client.widgets.layout.HLayout;
+import com.smartgwt.client.widgets.layout.VLayout;
 
+import de.intevation.flys.client.client.Config;
+import de.intevation.flys.client.client.FLYSConstants;
+import de.intevation.flys.client.client.event.StepForwardEvent;
+import de.intevation.flys.client.client.services.LoadArtifactServiceAsync;
+import de.intevation.flys.client.client.services.RemoveArtifactServiceAsync;
 import de.intevation.flys.client.shared.model.Artifact;
 import de.intevation.flys.client.shared.model.Collection;
 import de.intevation.flys.client.shared.model.Data;
 import de.intevation.flys.client.shared.model.DataItem;
+import de.intevation.flys.client.shared.model.DataList;
 import de.intevation.flys.client.shared.model.DefaultData;
 import de.intevation.flys.client.shared.model.DefaultDataItem;
-import de.intevation.flys.client.shared.model.DataList;
-import de.intevation.flys.client.shared.model.User;
-
-import de.intevation.flys.client.client.FLYSConstants;
-import de.intevation.flys.client.client.event.StepForwardEvent;
 import de.intevation.flys.client.shared.model.Recommendation;
 import de.intevation.flys.client.shared.model.Recommendation.Facet;
 import de.intevation.flys.client.shared.model.Recommendation.Filter;
+import de.intevation.flys.client.shared.model.User;
 
-import de.intevation.flys.client.client.Config;
-import de.intevation.flys.client.client.services.LoadArtifactService;
-import de.intevation.flys.client.client.services.LoadArtifactServiceAsync;
-import de.intevation.flys.client.client.services.RemoveArtifactService;
-import de.intevation.flys.client.client.services.RemoveArtifactServiceAsync;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 // TODO Probably better to branch off AbstractUIProvider.
 // TODO Merge with other datacage-widget impls.
@@ -247,6 +243,7 @@
            capitalField, removeField});
 
         differencesList.addRecordClickHandler(new RecordClickHandler() {
+                @Override
                 public void onRecordClick(final RecordClickEvent event) {
                     // Just handle remove-clicks
                     if(!event.getField().getName().equals(removeField.getName())) {
@@ -370,9 +367,11 @@
                 uuid,
                 locale,
                 new AsyncCallback<Collection>() {
+                    @Override
                     public void onFailure(Throwable caught) {
                         GWT.log("RemoveArtifact (" + uuid + ") failed.");
                     }
+                    @Override
                     public void onSuccess(Collection collection) {
                         GWT.log("RemoveArtifact succeeded");
                     }
@@ -387,9 +386,11 @@
             null,
             locale,
             new AsyncCallback<Artifact[]>() {
+                @Override
                 public void onFailure(Throwable caught) {
                     GWT.log("Failure of cloning with factories!");
                 }
+                @Override
                 public void onSuccess(Artifact[] artifacts) {
                     GWT.log("Successfully cloned " + toClone.length +
                         " with factories.");

http://dive4elements.wald.intevation.org