incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1362423 - /sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/ui/UIServlet.java
Date Tue, 17 Jul 2012 09:21:30 GMT
Author: cziegeler
Date: Tue Jul 17 09:21:30 2012
New Revision: 1362423

URL: http://svn.apache.org/viewvc?rev=1362423&view=rev
Log:
Code cleanup

Modified:
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/ui/UIServlet.java

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/ui/UIServlet.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/ui/UIServlet.java?rev=1362423&r1=1362422&r2=1362423&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/ui/UIServlet.java
(original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/ui/UIServlet.java
Tue Jul 17 09:21:30 2012
@@ -27,6 +27,7 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.Property;
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.Service;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
 import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
@@ -75,7 +76,12 @@ public class UIServlet extends SlingSafe
                 w.key("value");
                 w.value(entity.getPortletEntityId().getKey());
                 w.key("text");
-                w.value(entity.getPortletConfig().getPortletDefinition().getPortletName());
+                final PortletDefinition def = entity.getPortletConfig().getPortletDefinition();
+                if ( def.getPortletInfo() != null && def.getPortletInfo().getTitle()
!= null ) {
+                    w.value(def.getPortletInfo().getTitle());
+                } else {
+                    w.value(def.getPortletName());
+                }
                 w.endObject();
             }
             w.endArray();



Mime
View raw message