diff --git a/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVExportConfigCard.java b/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVExportConfigCard.java index 1c46d65..d2d1456 100644 --- a/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVExportConfigCard.java +++ b/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVExportConfigCard.java @@ -6,7 +6,10 @@ import org.gcube.portlets.user.td.csvexportwidget.client.grid.ColumnDataGridPane import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; import org.gcube.portlets.user.td.gwtservice.shared.csv.AvailableCharsetList; import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession; +import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException; import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData; +import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent; +import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType; import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; import com.allen_sauer.gwt.log.client.Log; @@ -113,9 +116,16 @@ public class CSVExportConfigCard extends WizardCard { * {@inheritDoc} */ public void onFailure(Throwable caught) { + if (caught instanceof TDGWTSessionExpiredException) { + getEventBus().fireEvent(new SessionExpiredEvent( + SessionExpiredType.EXPIREDONSERVER)); + } else { + + GWT.log("Error loading charset list", caught); showErrorAndHide("Error loading charset list", "Error loading charset list", "", caught); + } } }); diff --git a/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVExportWizardTD.java b/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVExportWizardTD.java index ca8428d..dc37860 100644 --- a/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVExportWizardTD.java +++ b/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVExportWizardTD.java @@ -4,7 +4,7 @@ package org.gcube.portlets.user.td.csvexportwidget.client; import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession; import org.gcube.portlets.user.td.wizardwidget.client.WizardWindow; - +import com.google.web.bindery.event.shared.EventBus; @@ -21,8 +21,8 @@ public class CSVExportWizardTD extends WizardWindow { * @param targetId */ - public CSVExportWizardTD(String title) { - super(title); + public CSVExportWizardTD(String title, EventBus eventBus) { + super(title,eventBus); exportSession= new CSVExportSession(); @@ -30,8 +30,6 @@ public class CSVExportWizardTD extends WizardWindow { addCard(csvExportConfigCard); csvExportConfigCard.setup(); - - } diff --git a/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVExportWizardTDEntry.java b/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVExportWizardTDEntry.java index 50aa939..45c846a 100644 --- a/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVExportWizardTDEntry.java +++ b/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVExportWizardTDEntry.java @@ -2,12 +2,14 @@ package org.gcube.portlets.user.td.csvexportwidget.client; import com.allen_sauer.gwt.log.client.Log; import com.google.gwt.core.client.EntryPoint; +import com.google.web.bindery.event.shared.SimpleEventBus; public class CSVExportWizardTDEntry implements EntryPoint { public void onModuleLoad() { - CSVExportWizardTD exportWizard= new CSVExportWizardTD("CSVExport"); + SimpleEventBus eventBus=new SimpleEventBus(); + CSVExportWizardTD exportWizard= new CSVExportWizardTD("CSVExport",eventBus); Log.info(exportWizard.getId()); } } diff --git a/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVOperationInProgressCard.java b/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVOperationInProgressCard.java index 482b376..eb23083 100644 --- a/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVOperationInProgressCard.java +++ b/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVOperationInProgressCard.java @@ -8,6 +8,9 @@ import org.gcube.portlets.user.td.csvexportwidget.client.progress.CSVExportProgr import org.gcube.portlets.user.td.csvexportwidget.client.progress.CSVExportProgressUpdater; import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession; +import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException; +import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent; +import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType; import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; @@ -98,11 +101,18 @@ public class CSVOperationInProgressCard extends WizardCard implements } public void onFailure(Throwable caught) { - showErrorAndHide( - "Error in exportCSV", - "An error occured in exportCSV: " - + caught.getLocalizedMessage(), caught - .getStackTrace().toString(), caught); + if (caught instanceof TDGWTSessionExpiredException) { + getEventBus() + .fireEvent( + new SessionExpiredEvent( + SessionExpiredType.EXPIREDONSERVER)); + } else { + showErrorAndHide( + "Error in exportCSV", + "An error occured in exportCSV: " + + caught.getLocalizedMessage(), + caught.getStackTrace().toString(), caught); + } } }); } @@ -186,13 +196,13 @@ public class CSVOperationInProgressCard extends WizardCard implements @Override public void operationGeneratingView() { // TODO Auto-generated method stub - + } @Override public void operationValidate(float elaborated) { // TODO Auto-generated method stub - + } }