Fixed Final and Lock error

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@100289 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-09-30 12:38:31 +00:00
parent b4158cf9a1
commit 11a6c4e54a
5 changed files with 139 additions and 68 deletions

View File

@ -1,10 +1,16 @@
package org.gcube.portlets.user.td.expressionwidget.client;
import org.gcube.portlets.user.td.expressionwidget.client.resources.ExpressionResources;
import org.gcube.portlets.user.td.expressionwidget.client.utils.UtilsGXT3;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ExpressionEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ExpressionType;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
@ -17,8 +23,8 @@ import com.google.web.bindery.event.shared.EventBus;
import com.sencha.gxt.widget.core.client.Window;
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
import com.sencha.gxt.widget.core.client.event.HideEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
/**
@ -145,8 +151,21 @@ public class ColumnExpressionDialog extends Window {
new AsyncCallback<ColumnData>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
caught.getLocalizedMessage());
} else {
Log.error("Error retrieving column: "
+ caught.getMessage());
UtilsGXT3.alert("Error","Error retrieving column: "
+ caught.getMessage());
}
}
}

View File

@ -4,6 +4,8 @@ import org.gcube.portlets.user.td.expressionwidget.client.resources.ExpressionRe
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
import org.gcube.portlets.user.td.expressionwidget.client.utils.UtilsGXT3;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.FilterColumnSession;
@ -137,11 +139,23 @@ public class ColumnFilterDialog extends Window implements MonitorDialogListener
new AsyncCallback<ColumnData>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
caught.getLocalizedMessage());
} else {
Log.error("Error retrieving column: "
+ caught.getMessage());
UtilsGXT3.alert("Error retrieving column",
caught.getMessage());
}
}
}
public void onSuccess(ColumnData result) {
Log.debug("Retrived column: " + result);
@ -179,14 +193,26 @@ public class ColumnFilterDialog extends Window implements MonitorDialogListener
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
caught.getLocalizedMessage());
} else {
Log.error("Error submitting the column filter: "
+ caught.getLocalizedMessage());
caught.printStackTrace();
UtilsGXT3.alert(
"Error submitting the column filter",
UtilsGXT3
.alert("Error submitting the column filter",
caught.getLocalizedMessage());
}
}
}
}
});

View File

@ -4,7 +4,11 @@ import java.util.ArrayList;
import org.gcube.portlets.user.td.expressionwidget.client.utils.UtilsGXT3;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.allen_sauer.gwt.log.client.Log;
@ -12,17 +16,14 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.web.bindery.event.shared.EventBus;
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.event.BeforeShowEvent;
import com.sencha.gxt.widget.core.client.event.BeforeShowEvent.BeforeShowHandler;
import com.sencha.gxt.widget.core.client.event.HideEvent;
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class MultiColumnFilterPanel extends SimplePanel {
@ -36,8 +37,8 @@ public class MultiColumnFilterPanel extends SimplePanel {
protected MultiColumnFilterDialog multiColumnFilterDialog;
public MultiColumnFilterPanel(
MultiColumnFilterDialog multiColumnFilterDialog,
TRId trId, EventBus eventBus) {
MultiColumnFilterDialog multiColumnFilterDialog, TRId trId,
EventBus eventBus) {
super();
Log.debug("Create MultiColumnFilterPanel");
setHeight(HEIGHT);
@ -49,14 +50,14 @@ public class MultiColumnFilterPanel extends SimplePanel {
load(trId);
}
protected void create() {
UtilsGXT3.umask(this.getElement());
VerticalLayoutContainer vl = new VerticalLayoutContainer();
vl.setBorders(false);
final MultiColumnFilterTabPanel mcfTabPanel=new MultiColumnFilterTabPanel(this,eventBus);
final MultiColumnFilterTabPanel mcfTabPanel = new MultiColumnFilterTabPanel(
this, eventBus);
vl.add(mcfTabPanel);
mcfTabPanel.addBeforeShowHandler(new BeforeShowHandler() {
@ -74,26 +75,27 @@ public class MultiColumnFilterPanel extends SimplePanel {
add(vl);
}
protected void load(TRId trId) {
TDGWTServiceAsync.INSTANCE.getColumns(trId,
new AsyncCallback<ArrayList<ColumnData>>() {
@Override
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
caught.getLocalizedMessage());
} else {
Log.error("Error retrieving columns: "
+ caught.getMessage());
AlertMessageBox d = new AlertMessageBox(
"Error retrieving columns", caught.getMessage());
d.addHideHandler(new HideHandler() {
public void onHide(HideEvent event) {
multiColumnFilterDialog.hide();
UtilsGXT3.alert("Error",
"Error retrieving columns: "+caught.getMessage());
}
}
});
d.show();
}
@Override

View File

@ -4,6 +4,8 @@ import org.gcube.portlets.user.td.expressionwidget.client.resources.ExpressionRe
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
import org.gcube.portlets.user.td.expressionwidget.client.utils.UtilsGXT3;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.ReplaceColumnByExpressionSession;
@ -166,11 +168,22 @@ public class ReplaceColumnByExpressionDialog extends Window implements
new AsyncCallback<ColumnData>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
caught.getLocalizedMessage());
} else {
Log.error("Error retrieving column: "
+ caught.getMessage());
UtilsGXT3.alert("Error retrieving column",
caught.getMessage());
}
}
}
public void onSuccess(ColumnData result) {
Log.debug("Retrived column: " + result);
@ -209,6 +222,16 @@ public class ReplaceColumnByExpressionDialog extends Window implements
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
caught.getLocalizedMessage());
} else {
Log.error("Error submitting replace column by expression: "
+ caught.getLocalizedMessage());
@ -217,6 +240,8 @@ public class ReplaceColumnByExpressionDialog extends Window implements
.alert("Error submitting replace column by expression",
caught.getLocalizedMessage());
}
}
}
}
});

View File

@ -19,7 +19,6 @@ import org.gcube.portlets.user.td.expressionwidget.shared.exception.ExpressionSe
import org.gcube.portlets.user.td.gwtservice.server.SessionUtil;
import org.gcube.portlets.user.td.gwtservice.server.TDGWTServiceImpl;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTServiceException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.FilterColumnSession;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.ReplaceColumnByExpressionSession;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
@ -71,7 +70,7 @@ public class ExpressionServiceImpl extends RemoteServiceServlet implements
return taskId;
} catch (TDGWTSessionExpiredException e) {
} catch (TDGWTServiceException e) {
throw e;
} catch (Throwable e) {
e.printStackTrace();
@ -124,7 +123,7 @@ public class ExpressionServiceImpl extends RemoteServiceServlet implements
replaceExpression, session);
return taskId;
} catch (TDGWTSessionExpiredException e) {
} catch (TDGWTServiceException e) {
throw e;
} catch (Throwable e) {
e.printStackTrace();
@ -187,7 +186,7 @@ public class ExpressionServiceImpl extends RemoteServiceServlet implements
logger.debug("Retrieved TRId basic info:" + newTRId.toString());
return newTRId;
} catch (TDGWTSessionExpiredException e) {
} catch (TDGWTServiceException e) {
throw e;
} catch (SecurityException e) {
e.printStackTrace();