.addPathInfo("media-type", "html")
.toString()
);
JetspeedLinkFactory.putInstance(jsLink);
jsLink = null;
return new JetspeedClearElement("");
} catch (Exception e)
{
logger.error("Exception", e);
rundata.setScreenTemplate("Home");
return new JetspeedClearElement("");
}
//return new JetspeedClearElement("You must specify portlet to preview using [previewedPortletName] parameter");
}
Portlet portlet = null;
try
{
portlet = PortletFactory.getPortlet(portletName, "PreviewPortlet");
PortletControl control = controlName == null ? PortalToolkit.getControl((String)null) :
PortalToolkit.getControl(controlName);
control = null;
if ( control != null )
{
JetspeedRunData jdata = (JetspeedRunData)rundata;
// Use the profile's skin
//portlet.getPortletConfig().setSkin(PortalToolkit.getSkin(jdata.getProfile().getDocument().getPortlets().getSkin()));
control.setPortlet(portlet);
control.init();
result = control.getContent(rundata);
}
else if ( portlet != null )
{
result = portlet.getContent(rundata);
}
if ( result != null && !result.toString().equals("") )
{
/*String html = result.toString();
String currentURL = rundata.getRequest().getRequestURI();
Log.debug("PreviewPortlet: currentURL = " + currentURL + " reader value = " + html);
PreviewRewriter rewriter = new PreviewRewriter(currentURL, currentURL , currentURL, portletName);
result = new JetspeedClearElement(rewriter.rewrite(new StringReader(html)));*/
}
else
{
// The portlet already streamed its content - return a stub
result = new JetspeedClearElement("");
}
}
catch ( Exception e )
{
logger.error("Exception", e);
result = new JetspeedClearElement("This resource is temporarily unavailable");
}
rundata.setLayout("preview");
return result;
}