diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/AppController.java b/src/main/java/org/gcube/portlets/user/workspace/client/AppController.java index e74b0ff..d077cd2 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/AppController.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/AppController.java @@ -66,6 +66,7 @@ import org.gcube.portlets.user.workspace.client.event.SearchTextEvent; import org.gcube.portlets.user.workspace.client.event.SearchTextEventHandler; import org.gcube.portlets.user.workspace.client.event.SendMessageEvent; import org.gcube.portlets.user.workspace.client.event.SendMessageEventHandler; +import org.gcube.portlets.user.workspace.client.event.SessionExpiredEvent; import org.gcube.portlets.user.workspace.client.event.WebDavUrlEvent; import org.gcube.portlets.user.workspace.client.event.WebDavUrlEventHandler; import org.gcube.portlets.user.workspace.client.interfaces.EventsTypeEnum; @@ -80,6 +81,7 @@ import org.gcube.portlets.user.workspace.client.view.panels.GxtItemsPanel; import org.gcube.portlets.user.workspace.client.view.windows.DialogGetInfo; import org.gcube.portlets.user.workspace.client.view.windows.InfoDisplay; import org.gcube.portlets.user.workspace.client.view.windows.MessageBoxAlert; +import org.gcube.portlets.user.workspace.shared.SessionExpiredException; import org.gcube.portlets.user.wsmail.client.forms.MailForm; import com.extjs.gxt.ui.client.widget.LayoutContainer; @@ -106,6 +108,7 @@ public class AppController implements SubscriberInterface { private AppControllerExplorer appContrExplorer = null; private String rootIdentifier = null; // public static boolean isSearchActive = false; + private HasWidgets rootPanel; @@ -130,7 +133,8 @@ public class AppController implements SubscriberInterface { EventsTypeEnum.SELECTED_MESSAGE, EventsTypeEnum.CREATE_NEW_MESSAGE, EventsTypeEnum.REPLY_FORWARD_MESSAGE, - EventsTypeEnum.FILE_DOWNLAD_EVENT + EventsTypeEnum.FILE_DOWNLAD_EVENT, + EventsTypeEnum.SESSION_EXPIRED }); bind(); } @@ -512,6 +516,12 @@ public class AppController implements SubscriberInterface { @Override public void onFailure(Throwable caught) { + + if(caught instanceof SessionExpiredException){ + eventBus.fireEvent(new SessionExpiredEvent()); + return; + } + new MessageBoxAlert("Error", caught.getMessage(), null); wsPortlet.getGridGroupContainer().unmask(); @@ -806,6 +816,8 @@ public class AppController implements SubscriberInterface { */ public void go(final HasWidgets rootPanel) { + this.rootPanel = rootPanel; + final String searchParameter = Window.Location.getParameter(ConstantsPortlet.GET_SEARCH_PARAMETER); final String itemIdParameter = Window.Location.getParameter(ConstantsPortlet.GET_ITEMID_PARAMETER); final String operationParameter = Window.Location.getParameter(ConstantsPortlet.GET_OPEARATION_PARAMETER); @@ -868,9 +880,7 @@ public class AppController implements SubscriberInterface { initPortlet(rootPanel, instanceWithGrouping, searchingForItemId, searchParameter, itemIdParameter, operationParameter); else{ //SESSION IS EXPIRED - - rootPanel.add(showProblems()); - getMainPanel().setHeight(350); + viewSessionExpiredPanel(); } } @@ -913,18 +923,7 @@ public class AppController implements SubscriberInterface { // // } } - - private LayoutContainer showProblems() { - LayoutContainer errorPanel = new LayoutContainer(); - errorPanel.setLayout(new FitLayout()); - - errorPanel.add(new HTML("