Search in sources :

Example 31 with IStylesheetDescriptor

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);
}
Also used : IUserInstance(org.apereo.portal.user.IUserInstance) IUserProfile(org.apereo.portal.IUserProfile) IStylesheetDescriptor(org.apereo.portal.layout.om.IStylesheetDescriptor) IUserPreferencesManager(org.apereo.portal.IUserPreferencesManager)

Aggregations

IStylesheetDescriptor (org.apereo.portal.layout.om.IStylesheetDescriptor)31 IStylesheetUserPreferences (org.apereo.portal.layout.om.IStylesheetUserPreferences)15 Scope (org.apereo.portal.layout.om.IStylesheetData.Scope)11 IStylesheetParameterDescriptor (org.apereo.portal.layout.om.IStylesheetParameterDescriptor)10 Map (java.util.Map)7 ILayoutAttributeDescriptor (org.apereo.portal.layout.om.ILayoutAttributeDescriptor)7 Transactional (org.springframework.transaction.annotation.Transactional)6 ConcurrentMap (java.util.concurrent.ConcurrentMap)5 ImmutableMap (com.google.common.collect.ImmutableMap)4 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)4 WindowState (javax.portlet.WindowState)4 HttpSession (javax.servlet.http.HttpSession)4 IUserProfile (org.apereo.portal.IUserProfile)4 IOutputPropertyDescriptor (org.apereo.portal.layout.om.IOutputPropertyDescriptor)4 IPerson (org.apereo.portal.security.IPerson)4 IUserInstance (org.apereo.portal.user.IUserInstance)4 MapPopulator (org.apereo.portal.utils.MapPopulator)4 IUserPreferencesManager (org.apereo.portal.IUserPreferencesManager)3 PreferencesScope (org.apereo.portal.layout.IStylesheetUserPreferencesService.PreferencesScope)3 IPortletEntity (org.apereo.portal.portlet.om.IPortletEntity)3