bug fixed in GxtBorderLayout e servlet classes for the submit query operation in such a way if a query does not generate a result a dialog shows a message to user.

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/databases-manager-portlet@99370 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Loredana Liccardo 2014-09-01 10:58:31 +00:00
parent 8e641ab117
commit 1ebffe746f
2 changed files with 22 additions and 6 deletions

View File

@ -842,8 +842,8 @@ public class GxtBorderLayoutPanel extends ContentPanel {
@Override
public void onFailure(Throwable caught) {
// Window.alert(caught.getMessage());
rootLogger.log(Level.SEVERE, "FAILURE RPC submitQuery");
rootLogger.log(Level.SEVERE, "FAILURE RPC submitQuery ");
Listener<MessageBoxEvent> l = new Listener<MessageBoxEvent>() {
public void handleEvent(MessageBoxEvent ce) {
// Button btn = ce.getButtonClicked();
@ -857,13 +857,22 @@ public class GxtBorderLayoutPanel extends ContentPanel {
}
};
MessageBox.alert("Error ",
"<br/>Message:" + caught.getMessage(), l);
if (!(caught.getMessage().equals("ServerException"))){
MessageBox.alert("Error ",
"<br/>Message:" + caught.getMessage(), l);
}
// if (!(caught instanceof javax.xml.ws.soap.SOAPFaultException)){
// MessageBox.alert("Error ",
// "<br/>Message:" + caught.getMessage(), l);
// }
}
@Override
public void onSuccess(List<String> listAttributes) {
rootLogger.log(Level.SEVERE, "SUCCESS RPC submitQuery");
if (form.getBody().isMasked())
form.getBody().unmask();
@ -875,6 +884,8 @@ public class GxtBorderLayoutPanel extends ContentPanel {
rootLogger.log(Level.SEVERE,
"No results have been returned");
MessageBox.alert("Error ", "<br/>Message:"+ "Result not available", null);
return;
}

View File

@ -615,7 +615,12 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
}
} catch (Exception e) {
// TODO: handle exception
// e.printStackTrace();
// e.printStackTrace();
//TODO to remove. Exception Statistical management to remove a computation
if (e.getMessage().contains("javax.xml.ws.soap.SOAPFaultException: java.lang.IndexOutOfBoundsException")){
e = new Exception("ServerException");
}
throw e;
}
return listAttributes;
}