//in the markup, so that cached portlets can keep their metainfo
//This may lead to an incorrect metainfo retrieved if the first
//instance of the portlet, which is put in the cache, has some
//special metainfo defined in the markup
MetaData meta = pc.getMetainfo();
if ( meta != null)
{
if (!DEFAULT_TITLE.equals( meta.getTitle() ) )
{
portlet.setTitle( meta.getTitle() );
}
if (!DEFAULT_DESCRIPTION.equals( meta.getDescription() ) )
{
portlet.setDescription( meta.getDescription() );
}
}
//FIXME: Notice here we are putting the portlet without wrapper
//in the cache, and we must wrap it on return.
//Security implications: the portletcache should not be
//publicly accessible.
//Alternative: we could wrap the portlet before putting
//it in the cache.
//now compute the time it took to instantate and log it...
// time in millis, sugested by Thomas Schaeck (schaeck@de.ibm.com)
long milliseconds = ( System.currentTimeMillis() - begin );
if (logger.isDebugEnabled())
logger.debug( "PortletFactory.getPortlet(): found in cache in "
+ milliseconds + " ms - handle: " + handle );
return PortletWrapper.wrap( portlet );
}
// if not found in the cache, instanciate a new Portlet
portlet = (Portlet)portletClass.newInstance();
}
catch ( Throwable t )
{
logger.error("Throwable", t);
throw new PortletException( t.getMessage() );
}
// save the current meta-info
String title = null;
String description = null;
MetaData metainfo = pc.getMetainfo();
if ( metainfo != null ) {
title=metainfo.getTitle();
description=metainfo.getDescription();
}
// init the portlet, it may override its PSML defined markup if
// it doesn't check for it