Fixed Final and Lock error
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-table-widget@100287 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
74ad4e36fd
commit
3983d12f6d
|
@ -8,6 +8,8 @@ import org.gcube.portlets.user.td.columnwidget.client.dimension.DimensionRowSele
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.dimension.DimensionRowSelectionListener;
|
import org.gcube.portlets.user.td.columnwidget.client.dimension.DimensionRowSelectionListener;
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.dimension.DimensionRowsProperties;
|
import org.gcube.portlets.user.td.columnwidget.client.dimension.DimensionRowsProperties;
|
||||||
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.DimensionRow;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.DimensionRow;
|
||||||
|
@ -208,10 +210,16 @@ public class EditRowPanel extends FramedPanel implements 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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -565,8 +573,10 @@ public class EditRowPanel extends FramedPanel implements MonitorDialogListener {
|
||||||
maps.put(columnId, val);
|
maps.put(columnId, val);
|
||||||
} else {
|
} else {
|
||||||
UtilsGXT3
|
UtilsGXT3
|
||||||
.alert("Attentions","The value of "+
|
.alert("Attentions",
|
||||||
colCurrent.getLabel()
|
"The value of "
|
||||||
|
+ colCurrent
|
||||||
|
.getLabel()
|
||||||
+ " is not a valid text representation for geometry type ( e.g. POINT(34 56) or LINESTRING(65 34, 56.43 78.65)!");
|
+ " is not a valid text representation for geometry type ( e.g. POINT(34 56) or LINESTRING(65 34, 56.43 78.65)!");
|
||||||
btnSave.enable();
|
btnSave.enable();
|
||||||
return;
|
return;
|
||||||
|
@ -661,8 +671,20 @@ public class EditRowPanel extends FramedPanel implements MonitorDialogListener {
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
UtilsGXT3.alert("Error",
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
"Error in operation invocation!");
|
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 {
|
||||||
|
UtilsGXT3.alert("Error",
|
||||||
|
"Error in operation invocation!");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ 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.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.Validations;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.table.Validations;
|
||||||
|
@ -194,11 +195,17 @@ public class ValidationsTablePanel extends FramedPanel {
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.error("Load validations metadata failure: "
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
+ caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert(
|
UtilsGXT3.alert("Error Locked",
|
||||||
"Error retrieving validations metadata",
|
caught.getLocalizedMessage());
|
||||||
"Error retrieving validations metadata");
|
} else {
|
||||||
|
Log.error("Load validations metadata failure: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3
|
||||||
|
.alert("Error retrieving validations metadata",
|
||||||
|
"Error retrieving validations metadata");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
callback.onFailure(caught);
|
callback.onFailure(caught);
|
||||||
}
|
}
|
||||||
|
@ -241,10 +248,16 @@ public class ValidationsTablePanel extends FramedPanel {
|
||||||
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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,8 @@ 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.Constants;
|
import org.gcube.portlets.user.td.gwtservice.shared.Constants;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.OperationsId;
|
import org.gcube.portlets.user.td.gwtservice.shared.OperationsId;
|
||||||
|
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.task.InvocationS;
|
import org.gcube.portlets.user.td.gwtservice.shared.task.InvocationS;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.task.TaskResumeSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.task.TaskResumeSession;
|
||||||
|
@ -76,7 +78,7 @@ import com.sencha.gxt.widget.core.client.treegrid.TreeGrid;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ValidationsTasksPanel extends FramedPanel implements
|
public class ValidationsTasksPanel extends FramedPanel implements
|
||||||
MonitorDialogListener {
|
MonitorDialogListener {
|
||||||
protected String WIDTH = "298px";
|
protected String WIDTH = "298px";
|
||||||
protected String HEIGHT = "520px";
|
protected String HEIGHT = "520px";
|
||||||
protected ValidationsTasksPanel thisPanel;
|
protected ValidationsTasksPanel thisPanel;
|
||||||
|
@ -94,15 +96,14 @@ MonitorDialogListener {
|
||||||
protected TreeStore<BaseDto> store;
|
protected TreeStore<BaseDto> store;
|
||||||
protected TreeGrid<BaseDto> tree;
|
protected TreeGrid<BaseDto> tree;
|
||||||
private boolean updateTR;
|
private boolean updateTR;
|
||||||
|
|
||||||
|
|
||||||
class KeyProvider implements ModelKeyProvider<BaseDto> {
|
class KeyProvider implements ModelKeyProvider<BaseDto> {
|
||||||
@Override
|
@Override
|
||||||
public String getKey(BaseDto item) {
|
public String getKey(BaseDto item) {
|
||||||
return (item instanceof FolderDto ? "f-" : "v-") + item.getId();
|
return (item instanceof FolderDto ? "f-" : "v-") + item.getId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param eventBus
|
* @param eventBus
|
||||||
|
@ -113,12 +114,12 @@ MonitorDialogListener {
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
this.thisPanel = this;
|
this.thisPanel = this;
|
||||||
forceLayoutOnResize = true;
|
forceLayoutOnResize = true;
|
||||||
updateTR=false;
|
updateTR = false;
|
||||||
init();
|
init();
|
||||||
retrieveCurrentTR();
|
retrieveCurrentTR();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param trId
|
* @param trId
|
||||||
|
@ -131,35 +132,32 @@ MonitorDialogListener {
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
this.thisPanel = this;
|
this.thisPanel = this;
|
||||||
forceLayoutOnResize = true;
|
forceLayoutOnResize = true;
|
||||||
updateTR=false;
|
updateTR = false;
|
||||||
init();
|
init();
|
||||||
retrieveValidations();
|
retrieveValidations();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected void init() {
|
protected void init() {
|
||||||
setWidth(WIDTH);
|
setWidth(WIDTH);
|
||||||
setHeight(HEIGHT);
|
setHeight(HEIGHT);
|
||||||
setHeaderVisible(false);
|
setHeaderVisible(false);
|
||||||
setBodyBorder(false);
|
setBodyBorder(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createTreeData() {
|
protected void createTreeData() {
|
||||||
if(updateTR){
|
if (updateTR) {
|
||||||
store.clear();
|
store.clear();
|
||||||
store.commitChanges();
|
store.commitChanges();
|
||||||
addChildrensToStore();
|
addChildrensToStore();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
create();
|
create();
|
||||||
}
|
}
|
||||||
store.commitChanges();
|
store.commitChanges();
|
||||||
tree.expandAll();
|
tree.expandAll();
|
||||||
forceLayout();
|
forceLayout();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void create() {
|
protected void create() {
|
||||||
|
@ -167,9 +165,9 @@ MonitorDialogListener {
|
||||||
con.setScrollMode(ScrollMode.AUTO);
|
con.setScrollMode(ScrollMode.AUTO);
|
||||||
|
|
||||||
store = new TreeStore<BaseDto>(new KeyProvider());
|
store = new TreeStore<BaseDto>(new KeyProvider());
|
||||||
|
|
||||||
addChildrensToStore();
|
addChildrensToStore();
|
||||||
|
|
||||||
ColumnConfig<BaseDto, String> cc1 = new ColumnConfig<BaseDto, String>(
|
ColumnConfig<BaseDto, String> cc1 = new ColumnConfig<BaseDto, String>(
|
||||||
new ToStringValueProvider<BaseDto>("task"), 168, "Task");
|
new ToStringValueProvider<BaseDto>("task"), 168, "Task");
|
||||||
cc1.setHeader("Task");
|
cc1.setHeader("Task");
|
||||||
|
@ -224,7 +222,7 @@ MonitorDialogListener {
|
||||||
tree.getView().setAutoFill(true);
|
tree.getView().setAutoFill(true);
|
||||||
tree.setBorders(false);
|
tree.setBorders(false);
|
||||||
tree.setLoadMask(true);
|
tree.setLoadMask(true);
|
||||||
tree.setColumnResize(true);
|
tree.setColumnResize(true);
|
||||||
tree.setAutoExpand(true);
|
tree.setAutoExpand(true);
|
||||||
tree.getView().setAutoExpandColumn(cc1);
|
tree.getView().setAutoExpandColumn(cc1);
|
||||||
|
|
||||||
|
@ -305,12 +303,10 @@ MonitorDialogListener {
|
||||||
|
|
||||||
add(con, new MarginData(0));
|
add(con, new MarginData(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void addChildrensToStore() {
|
private void addChildrensToStore() {
|
||||||
gen = new TreeDataGenerator(validationsTasksMetadata);
|
gen = new TreeDataGenerator(validationsTasksMetadata);
|
||||||
|
|
||||||
FolderDto root = gen.getRoot();
|
FolderDto root = gen.getRoot();
|
||||||
for (BaseDto base : root.getChildrens()) {
|
for (BaseDto base : root.getChildrens()) {
|
||||||
store.add(base);
|
store.add(base);
|
||||||
|
@ -318,8 +314,7 @@ MonitorDialogListener {
|
||||||
processFolder(store, (FolderDto) base);
|
processFolder(store, (FolderDto) base);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void requestSolution(Context context) {
|
protected void requestSolution(Context context) {
|
||||||
|
@ -505,11 +500,17 @@ MonitorDialogListener {
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.error("Load validations metadata failure: "
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
+ caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert(
|
UtilsGXT3.alert("Error Locked",
|
||||||
"Error retrieving validations metadata",
|
caught.getLocalizedMessage());
|
||||||
"Error retrieving validations metadata");
|
} else {
|
||||||
|
Log.error("Load validations metadata failure: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3
|
||||||
|
.alert("Error retrieving validations metadata",
|
||||||
|
"Error retrieving validations metadata");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -525,13 +526,13 @@ MonitorDialogListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void update() {
|
public void update() {
|
||||||
updateTR=true;
|
updateTR = true;
|
||||||
retrieveCurrentTR();
|
retrieveCurrentTR();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void update(TRId trId) {
|
public void update(TRId trId) {
|
||||||
this.trId = trId;
|
this.trId = trId;
|
||||||
updateTR=true;
|
updateTR = true;
|
||||||
retrieveValidations();
|
retrieveValidations();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -543,10 +544,16 @@ 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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -580,9 +587,21 @@ MonitorDialogListener {
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.debug(caught.getLocalizedMessage());
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
UtilsGXT3.alert("Error in Resume",
|
Log.error(caught.getLocalizedMessage());
|
||||||
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.debug(caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error in Resume",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -590,18 +609,16 @@ MonitorDialogListener {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(String taskId) {
|
public void onSuccess(String taskId) {
|
||||||
openMonitorDialog(taskId);
|
openMonitorDialog(taskId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected void close() {
|
protected void close() {
|
||||||
/*if (parent != null) {
|
/*
|
||||||
parent.close();
|
* if (parent != null) { parent.close(); }
|
||||||
}*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
// /
|
// /
|
||||||
|
@ -648,7 +665,6 @@ MonitorDialogListener {
|
||||||
close();
|
close();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @SuppressWarnings("rawtypes")
|
// @SuppressWarnings("rawtypes")
|
||||||
// protected AbstractCell actionButton = new AbstractCell<Boolean>() {
|
// protected AbstractCell actionButton = new AbstractCell<Boolean>() {
|
||||||
|
|
Loading…
Reference in New Issue