comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java @ 215:e02f50a3ad59

Improved the exception handling of artifact / collection specific operations. Warning dialog are displayed after such an exception. flys-client/trunk@1657 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 08 Apr 2011 08:51:28 +0000
parents b92281182c6b
children a4a68b4ee2a3
comparison
equal deleted inserted replaced
214:29c6d9573ae7 215:e02f50a3ad59
7 import java.util.Set; 7 import java.util.Set;
8 8
9 import com.google.gwt.core.client.GWT; 9 import com.google.gwt.core.client.GWT;
10 import com.google.gwt.user.client.rpc.AsyncCallback; 10 import com.google.gwt.user.client.rpc.AsyncCallback;
11 11
12 import com.smartgwt.client.util.SC;
12 import com.smartgwt.client.widgets.Window; 13 import com.smartgwt.client.widgets.Window;
13 import com.smartgwt.client.widgets.layout.Layout; 14 import com.smartgwt.client.widgets.layout.Layout;
14 import com.smartgwt.client.widgets.layout.VLayout; 15 import com.smartgwt.client.widgets.layout.VLayout;
15 import com.smartgwt.client.widgets.tab.TabSet; 16 import com.smartgwt.client.widgets.tab.TabSet;
16 17
144 createCollectionService.create( 145 createCollectionService.create(
145 serverUrl, ownerId, 146 serverUrl, ownerId,
146 new AsyncCallback<Collection>() { 147 new AsyncCallback<Collection>() {
147 public void onFailure(Throwable caught) { 148 public void onFailure(Throwable caught) {
148 GWT.log("Could not create the new collection."); 149 GWT.log("Could not create the new collection.");
149 GWT.log(caught.getMessage()); 150 SC.warn(messages.getString(caught.getMessage()));
150 } 151 }
151 152
152 public void onSuccess(Collection collection) { 153 public void onSuccess(Collection collection) {
153 GWT.log("Successfully created a new collection."); 154 GWT.log("Successfully created a new collection.");
154 155
156 addArtifactService.add(collection, artifact, serverUrl, 157 addArtifactService.add(collection, artifact, serverUrl,
157 new AsyncCallback<Collection>() { 158 new AsyncCallback<Collection>() {
158 159
159 public void onFailure(Throwable caught) { 160 public void onFailure(Throwable caught) {
160 GWT.log("An error occured while adding artifact."); 161 GWT.log("An error occured while adding artifact.");
161 GWT.log(caught.getMessage()); 162 SC.warn(messages.getString(caught.getMessage()));
162 } 163 }
163 164
164 public void onSuccess(Collection newCollection) { 165 public void onSuccess(Collection newCollection) {
165 GWT.log("Successfully added artifact."); 166 GWT.log("Successfully added artifact.");
166 setCollection(newCollection); 167 setCollection(newCollection);
263 264
264 describeCollectionService.describe(collection.identifier(), url, 265 describeCollectionService.describe(collection.identifier(), url,
265 new AsyncCallback<Collection>() { 266 new AsyncCallback<Collection>() {
266 public void onFailure(Throwable caught) { 267 public void onFailure(Throwable caught) {
267 GWT.log("Could not DESCRIBE collection."); 268 GWT.log("Could not DESCRIBE collection.");
268 GWT.log(caught.getMessage()); 269 SC.warn(messages.getString(caught.getMessage()));
269 } 270 }
270 271
271 272
272 public void onSuccess(Collection newCollection) { 273 public void onSuccess(Collection newCollection) {
273 GWT.log("Successfully DESCRIBED collection."); 274 GWT.log("Successfully DESCRIBED collection.");

http://dive4elements.wald.intevation.org