Author: hfnukal
Date: 2012-03-12 14:21:31 -0400 (Mon, 12 Mar 2012)
New Revision: 8563
Modified:
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
Log:
Bug 794410 Navigation loading fails with NPE when previewing a page
Modified:
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2012-03-12
04:20:44 UTC (rev 8562)
+++
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2012-03-12
18:21:31 UTC (rev 8563)
@@ -27,8 +27,6 @@
import org.exoplatform.portal.mop.SiteType;
import org.exoplatform.portal.mop.user.UserNavigation;
import org.exoplatform.portal.mop.user.UserNode;
-import org.exoplatform.web.url.navigation.NodeURL;
-import org.exoplatform.web.url.navigation.NavigationResource;
import org.exoplatform.portal.webui.application.UIPortlet;
import org.exoplatform.portal.webui.container.UIContainer;
import org.exoplatform.portal.webui.page.UIPage;
@@ -50,16 +48,16 @@
import org.exoplatform.web.login.LogoutControl;
import org.exoplatform.web.security.security.AbstractTokenService;
import org.exoplatform.web.security.security.CookieTokenService;
+import org.exoplatform.web.url.navigation.NavigationResource;
+import org.exoplatform.web.url.navigation.NodeURL;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
-
import java.util.HashMap;
import java.util.Map;
-
import javax.portlet.WindowState;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
@@ -214,8 +212,8 @@
public UserNavigation getUserNavigation() throws Exception
{
- UIPortalApplication uiPortalApp = getAncestorOfType(UIPortalApplication.class);
- return uiPortalApp.getUserPortalConfig().getUserPortal().getNavigation(siteKey);
+ PortalRequestContext prc = Util.getPortalRequestContext();
+ return prc.getUserPortalConfig().getUserPortal().getNavigation(siteKey);
}
/**