Search in sources :

Example 36 with IUserLayoutManager

use of org.apereo.portal.layout.IUserLayoutManager in project uPortal by Jasig.

the class TransientPortletEntityDao method determineDatabaseChannelSubscribeId.

protected String determineDatabaseChannelSubscribeId(String layoutNodeId) {
    //Find the referenced Node in the user's layout
    final IUserLayoutManager userLayoutManager = this.getUserLayoutManager();
    final IUserLayoutChannelDescription channelNode = (IUserLayoutChannelDescription) userLayoutManager.getNode(layoutNodeId);
    //Lookup the IportletDefinition for the node
    final String portletPublishId = channelNode.getChannelPublishId();
    final IPortletDefinition portletDefinition = this.portletDefinitionRegistry.getPortletDefinition(portletPublishId);
    //Generate the subscribe ID used for the database
    return this.getPersistentLayoutNodeId(portletDefinition.getPortletDefinitionId());
}
Also used : IUserLayoutManager(org.apereo.portal.layout.IUserLayoutManager) IUserLayoutChannelDescription(org.apereo.portal.layout.node.IUserLayoutChannelDescription) IPortletDefinition(org.apereo.portal.portlet.om.IPortletDefinition)

Example 37 with IUserLayoutManager

use of org.apereo.portal.layout.IUserLayoutManager in project uPortal by Jasig.

the class TransientPortletEntityDao method wrapEntity.

/**
     * Adds a TransientPortletEntity wrapper to the portletEntity if it is needed. If the specified
     * entity is transient but no transient subscribe id has been registered for it yet in the
     * transientIdMap null is returned. If no wrapping is needed the original entity is returned.
     */
protected IPortletEntity wrapEntity(IPortletEntity portletEntity) {
    if (portletEntity == null) {
        return null;
    }
    final String persistentLayoutNodeId = portletEntity.getLayoutNodeId();
    if (persistentLayoutNodeId.startsWith(TransientUserLayoutManagerWrapper.SUBSCRIBE_PREFIX)) {
        final IUserLayoutManager userLayoutManager = this.getUserLayoutManager();
        if (userLayoutManager == null) {
            this.logger.warn("Could not find IUserLayoutManager when trying to wrap transient portlet entity: " + portletEntity);
            return portletEntity;
        }
        final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
        final String fname = portletDefinition.getFName();
        final String layoutNodeId = userLayoutManager.getSubscribeId(fname);
        return new TransientPortletEntity(portletEntity, layoutNodeId);
    }
    return portletEntity;
}
Also used : IUserLayoutManager(org.apereo.portal.layout.IUserLayoutManager) IPortletDefinition(org.apereo.portal.portlet.om.IPortletDefinition)

Aggregations

IUserLayoutManager (org.apereo.portal.layout.IUserLayoutManager)37 IUserInstance (org.apereo.portal.user.IUserInstance)27 IUserPreferencesManager (org.apereo.portal.IUserPreferencesManager)16 PortalException (org.apereo.portal.PortalException)16 UserPreferencesManager (org.apereo.portal.UserPreferencesManager)16 IUserLayoutNodeDescription (org.apereo.portal.layout.node.IUserLayoutNodeDescription)14 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)13 ModelAndView (org.springframework.web.servlet.ModelAndView)13 IPerson (org.apereo.portal.security.IPerson)11 IPortletDefinition (org.apereo.portal.portlet.om.IPortletDefinition)9 IPortletWindow (org.apereo.portal.portlet.om.IPortletWindow)7 HashMap (java.util.HashMap)6 Locale (java.util.Locale)6 IUserLayout (org.apereo.portal.layout.IUserLayout)6 IUserLayoutChannelDescription (org.apereo.portal.layout.node.IUserLayoutChannelDescription)6 UserLayoutFolderDescription (org.apereo.portal.layout.node.UserLayoutFolderDescription)6 IUserLayoutFolderDescription (org.apereo.portal.layout.node.IUserLayoutFolderDescription)5 IPortletEntity (org.apereo.portal.portlet.om.IPortletEntity)5 IPortletWindowId (org.apereo.portal.portlet.om.IPortletWindowId)4 XPathExpressionException (javax.xml.xpath.XPathExpressionException)3