portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r895695 - /portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java
Date Mon, 04 Jan 2010 16:48:06 GMT
Author: woonsan
Date: Mon Jan  4 16:47:58 2010
New Revision: 895695

URL: http://svn.apache.org/viewvc?rev=895695&view=rev
Log:
JS2-1091: Fixing the problem that it displays fragment's name instead of portlet's display
name when the portlet window is out-of-service.

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java?rev=895695&r1=895694&r2=895695&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java
Mon Jan  4 16:47:58 2010
@@ -702,22 +702,41 @@
     public String getTitle(ContentFragment f)
     {
         String title = null;
+        
         if (f != null)
         {
             title = f.getTitle();
+            
             if (title == null && f.getPortletContent() != null)
             {
                 title = f.getPortletContent().getTitle();
             }
-            else
+            
+            if (title == null)
             {
-                title = f.getName();
-                if (title != null && title.indexOf("::") > -1)
+                PortletWindow portletWindow = requestContext.getPortletWindow(f);
+            
+                if (portletWindow != null)
+                {
+                    title = requestContext.getPreferedLanguage(portletWindow.getPortletDefinition()).getTitle();
+                    
+                    if (title == null)
+                    {
+                        title = portletWindow.getPortletDefinition().getPortletName();
+                    }
+                }
+                else
                 {
-                    title = title.substring(title.indexOf("::")+2);
+                    title = f.getName();
+                    
+                    if (title != null && title.indexOf("::") > -1)
+                    {
+                        title = title.substring(title.indexOf("::") + 2);
+                    }
                 }
             }
         }
+        
         return title;
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message