portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Sean Taylor" <da...@bluesunrise.com>
Subject RE: A brief report on Jetspeed Portlet Caching
Date Mon, 13 May 2002 04:31:41 GMT
Glenn,

I ran a little test, seems like I've got a patch, but haven't tested it
much.
Added the id from the psml-entry into the PortletConfig, and then use it
in getHandle.
Here is summary of the most important changes:

JetspeedPortletFactoryService:

    public static Portlet getPortlet( String name, String id ) throws
PortletException
                                                         ^ 
    protected PortletConfig getPortletConfig( PortletEntry entry, String
id)
    {
      ....
        pc.setId(id);        
        
        return pc;
    }
^

PortletConfig, BasePortletConfig, added:

    public void setId(String id);
    public String getId();




Here is the test portlet:
I put two of these on the same page and the portlet config returned
different ids (so did the 'portlet id')

public class BogusPortlet extends AbstractPortlet 
{
    
    public org.apache.ecs.ConcreteElement
getContent(org.apache.turbine.util.RunData data) 
    {
        String s1 = "Config ID: " + getPortletConfig().getId();
        String s2 = ", Portlet ID: " + getID();
        return new org.apache.ecs.ClearElement( s1 + s2 );
    }

    public static Object getHandle(Object config)
    {
        //this implementation expects a PortletConfig object as its
        // configuration 
        PortletConfig pc = null;

        if (!(config instanceof PortletConfig))
        {
            return null;
            
        }

        // By default, only take into account the init parameters 
        pc = (PortletConfig)config;

        return pc.getId();
        
    }

If you're interestd I can send you the rest of the code (or just check
it in),

David



--
To unsubscribe, e-mail:   <mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-dev-help@jakarta.apache.org>


Mime
View raw message