@Override public IPortletEntityId getPortletEntityId() { return this.delegatePortletEntity.getPortletEntityId(); }
@Override public IPortletEntityId getPortletEntityId() { return this.portletEntity.getPortletEntityId(); }
@Override public IPortletEntityId getPortletEntityId() { return this.portletEntity.getPortletEntityId(); }
@Override public IPortletEntityId getPortletEntityId() { return this.portletEntity.getPortletEntityId(); }
@Override public IPortletEntityId getPortletEntityId() { return this.portletEntity.getPortletEntityId(); }
@Override public IPortletEntity apply(IPortletEntityId input) { logger.trace( "Found persistent IPortletEntity {}, mapped id to {}, caching the wrapper in the request", anonPortletEntity.getPortletEntityId(), consistentPortletEntityId); return new PersistentPortletEntityWrapper( anonPortletEntity, consistentPortletEntityId); } });
@Override public IPortletEntity apply(IPortletEntityId input) { logger.trace( "Found persistent IPortletEntity {}, mapped id to {}, caching the wrapper in the request", anonPortletEntity.getPortletEntityId(), consistentPortletEntityId); return new PersistentPortletEntityWrapper( anonPortletEntity, consistentPortletEntityId); } });
@Override public IPortletWindow getOrCreateDefaultPortletWindow( HttpServletRequest request, IPortletDefinitionId portletDefinitionId) { Validate.notNull(request, "HttpServletRequest cannot be null"); Validate.notNull(portletDefinitionId, "portletDefinition cannot be null"); final IPortletEntity portletEntity = this.portletEntityRegistry.getOrCreateDefaultPortletEntity( request, portletDefinitionId); final IPortletEntityId portletEntityId = portletEntity.getPortletEntityId(); return this.getOrCreateDefaultPortletWindow(request, portletEntityId); }
@Override public IPortletWindow getOrCreateDefaultPortletWindow( HttpServletRequest request, IPortletDefinitionId portletDefinitionId) { Validate.notNull(request, "HttpServletRequest cannot be null"); Validate.notNull(portletDefinitionId, "portletDefinition cannot be null"); final IPortletEntity portletEntity = this.portletEntityRegistry.getOrCreateDefaultPortletEntity( request, portletDefinitionId); final IPortletEntityId portletEntityId = portletEntity.getPortletEntityId(); return this.getOrCreateDefaultPortletWindow(request, portletEntityId); }
@Override public IPortletWindow getOrCreateDefaultPortletWindowByLayoutNodeId( HttpServletRequest request, String subscribeId) { Validate.notNull(request, "HttpServletRequest cannot be null"); Validate.notNull(subscribeId, "subscribeId cannot be null"); final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request); final IPortletEntity portletEntity = this.portletEntityRegistry.getOrCreatePortletEntity( request, userInstance, subscribeId); if (portletEntity == null) { logger.debug( "No portlet entity found for id {}, no IPortletWindow will be returned.", subscribeId); return null; } logger.trace("Found portlet entity {} for id {}", portletEntity, subscribeId); final IPortletWindow portletWindow = this.getOrCreateDefaultPortletWindow(request, portletEntity.getPortletEntityId()); logger.trace("Found portlet window {} for layout node {}", portletWindow, subscribeId); return portletWindow; }
@Override public IPortletWindow getOrCreateDefaultPortletWindowByFname( HttpServletRequest request, String fname) { Validate.notNull(request, "HttpServletRequest cannot be null"); Validate.notNull(fname, "fname cannot be null"); final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request); final IPortletEntity portletEntity = this.portletEntityRegistry.getOrCreatePortletEntityByFname( request, userInstance, fname); if (portletEntity == null) { return null; } final IPortletWindow portletWindow = this.getOrCreateDefaultPortletWindow(request, portletEntity.getPortletEntityId()); logger.trace( "Found portlet window {} for portlet definition fname {}", portletWindow, fname); return portletWindow; }
@Override public IPortletWindow getOrCreateDefaultPortletWindowByLayoutNodeId( HttpServletRequest request, String subscribeId) { Validate.notNull(request, "HttpServletRequest cannot be null"); Validate.notNull(subscribeId, "subscribeId cannot be null"); final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request); final IPortletEntity portletEntity = this.portletEntityRegistry.getOrCreatePortletEntity( request, userInstance, subscribeId); if (portletEntity == null) { logger.debug( "No portlet entity found for id {}, no IPortletWindow will be returned.", subscribeId); return null; } logger.trace("Found portlet entity {} for id {}", portletEntity, subscribeId); final IPortletWindow portletWindow = this.getOrCreateDefaultPortletWindow(request, portletEntity.getPortletEntityId()); logger.trace("Found portlet window {} for layout node {}", portletWindow, subscribeId); return portletWindow; }
@Override public IPortletWindow getOrCreateDefaultPortletWindowByFname( HttpServletRequest request, String fname) { Validate.notNull(request, "HttpServletRequest cannot be null"); Validate.notNull(fname, "fname cannot be null"); final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request); final IPortletEntity portletEntity = this.portletEntityRegistry.getOrCreatePortletEntityByFname( request, userInstance, fname); if (portletEntity == null) { return null; } final IPortletWindow portletWindow = this.getOrCreateDefaultPortletWindow(request, portletEntity.getPortletEntityId()); logger.trace( "Found portlet window {} for portlet definition fname {}", portletWindow, fname); return portletWindow; }
@Override public String toString() { return "PortletEntity [" + "portletEntityId=" + this.delegatePortletEntity.getPortletEntityId() + ", " + "layoutNodeId=" + this.transientLayoutNodeId + ", " + "userId=" + this.delegatePortletEntity.getUserId() + ", " + "portletDefinition=" + this.delegatePortletEntity.getPortletDefinition() + "]"; } }
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(); }
@Override public PortletSession createPortletSession( PortletContext portletContext, PortletWindow portletWindow, HttpSession session) { // TODO pluto 1.1 PortletEnvironmentService#createPortletSession passed in the request; now // use IPortalRequestUtils#getCurrentPortalRequest()? final HttpServletRequest request = portalRequestUtils.getCurrentPortalRequest(); final IPortletWindow internalPortletWindow = this.portletWindowRegistry.convertPortletWindow(request, portletWindow); final IPortletEntity portletEntity = internalPortletWindow.getPortletEntity(); final IPortletEntityId portletEntityId = portletEntity.getPortletEntityId(); return new ScopingPortletSessionImpl( portletEntityId, portletContext, portletWindow, session); }
@Override public PortletSession createPortletSession( PortletContext portletContext, PortletWindow portletWindow, HttpSession session) { // TODO pluto 1.1 PortletEnvironmentService#createPortletSession passed in the request; now // use IPortalRequestUtils#getCurrentPortalRequest()? final HttpServletRequest request = portalRequestUtils.getCurrentPortalRequest(); final IPortletWindow internalPortletWindow = this.portletWindowRegistry.convertPortletWindow(request, portletWindow); final IPortletEntity portletEntity = internalPortletWindow.getPortletEntity(); final IPortletEntityId portletEntityId = portletEntity.getPortletEntityId(); return new ScopingPortletSessionImpl( portletEntityId, portletContext, portletWindow, session); }
@Override public PortletWindowIdImpl getPortletWindowId( HttpServletRequest request, String portletWindowId) { Validate.notNull(portletWindowId, "portletWindowId can not be null"); final String entityIdStr = PortletWindowIdStringUtils.parsePortletEntityId(portletWindowId); final String instanceId; if (!PortletEntityIdStringUtils.hasCorrectNumberOfParts(entityIdStr) || !PortletWindowIdStringUtils.hasCorrectNumberOfParts(portletWindowId)) { throw new IllegalArgumentException( "Provided portlet window ID '" + portletWindowId + "' is not valid"); } if (PortletWindowIdStringUtils.hasPortletWindowInstanceId(portletWindowId)) { instanceId = PortletWindowIdStringUtils.parsePortletWindowInstanceId(portletWindowId); } else { instanceId = null; } final IPortletEntity portletEntity = this.portletEntityRegistry.getPortletEntity(request, entityIdStr); if (portletEntity == null) { throw new IllegalArgumentException( "No parent IPortletEntity found for id '" + entityIdStr + "' from portlet window id: " + portletWindowId); } return createPortletWindowId(instanceId, portletEntity.getPortletEntityId()); }
@Override public PortletWindowIdImpl getPortletWindowId( HttpServletRequest request, String portletWindowId) { Validate.notNull(portletWindowId, "portletWindowId can not be null"); final String entityIdStr = PortletWindowIdStringUtils.parsePortletEntityId(portletWindowId); final String instanceId; if (!PortletEntityIdStringUtils.hasCorrectNumberOfParts(entityIdStr) || !PortletWindowIdStringUtils.hasCorrectNumberOfParts(portletWindowId)) { throw new IllegalArgumentException( "Provided portlet window ID '" + portletWindowId + "' is not valid"); } if (PortletWindowIdStringUtils.hasPortletWindowInstanceId(portletWindowId)) { instanceId = PortletWindowIdStringUtils.parsePortletWindowInstanceId(portletWindowId); } else { instanceId = null; } final IPortletEntity portletEntity = this.portletEntityRegistry.getPortletEntity(request, entityIdStr); if (portletEntity == null) { throw new IllegalArgumentException( "No parent IPortletEntity found for id '" + entityIdStr + "' from portlet window id: " + portletWindowId); } return createPortletWindowId(instanceId, portletEntity.getPortletEntityId()); }
@Override public PortletDelegationDispatcher createRequestDispatcher( PortletRequest portletRequest, IPortletDefinitionId delegatePortletDefinitionId) { final HttpServletRequest request = this.portalRequestUtils.getPortletHttpRequest(portletRequest); final String windowID = portletRequest.getWindowID(); final IPortletWindowId parentPortletWindowId = this.portletWindowRegistry.getPortletWindowId(request, windowID); final IPortletEntity delegatePortletEntity = this.portletEntityRegistry.getOrCreateDelegatePortletEntity( request, parentPortletWindowId, delegatePortletDefinitionId); final IPortletEntityId delegatePortletEntityId = delegatePortletEntity.getPortletEntityId(); final IPortletWindow delegatePortletWindow = this.portletWindowRegistry.createDelegatePortletWindow( request, delegatePortletEntityId, parentPortletWindowId); final IPerson person = this.personManager.getPerson(request); final int userId = person.getID(); return new PortletDelegationDispatcherImpl( delegatePortletWindow, userId, portalRequestUtils, personManager, portletRenderer, portalUrlProvider, portletDelegationManager); }