taylor 02/03/06 10:32:34 Modified: src/java/org/apache/jetspeed/portal/controls AbstractPortletControl.java Log: - added method to lookup portlet from portlet set by id Revision Changes Path 1.13 +41 -1 jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controls/AbstractPortletControl.java Index: AbstractPortletControl.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controls/AbstractPortletControl.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- AbstractPortletControl.java 4 Dec 2001 18:35:51 -0000 1.12 +++ AbstractPortletControl.java 6 Mar 2002 18:32:34 -0000 1.13 @@ -91,7 +91,7 @@ * * @author <a href="mailto:[EMAIL PROTECTED]">Raphaël Luta</a> * @author <a href="mailto:[EMAIL PROTECTED]">Santiago Gala</a> - * @version $Id: AbstractPortletControl.java,v 1.12 2001/12/04 18:35:51 sgala Exp $ + * @version $Id: AbstractPortletControl.java,v 1.13 2002/03/06 18:32:34 taylor Exp $ */ public abstract class AbstractPortletControl extends AbstractPortlet implements PortletControl @@ -105,6 +105,11 @@ private Portlet portlet = null; private PortletControlConfig conf = null; + /** + Provide a Unique Portlet ID + */ + private String id = null; + // PortletControl specifc interface /** @@ -748,5 +753,40 @@ ((PortletState)p).setMinimized( minimize, rundata); } } + + public String getID() + { + return id; + } + + public void setID(String id) + { + this.id = id; + } + + /** + Returns the Portlet with the given id + */ + public Portlet getPortletByID(String id) + { + Portlet p = getPortlet(); + if (null == p) + return null; + + if (p instanceof PortletSet) + { + Enumeration e = ((PortletSet)p).getPortlets(); + Portlet portlet = null; + while ( e.hasMoreElements() ) + { + portlet = (Portlet)e.nextElement(); + if (portlet.getID().equals(id)) + return portlet; + } + return portlet; + } + return null; + } + }
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>