[gatein-commits] gatein SVN: r3821 - in exo/portal/branches/3.1.x: webui/portal/src/main/java/org/exoplatform/portal/webui/application and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Aug 13 07:49:55 EDT 2010


Author: hoang_to
Date: 2010-08-13 07:49:54 -0400 (Fri, 13 Aug 2010)
New Revision: 3821

Modified:
   exo/portal/branches/3.1.x/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
   exo/portal/branches/3.1.x/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
Log:
EXOGTN-29: GateIn should use the portlet title set in RenderResponse for the title on info bar

Modified: exo/portal/branches/3.1.x/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
===================================================================
--- exo/portal/branches/3.1.x/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl	2010-08-13 11:47:25 UTC (rev 3820)
+++ exo/portal/branches/3.1.x/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl	2010-08-13 11:49:54 UTC (rev 3821)
@@ -37,12 +37,14 @@
 										<div class="FixHeight">
 											<%
 											if(hasPermission) {
-												try {
-													String portletName = uicomponent.getProducedOfferedPortlet().getInfo().getName();
-													print _ctx.getRequestContext().getApplicationResourceBundle().getString("UIPortlet.description." + portletName);
-												} catch(Exception e){
-													print uicomponent.getDisplayName();
-												}
+												if(portletTitle == null || portletTitle.trim().length() < 1) {
+													try {
+														String portletName = uicomponent.getProducedOfferedPortlet().getInfo().getName();
+														print _ctx.getRequestContext().getApplicationResourceBundle().getString("UIPortlet.description." + portletName);
+													} catch(Exception e){
+														print uicomponent.getDisplayName();
+													}
+												} else print portletTitle;
 											} else print "<div class='ProtectedContent'>"+_ctx.appRes("UIPortlet.label.protectedContent")+"</div>";
 											%>
 										</div>
@@ -60,10 +62,12 @@
 			
 		if(portalMode != uiPortalApp.CONTAINER_BLOCK_EDIT_MODE && portalMode != uiPortalApp.APP_BLOCK_EDIT_MODE) {
 			if(uicomponent.getShowInfoBar()) {
-				String title = uicomponent.getTitle();
-				if(title == null || title.trim().length() < 1) 
+				String title = portletTitle;
+				if(title == null || title.trim().length() < 1)
+					title = uicomponent.getTitle();
+				if(title == null || title.trim().length() < 1)
 					title = uicomponent.getDisplayName();
-				if(title == null || title.trim().length() < 1)					
+				if(title == null || title.trim().length() < 1)
 					title = portletId;
 				/*Begin Window Portlet Bar*/
 				String visibility = "visible";
@@ -288,7 +292,9 @@
 																String portletIcon = uicomponent.getIcon();
 																if(portletIcon == null) portletIcon = "PortletIcon";
 																
-																String title = uicomponent.getDisplayTitle();
+																String title = portletTitle;
+																if(title == null || title.trim().length() < 1)
+																	title = uicomponent.getDisplayTitle();
 																if(title.length() > 30) title = title.substring(0,27) + "...";
 															%>
 															<div class="PortletIcon $portletIcon"><%=hasPermission ? title : _ctx.appRes("UIPortlet.label.protectedContent")%></div>

Modified: exo/portal/branches/3.1.x/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
===================================================================
--- exo/portal/branches/3.1.x/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java	2010-08-13 11:47:25 UTC (rev 3820)
+++ exo/portal/branches/3.1.x/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java	2010-08-13 11:49:54 UTC (rev 3821)
@@ -325,12 +325,6 @@
       }
 
       //
-      if (portletTitle == null)
-      {
-         portletTitle = "Portlet";
-      }
-
-      //
       if (context.useAjax() && !prcontext.getFullRender())
       {
          if (markup != null)



More information about the gatein-commits mailing list