Author: thomas.heute(a)jboss.com
Date: 2010-04-01 09:09:37 -0400 (Thu, 01 Apr 2010)
New Revision: 2453
Modified:
portal/branches/EPP_5_0_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java
Log:
JBEPP-224: Reset current navigation after sign in
Modified:
portal/branches/EPP_5_0_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java
===================================================================
---
portal/branches/EPP_5_0_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java 2010-04-01
12:44:40 UTC (rev 2452)
+++
portal/branches/EPP_5_0_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java 2010-04-01
13:09:37 UTC (rev 2453)
@@ -19,9 +19,11 @@
package org.exoplatform.portal.webui.page;
+import org.exoplatform.container.ExoContainer;
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.UserPortalConfig;
+import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.ModelObject;
import org.exoplatform.portal.config.model.Page;
@@ -40,7 +42,6 @@
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
-import org.exoplatform.webui.event.Event.Phase;
import java.util.ArrayList;
import java.util.List;
@@ -295,13 +296,33 @@
*/
private PageNode getDefaultNode(PageNavigation nav)
{
- PageNode defaultNode;
+ PageNode defaultNode = null;
try
{
- defaultNode = nav.getNodes().get(0);
+ if (nav != null && nav.getNodes().size() > 0)
+ {
+ WebuiRequestContext context = Util.getPortalRequestContext();
+ ExoContainer appContainer =
context.getApplication().getApplicationServiceContainer();
+ UserPortalConfigService userPortalConfigService =
(UserPortalConfigService)appContainer.getComponentInstanceOfType(UserPortalConfigService.class);
+
+ for (PageNode pageNode : nav.getNodes())
+ {
+ Page page =
userPortalConfigService.getPage(pageNode.getPageReference(), context.getRemoteUser());
+ if (page != null)
+ {
+ defaultNode = pageNode;
+ break;
+ }
+ }
+ }
+ else
+ {
+ return null;
+ }
}
- catch (IndexOutOfBoundsException ex)
+ catch (Exception e)
{
+ e.printStackTrace();
return null;
}
if (defaultNode != null &&
!("notfound".equals(defaultNode.getName())))
Show replies by date