From 3f8622d49342153e11fb29d2c57b6f86ffff2ea0 Mon Sep 17 00:00:00 2001 From: Christos Stathis Date: Wed, 7 Dec 2011 17:06:14 +0200 Subject: [PATCH] Implemented ability to send error data along with user feedback in case of error --- .../grnet/pithos/web/client/DeleteFileDialog.java | 1 + src/gr/grnet/pithos/web/client/FeedbackDialog.java | 4 +- .../pithos/web/client/FilePropertiesDialog.java | 3 + .../pithos/web/client/FolderPropertiesDialog.java | 4 + src/gr/grnet/pithos/web/client/MessagePanel.java | 132 +++++++++----------- src/gr/grnet/pithos/web/client/Pithos.java | 28 ++++- src/gr/grnet/pithos/web/client/TopPanel.java | 3 +- src/gr/grnet/pithos/web/client/VersionsList.java | 1 + .../pithos/web/client/commands/AddUserCommand.java | 3 +- .../web/client/commands/DeleteGroupCommand.java | 1 + .../web/client/commands/EmptyTrashCommand.java | 3 + .../pithos/web/client/commands/PasteCommand.java | 1 + .../web/client/commands/RemoveUserCommand.java | 1 + .../web/client/commands/RestoreTrashCommand.java | 4 + .../pithos/web/client/commands/ToTrashCommand.java | 4 + .../web/client/foldertree/FolderTreeViewModel.java | 2 + .../client/mysharedtree/MysharedTreeViewModel.java | 2 + .../othersharedtree/OtherSharedTreeViewModel.java | 5 + .../web/client/tagtree/TagTreeViewModel.java | 1 + src/gr/grnet/pithos/web/public/pithos.css | 1 + 20 files changed, 123 insertions(+), 81 deletions(-) diff --git a/src/gr/grnet/pithos/web/client/DeleteFileDialog.java b/src/gr/grnet/pithos/web/client/DeleteFileDialog.java index 9b67a53..aee2d28 100644 --- a/src/gr/grnet/pithos/web/client/DeleteFileDialog.java +++ b/src/gr/grnet/pithos/web/client/DeleteFileDialog.java @@ -145,6 +145,7 @@ public class DeleteFileDialog extends DialogBox { @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) { app.displayError("Unable to delete file: " + ((RestException) t).getHttpStatusText()); } diff --git a/src/gr/grnet/pithos/web/client/FeedbackDialog.java b/src/gr/grnet/pithos/web/client/FeedbackDialog.java index 83a2db9..a337792 100644 --- a/src/gr/grnet/pithos/web/client/FeedbackDialog.java +++ b/src/gr/grnet/pithos/web/client/FeedbackDialog.java @@ -63,7 +63,7 @@ public class FeedbackDialog extends DialogBox { /** * The widget constructor. */ - public FeedbackDialog(final Pithos app) { + public FeedbackDialog(final Pithos app, final String appData) { // Set the dialog's caption. Anchor close = new Anchor(); close.addStyleName("close"); @@ -105,7 +105,7 @@ public class FeedbackDialog extends DialogBox { Button confirm = new Button("Submit feedback", new ClickHandler() { @Override public void onClick(ClickEvent event) { - PostRequest sendFeedback = new PostRequest("/tools/", "", "feedback", "feedback-msg=" + msg.getText()) { + PostRequest sendFeedback = new PostRequest("/tools/", "", "feedback", "feedback-msg=" + msg.getText() + "&feedback-data=" + appData) { @Override protected void onUnauthorized(Response response) { diff --git a/src/gr/grnet/pithos/web/client/FilePropertiesDialog.java b/src/gr/grnet/pithos/web/client/FilePropertiesDialog.java index c487d18..1f1a1b0 100644 --- a/src/gr/grnet/pithos/web/client/FilePropertiesDialog.java +++ b/src/gr/grnet/pithos/web/client/FilePropertiesDialog.java @@ -183,6 +183,7 @@ public class FilePropertiesDialog extends AbstractPropertiesDialog { @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) { app.displayError("Unable to fetch versions: " + ((RestException) t).getHttpStatusText()); } @@ -435,6 +436,7 @@ public class FilePropertiesDialog extends AbstractPropertiesDialog { @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); app.displayError("System error modifying file:" + t.getMessage()); } @@ -463,6 +465,7 @@ public class FilePropertiesDialog extends AbstractPropertiesDialog { @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); app.displayError("System error modifying file:" + t.getMessage()); } diff --git a/src/gr/grnet/pithos/web/client/FolderPropertiesDialog.java b/src/gr/grnet/pithos/web/client/FolderPropertiesDialog.java index 611c0aa..523dbe1 100644 --- a/src/gr/grnet/pithos/web/client/FolderPropertiesDialog.java +++ b/src/gr/grnet/pithos/web/client/FolderPropertiesDialog.java @@ -301,6 +301,7 @@ public class FolderPropertiesDialog extends DialogBox { @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) { app.displayError("Unable to create folder:" + ((RestException) t).getHttpStatusText()); } @@ -360,6 +361,7 @@ public class FolderPropertiesDialog extends DialogBox { @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if(t instanceof RestException){ app.displayError("Unable to update folder: " + ((RestException) t).getHttpStatusText()); } @@ -393,6 +395,7 @@ public class FolderPropertiesDialog extends DialogBox { @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) { if (((RestException) t).getHttpStatusCode() == Response.SC_NOT_FOUND) { //Probably a virtual folder final String path1 = folder.getUri(); @@ -405,6 +408,7 @@ public class FolderPropertiesDialog extends DialogBox { @Override public void onError(Throwable _t) { GWT.log("", _t); + app.setError(_t); if(_t instanceof RestException){ app.displayError("Unable to update folder: " + ((RestException) _t).getHttpStatusText()); } diff --git a/src/gr/grnet/pithos/web/client/MessagePanel.java b/src/gr/grnet/pithos/web/client/MessagePanel.java index 8ed1c9a..81aa361 100644 --- a/src/gr/grnet/pithos/web/client/MessagePanel.java +++ b/src/gr/grnet/pithos/web/client/MessagePanel.java @@ -42,7 +42,6 @@ import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.resources.client.ClientBundle; import com.google.gwt.resources.client.ImageResource; -import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.AbstractImagePrototype; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.HTML; @@ -50,6 +49,7 @@ import com.google.gwt.user.client.ui.HasHorizontalAlignment; import com.google.gwt.user.client.ui.HasVerticalAlignment; import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.SimplePanel; +import com.google.gwt.user.client.ui.VerticalPanel; /** * A panel that displays various system messages. @@ -77,54 +77,44 @@ public class MessagePanel extends Composite { /** * The system message to be displayed. */ - private HTML message = new HTML(" "); - - /** - * A link to clear the displayed message. - */ - private HTML clearMessageLink = new HTML("Clear"); + private HTML message; /** * The panel that contains the messages. */ - private HorizontalPanel inner = new HorizontalPanel(); + private HorizontalPanel inner; /** * The panel that enables special effects for this widget. */ - protected SimplePanel simplePanel = new SimplePanel(); + protected SimplePanel simplePanel; /** + * A link to send feedBack about the error. + */ + private HTML feedbackLink; + /** * The widget's constructor. * * @param newImages a bundle that provides the images for this widget */ - public MessagePanel(final Images newImages) { + public MessagePanel(final Pithos app, final Images newImages) { images = newImages; - buildPanel(); + simplePanel = new SimplePanel(); simplePanel.setStyleName("effectPanel"); + + inner = new HorizontalPanel(); inner.setStyleName("effectPanel-inner"); - DOM.setStyleAttribute(simplePanel.getElement(), "zoom", "1"); - simplePanel.add(inner); - initWidget(simplePanel); - } - - /** - * Build the panel that contains the icon, the message and the 'clear' link. - */ - private void buildPanel() { - inner.clear(); inner.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); inner.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); -// inner.setSpacing(4); - inner.add(message); - inner.add(clearMessageLink); - inner.setCellVerticalAlignment(message, HasVerticalAlignment.ALIGN_MIDDLE); - clearMessageLink.addClickHandler(new ClickHandler() { + + message = new HTML(" "); + message.addClickHandler(new ClickHandler() { @Override public void onClick(@SuppressWarnings("unused") ClickEvent event) { FadeOut anim = new FadeOut(simplePanel){ + @Override protected void onComplete() { super.onComplete(); @@ -134,22 +124,20 @@ public class MessagePanel extends Composite { anim.run(500); } }); - } + inner.add(message); + inner.setCellVerticalAlignment(message, HasVerticalAlignment.ALIGN_MIDDLE); - /** - * Display an error message. - * - * @param msg the message to display - */ - public void displayError(final String msg) { - GWT.log(msg, null); - message = new HTML("
" + AbstractImagePrototype.create(images.error()).getHTML() + "" + msg + "
"); - message.addClickHandler(new ClickHandler() { + VerticalPanel linkPanel = new VerticalPanel(); + linkPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); + /** + * A link to clear the displayed message. + */ + HTML clearMessageLink = new HTML("Clear"); + clearMessageLink.addClickHandler(new ClickHandler() { @Override public void onClick(@SuppressWarnings("unused") ClickEvent event) { FadeOut anim = new FadeOut(simplePanel){ - @Override protected void onComplete() { super.onComplete(); @@ -159,7 +147,34 @@ public class MessagePanel extends Composite { anim.run(500); } }); - buildPanel(); + linkPanel.add(clearMessageLink); + + feedbackLink = new HTML("Send feedback"); + feedbackLink.addClickHandler(new ClickHandler() { + + @Override + public void onClick(@SuppressWarnings("unused") ClickEvent event) { + new FeedbackDialog(app, app.getErrorData()).center(); + } + }); + feedbackLink.setVisible(false); + linkPanel.add(feedbackLink); + + inner.add(linkPanel); + simplePanel.add(inner); + + initWidget(simplePanel); + } + + /** + * Display an error message. + * + * @param msg the message to display + */ + public void displayError(final String msg) { + GWT.log(msg, null); + message.setHTML("
" + AbstractImagePrototype.create(images.error()).getHTML() + "" + msg + "
"); + feedbackLink.setVisible(true); setVisible(true); FadeIn anim = new FadeIn(simplePanel); anim.run(500); @@ -171,24 +186,8 @@ public class MessagePanel extends Composite { * @param msg the message to display */ public void displayWarning(final String msg) { - message = new HTML("
" + AbstractImagePrototype.create(images.warn()).getHTML() + "" + msg + "
"); - message.addClickHandler(new ClickHandler() { - - @Override - public void onClick(@SuppressWarnings("unused") ClickEvent event) { - FadeOut anim = new FadeOut(simplePanel){ - - @Override - protected void onComplete() { - super.onComplete(); - hideMessage(); - } - }; - anim.run(500); - } - }); - - buildPanel(); + message.setHTML("
" + AbstractImagePrototype.create(images.warn()).getHTML() + "" + msg + "
"); + feedbackLink.setVisible(false); setVisible(true); FadeIn anim = new FadeIn(simplePanel); anim.run(500); @@ -200,24 +199,8 @@ public class MessagePanel extends Composite { * @param msg the message to display */ public void displayInformation(final String msg) { - message = new HTML("
" + AbstractImagePrototype.create(images.info()).getHTML() + "" + msg + "
"); - message.addClickHandler(new ClickHandler() { - - @Override - public void onClick(@SuppressWarnings("unused") ClickEvent event) { - FadeOut anim = new FadeOut(simplePanel){ - - @Override - protected void onComplete() { - super.onComplete(); - hideMessage(); - } - }; - anim.run(500); - } - }); - - buildPanel(); + message.setHTML("
" + AbstractImagePrototype.create(images.info()).getHTML() + "" + msg + "
"); + feedbackLink.setVisible(false); setVisible(true); FadeIn anim = new FadeIn(simplePanel); anim.run(500); @@ -227,7 +210,6 @@ public class MessagePanel extends Composite { * Clear the displayed message and hide the panel. */ public void hideMessage() { - inner.clear(); message = new HTML(" "); this.setVisible(false); } diff --git a/src/gr/grnet/pithos/web/client/Pithos.java b/src/gr/grnet/pithos/web/client/Pithos.java index f3b3681..4fa2daa 100644 --- a/src/gr/grnet/pithos/web/client/Pithos.java +++ b/src/gr/grnet/pithos/web/client/Pithos.java @@ -177,6 +177,8 @@ public class Pithos implements EntryPoint, ResizeHandler { ImageResource tools(); } + private Throwable error; + /** * The Application Clipboard implementation; */ @@ -190,7 +192,7 @@ public class Pithos implements EntryPoint, ResizeHandler { /** * The panel that contains the various system messages. */ - private MessagePanel messagePanel = new MessagePanel(Pithos.images); + private MessagePanel messagePanel = new MessagePanel(this, Pithos.images); /** * The bottom panel that contains the status bar. @@ -563,6 +565,7 @@ public class Pithos implements EntryPoint, ResizeHandler { @Override public void onError(Throwable t) { GWT.log("Error getting file", t); + setError(t); if (t instanceof RestException) displayError("Error getting file: " + ((RestException) t).getHttpStatusText()); else @@ -635,6 +638,7 @@ public class Pithos implements EntryPoint, ResizeHandler { @Override public void onError(Throwable t) { GWT.log("Error getting account", t); + setError(t); if (t instanceof RestException) displayError("Error getting account: " + ((RestException) t).getHttpStatusText()); else @@ -661,6 +665,7 @@ public class Pithos implements EntryPoint, ResizeHandler { @Override public void onError(Throwable t) { GWT.log("Error getting account", t); + setError(t); if (t instanceof RestException) displayError("Error getting account: " + ((RestException) t).getHttpStatusText()); else @@ -697,6 +702,7 @@ public class Pithos implements EntryPoint, ResizeHandler { @Override public void onError(Throwable t) { GWT.log("Error creating pithos", t); + setError(t); if (t instanceof RestException) displayError("Error creating pithos: " + ((RestException) t).getHttpStatusText()); else @@ -723,6 +729,7 @@ public class Pithos implements EntryPoint, ResizeHandler { @Override public void onError(Throwable t) { GWT.log("Error creating pithos", t); + setError(t); if (t instanceof RestException) displayError("Error creating pithos: " + ((RestException) t).getHttpStatusText()); else @@ -882,6 +889,7 @@ public class Pithos implements EntryPoint, ResizeHandler { @Override public void onError(@SuppressWarnings("unused") Request request, Throwable exception) { + setError(exception); displayError("System error unable to delete folder: " + exception.getMessage()); } }); @@ -905,6 +913,7 @@ public class Pithos implements EntryPoint, ResizeHandler { @Override public void onError(Throwable t) { GWT.log("", t); + setError(t); displayError("System error unable to delete folder: " + t.getMessage()); } @@ -941,6 +950,7 @@ public class Pithos implements EntryPoint, ResizeHandler { @Override public void onError(@SuppressWarnings("unused") Request request, Throwable exception) { + setError(exception); displayError("System error unable to delete folder: " + exception.getMessage()); } }); @@ -966,6 +976,7 @@ public class Pithos implements EntryPoint, ResizeHandler { @Override public void onError(Throwable t) { GWT.log("", t); + setError(t); if (t instanceof RestException) { if (((RestException) t).getHttpStatusCode() != Response.SC_NOT_FOUND) displayError("Unable to delete folder: "+((RestException) t).getHttpStatusText()); @@ -1003,6 +1014,7 @@ public class Pithos implements EntryPoint, ResizeHandler { @Override public void onError(Throwable t) { GWT.log("", t); + setError(t); if (t instanceof RestException) { displayError("Unable to copy file: " + ((RestException) t).getHttpStatusText()); } @@ -1065,6 +1077,7 @@ public class Pithos implements EntryPoint, ResizeHandler { @Override public void onError(Throwable t) { GWT.log("", t); + setError(t); if (t instanceof RestException) { displayError("Unable to get folder: " + ((RestException) t).getHttpStatusText()); } @@ -1084,7 +1097,8 @@ public class Pithos implements EntryPoint, ResizeHandler { @Override public void onError(Throwable t) { GWT.log("", t); - if (t instanceof RestException) { + setError(t); + if (t instanceof RestException) { displayError("Unable to create folder: " + ((RestException) t).getHttpStatusText()); } else @@ -1215,4 +1229,14 @@ public class Pithos implements EntryPoint, ResizeHandler { Cookies.removeCookie(s, "/"); Window.Location.assign(Window.Location.getPath()); } + + public String getErrorData() { + if (error != null) + return error.toString(); + return ""; + } + + public void setError(Throwable t) { + error = t; + } } diff --git a/src/gr/grnet/pithos/web/client/TopPanel.java b/src/gr/grnet/pithos/web/client/TopPanel.java index 24968cf..bf9290f 100644 --- a/src/gr/grnet/pithos/web/client/TopPanel.java +++ b/src/gr/grnet/pithos/web/client/TopPanel.java @@ -121,6 +121,7 @@ public class TopPanel extends Composite { @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) app.displayError("Error getting invitations: " + ((RestException) t).getHttpStatusText()); else @@ -140,7 +141,7 @@ public class TopPanel extends Composite { @Override public void execute() { - new FeedbackDialog(app).center(); + new FeedbackDialog(app, "").center(); } })); userItemMenu.addItem(new MenuItem("API access", new Command() { diff --git a/src/gr/grnet/pithos/web/client/VersionsList.java b/src/gr/grnet/pithos/web/client/VersionsList.java index 1e546a7..17ff860 100644 --- a/src/gr/grnet/pithos/web/client/VersionsList.java +++ b/src/gr/grnet/pithos/web/client/VersionsList.java @@ -141,6 +141,7 @@ public class VersionsList extends Composite { @Override public void onError(Throwable t) { + app.setError(t); if (t instanceof RestException) { if (((RestException) t).getHttpStatusCode() == Response.SC_NO_CONTENT) onSuccess(null); diff --git a/src/gr/grnet/pithos/web/client/commands/AddUserCommand.java b/src/gr/grnet/pithos/web/client/commands/AddUserCommand.java index 05be500..be0e0f9 100644 --- a/src/gr/grnet/pithos/web/client/commands/AddUserCommand.java +++ b/src/gr/grnet/pithos/web/client/commands/AddUserCommand.java @@ -86,10 +86,11 @@ public class AddUserCommand implements Command { @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) { app.displayError("Unable to update group:" + ((RestException) t).getHttpStatusText()); } - else + else app.displayError("System error updating group:" + t.getMessage()); } diff --git a/src/gr/grnet/pithos/web/client/commands/DeleteGroupCommand.java b/src/gr/grnet/pithos/web/client/commands/DeleteGroupCommand.java index d87b679..8daf2d2 100644 --- a/src/gr/grnet/pithos/web/client/commands/DeleteGroupCommand.java +++ b/src/gr/grnet/pithos/web/client/commands/DeleteGroupCommand.java @@ -85,6 +85,7 @@ public class DeleteGroupCommand implements Command { @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) { app.displayError("Unable to delete group:" + ((RestException) t).getHttpStatusText()); } diff --git a/src/gr/grnet/pithos/web/client/commands/EmptyTrashCommand.java b/src/gr/grnet/pithos/web/client/commands/EmptyTrashCommand.java index b519a0f..ce836e8 100644 --- a/src/gr/grnet/pithos/web/client/commands/EmptyTrashCommand.java +++ b/src/gr/grnet/pithos/web/client/commands/EmptyTrashCommand.java @@ -124,6 +124,7 @@ public class EmptyTrashCommand implements Command{ @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) { app.displayError("Unable to delete file:" + ((RestException) t).getHttpStatusText()); } @@ -147,6 +148,7 @@ public class EmptyTrashCommand implements Command{ @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) { app.displayError("Unable to get folder: " + ((RestException) t).getHttpStatusText()); } @@ -182,6 +184,7 @@ public class EmptyTrashCommand implements Command{ @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) { app.displayError("Unable to delete file:" + ((RestException) t).getHttpStatusText()); } diff --git a/src/gr/grnet/pithos/web/client/commands/PasteCommand.java b/src/gr/grnet/pithos/web/client/commands/PasteCommand.java index 9d344bd..639050b 100644 --- a/src/gr/grnet/pithos/web/client/commands/PasteCommand.java +++ b/src/gr/grnet/pithos/web/client/commands/PasteCommand.java @@ -145,6 +145,7 @@ public class PasteCommand implements Command { @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) { app.displayError("Unable to copy file: " + ((RestException) t).getHttpStatusText()); } diff --git a/src/gr/grnet/pithos/web/client/commands/RemoveUserCommand.java b/src/gr/grnet/pithos/web/client/commands/RemoveUserCommand.java index fa72c36..3bce1df 100644 --- a/src/gr/grnet/pithos/web/client/commands/RemoveUserCommand.java +++ b/src/gr/grnet/pithos/web/client/commands/RemoveUserCommand.java @@ -85,6 +85,7 @@ public class RemoveUserCommand implements Command { @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) { app.displayError("Unable to update group:" + ((RestException) t).getHttpStatusText()); } diff --git a/src/gr/grnet/pithos/web/client/commands/RestoreTrashCommand.java b/src/gr/grnet/pithos/web/client/commands/RestoreTrashCommand.java index 936be5e..4210de1 100644 --- a/src/gr/grnet/pithos/web/client/commands/RestoreTrashCommand.java +++ b/src/gr/grnet/pithos/web/client/commands/RestoreTrashCommand.java @@ -125,6 +125,7 @@ public class RestoreTrashCommand implements Command { @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) { if (((RestException) t).getHttpStatusCode() == Response.SC_NOT_FOUND) onSuccess(null); @@ -151,6 +152,7 @@ public class RestoreTrashCommand implements Command { @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) { app.displayError("Unable to get folder: " + ((RestException) t).getHttpStatusText()); } @@ -170,6 +172,7 @@ public class RestoreTrashCommand implements Command { @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) { app.displayError("Unable to create folder:" + ((RestException) t).getHttpStatusText()); } @@ -202,6 +205,7 @@ public class RestoreTrashCommand implements Command { @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) { app.displayError("Unable to copy file: " + ((RestException) t).getHttpStatusText()); } diff --git a/src/gr/grnet/pithos/web/client/commands/ToTrashCommand.java b/src/gr/grnet/pithos/web/client/commands/ToTrashCommand.java index a7411fc..614b8ed 100644 --- a/src/gr/grnet/pithos/web/client/commands/ToTrashCommand.java +++ b/src/gr/grnet/pithos/web/client/commands/ToTrashCommand.java @@ -126,6 +126,7 @@ public class ToTrashCommand implements Command{ @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) { if (((RestException) t).getHttpStatusCode() == Response.SC_NOT_FOUND) onSuccess(null); @@ -152,6 +153,7 @@ public class ToTrashCommand implements Command{ @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) { app.displayError("Unable to get folder: " + ((RestException) t).getHttpStatusText()); } @@ -171,6 +173,7 @@ public class ToTrashCommand implements Command{ @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) { app.displayError("Unable to create folder:" + ((RestException) t).getHttpStatusText()); } @@ -205,6 +208,7 @@ public class ToTrashCommand implements Command{ @Override public void onError(Throwable t) { GWT.log("", t); + app.setError(t); if (t instanceof RestException) { app.displayError("Unable to copy file: " + ((RestException) t).getHttpStatusText()); } diff --git a/src/gr/grnet/pithos/web/client/foldertree/FolderTreeViewModel.java b/src/gr/grnet/pithos/web/client/foldertree/FolderTreeViewModel.java index 4402ed8..0fb166b 100644 --- a/src/gr/grnet/pithos/web/client/foldertree/FolderTreeViewModel.java +++ b/src/gr/grnet/pithos/web/client/foldertree/FolderTreeViewModel.java @@ -156,6 +156,7 @@ public class FolderTreeViewModel implements TreeViewModel { @Override public void onError(Throwable t) { GWT.log("Error getting folder", t); + app.setError(t); if (t instanceof RestException) app.displayError("Error getting folder: " + ((RestException) t).getHttpStatusText()); else @@ -241,6 +242,7 @@ public class FolderTreeViewModel implements TreeViewModel { @Override public void onError(Throwable t) { GWT.log("Error getting folder", t); + app.setError(t); if (t instanceof RestException) app.displayError("Error getting folder: " + ((RestException) t).getHttpStatusText()); else diff --git a/src/gr/grnet/pithos/web/client/mysharedtree/MysharedTreeViewModel.java b/src/gr/grnet/pithos/web/client/mysharedtree/MysharedTreeViewModel.java index ca584f9..2d9e9d3 100644 --- a/src/gr/grnet/pithos/web/client/mysharedtree/MysharedTreeViewModel.java +++ b/src/gr/grnet/pithos/web/client/mysharedtree/MysharedTreeViewModel.java @@ -231,6 +231,7 @@ public class MysharedTreeViewModel implements TreeViewModel { @Override public void onError(Throwable t) { GWT.log("Error getting folder", t); + app.setError(t); if (t instanceof RestException) app.displayError("Error getting folder: " + ((RestException) t).getHttpStatusText()); else @@ -282,6 +283,7 @@ public class MysharedTreeViewModel implements TreeViewModel { @Override public void onError(Throwable t) { GWT.log("Error getting folder", t); + app.setError(t); if (t instanceof RestException) app.displayError("Error getting folder: " + ((RestException) t).getHttpStatusText()); else diff --git a/src/gr/grnet/pithos/web/client/othersharedtree/OtherSharedTreeViewModel.java b/src/gr/grnet/pithos/web/client/othersharedtree/OtherSharedTreeViewModel.java index d71cbe9..54c60f7 100644 --- a/src/gr/grnet/pithos/web/client/othersharedtree/OtherSharedTreeViewModel.java +++ b/src/gr/grnet/pithos/web/client/othersharedtree/OtherSharedTreeViewModel.java @@ -216,6 +216,7 @@ public class OtherSharedTreeViewModel implements TreeViewModel { @Override public void onError(Throwable t) { GWT.log("Error getting folder", t); + app.setError(t); if (t instanceof RestException) app.displayError("Error getting folder: " + ((RestException) t).getHttpStatusText()); else @@ -292,6 +293,7 @@ public class OtherSharedTreeViewModel implements TreeViewModel { @Override public void onError(Throwable t) { GWT.log("Error getting account", t); + app.setError(t); if (t instanceof RestException) app.displayError("Error getting account: " + ((RestException) t).getHttpStatusText()); else @@ -328,6 +330,7 @@ public class OtherSharedTreeViewModel implements TreeViewModel { @Override public void onError(Throwable t) { GWT.log("Error getting account", t); + app.setError(t); if (t instanceof RestException) app.displayError("Error getting account: " + ((RestException) t).getHttpStatusText()); else @@ -374,6 +377,7 @@ public class OtherSharedTreeViewModel implements TreeViewModel { @Override public void onError(Throwable t) { GWT.log("Error getting folder", t); + app.setError(t); if (t instanceof RestException) app.displayError("Error getting folder: " + ((RestException) t).getHttpStatusText()); else @@ -425,6 +429,7 @@ public class OtherSharedTreeViewModel implements TreeViewModel { @Override public void onError(Throwable t) { GWT.log("Error getting folder", t); + app.setError(t); if (t instanceof RestException) app.displayError("Error getting folder: " + ((RestException) t).getHttpStatusText()); else diff --git a/src/gr/grnet/pithos/web/client/tagtree/TagTreeViewModel.java b/src/gr/grnet/pithos/web/client/tagtree/TagTreeViewModel.java index 4cee314..ff5778f 100644 --- a/src/gr/grnet/pithos/web/client/tagtree/TagTreeViewModel.java +++ b/src/gr/grnet/pithos/web/client/tagtree/TagTreeViewModel.java @@ -158,6 +158,7 @@ public class TagTreeViewModel implements TreeViewModel { @Override public void onError(Throwable th) { GWT.log("Error getting folder", th); + app.setError(th); if (th instanceof RestException) app.displayError("Error getting folder: " + ((RestException) th).getHttpStatusText()); else diff --git a/src/gr/grnet/pithos/web/public/pithos.css b/src/gr/grnet/pithos/web/public/pithos.css index 4cb5286..62a55e6 100644 --- a/src/gr/grnet/pithos/web/public/pithos.css +++ b/src/gr/grnet/pithos/web/public/pithos.css @@ -318,6 +318,7 @@ table.pithos-permList.props-labels { font-weight: bold; text-decoration: none; color: black; + padding-left: 5px; } .pithos-clearMessage:visited { -- 1.7.10.4