[gatein-commits] gatein SVN: r6184 - in portal/branches/site-describability: portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Apr 8 07:29:02 EDT 2011


Author: ndkhoiits
Date: 2011-04-08 07:29:01 -0400 (Fri, 08 Apr 2011)
New Revision: 6184

Modified:
   portal/branches/site-describability/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarSitePortlet.java
   portal/branches/site-describability/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarSitePortlet.gtmpl
   portal/branches/site-describability/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
Log:
GTNPORTAL-1854 Site instance is displayed in menu by label instead of portal name

Modified: portal/branches/site-describability/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarSitePortlet.java
===================================================================
--- portal/branches/site-describability/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarSitePortlet.java	2011-04-08 10:38:06 UTC (rev 6183)
+++ portal/branches/site-describability/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarSitePortlet.java	2011-04-08 11:29:01 UTC (rev 6184)
@@ -19,6 +19,7 @@
 
 package org.exoplatform.toolbar.webui.component;
 
+import org.exoplatform.portal.config.DataStorage;
 import org.exoplatform.portal.config.UserPortalConfigService;
 import org.exoplatform.portal.config.model.PageNavigation;
 import org.exoplatform.portal.config.model.PageNode;
@@ -52,6 +53,19 @@
       UserPortalConfigService dataStorage = getApplicationComponent(UserPortalConfigService.class);
       return dataStorage.getAllPortalNames();
    }
+   
+   public String getPortalLabel(String portalName) throws Exception
+   {
+      DataStorage storage_ = getApplicationComponent(DataStorage.class);
+      PortalConfig portalConfig = storage_.getPortalConfig(portalName);
+      String label = portalConfig.getLabel();
+      if (label != null && label.trim().length() > 0)
+      {
+         return label;
+      }
+      
+      return portalName;
+   }
 
    public String getCurrentPortal()
    {

Modified: portal/branches/site-describability/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarSitePortlet.gtmpl
===================================================================
--- portal/branches/site-describability/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarSitePortlet.gtmpl	2011-04-08 10:38:06 UTC (rev 6183)
+++ portal/branches/site-describability/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarSitePortlet.gtmpl	2011-04-08 11:29:01 UTC (rev 6184)
@@ -35,12 +35,13 @@
 				if(isCurrent && nodes.size() > 0) clazz = "class='ArrowIcon'";
 				else clazz = "";
 				href = uicomponent.getPortalURI(portal);
+                label = uicomponent.getPortalLabel(portal);
                 EntityEncoder entityEncoder = EntityEncoder.FULL;
 				portal = entityEncoder.encode(portal);
 				print """
 					<div class="MenuItem portlet-menu-cascade-item">
 						<div $clazz>
-							<a href="$href" class="ItemIcon SiteIcon">$portal</a>
+							<a href="$href" class="ItemIcon SiteIcon">$label</a>
 						</div>
 				""";
 						if(isCurrent) {

Modified: portal/branches/site-describability/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
===================================================================
--- portal/branches/site-describability/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java	2011-04-08 10:38:06 UTC (rev 6183)
+++ portal/branches/site-describability/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java	2011-04-08 11:29:01 UTC (rev 6184)
@@ -323,6 +323,11 @@
                dataService.save(portalConfig);
                prContext.setAttribute(UserPortalConfig.class, service.getUserPortalConfig(uiForm.getPortalOwner(), prContext.getRemoteUser()));
                uiPortalApp.reloadSkinPortal(prContext);
+               
+               // We should use IPC to update some portlets in the future instead of
+               UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChild(UIWorkingWorkspace.class);
+               uiWorkingWS.updatePortletsByName("PortalNavigationPortlet");
+               uiWorkingWS.updatePortletsByName("UserToolbarSitePortlet");
             }
             else
             {



More information about the gatein-commits mailing list