Fixed Final and Lock error

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@100216 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-09-26 10:20:11 +00:00
parent 683366a81d
commit 274d781987
9 changed files with 459 additions and 164 deletions

View File

@ -7,6 +7,8 @@ import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnDataPrope
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.columnwidget.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.DeleteColumnSession;
@ -83,7 +85,7 @@ public class DeleteColumnPanel extends FramedPanel implements
protected FieldLabel columnsSelectLabel;
protected DeleteColumnSession deleteColumnSession;
private ListStore<ColumnData> store;
public DeleteColumnPanel(TRId trId, String columnName, EventBus eventBus) {
@ -230,10 +232,22 @@ public class DeleteColumnPanel extends FramedPanel implements
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 {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
caught.getLocalizedMessage());
} else {
Log.error("load columns failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving columns",
"Error retrieving columns");
}
}
}
callback.onFailure(caught);
@ -245,12 +259,14 @@ public class DeleteColumnPanel extends FramedPanel implements
callback.onSuccess(new ListLoadResultBean<ColumnData>(
result));
} catch(UmbrellaException e){
Log.debug("Umbrella exception "+e.getLocalizedMessage());
} catch (com.google.web.bindery.event.shared.UmbrellaException e){
Log.debug("Umbrella exception "+e.getLocalizedMessage());
} catch (UmbrellaException e) {
Log.debug("Umbrella exception "
+ e.getLocalizedMessage());
} catch (com.google.web.bindery.event.shared.UmbrellaException e) {
Log.debug("Umbrella exception "
+ e.getLocalizedMessage());
}
}
});
@ -278,11 +294,23 @@ public class DeleteColumnPanel extends FramedPanel implements
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("Delete Column Error: "
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Delete Column Error ",
"Error in invocation of delete column operation!");
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("Delete Column Error: "
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Delete Column Error ",
"Error in invocation of delete column operation!");
}
}
}
}
@ -294,14 +322,13 @@ public class DeleteColumnPanel extends FramedPanel implements
}
public void close() {
if (parent != null) {
parent.close();
}
}
///
// /
protected void openMonitorDialog(String taskId) {
MonitorDialog monitorDialog = new MonitorDialog(taskId, eventBus);
monitorDialog.addProgressDialogListener(this);

View File

@ -6,6 +6,8 @@ import java.util.HashMap;
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.columnwidget.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.LabelColumnSession;
@ -85,11 +87,23 @@ public class LabelColumnPanel extends FramedPanel implements
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("load combo failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving columns of tabular resource:"
+ trId.getId());
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("load combo failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving columns of tabular resource:"
+ trId.getId());
}
}
}
}
@ -126,15 +140,15 @@ public class LabelColumnPanel extends FramedPanel implements
protected void create() {
Log.debug("Create LabelColunmPanel");
SimpleContainer columnsContainer = new SimpleContainer();
//columnsContainer.setHeight(getOffsetHeight(true)-50);
// columnsContainer.setHeight(getOffsetHeight(true)-50);
columnsLayoutContainer = new VerticalLayoutContainer();
columnsLayoutContainer.setScrollMode(ScrollMode.AUTO);
columnsContainer.add(columnsLayoutContainer);
addFields();
columnsContainer.forceLayout();
change = new TextButton("Change");
change.setIcon(ResourceBundle.INSTANCE.columnLabel());
change.setIconAlign(IconAlign.RIGHT);
@ -173,7 +187,7 @@ public class LabelColumnPanel extends FramedPanel implements
protected ArrayList<FieldLabel> generateFields() {
ArrayList<FieldLabel> fields = new ArrayList<FieldLabel>();
for (ColumnData col : columns) {
if (col != null) {
FieldLabel textLabel;
@ -192,9 +206,9 @@ public class LabelColumnPanel extends FramedPanel implements
}
fields.add(textLabel);
}
}
Log.debug("Fields: "+fields.size());
Log.debug("Fields: " + fields.size());
return fields;
}
@ -249,7 +263,7 @@ public class LabelColumnPanel extends FramedPanel implements
}
if (maps.size() > 0) {
labelColumnSession = new LabelColumnSession(trId,maps);
labelColumnSession = new LabelColumnSession(trId, maps);
callLabelColumn();
} else {
UtilsGXT3.alert("Attention", "Insert valid labels!");
@ -266,11 +280,23 @@ public class LabelColumnPanel extends FramedPanel implements
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("Change The Column Label Error: "
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Error Changing The Column Label",
"Error in invocation of Change The Column Label operation!");
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("Change The Column Label Error: "
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Error Changing The Column Label",
"Error in invocation of Change The Column Label operation!");
}
}
}
}

View File

@ -6,6 +6,8 @@ import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
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.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;
@ -41,8 +43,9 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
public class ReplaceBatchDialog extends Window implements MonitorDialogListener {
// ProgressDialogListener, ResumeDialogListener {
protected enum CALLTYPE {
REPLACEBATH, RESUME;
REPLACEBATH, RESUME;
}
protected String WIDTH = "650px";
protected String HEIGHT = "530px";
protected TRId trId;
@ -53,7 +56,7 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener
protected CALLTYPE callType;
private InvocationS invocationS;
private ConditionCode conditionCode; // For Curation
/**
*
* @param trId
@ -250,10 +253,22 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Start Replace Batch failed:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error on batch replace",
"Error on batch replace");
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("Start Replace Batch failed:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error on batch replace",
"Error on batch replace");
}
}
}
close();
@ -273,9 +288,9 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener
*/
// TODO
protected void callReplaceBatchColumnProgressDialog(String taskId) {
callType=CALLTYPE.REPLACEBATH;
callType = CALLTYPE.REPLACEBATH;
openMonitorDialog(taskId);
}
/**
@ -292,11 +307,25 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Task Resume failed:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error on task resume",
"Error on task resume (taskId="
+ taskIdOfInvocationS + ")");
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("Task Resume failed:"
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Error on task resume",
"Error on task resume (taskId="
+ taskIdOfInvocationS
+ ")");
}
}
}
close();
@ -327,11 +356,25 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Task Resume failed:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error on task resume",
"Error on task resume (taskId="
+ taskIdOfInvocationS + ")");
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("Task Resume failed:"
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Error on task resume",
"Error on task resume (taskId="
+ taskIdOfInvocationS
+ ")");
}
}
}
close();
@ -350,16 +393,11 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener
*
*/
protected void callForTaskResume(String taskId) {
callType=CALLTYPE.RESUME;
callType = CALLTYPE.RESUME;
openMonitorDialog(taskId);
}
/**
*
* @param replaceBatchColumnSession
@ -390,16 +428,14 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener
/**
*
protected void callChangeColumnTypeProgressDialog() {
ChangeColumnTypeProgressDialog changeColumnTypeProgressDialog = new ChangeColumnTypeProgressDialog(
eventBus);
changeColumnTypeProgressDialog.addProgressDialogListener(this);
changeColumnTypeProgressDialog.show();
}
protected void callChangeColumnTypeProgressDialog() {
* ChangeColumnTypeProgressDialog changeColumnTypeProgressDialog = new
* ChangeColumnTypeProgressDialog( eventBus);
* changeColumnTypeProgressDialog.addProgressDialogListener(this);
* changeColumnTypeProgressDialog.show(); }
*/
///
// /
protected void openMonitorDialog(String taskId) {
MonitorDialog monitorDialog = new MonitorDialog(taskId, eventBus);
monitorDialog.addProgressDialogListener(this);
@ -408,7 +444,7 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener
@Override
public void operationComplete(TRId trId) {
switch(callType){
switch (callType) {
case REPLACEBATH:
this.trId = trId;
if (taskIdOfInvocationS == null) {
@ -427,8 +463,8 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener
case AmbiguousValueOnExternalReference:
ChangeTableWhy why = ChangeTableWhy.TABLECURATION;
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
ChangeTableRequestType.COLUMNREPLACEBATCH, trId,
why);
ChangeTableRequestType.COLUMNREPLACEBATCH,
trId, why);
eventBus.fireEvent(changeTableRequestEvent);
close();
break;
@ -479,14 +515,14 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener
break;
default:
break;
}
}
@Override
public void operationFailed(Throwable caught, String reason, String details) {
switch(callType){
switch (callType) {
case REPLACEBATH:
UtilsGXT3.alert("Error in Replace Batch", reason);
close();
@ -507,7 +543,7 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener
ChangeTableRequestType.COLUMNREPLACEBATCH, trId, why);
eventBus.fireEvent(changeTableRequestEvent);
close();
}
@Override

View File

@ -15,6 +15,8 @@ import org.gcube.portlets.user.td.columnwidget.client.store.ShowOccurrencesTypeS
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
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.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.tr.ColumnData;
@ -204,8 +206,7 @@ public class ReplaceBatchPanel extends FramedPanel implements
.create(ShowOccurrencesTypeProperties.class);
storeShowOccurrencesType = new ListStore<ShowOccurrencesTypeElement>(
propsShowOccurrencesType.id());
comboShowOccurrencesType = new ComboBox<ShowOccurrencesTypeElement>(
storeShowOccurrencesType, propsShowOccurrencesType.label());
Log.trace("ComboMeasureType created");
@ -439,7 +440,8 @@ public class ReplaceBatchPanel extends FramedPanel implements
add(v);
if (curation) {
storeShowOccurrencesType.addAll(ShowOccurrencesTypeStore.getShowOccurrencesType());
storeShowOccurrencesType.addAll(ShowOccurrencesTypeStore
.getShowOccurrencesType());
if (connection != null) {
Log.debug("Selected connection: " + connection);
connectionField.setValue(connection.getLabel());
@ -463,7 +465,8 @@ public class ReplaceBatchPanel extends FramedPanel implements
cViewData.getTargetTableColumnId());
retrieveConnectionForViewColumn(refCol);
} else {
storeShowOccurrencesType.addAll(ShowOccurrencesTypeStore.getShowOccurrencesType());
storeShowOccurrencesType.addAll(ShowOccurrencesTypeStore
.getShowOccurrencesType());
Log.debug("Not Is View Column");
connectionField.setVisible(false);
btnDisconnect.setVisible(false);
@ -483,10 +486,22 @@ public class ReplaceBatchPanel extends FramedPanel implements
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("load column failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving column",
"Error retrieving column");
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("load column failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving column",
"Error retrieving column");
}
}
}
}
@ -510,10 +525,22 @@ public class ReplaceBatchPanel extends FramedPanel implements
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("load column failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving column",
"Error retrieving column");
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("load column failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving column",
"Error retrieving column");
}
}
}
}
@ -536,10 +563,22 @@ public class ReplaceBatchPanel extends FramedPanel implements
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("load column failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving column",
"Error retrieving column");
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("load column failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving column",
"Error retrieving column");
}
}
}
}
@ -615,10 +654,22 @@ public class ReplaceBatchPanel extends FramedPanel implements
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 {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
caught.getLocalizedMessage());
} else {
Log.error("load columns failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving columns",
"Error retrieving columns");
}
}
}
callback.onFailure(caught);
}
@ -1014,10 +1065,23 @@ public class ReplaceBatchPanel extends FramedPanel implements
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("load column failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving connection",
"Error retrieving connection column");
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("load column failure:"
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Error retrieving connection",
"Error retrieving connection column");
}
}
}
}
@ -1041,10 +1105,23 @@ public class ReplaceBatchPanel extends FramedPanel implements
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("load column failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving connection",
"Error retrieving connection column");
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("load column failure:"
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Error retrieving connection",
"Error retrieving connection column");
}
}
}
}

View File

@ -21,6 +21,8 @@ import org.gcube.portlets.user.td.columnwidget.client.store.TimeDimensionTypeEle
import org.gcube.portlets.user.td.columnwidget.client.store.TimeDimensionTypeStore;
import org.gcube.portlets.user.td.columnwidget.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.DefNewColumn;
@ -829,11 +831,23 @@ public class AddColumnPanel extends FramedPanel implements
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("Add Column Error: "
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Add Column Error ",
"Error in invocation of add column operation!");
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("Add Column Error: "
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Add Column Error ",
"Error in invocation of add column operation!");
}
}
}
}
@ -883,10 +897,23 @@ public class AddColumnPanel extends FramedPanel implements
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("Error retrieving columns: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving columns",
"Error retrieving columns on server!");
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("Error retrieving columns: "
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Error retrieving columns",
"Error retrieving columns on server!");
}
}
}
}
@ -913,9 +940,21 @@ public class AddColumnPanel extends FramedPanel implements
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug(caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving locales",
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 retrieving locales",
caught.getLocalizedMessage());
}
}
}
}

View File

@ -10,6 +10,8 @@ import org.gcube.portlets.user.td.columnwidget.client.store.ColumnTypeCodeStore;
import org.gcube.portlets.user.td.columnwidget.client.store.LocaleTypeElement;
import org.gcube.portlets.user.td.columnwidget.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.DefNewColumn;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
@ -63,7 +65,6 @@ public class CreateDefColumnPanel extends FramedPanel {
protected EventBus eventBus;
protected CreateDefColumnDialog parent;
protected TableType tableType;
protected ComboBox<ColumnTypeCodeElement> comboColumnTypeCode = null;
protected FieldLabel comboColumnTypeCodeLabel;
@ -87,7 +88,8 @@ public class CreateDefColumnPanel extends FramedPanel {
public CreateDefColumnPanel(CreateDefColumnDialog parent,
TableType tableType, EventBus eventBus) {
super();
Log.debug("CreateDefColumnPanel[parent: "+parent+", tableType: "+tableType);
Log.debug("CreateDefColumnPanel[parent: " + parent + ", tableType: "
+ tableType);
this.parent = parent;
this.eventBus = eventBus;
this.tableType = tableType;
@ -375,9 +377,21 @@ public class CreateDefColumnPanel extends FramedPanel {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug(caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving locales",
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 retrieving locales",
caught.getLocalizedMessage());
}
}
}
}

View File

@ -8,6 +8,8 @@ import java.util.List;
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.columnwidget.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.TabResource;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData;
@ -247,11 +249,23 @@ public class CodelistSelectionDialog extends Window {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("Attention",
"This tabular resource does not have a valid table");
UtilsGXT3
.alert("Attention",
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("Attention",
"This tabular resource does not have a valid table");
UtilsGXT3
.alert("Attention",
"This tabular resource does not have a valid table");
}
}
}
}
@ -316,11 +330,24 @@ public class CodelistSelectionDialog extends Window {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("Error Retrieving Codelist",
caught.getMessage());
caught.printStackTrace();
UtilsGXT3.alert("Error Retrieving Codelist",
"Error retrieving codelist on server");
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("Error Retrieving Codelist",
caught.getMessage());
caught.printStackTrace();
UtilsGXT3
.alert("Error Retrieving Codelist",
"Error retrieving codelist on server");
}
}
}
}
@ -347,12 +374,25 @@ public class CodelistSelectionDialog extends Window {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("Error in setCodelistsPagingLoader",
caught.getMessage());
caught.printStackTrace();
UtilsGXT3
.alert("Error Retrieving Codelist",
"Error error in retrieving the codelists during the initialization phase!");
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(
"Error in setCodelistsPagingLoader",
caught.getMessage());
caught.printStackTrace();
UtilsGXT3
.alert("Error Retrieving Codelist",
"Error error in retrieving the codelists during the initialization phase!");
}
}
}
}

View File

@ -7,6 +7,8 @@ import org.gcube.portlets.user.td.columnwidget.client.properties.TabResourceProp
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.columnwidget.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.TabResource;
@ -263,10 +265,23 @@ public class ConnectCodelistDialog extends Window implements
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("Error retrieving columns: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving columns",
"Error retrieving columns on server!");
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("Error retrieving columns: "
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Error retrieving columns",
"Error retrieving columns on server!");
}
}
}
}

View File

@ -8,6 +8,8 @@ import org.gcube.portlets.user.td.columnwidget.client.dimension.DimensionRowsPro
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.columnwidget.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.DimensionRow;
@ -56,10 +58,9 @@ import com.sencha.gxt.widget.core.client.form.TextField;
*
*/
public class ReplacePanel extends FramedPanel implements
DimensionRowSelectionListener,
MonitorDialogListener {
DimensionRowSelectionListener, MonitorDialogListener {
private DateTimeFormat sdf = DateTimeFormat.getFormat("yyyy-MM-dd");
protected String WIDTH = "500px";
protected String HEIGHT = "150px";
protected EventBus eventBus;
@ -70,7 +71,6 @@ public class ReplacePanel extends FramedPanel implements
protected DimensionRow dimensionRow;
protected ReplaceColumnSession replaceColumnSession;
private ComboBox<DimensionRow> comboDimensionType;
private FieldLabel comboDimensionTypeLabel;
@ -112,10 +112,22 @@ public class ReplacePanel extends FramedPanel implements
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error retrieving column: "
+ caught.getMessage());
UtilsGXT3.alert("Error retrieving column",
caught.getMessage());
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 retrieving column: "
+ caught.getMessage());
UtilsGXT3.alert("Error retrieving column",
caught.getMessage());
}
}
}
}
@ -338,7 +350,7 @@ public class ReplacePanel extends FramedPanel implements
if (d != null) {
String dateS = sdf.format(d);
checked = dateS;
}
} else {
if (column.getDataTypeName().compareTo("Geometry") == 0) {
@ -392,7 +404,7 @@ public class ReplacePanel extends FramedPanel implements
public void onSuccess(String taskId) {
Log.debug("Submitted replace column value");
openMonitorDialog(taskId);
}
@Override
@ -401,23 +413,32 @@ public class ReplacePanel extends FramedPanel implements
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error submitting replace column value: "
+ caught.getMessage() + " "
+ caught.getCause());
caught.printStackTrace();
UtilsGXT3.alert(
"Error submitting replace column value",
caught.getMessage());
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 value: "
+ caught.getMessage()
+ " "
+ caught.getCause());
caught.printStackTrace();
UtilsGXT3
.alert("Error submitting replace column value",
caught.getMessage());
}
}
}
}
});
}
protected void addHandlersForComboDimensionType(
final LabelProvider<DimensionRow> labelProvider) {
@ -464,14 +485,14 @@ public class ReplacePanel extends FramedPanel implements
dimensionRow = null;
}
public void close() {
if (parent != null) {
parent.close();
}
}
///
// /
protected void openMonitorDialog(String taskId) {
MonitorDialog monitorDialog = new MonitorDialog(taskId, eventBus);
monitorDialog.addProgressDialogListener(this);
@ -515,5 +536,5 @@ public class ReplacePanel extends FramedPanel implements
close();
}
}