--- VelocityPanedPortletController_cvs.java Tue Apr 8 10:37:37 2003
+++ VelocityPanedPortletController.java Tue Apr 8 10:37:52 2003
@@ -76,7 +76,7 @@
* @author Raphal Luta
* @author David Sean Taylor
*
- * @version $Id: VelocityPanedPortletController.java,v 1.8 2003/03/04 00:05:03 sgala Exp $
+ * @version $Id: VelocityPanedPortletController.java,v 1.7 2002/11/12 00:34:57 taylor Exp $
*/
public class VelocityPanedPortletController extends VelocityPortletController
@@ -105,7 +105,14 @@
public boolean isSelected( Portlet p, RunData rundata )
{
String peid = rundata.getParameters().getString( getPaneParameter() );
+ String pname = rundata.getParameters().getString(JetspeedResources.PATH_PANENAME_KEY);
String last = retrievePaneIDFromSession(rundata);
+
+ //match by portlet name if appropriate.
+ if (pname != null && pname.equals(p.getName()))
+ {
+ return true;
+ }
if (peid == null)
{
@@ -115,7 +122,18 @@
}
else
{
- return (p.getID().equals(last));
+ if (pname == null)
+ {
+ return (p.getID().equals(last));
+ }
+ else
+ {
+ //If the current portlet set has a portlet with the same name as the one we're trying to select
+ //we don't want to select anything else b/c we'll select the one we want AND the last-used portlet.
+ //If the portlet set doesn't have a portlet by this name, we WANT to select the last
+ //used, otherwise nothing will be selected in this set.
+ return (getPortlets().getPortletByName(pname) == null && p.getID().equals(last));
+ }
}
}
else
@@ -127,9 +145,7 @@
subPane = peid.substring(index + 1);
peid = peid.substring(0, index);
}
-
-
-
+
if ( p.getID().equals(peid) ) // && subPane == null )
{
return true;
@@ -147,7 +163,7 @@
return true;
}
- // is the peid for this tab set?
+ // is the peid for this tab set?
if (getPortlets().getPortletByID(peid) != null)
{
// its for another tab in this set
@@ -345,3 +361,5 @@
}
}
+
+