/**
*/
public ConcreteElement getContent(RunData rundata)
{
ConcreteElement content = null;
PortletController controller = getController();
PortalResource portalResource = new PortalResource(this);
try
{
JetspeedLink jsLink = JetspeedLinkFactory.getInstance(rundata);
portalResource.setOwner(jsLink.getUserName());
JetspeedLinkFactory.putInstance(jsLink);
}
catch (Exception e)
{
Log.warn(e.toString());
portalResource.setOwner(null);
}
if (!JetspeedSecurity.checkPermission((JetspeedUser) rundata.getUser(),
portalResource, JetspeedSecurity.PERMISSION_VIEW))
{
Log.debug("Unauthorized access by user \"" + rundata.getUser().getUserName() + "\"");
// Clear any portlets that exist in this set
if (this.portlets != null)
{
this.portlets.clear();
}
return new StringElement(Localization.getString("SECURITY_NO_ACCESS"));
}
else
{
Log.debug("User \"" + rundata.getUser().getUserName() + "\" is authorized to portlet set " + getID());
}
if (controller == null)
{
Portlet p = getPortletAt(0);
if (p != null)
{
content = p.getContent(rundata);
}
}
else
{
content = controller.getContent(rundata);
}
if (content == null)
{
content = new ConcreteElement();
}
return content;
}