use of org.apereo.portal.layout.om.IStylesheetDescriptor in project uPortal by Jasig.
the class ThemeNameRequestPropertiesManager method populateRequestProperties.
@Override
public <P extends Populator<String, String>> void populateRequestProperties(HttpServletRequest portletRequest, IPortletWindow portletWindow, P propertiesPopulator) {
// get the current user profile
IUserInstance ui = userInstanceManager.getUserInstance(portletRequest);
IUserPreferencesManager upm = ui.getPreferencesManager();
IUserProfile profile = upm.getUserProfile();
// get the theme for this profile
long themeId = profile.getThemeStylesheetId();
IStylesheetDescriptor theme = stylesheetDao.getStylesheetDescriptor(themeId);
// set the theme name as a portlet response property
final String themeName = theme.getName();
propertiesPopulator.put(IPortletRenderer.THEME_NAME_PROPERTY, themeName);
}
Aggregations