Author: liem_nguyen
Date: 2010-02-02 03:54:01 -0500 (Tue, 02 Feb 2010)
New Revision: 1494
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarDashboardPortlet.java
Log:
GTNPORTAL-489 Show exception in cygwin when select dashboard with 2 browser
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarDashboardPortlet.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarDashboardPortlet.java 2010-02-02
08:47:33 UTC (rev 1493)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarDashboardPortlet.java 2010-02-02
08:54:01 UTC (rev 1494)
@@ -20,6 +20,7 @@
package org.exoplatform.toolbar.webui.component;
import org.exoplatform.portal.application.PortalRequestContext;
+import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
@@ -88,12 +89,26 @@
{
UIUserToolBarDashboardPortlet toolBarPortlet = event.getSource();
String nodeName =
event.getRequestContext().getRequestParameter(UIComponent.OBJECTID);
- PageNavigation userNavigation = toolBarPortlet.getCurrentUserNavigation();
+
+ PageNavigation cachedNavigation = toolBarPortlet.getCurrentUserNavigation();
+
+ // Update navigation for prevent create first node which already existed
+ DataStorage dataStorage =
toolBarPortlet.getApplicationComponent(DataStorage.class);
+ PageNavigation userNavigation =
+ dataStorage.getPageNavigation(cachedNavigation.getOwnerType(),
cachedNavigation.getOwnerId());
+ cachedNavigation.merge(userNavigation);
+
UserPortalConfigService configService =
toolBarPortlet.getApplicationComponent(UserPortalConfigService.class);
- if (userNavigation != null && configService != null &&
userNavigation.getNodes().size() < 1)
+ if (cachedNavigation != null && configService != null &&
cachedNavigation.getNodes().size() < 1)
{
- createDashboard(nodeName, userNavigation, configService);
+ createDashboard(nodeName, cachedNavigation, configService);
}
+ else
+ {
+ PortalRequestContext prContext = Util.getPortalRequestContext();
+ prContext.getResponse().sendRedirect(
+ prContext.getPortalURI() + cachedNavigation.getNodes().get(0).getName());
+ }
}
private static void createDashboard(String _nodeName, PageNavigation
_pageNavigation,
Show replies by date