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:
parent
b4158cf9a1
commit
11a6c4e54a
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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,27 +37,27 @@ 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);
|
||||
setWidth(WIDTH);
|
||||
this.multiColumnFilterDialog=multiColumnFilterDialog;
|
||||
this.trId=trId;
|
||||
this.multiColumnFilterDialog = multiColumnFilterDialog;
|
||||
this.trId = trId;
|
||||
this.eventBus = eventBus;
|
||||
UtilsGXT3.mask(this.getElement());
|
||||
load(trId);
|
||||
}
|
||||
|
||||
|
||||
protected void create(){
|
||||
protected void create() {
|
||||
UtilsGXT3.umask(this.getElement());
|
||||
|
||||
VerticalLayoutContainer vl=new VerticalLayoutContainer();
|
||||
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() {
|
||||
|
@ -67,33 +68,34 @@ public class MultiColumnFilterPanel extends SimplePanel {
|
|||
}
|
||||
});
|
||||
|
||||
final SimplePanel bo=new SimplePanel();
|
||||
final SimplePanel bo = new SimplePanel();
|
||||
bo.add(new HTML("Expression"));
|
||||
vl.add(bo);
|
||||
|
||||
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
|
||||
|
|
|
@ -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;
|
||||
|
@ -102,7 +104,7 @@ public class ReplaceColumnByExpressionDialog extends Window implements
|
|||
protected void create() {
|
||||
if (column != null
|
||||
&& column.getDataTypeName().compareTo(
|
||||
ColumnDataType.Text.toString())==0) {
|
||||
ColumnDataType.Text.toString()) == 0) {
|
||||
setHeight(HEIGHT);
|
||||
} else {
|
||||
setHeight(HEIGHT_REDUCE);
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue