Package org.jasig.portal.portlet.om

Examples of org.jasig.portal.portlet.om.IPortletEntity


    @Override
    public PortletPreferences createPortletPreferences(final PortletRequestContext requestContext, boolean render) {
        final HttpServletRequest containerRequest = requestContext.getContainerRequest();
        final PortletWindow plutoPortletWindow = requestContext.getPortletWindow();
        final IPortletWindow portletWindow = portletWindowRegistry.convertPortletWindow(containerRequest, plutoPortletWindow);
        final IPortletEntity portletEntity = portletWindow.getPortletEntity();
       
        final boolean configMode = IPortletRenderer.CONFIG.equals(portletWindow.getPortletMode());
        if (configMode) {
            final IPortletDefinitionId portletDefinitionId = portletEntity.getPortletDefinitionId();
            return new PortletDefinitionPreferencesImpl(portletDefinitionRegistry, transactionOperations, portletDefinitionId, render);
        }
        else if (this.isStoreInMemory(containerRequest)) {
            final IPortletEntityId portletEntityId = portletEntity.getPortletEntityId();
            return new GuestPortletEntityPreferencesImpl(requestContext, portletEntityRegistry, portletDefinitionRegistry, portletEntityId, render);
        }
        else {
            final IPortletEntityId portletEntityId = portletEntity.getPortletEntityId();
            return new PortletEntityPreferencesImpl(requestContext, portletEntityRegistry, portletDefinitionRegistry, transactionOperations, portletEntityId, render);
        }
    }
View Full Code Here


    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;
    }
View Full Code Here

    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;
    }
View Full Code Here

    @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);
    }
View Full Code Here

        }
        else  {
            throw new IllegalArgumentException("Provided portlet window ID '" + portletWindowId + "' is not valid");
        }
       
        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());
    }
View Full Code Here

       
        final PortletWindowCache<PortletWindowData> statelessPortletWindowDataMap = this.getStatelessPortletWindowDataMap(request, true);
       
        //If no base to clone from lookup the entity and pluto definition data
        if (basePortletWindow == null) {
            final IPortletEntity portletEntity = this.portletEntityRegistry.getPortletEntity(request, portletEntityId);
            if (portletEntity == null) {
                throw new IllegalArgumentException("No IPortletEntity could be found for " + portletEntity + " while creating stateless portlet window for " + basePortletWindowId);
            }
           
            final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
            final IPortletDefinitionId portletDefinitionId = portletDefinition.getPortletDefinitionId();
            final PortletDefinition portletDescriptor = this.portletDefinitionRegistry.getParentPortletDescriptor(portletDefinitionId);
           
            final PortletWindowData portletWindowData = new PortletWindowData(statelessPortletWindowId, portletEntityId);
            statelessPortletWindowDataMap.storeWindow(portletWindowData);
           
            statelessPortletWindow = new StatelessPortletWindowImpl(portletWindowData, portletEntity, portletDescriptor);
        }
        //Clone the existing base window
        else {
            final PortletWindowData portletWindowData = new PortletWindowData(statelessPortletWindowId, portletEntityId);
            portletWindowData.setExpirationCache(basePortletWindow.getExpirationCache());
            portletWindowData.setPortletMode(basePortletWindow.getPortletMode());
            portletWindowData.setWindowState(basePortletWindow.getWindowState());
            portletWindowData.setPublicRenderParameters(basePortletWindow.getPublicRenderParameters());
            portletWindowData.setRenderParameters(basePortletWindow.getRenderParameters());
           
            statelessPortletWindowDataMap.storeWindow(portletWindowData);

            final IPortletEntity portletEntity = basePortletWindow.getPortletEntity();
            final PortletDefinition portletDescriptor = basePortletWindow.getPlutoPortletWindow().getPortletDefinition();
            statelessPortletWindow = new StatelessPortletWindowImpl(portletWindowData, portletEntity, portletDescriptor);
        }
       
        //Cache the stateless window in the request
View Full Code Here

       
        final IStylesheetDescriptor themeStylesheetDescriptor = this.getThemeStylesheetDescriptor(request);
       
        final WindowState windowState = portletWindow.getWindowState();
       
        final IPortletEntity portletEntity = portletWindow.getPortletEntity();
        final WindowState entityWindowState = portletEntity.getWindowState(themeStylesheetDescriptor);
       
        //If the window and entity states are different
        if (windowState != entityWindowState && !windowState.equals(entityWindowState)) {
            final WindowState defaultWindowState = this.getDefaultWindowState(themeStylesheetDescriptor);
           
            //If a window state is set and is one of the persistent states set it on the entity
            if (!defaultWindowState.equals(windowState) && persistentWindowStates.contains(windowState)) {
                portletEntity.setWindowState(themeStylesheetDescriptor, windowState);
            }
            //If not remove the state from the entity
            else if (entityWindowState != null) {
                portletEntity.setWindowState(themeStylesheetDescriptor, null);
            }
           
            //Persist the modified entity
            this.portletEntityRegistry.storePortletEntity(request, portletEntity);
        }
View Full Code Here

        final Set<String> allSubscribedChannels = userLayoutManager.getAllSubscribedChannels();
       
        final Set<IPortletWindow> allLayoutWindows = new LinkedHashSet<IPortletWindow>(allSubscribedChannels.size());

        for (final String channelSubscribeId : allSubscribedChannels) {
            final IPortletEntity portletEntity = this.portletEntityRegistry.getOrCreatePortletEntity(request, userInstance, channelSubscribeId);
            if (portletEntity == null) {
                this.logger.debug("No portlet entity found for layout node {} for user {}", channelSubscribeId, userInstance.getPerson().getUserName());
                continue;
            }
           
            final IPortletEntityId portletEntityId = portletEntity.getPortletEntityId();
            final IPortletWindow portletWindow = this.getOrCreateDefaultPortletWindow(request, portletEntityId);
            if (portletWindow == null) {
                this.logger.debug("No portlet window found for {}", portletEntity);
                continue;
            }
View Full Code Here

        final Set<String> allSubscribedChannels = userLayoutManager.getAllSubscribedChannels();
       
        final Set<IPortletWindow> allLayoutWindows = new LinkedHashSet<IPortletWindow>(allSubscribedChannels.size());

        for (final String channelSubscribeId : allSubscribedChannels) {
            final IPortletEntity portletEntity = this.portletEntityRegistry.getOrCreatePortletEntity(request, userInstance, channelSubscribeId);
           
            final IPortletEntityId portletEntityId = portletEntity.getPortletEntityId();
            final Set<IPortletWindow> portletWindows = this.getAllPortletWindowsForEntity(request, portletEntityId);
            allLayoutWindows.addAll(portletWindows);
        }
       
        return allLayoutWindows;
View Full Code Here

        return this.getPortletWindowId(request, portletWindowId.getStringId());
    }

    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;
        }
       
View Full Code Here

TOP

Related Classes of org.jasig.portal.portlet.om.IPortletEntity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.