portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r908523 - /portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java
Date Wed, 10 Feb 2010 14:52:41 GMT
Author: woonsan
Date: Wed Feb 10 14:52:41 2010
New Revision: 908523

URL: http://svn.apache.org/viewvc?rev=908523&view=rev
Log:
JS2-1057: Adding a method in JetUI to retrieve portlet icon.

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

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java?rev=908523&r1=908522&r2=908523&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java
Wed Feb 10 14:52:41 2010
@@ -33,6 +33,7 @@
 import org.apache.jetspeed.layout.PageLayoutComponent;
 import org.apache.jetspeed.om.page.ContentFragment;
 import org.apache.jetspeed.om.page.ContentPage;
+import org.apache.jetspeed.om.portlet.InitParam;
 import org.apache.jetspeed.pipeline.PipelineException;
 import org.apache.jetspeed.portlet.HeadElement;
 import org.apache.jetspeed.portlet.HeaderPhaseSupportConstants;
@@ -295,4 +296,22 @@
         return null;
     }
     
+    public String getPortletIcon(RequestContext context, String windowId, String defaultPortletIcon)
+    {
+        String portletIcon = null;
+        PortletWindow window = context.getPortletWindow(windowId);
+        
+        if (window != null && window.getPortletDefinition() != null)
+        {
+            InitParam portletIconInitParam = window.getPortletDefinition().getInitParam("portlet-icon");
+            
+            if (portletIconInitParam != null)
+            {
+                portletIcon = portletIconInitParam.getParamValue();
+            }
+        }
+        
+        return (portletIcon != null ? portletIcon : defaultPortletIcon);
+    }
+    
 }



---------------------------------------------------------------------
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