Added SessionExpiredShow
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-csv-export-widget@95765 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
77ca8f02ba
commit
1cace1cb36
|
@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue