}
String viewPage = null;
String absViewPage = null;
try
{
JetspeedPowerTool jpt = getJetspeedPowerTool(request);
if (maximized)
{
viewPage = getCachedLayoutViewPage(request, PortalReservedParameters.PAGE_LAYOUT_MAX);
if (viewPage == null)
{
PortletPreferences prefs = request.getPreferences();
viewPage = prefs.getValue(PARAM_MAX_PAGE, null);
if (viewPage == null)
{
viewPage = this.getInitParameter(PARAM_MAX_PAGE);
if (viewPage == null)
viewPage = "maximized";
}
cacheLayoutViewPage(request, PortalReservedParameters.PAGE_LAYOUT_MAX, viewPage);
}
}
else if (solo)
{
viewPage = getCachedLayoutViewPage(request, PortalReservedParameters.PAGE_LAYOUT_SOLO);
if (viewPage == null)
{
PortletPreferences prefs = request.getPreferences();
viewPage = prefs.getValue(PARAM_SOLO_PAGE, null);
if (viewPage == null)
{
viewPage = this.getInitParameter(PARAM_SOLO_PAGE);
if (viewPage == null)
{
viewPage = "solo";
}
}
cacheLayoutViewPage(request, PortalReservedParameters.PAGE_LAYOUT_SOLO, viewPage);
}
}
else
{
viewPage = getCachedLayoutViewPage(request, PortalReservedParameters.PAGE_LAYOUT_VIEW);
if (viewPage == null)
{
PortletPreferences prefs = request.getPreferences();
viewPage = prefs.getValue(PARAM_VIEW_PAGE, null);
if (viewPage == null)
{
viewPage = this.getInitParameter(PARAM_VIEW_PAGE);
if (viewPage == null)
viewPage = "columns";
}
cacheLayoutViewPage(request, PortalReservedParameters.PAGE_LAYOUT_VIEW, viewPage);
}
}
String templateKey = viewPage + "/" + JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE;
CachedTemplate ct = (CachedTemplate)layoutTemplatesCache.get(templateKey);
if (ct == null)
{
TemplateDescriptor template = null;
Configuration props = getConfiguration(request, viewPage);
String ext = (String) props.getString(TEMPLATE_EXTENSION_KEY);
String path = viewPage + "/" + JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE + ext;
template = jpt.getTemplate(path, JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE);
if (template == null)
{
String msg = "*** FAILED getTemplate:" + path;
throw new TemplateLocatorException(msg);
}