if (themes != null)
{
return themes;
}
themes = new ArrayList<ThemeBean>();
RequestContext rc = (RequestContext) request.getAttribute(RequestContext.REQUEST_PORTALENV);
Set<String> decorators = (Set<String>)decorationFactory.getPageDecorations(rc);
for (String name : decorators)
{
LayoutDecoration decor = decorationFactory.getLayoutDecoration(name, rc);
String compatibility = decor.getProperty("compatibility");
if (compatibility != null && compatibility.compareTo("2.2.1") >= 0)
{
ResourceBundle rb = decor.getResourceBundle(rc.getLocale(), rc);
String title = null;
try
{
title = rb.getString("title");
}
catch(Exception e)
{}
if (title == null)
title = decor.getName();
String icon = decor.getProperty("icon");
if (icon == null)
{
icon = "";
}
ThemeBean theme = new ThemeBean(decor.getName(), title, icon);
Theme pageTheme = (Theme)rc.getRequest().getAttribute("org.apache.jetspeed.theme");
if (overrideTheme == null)
overrideTheme = pageTheme.getPageLayoutDecoration().getName();
if (overrideTheme.equals(decor.getName()))
theme.setSelected(true);
themes.add(theme);