Search in sources :

Example 51 with IPortletWindow

use of org.apereo.portal.portlet.om.IPortletWindow in project uPortal by Jasig.

the class PortletWindowRegistryImpl method wrapPortletWindowData.

protected IPortletWindow wrapPortletWindowData(HttpServletRequest request, PortletWindowData portletWindowData) {
    final IPortletEntityId portletEntityId = portletWindowData.getPortletEntityId();
    final IPortletEntity portletEntity = this.portletEntityRegistry.getPortletEntity(request, portletEntityId);
    if (portletEntity == null) {
        return null;
    }
    final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
    final PortletDefinition portletDescriptor = this.portletDefinitionRegistry.getParentPortletDescriptor(portletDefinition.getPortletDefinitionId());
    if (portletDescriptor == null) {
        return null;
    }
    final IPortletWindow portletWindow = new PortletWindowImpl(portletDescriptor, portletEntity, portletWindowData);
    logger.trace("Wrapping PortletWindowData {} as IPortletWindow", portletWindow.getPortletWindowId());
    return portletWindow;
}
Also used : IPortletEntity(org.apereo.portal.portlet.om.IPortletEntity) IPortletEntityId(org.apereo.portal.portlet.om.IPortletEntityId) IPortletWindow(org.apereo.portal.portlet.om.IPortletWindow) IPortletDefinition(org.apereo.portal.portlet.om.IPortletDefinition) IPortletDefinition(org.apereo.portal.portlet.om.IPortletDefinition) PortletDefinition(org.apache.pluto.container.om.portlet.PortletDefinition)

Example 52 with IPortletWindow

use of org.apereo.portal.portlet.om.IPortletWindow in project uPortal by Jasig.

the class PortletExecutionManager method postExecution.

@Override
public void postExecution(HttpServletRequest request, HttpServletResponse response, IPortletExecutionContext context, Exception e) {
    final IPortletWindowId portletWindowId = context.getPortletWindowId();
    final IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow(request, portletWindowId);
    final IPortletEntity portletEntity = portletWindow.getPortletEntity();
    final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
    final IPortletDescriptorKey portletDescriptorKey = portletDefinition.getPortletDescriptorKey();
    final AtomicInteger counter = this.executionCount.get(portletDescriptorKey);
    counter.incrementAndGet();
}
Also used : IPortletEntity(org.apereo.portal.portlet.om.IPortletEntity) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) IPortletDescriptorKey(org.apereo.portal.portlet.om.IPortletDescriptorKey) IPortletWindowId(org.apereo.portal.portlet.om.IPortletWindowId) IPortletWindow(org.apereo.portal.portlet.om.IPortletWindow) IPortletDefinition(org.apereo.portal.portlet.om.IPortletDefinition)

Example 53 with IPortletWindow

use of org.apereo.portal.portlet.om.IPortletWindow in project uPortal by Jasig.

the class PortletExecutionManager method getPortletDefinition.

protected IPortletDefinition getPortletDefinition(IPortletWindowId portletWindowId, HttpServletRequest request) {
    final IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow(request, portletWindowId);
    final IPortletEntity parentPortletEntity = portletWindow.getPortletEntity();
    return parentPortletEntity.getPortletDefinition();
}
Also used : IPortletEntity(org.apereo.portal.portlet.om.IPortletEntity) IPortletWindow(org.apereo.portal.portlet.om.IPortletWindow)

Example 54 with IPortletWindow

use of org.apereo.portal.portlet.om.IPortletWindow in project uPortal by Jasig.

the class PortletWorkerFactoryImpl method getErrorPortletWindowId.

protected IPortletWindowId getErrorPortletWindowId(HttpServletRequest request, String fname) {
    final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
    final IPortletEntity errorPortletEntity = this.portletEntityRegistry.getOrCreatePortletEntityByFname(request, userInstance, fname);
    final IPortletWindow portletWindow = this.portletWindowRegistry.getOrCreateDefaultPortletWindow(request, errorPortletEntity.getPortletEntityId());
    return portletWindow.getPortletWindowId();
}
Also used : IUserInstance(org.apereo.portal.user.IUserInstance) IPortletEntity(org.apereo.portal.portlet.om.IPortletEntity) IPortletWindow(org.apereo.portal.portlet.om.IPortletWindow)

Example 55 with IPortletWindow

use of org.apereo.portal.portlet.om.IPortletWindow in project uPortal by Jasig.

the class PortalUrlProviderImpl method getPortletWindowId.

private IPortletWindowId getPortletWindowId(HttpServletRequest request, String layoutNodeId) {
    if (layoutNodeId == null) {
        return null;
    }
    final LayoutNodeType layoutNodeType = this.getLayoutNodeType(request, layoutNodeId);
    if (layoutNodeType == null) {
        throw new IllegalArgumentException("No layout node exists for id: " + layoutNodeId);
    }
    if (layoutNodeType != LayoutNodeType.PORTLET) {
        return null;
    }
    final IPortletWindow portletWindow = this.portletWindowRegistry.getOrCreateDefaultPortletWindowByLayoutNodeId(request, layoutNodeId);
    if (portletWindow == null) {
        return null;
    }
    return portletWindow.getPortletWindowId();
}
Also used : LayoutNodeType(org.apereo.portal.layout.node.IUserLayoutNodeDescription.LayoutNodeType) IPortletWindow(org.apereo.portal.portlet.om.IPortletWindow)

Aggregations

IPortletWindow (org.apereo.portal.portlet.om.IPortletWindow)88 IPortletEntity (org.apereo.portal.portlet.om.IPortletEntity)32 IPortletWindowId (org.apereo.portal.portlet.om.IPortletWindowId)32 IPortletDefinition (org.apereo.portal.portlet.om.IPortletDefinition)23 HttpServletRequest (javax.servlet.http.HttpServletRequest)13 IPortalRequestInfo (org.apereo.portal.url.IPortalRequestInfo)12 IUserInstance (org.apereo.portal.user.IUserInstance)12 List (java.util.List)10 IPortletEntityId (org.apereo.portal.portlet.om.IPortletEntityId)10 IPortletUrlBuilder (org.apereo.portal.url.IPortletUrlBuilder)9 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)9 IOException (java.io.IOException)8 IUserLayoutManager (org.apereo.portal.layout.IUserLayoutManager)7 WindowState (javax.portlet.WindowState)6 IUserPreferencesManager (org.apereo.portal.IUserPreferencesManager)6 IPortalUrlBuilder (org.apereo.portal.url.IPortalUrlBuilder)6 LinkedHashMap (java.util.LinkedHashMap)5 Locale (java.util.Locale)5 PortletException (javax.portlet.PortletException)5 PortletMode (javax.portlet.PortletMode)5