morciuch 2002/11/18 09:08:07
Modified: src/java/org/apache/jetspeed/portal/controls
VelocityPortletSetControl.java
Log:
Title for the tab is now retrieved from the portlet instance. If user customizes the
portlet title, the correct title will be shown rather than the default titile defined
in the registry.
Revision Changes Path
1.12 +17 -2
jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controls/VelocityPortletSetControl.java
Index: VelocityPortletSetControl.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controls/VelocityPortletSetControl.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- VelocityPortletSetControl.java 25 Aug 2002 21:49:45 -0000 1.11
+++ VelocityPortletSetControl.java 18 Nov 2002 17:08:07 -0000 1.12
@@ -69,6 +69,8 @@
import org.apache.jetspeed.services.security.PortalResource;
import org.apache.jetspeed.util.template.JetspeedLink;
import org.apache.jetspeed.util.template.JetspeedLinkFactory;
+import org.apache.jetspeed.services.persistence.PersistenceManager;
+import org.apache.jetspeed.portal.PortletInstance;
// Velocity Stuff
import org.apache.velocity.context.Context;
@@ -167,7 +169,20 @@
}
PortletTab tab = new PortletTab();
- tab.setTitle((p.getTitle() != null) ? p.getTitle() : p.getName());
+
+ // Handle the portlet title
+ String title = null;
+ PortletInstance pi = PersistenceManager.getInstance(p, rundata);
+ if (pi != null)
+ {
+ title = pi.getTitle();
+ if (title == null)
+ {
+ title = (p.getTitle() != null) ? p.getTitle() : p.getName();
+ }
+ }
+ tab.setTitle(title);
+
tab.setPosition(p.getPortletConfig().getPosition());
if (tabs.contains(tab))
{
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>