Fixed Final and Lock error
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-table-widget@100286 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
94d4482581
commit
74ad4e36fd
|
@ -1,6 +1,8 @@
|
||||||
package org.gcube.portlets.user.td.tablewidget.client;
|
package org.gcube.portlets.user.td.tablewidget.client;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
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.exception.TDGWTSessionExpiredException;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.table.ChangeTableTypeSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.table.ChangeTableTypeSession;
|
||||||
|
@ -142,11 +144,23 @@ public class ChangeTableTypePanel extends FramedPanel implements
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.debug("Change The Table Type Error: "
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
+ caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3
|
UtilsGXT3.alert("Error Locked",
|
||||||
.alert("Error Changing The Table Type",
|
caught.getLocalizedMessage());
|
||||||
"Error in invocation of Change Table Type operation!");
|
} else {
|
||||||
|
if (caught instanceof TDGWTIsFinalException) {
|
||||||
|
Log.error(caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error Final",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
Log.debug("Change The Table Type Error: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3
|
||||||
|
.alert("Error Changing The Table Type",
|
||||||
|
"Error in invocation of Change Table Type operation!");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,10 +189,16 @@ public class ChangeTableTypePanel extends FramedPanel implements
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.error("Error retrieving table: "
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
+ caught.getMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error retrieving table",
|
UtilsGXT3.alert("Error Locked",
|
||||||
caught.getMessage());
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
Log.error("Error retrieving table: "
|
||||||
|
+ caught.getMessage());
|
||||||
|
UtilsGXT3.alert("Error retrieving table",
|
||||||
|
caught.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.gcube.portlets.user.td.tablewidget.client;
|
package org.gcube.portlets.user.td.tablewidget.client;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
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.exception.TDGWTSessionExpiredException;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.clone.CloneTabularResourceSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.clone.CloneTabularResourceSession;
|
||||||
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
|
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
|
||||||
|
@ -43,10 +44,17 @@ public class CloneTabularResource implements MonitorDialogListener {
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.debug("Clone Error: "
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
+ caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error Cloning Tabular Resource",
|
UtilsGXT3.alert("Error Locked",
|
||||||
"Error in clone operation!");
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
Log.debug("Clone Error: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert(
|
||||||
|
"Error Cloning Tabular Resource",
|
||||||
|
"Error in clone operation!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package org.gcube.portlets.user.td.tablewidget.client.history;
|
package org.gcube.portlets.user.td.tablewidget.client.history;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
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.exception.TDGWTSessionExpiredException;
|
||||||
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
|
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
|
||||||
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
|
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
|
||||||
|
@ -36,10 +38,16 @@ public class HistoryDiscard implements MonitorDialogListener {
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.error("Error retrieving trId: "
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
+ caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error",
|
UtilsGXT3.alert("Error Locked",
|
||||||
"Error retrieving current tabular resource id");
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
Log.error("Error retrieving trId: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error",
|
||||||
|
"Error retrieving current tabular resource id");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,10 +69,22 @@ public class HistoryDiscard implements MonitorDialogListener {
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.error("Error in discard: "
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
+ caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error in undo",
|
UtilsGXT3.alert("Error Locked",
|
||||||
caught.getLocalizedMessage());
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
if (caught instanceof TDGWTIsFinalException) {
|
||||||
|
Log.error(caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error Final",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
Log.error("Error in discard: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error in undo",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,8 +101,6 @@ public class HistoryDiscard implements MonitorDialogListener {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected void close() {
|
protected void close() {
|
||||||
/*
|
/*
|
||||||
* if (parent != null) { parent.close(); }
|
* if (parent != null) { parent.close(); }
|
||||||
|
|
|
@ -4,6 +4,8 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
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.exception.TDGWTSessionExpiredException;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.history.OpHistory;
|
import org.gcube.portlets.user.td.gwtservice.shared.history.OpHistory;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.history.RollBackSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.history.RollBackSession;
|
||||||
|
@ -240,24 +242,36 @@ public class HistoryPanel extends FramedPanel implements MonitorDialogListener {
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.error("Error in rollback: "
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
+ caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error in rollback",
|
UtilsGXT3.alert("Error Locked",
|
||||||
"Error: "+caught.getLocalizedMessage());
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
if (caught instanceof TDGWTIsFinalException) {
|
||||||
|
Log.error(caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error Final",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
Log.error("Error in rollback: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3
|
||||||
|
.alert("Error in rollback",
|
||||||
|
"Error: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSuccess(String taskId) {
|
public void onSuccess(String taskId) {
|
||||||
Log.debug("Rollback started");
|
Log.debug("Rollback started");
|
||||||
openMonitorDialog(taskId);
|
openMonitorDialog(taskId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected void loadData(ListLoadConfig loadConfig,
|
protected void loadData(ListLoadConfig loadConfig,
|
||||||
final AsyncCallback<ListLoadResult<OpHistory>> callback) {
|
final AsyncCallback<ListLoadResult<OpHistory>> callback) {
|
||||||
|
|
||||||
|
@ -269,10 +283,16 @@ public class HistoryPanel extends FramedPanel implements MonitorDialogListener {
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.error("Error Retrieving History: "
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
+ caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error retrieving history",
|
UtilsGXT3.alert("Error Locked",
|
||||||
"Error retrieving history");
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
Log.error("Error Retrieving History: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error retrieving history",
|
||||||
|
"Error retrieving history");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
callback.onFailure(caught);
|
callback.onFailure(caught);
|
||||||
}
|
}
|
||||||
|
@ -301,10 +321,16 @@ public class HistoryPanel extends FramedPanel implements MonitorDialogListener {
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.error("Error retrieving current TRId: "
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
+ caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error",
|
UtilsGXT3.alert("Error Locked",
|
||||||
"Error retrieving current tabular resource id");
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
Log.error("Error retrieving current TRId: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error",
|
||||||
|
"Error retrieving current tabular resource id");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,7 +345,7 @@ public class HistoryPanel extends FramedPanel implements MonitorDialogListener {
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void close() {
|
protected void close() {
|
||||||
/*
|
/*
|
||||||
* if (parent != null) { parent.close(); }
|
* if (parent != null) { parent.close(); }
|
||||||
|
|
|
@ -4,6 +4,8 @@ import java.util.ArrayList;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnDataPropertiesCombo;
|
import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnDataPropertiesCombo;
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
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.exception.TDGWTSessionExpiredException;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.normalization.DenormalizationSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.normalization.DenormalizationSession;
|
||||||
|
@ -286,11 +288,17 @@ public class DenormalizePanel extends FramedPanel implements
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.error("load combo failure:"
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
+ caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error",
|
UtilsGXT3.alert("Error Locked",
|
||||||
"Error retrieving columns of tabular resource:"
|
caught.getLocalizedMessage());
|
||||||
+ trId.getId());
|
} else {
|
||||||
|
Log.error("load combo failure:"
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error",
|
||||||
|
"Error retrieving columns of tabular resource:"
|
||||||
|
+ trId.getId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
callback.onFailure(caught);
|
callback.onFailure(caught);
|
||||||
}
|
}
|
||||||
|
@ -356,10 +364,22 @@ public class DenormalizePanel extends FramedPanel implements
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.debug("Denormalize Error: "
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
+ caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error on Denormalize",
|
UtilsGXT3.alert("Error Locked",
|
||||||
caught.getLocalizedMessage());
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
if (caught instanceof TDGWTIsFinalException) {
|
||||||
|
Log.error(caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error Final",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
Log.debug("Denormalize Error: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error on Denormalize",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
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.exception.TDGWTSessionExpiredException;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.normalization.NormalizationSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.normalization.NormalizationSession;
|
||||||
|
@ -53,7 +55,7 @@ import com.sencha.gxt.widget.core.client.grid.ColumnModel;
|
||||||
import com.sencha.gxt.widget.core.client.grid.Grid;
|
import com.sencha.gxt.widget.core.client.grid.Grid;
|
||||||
|
|
||||||
public class NormalizePanel extends FramedPanel implements
|
public class NormalizePanel extends FramedPanel implements
|
||||||
MonitorDialogListener {
|
MonitorDialogListener {
|
||||||
protected String WIDTH = "640px";
|
protected String WIDTH = "640px";
|
||||||
protected String HEIGHT = "520px";
|
protected String HEIGHT = "520px";
|
||||||
|
|
||||||
|
@ -71,24 +73,23 @@ MonitorDialogListener {
|
||||||
protected TextField normalizedColumnName;
|
protected TextField normalizedColumnName;
|
||||||
protected TextField valueColumnName;
|
protected TextField valueColumnName;
|
||||||
protected NormalizeDialog parent;
|
protected NormalizeDialog parent;
|
||||||
|
|
||||||
|
|
||||||
public NormalizePanel(NormalizeDialog parent,TRId trId, EventBus eventBus) {
|
public NormalizePanel(NormalizeDialog parent, TRId trId, EventBus eventBus) {
|
||||||
this.parent=parent;
|
this.parent = parent;
|
||||||
this.trId = trId;
|
this.trId = trId;
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
create();
|
create();
|
||||||
}
|
}
|
||||||
|
|
||||||
public NormalizePanel(TRId trId, EventBus eventBus) {
|
public NormalizePanel(TRId trId, EventBus eventBus) {
|
||||||
this.trId = trId;
|
this.trId = trId;
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
this.parent=null;
|
this.parent = null;
|
||||||
create();
|
create();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void create(){
|
protected void create() {
|
||||||
|
|
||||||
setWidth(WIDTH);
|
setWidth(WIDTH);
|
||||||
setHeight(HEIGHT);
|
setHeight(HEIGHT);
|
||||||
setHeaderVisible(false);
|
setHeaderVisible(false);
|
||||||
|
@ -151,12 +152,12 @@ MonitorDialogListener {
|
||||||
grid.setColumnReordering(true);
|
grid.setColumnReordering(true);
|
||||||
grid.setColumnResize(false);
|
grid.setColumnResize(false);
|
||||||
|
|
||||||
//Normalize Button
|
// Normalize Button
|
||||||
normalizeButton = new TextButton("Normalize");
|
normalizeButton = new TextButton("Normalize");
|
||||||
normalizeButton.setIcon(ResourceBundle.INSTANCE.tableNormalize());
|
normalizeButton.setIcon(ResourceBundle.INSTANCE.tableNormalize());
|
||||||
normalizeButton.setIconAlign(IconAlign.RIGHT);
|
normalizeButton.setIconAlign(IconAlign.RIGHT);
|
||||||
normalizeButton.setTitle("Normalize");
|
normalizeButton.setTitle("Normalize");
|
||||||
|
|
||||||
SelectHandler deleteHandler = new SelectHandler() {
|
SelectHandler deleteHandler = new SelectHandler() {
|
||||||
|
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
|
@ -167,26 +168,26 @@ MonitorDialogListener {
|
||||||
normalizeButton.addSelectHandler(deleteHandler);
|
normalizeButton.addSelectHandler(deleteHandler);
|
||||||
|
|
||||||
normalizedColumnName = new TextField();
|
normalizedColumnName = new TextField();
|
||||||
FieldLabel normalizedColumnNameLabel=new FieldLabel(normalizedColumnName, "Normalized column");
|
FieldLabel normalizedColumnNameLabel = new FieldLabel(
|
||||||
|
normalizedColumnName, "Normalized column");
|
||||||
normalizedColumnNameLabel.setLabelWidth(110);
|
normalizedColumnNameLabel.setLabelWidth(110);
|
||||||
|
|
||||||
valueColumnName = new TextField();
|
valueColumnName = new TextField();
|
||||||
FieldLabel valueColumnNameLabel=new FieldLabel(valueColumnName, "Value column");
|
FieldLabel valueColumnNameLabel = new FieldLabel(valueColumnName,
|
||||||
|
"Value column");
|
||||||
valueColumnNameLabel.setLabelWidth(110);
|
valueColumnNameLabel.setLabelWidth(110);
|
||||||
|
|
||||||
FieldLabel columnsLabel = new FieldLabel(null,"Columns to Normalize");
|
FieldLabel columnsLabel = new FieldLabel(null, "Columns to Normalize");
|
||||||
columnsLabel.setLabelWidth(150);
|
columnsLabel.setLabelWidth(150);
|
||||||
|
|
||||||
|
|
||||||
columnsLabel.getElement().applyStyles("font-weight:bold");
|
columnsLabel.getElement().applyStyles("font-weight:bold");
|
||||||
HBoxLayoutContainer hBox = new HBoxLayoutContainer();
|
HBoxLayoutContainer hBox = new HBoxLayoutContainer();
|
||||||
hBox.add(normalizeButton, new BoxLayoutData(new Margins(2, 5, 2, 5)));
|
hBox.add(normalizeButton, new BoxLayoutData(new Margins(2, 5, 2, 5)));
|
||||||
|
|
||||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||||
v.setScrollMode(ScrollMode.AUTO);
|
v.setScrollMode(ScrollMode.AUTO);
|
||||||
v.add(normalizedColumnNameLabel,new VerticalLayoutData(1, -1));
|
v.add(normalizedColumnNameLabel, new VerticalLayoutData(1, -1));
|
||||||
v.add(valueColumnNameLabel,
|
v.add(valueColumnNameLabel, new VerticalLayoutData(1, -1));
|
||||||
new VerticalLayoutData(1, -1));
|
|
||||||
v.add(columnsLabel, new VerticalLayoutData(-1, -1, new Margins(2, 1, 5,
|
v.add(columnsLabel, new VerticalLayoutData(-1, -1, new Margins(2, 1, 5,
|
||||||
1)));
|
1)));
|
||||||
v.add(grid, new VerticalLayoutData(1, -1, new Margins(0)));
|
v.add(grid, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||||
|
@ -216,10 +217,16 @@ MonitorDialogListener {
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.error("load columns failure:"
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
+ caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error retrieving columns",
|
UtilsGXT3.alert("Error Locked",
|
||||||
"Error retrieving columns");
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
Log.error("load columns failure:"
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error retrieving columns",
|
||||||
|
"Error retrieving columns");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
callback.onFailure(caught);
|
callback.onFailure(caught);
|
||||||
}
|
}
|
||||||
|
@ -241,12 +248,11 @@ MonitorDialogListener {
|
||||||
UtilsGXT3.alert("Attention", "Attention no column selected!");
|
UtilsGXT3.alert("Attention", "Attention no column selected!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String name=normalizedColumnName.getCurrentValue();
|
String name = normalizedColumnName.getCurrentValue();
|
||||||
String value=valueColumnName.getCurrentValue();
|
String value = valueColumnName.getCurrentValue();
|
||||||
|
|
||||||
normalizationSession = new NormalizationSession(trId, col,
|
normalizationSession = new NormalizationSession(trId, col, name, value);
|
||||||
name,value);
|
|
||||||
|
|
||||||
TDGWTServiceAsync.INSTANCE.startNormalization(normalizationSession,
|
TDGWTServiceAsync.INSTANCE.startNormalization(normalizationSession,
|
||||||
new AsyncCallback<String>() {
|
new AsyncCallback<String>() {
|
||||||
|
@ -256,10 +262,22 @@ MonitorDialogListener {
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.debug("Normalization Error: "
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
+ caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3
|
UtilsGXT3.alert("Error Locked",
|
||||||
.alert("Error on Normalization",caught.getLocalizedMessage());
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
if (caught instanceof TDGWTIsFinalException) {
|
||||||
|
Log.error(caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error Final",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
Log.debug("Normalization Error: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error on Normalization",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,7 +288,7 @@ MonitorDialogListener {
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void close() {
|
public void close() {
|
||||||
if (parent != null) {
|
if (parent != null) {
|
||||||
parent.close();
|
parent.close();
|
||||||
|
@ -322,6 +340,4 @@ MonitorDialogListener {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,8 @@ package org.gcube.portlets.user.td.tablewidget.client.rows;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
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.exception.TDGWTSessionExpiredException;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.rows.DeleteRowsSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.rows.DeleteRowsSession;
|
||||||
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
|
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
|
||||||
|
@ -25,12 +27,12 @@ import com.google.web.bindery.event.shared.EventBus;
|
||||||
* @author "Giancarlo Panichi"
|
* @author "Giancarlo Panichi"
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class DeleteRows implements MonitorDialogListener {
|
public class DeleteRows implements MonitorDialogListener {
|
||||||
protected TRId trId;
|
protected TRId trId;
|
||||||
protected EventBus eventBus;
|
protected EventBus eventBus;
|
||||||
protected ArrayList<String> rows;
|
protected ArrayList<String> rows;
|
||||||
protected DeleteRowsSession deleteRowsSession;
|
protected DeleteRowsSession deleteRowsSession;
|
||||||
|
|
||||||
public DeleteRows(TRId trId, ArrayList<String> rows, EventBus eventBus) {
|
public DeleteRows(TRId trId, ArrayList<String> rows, EventBus eventBus) {
|
||||||
this.trId = trId;
|
this.trId = trId;
|
||||||
this.rows = rows;
|
this.rows = rows;
|
||||||
|
@ -51,11 +53,23 @@ public class DeleteRows implements MonitorDialogListener {
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.debug("Delete Rows Error: "
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
+ caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3
|
UtilsGXT3.alert("Error Locked",
|
||||||
.alert("Error Deleting Rows",
|
caught.getLocalizedMessage());
|
||||||
"Error in invocation Delete Rows operation!");
|
} else {
|
||||||
|
if (caught instanceof TDGWTIsFinalException) {
|
||||||
|
Log.error(caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error Final",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
Log.debug("Delete Rows Error: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3
|
||||||
|
.alert("Error Deleting Rows",
|
||||||
|
"Error in invocation Delete Rows operation!");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,12 +80,11 @@ public class DeleteRows implements MonitorDialogListener {
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void close() {
|
protected void close() {
|
||||||
/*if (parent != null) {
|
/*
|
||||||
parent.close();
|
* if (parent != null) { parent.close(); }
|
||||||
}
|
*/
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// /
|
// /
|
||||||
|
@ -119,5 +132,4 @@ public class DeleteRows implements MonitorDialogListener {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
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.exception.TDGWTSessionExpiredException;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.rows.DuplicatesSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.rows.DuplicatesSession;
|
||||||
|
@ -51,8 +53,8 @@ import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
|
||||||
import com.sencha.gxt.widget.core.client.grid.ColumnModel;
|
import com.sencha.gxt.widget.core.client.grid.ColumnModel;
|
||||||
import com.sencha.gxt.widget.core.client.grid.Grid;
|
import com.sencha.gxt.widget.core.client.grid.Grid;
|
||||||
|
|
||||||
public class DuplicatesRowsPanel extends FramedPanel
|
public class DuplicatesRowsPanel extends FramedPanel implements
|
||||||
implements MonitorDialogListener {
|
MonitorDialogListener {
|
||||||
protected String WIDTH = "640px";
|
protected String WIDTH = "640px";
|
||||||
protected String HEIGHT = "520px";
|
protected String HEIGHT = "520px";
|
||||||
|
|
||||||
|
@ -61,7 +63,7 @@ public class DuplicatesRowsPanel extends FramedPanel
|
||||||
protected ArrayList<String> rows;
|
protected ArrayList<String> rows;
|
||||||
|
|
||||||
protected DuplicatesSession duplicatesSession;
|
protected DuplicatesSession duplicatesSession;
|
||||||
|
|
||||||
protected ListLoader<ListLoadConfig, ListLoadResult<ColumnData>> loader;
|
protected ListLoader<ListLoadConfig, ListLoadResult<ColumnData>> loader;
|
||||||
protected Grid<ColumnData> grid;
|
protected Grid<ColumnData> grid;
|
||||||
protected CheckBoxSelectionModel<ColumnData> sm;
|
protected CheckBoxSelectionModel<ColumnData> sm;
|
||||||
|
@ -136,10 +138,11 @@ public class DuplicatesRowsPanel extends FramedPanel
|
||||||
|
|
||||||
// Delete Button
|
// Delete Button
|
||||||
deleteButton = new TextButton("Delete");
|
deleteButton = new TextButton("Delete");
|
||||||
deleteButton.setIcon(ResourceBundle.INSTANCE.tableDuplicateRowsRemove());
|
deleteButton
|
||||||
|
.setIcon(ResourceBundle.INSTANCE.tableDuplicateRowsRemove());
|
||||||
deleteButton.setIconAlign(IconAlign.RIGHT);
|
deleteButton.setIconAlign(IconAlign.RIGHT);
|
||||||
deleteButton.setTitle("Delete Duplicates Rows");
|
deleteButton.setTitle("Delete Duplicates Rows");
|
||||||
|
|
||||||
SelectHandler deleteHandler = new SelectHandler() {
|
SelectHandler deleteHandler = new SelectHandler() {
|
||||||
|
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
|
@ -154,7 +157,7 @@ public class DuplicatesRowsPanel extends FramedPanel
|
||||||
validatesButton.setIcon(ResourceBundle.INSTANCE.tableDuplicateRows());
|
validatesButton.setIcon(ResourceBundle.INSTANCE.tableDuplicateRows());
|
||||||
validatesButton.setIconAlign(IconAlign.RIGHT);
|
validatesButton.setIconAlign(IconAlign.RIGHT);
|
||||||
validatesButton.setTitle("Validate Duplicates Rows");
|
validatesButton.setTitle("Validate Duplicates Rows");
|
||||||
|
|
||||||
SelectHandler validatesHandler = new SelectHandler() {
|
SelectHandler validatesHandler = new SelectHandler() {
|
||||||
|
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
|
@ -201,10 +204,16 @@ public class DuplicatesRowsPanel extends FramedPanel
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.error("load columns failure:"
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
+ caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error retrieving columns",
|
UtilsGXT3.alert("Error Locked",
|
||||||
"Error retrieving columns");
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
Log.error("load columns failure:"
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error retrieving columns",
|
||||||
|
"Error retrieving columns");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
callback.onFailure(caught);
|
callback.onFailure(caught);
|
||||||
}
|
}
|
||||||
|
@ -237,11 +246,23 @@ public class DuplicatesRowsPanel extends FramedPanel
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.debug("Delete Duplicates Error: "
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
+ caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3
|
UtilsGXT3.alert("Error Locked",
|
||||||
.alert("Error Deleting Rows",
|
caught.getLocalizedMessage());
|
||||||
"Error in invocation Delete Duplicates operation!");
|
} else {
|
||||||
|
if (caught instanceof TDGWTIsFinalException) {
|
||||||
|
Log.error(caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error Final",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
Log.debug("Delete Duplicates Error: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3
|
||||||
|
.alert("Error Deleting Rows",
|
||||||
|
"Error in invocation Delete Duplicates operation!");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,11 +291,23 @@ public class DuplicatesRowsPanel extends FramedPanel
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.debug("Validates Duplicates Error: "
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
+ caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3
|
UtilsGXT3.alert("Error Locked",
|
||||||
.alert("Error Deleting Rows",
|
caught.getLocalizedMessage());
|
||||||
"Error in invocation Validates Duplicates operation!");
|
} else {
|
||||||
|
if (caught instanceof TDGWTIsFinalException) {
|
||||||
|
Log.error(caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error Final",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
Log.debug("Validates Duplicates Error: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3
|
||||||
|
.alert("Error Deleting Rows",
|
||||||
|
"Error in invocation Validates Duplicates operation!");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,12 +318,11 @@ public class DuplicatesRowsPanel extends FramedPanel
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void close() {
|
protected void close() {
|
||||||
/*if (parent != null) {
|
/*
|
||||||
parent.close();
|
* if (parent != null) { parent.close(); }
|
||||||
}
|
*/
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// /
|
// /
|
||||||
|
|
Loading…
Reference in New Issue