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:
Giancarlo Panichi 2014-09-30 12:16:04 +00:00 committed by Giancarlo Panichi
parent 74ad4e36fd
commit 3983d12f6d
3 changed files with 112 additions and 61 deletions

View File

@ -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.DimensionRowsProperties;
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.DimensionRow;
@ -208,10 +210,16 @@ public class EditRowPanel extends FramedPanel implements MonitorDialogListener {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("load columns failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving columns",
"Error retrieving columns");
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
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);
} else {
UtilsGXT3
.alert("Attentions","The value of "+
colCurrent.getLabel()
.alert("Attentions",
"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)!");
btnSave.enable();
return;
@ -661,8 +671,20 @@ public class EditRowPanel extends FramedPanel implements MonitorDialogListener {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
UtilsGXT3.alert("Error",
"Error in operation invocation!");
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 {
UtilsGXT3.alert("Error",
"Error in operation invocation!");
}
}
}
}

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
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.TableData;
import org.gcube.portlets.user.td.gwtservice.shared.tr.table.Validations;
@ -194,11 +195,17 @@ public class ValidationsTablePanel extends FramedPanel {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Load validations metadata failure: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert(
"Error retrieving validations metadata",
"Error retrieving validations metadata");
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
caught.getLocalizedMessage());
} else {
Log.error("Load validations metadata failure: "
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Error retrieving validations metadata",
"Error retrieving validations metadata");
}
}
callback.onFailure(caught);
}
@ -241,10 +248,16 @@ public class ValidationsTablePanel extends FramedPanel {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error retrieving current TRId: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving current tabular resource id");
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
caught.getLocalizedMessage());
} else {
Log.error("Error retrieving current TRId: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving current tabular resource id");
}
}
}

View File

@ -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.shared.Constants;
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.task.InvocationS;
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
MonitorDialogListener {
MonitorDialogListener {
protected String WIDTH = "298px";
protected String HEIGHT = "520px";
protected ValidationsTasksPanel thisPanel;
@ -94,15 +96,14 @@ MonitorDialogListener {
protected TreeStore<BaseDto> store;
protected TreeGrid<BaseDto> tree;
private boolean updateTR;
class KeyProvider implements ModelKeyProvider<BaseDto> {
@Override
public String getKey(BaseDto item) {
return (item instanceof FolderDto ? "f-" : "v-") + item.getId();
}
}
/**
*
* @param eventBus
@ -113,12 +114,12 @@ MonitorDialogListener {
this.eventBus = eventBus;
this.thisPanel = this;
forceLayoutOnResize = true;
updateTR=false;
updateTR = false;
init();
retrieveCurrentTR();
}
/**
*
* @param trId
@ -131,35 +132,32 @@ MonitorDialogListener {
this.eventBus = eventBus;
this.thisPanel = this;
forceLayoutOnResize = true;
updateTR=false;
updateTR = false;
init();
retrieveValidations();
}
protected void init() {
setWidth(WIDTH);
setHeight(HEIGHT);
setHeaderVisible(false);
setBodyBorder(false);
}
protected void createTreeData() {
if(updateTR){
if (updateTR) {
store.clear();
store.commitChanges();
addChildrensToStore();
} else {
create();
}
store.commitChanges();
tree.expandAll();
forceLayout();
}
protected void create() {
@ -167,9 +165,9 @@ MonitorDialogListener {
con.setScrollMode(ScrollMode.AUTO);
store = new TreeStore<BaseDto>(new KeyProvider());
addChildrensToStore();
ColumnConfig<BaseDto, String> cc1 = new ColumnConfig<BaseDto, String>(
new ToStringValueProvider<BaseDto>("task"), 168, "Task");
cc1.setHeader("Task");
@ -224,7 +222,7 @@ MonitorDialogListener {
tree.getView().setAutoFill(true);
tree.setBorders(false);
tree.setLoadMask(true);
tree.setColumnResize(true);
tree.setColumnResize(true);
tree.setAutoExpand(true);
tree.getView().setAutoExpandColumn(cc1);
@ -305,12 +303,10 @@ MonitorDialogListener {
add(con, new MarginData(0));
}
private void addChildrensToStore() {
gen = new TreeDataGenerator(validationsTasksMetadata);
FolderDto root = gen.getRoot();
for (BaseDto base : root.getChildrens()) {
store.add(base);
@ -318,8 +314,7 @@ MonitorDialogListener {
processFolder(store, (FolderDto) base);
}
}
}
protected void requestSolution(Context context) {
@ -505,11 +500,17 @@ MonitorDialogListener {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Load validations metadata failure: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert(
"Error retrieving validations metadata",
"Error retrieving validations metadata");
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
caught.getLocalizedMessage());
} 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() {
updateTR=true;
updateTR = true;
retrieveCurrentTR();
}
public void update(TRId trId) {
this.trId = trId;
updateTR=true;
updateTR = true;
retrieveValidations();
}
@ -543,10 +544,16 @@ MonitorDialogListener {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error retrieving current TRId: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving current tabular resource id");
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
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(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug(caught.getLocalizedMessage());
UtilsGXT3.alert("Error in Resume",
caught.getLocalizedMessage());
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.debug(caught.getLocalizedMessage());
UtilsGXT3.alert("Error in Resume",
caught.getLocalizedMessage());
}
}
}
}
@ -590,18 +609,16 @@ MonitorDialogListener {
@Override
public void onSuccess(String taskId) {
openMonitorDialog(taskId);
}
});
}
protected void close() {
/*if (parent != null) {
parent.close();
}*/
/*
* if (parent != null) { parent.close(); }
*/
}
// /
@ -648,7 +665,6 @@ MonitorDialogListener {
close();
}
// @SuppressWarnings("rawtypes")
// protected AbstractCell actionButton = new AbstractCell<Boolean>() {