Search in sources :

Example 6 with IUserPreferencesManager

use of org.apereo.portal.IUserPreferencesManager in project uPortal by Jasig.

the class PortletWindowRegistryImpl method getThemeStylesheetDescriptor.

protected IStylesheetDescriptor getThemeStylesheetDescriptor(HttpServletRequest request) {
    final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
    final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
    final IUserProfile userProfile = preferencesManager.getUserProfile();
    final int themeStylesheetId = userProfile.getThemeStylesheetId();
    return stylesheetDescriptorDao.getStylesheetDescriptor(themeStylesheetId);
}
Also used : IUserInstance(org.apereo.portal.user.IUserInstance) IUserProfile(org.apereo.portal.IUserProfile) IUserPreferencesManager(org.apereo.portal.IUserPreferencesManager)

Example 7 with IUserPreferencesManager

use of org.apereo.portal.IUserPreferencesManager in project uPortal by Jasig.

the class BaseTransformerSource method getStylesheetDescriptor.

protected IStylesheetDescriptor getStylesheetDescriptor(HttpServletRequest request) {
    final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
    final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
    final long id = this.getStylesheetDescriptorId(preferencesManager);
    return this.stylesheetDescriptorDao.getStylesheetDescriptor(id);
}
Also used : IUserInstance(org.apereo.portal.user.IUserInstance) IUserPreferencesManager(org.apereo.portal.IUserPreferencesManager)

Example 8 with IUserPreferencesManager

use of org.apereo.portal.IUserPreferencesManager in project uPortal by Jasig.

the class UserLayoutStoreComponent method getUserLayoutManager.

/** Get the {@link IUserLayoutManager} for the user making the request */
protected IUserLayoutManager getUserLayoutManager(HttpServletRequest request) {
    final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
    final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
    return preferencesManager.getUserLayoutManager();
}
Also used : IUserInstance(org.apereo.portal.user.IUserInstance) IUserPreferencesManager(org.apereo.portal.IUserPreferencesManager)

Example 9 with IUserPreferencesManager

use of org.apereo.portal.IUserPreferencesManager in project uPortal by Jasig.

the class PortletEntityRegistryImpl method getOrCreatePortletEntityByFname.

@Override
public IPortletEntity getOrCreatePortletEntityByFname(HttpServletRequest request, IUserInstance userInstance, String fname) {
    final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
    final IUserLayoutManager userLayoutManager = preferencesManager.getUserLayoutManager();
    final String subscribeId = userLayoutManager.getSubscribeId(fname);
    return this.getOrCreatePortletEntity(request, userInstance, subscribeId);
}
Also used : IUserPreferencesManager(org.apereo.portal.IUserPreferencesManager) IUserLayoutManager(org.apereo.portal.layout.IUserLayoutManager)

Example 10 with IUserPreferencesManager

use of org.apereo.portal.IUserPreferencesManager in project uPortal by Jasig.

the class PortletEntityRegistryImpl method getOrCreatePortletEntity.

@Override
public IPortletEntity getOrCreatePortletEntity(HttpServletRequest request, IUserInstance userInstance, String layoutNodeId) {
    final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
    final IUserLayoutManager userLayoutManager = preferencesManager.getUserLayoutManager();
    //Find the channel and portlet definitions
    final IUserLayoutChannelDescription channelNode = (IUserLayoutChannelDescription) userLayoutManager.getNode(layoutNodeId);
    if (channelNode == null) {
        this.logger.warn("No layout node exists for id " + layoutNodeId + ", no portlet entity will be returned.");
        return null;
    }
    final String channelPublishId = channelNode.getChannelPublishId();
    final IPortletDefinition portletDefinition = this.getPortletDefinition(request, userInstance, channelPublishId);
    if (portletDefinition != null) {
        final IPerson person = userInstance.getPerson();
        return this.getOrCreatePortletEntity(request, portletDefinition.getPortletDefinitionId(), layoutNodeId, person.getID());
    }
    // No permission to see the portlet
    return null;
}
Also used : IPerson(org.apereo.portal.security.IPerson) IUserPreferencesManager(org.apereo.portal.IUserPreferencesManager) IUserLayoutManager(org.apereo.portal.layout.IUserLayoutManager) IUserLayoutChannelDescription(org.apereo.portal.layout.node.IUserLayoutChannelDescription) IPortletDefinition(org.apereo.portal.portlet.om.IPortletDefinition)

Aggregations

IUserPreferencesManager (org.apereo.portal.IUserPreferencesManager)29 IUserInstance (org.apereo.portal.user.IUserInstance)27 IUserLayoutManager (org.apereo.portal.layout.IUserLayoutManager)15 IUserProfile (org.apereo.portal.IUserProfile)9 IPerson (org.apereo.portal.security.IPerson)8 IPortletWindow (org.apereo.portal.portlet.om.IPortletWindow)6 IUserLayoutNodeDescription (org.apereo.portal.layout.node.IUserLayoutNodeDescription)5 IPortletDefinition (org.apereo.portal.portlet.om.IPortletDefinition)5 IPortletEntity (org.apereo.portal.portlet.om.IPortletEntity)5 IPortletWindowId (org.apereo.portal.portlet.om.IPortletWindowId)5 HttpServletRequest (javax.servlet.http.HttpServletRequest)4 IUserLayout (org.apereo.portal.layout.IUserLayout)4 IPortletEntityId (org.apereo.portal.portlet.om.IPortletEntityId)4 PortalException (org.apereo.portal.PortalException)3 IStylesheetDescriptor (org.apereo.portal.layout.om.IStylesheetDescriptor)3 LinkedHashMap (java.util.LinkedHashMap)2 LinkedHashSet (java.util.LinkedHashSet)2 Locale (java.util.Locale)2 RequestCache (org.apereo.portal.concurrency.caching.RequestCache)2 LocaleManager (org.apereo.portal.i18n.LocaleManager)2