Package org.jasig.portal.portlet.om

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


       
        final HttpServletRequest portalRequest = portalEventBuilder.getPortalRequest();

        //Get the portlet's fname
        final IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow(portalRequest, portletWindowId);
        final IPortletEntity portletEntity = portletWindow.getPortletEntity();
        final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
        final String fname = portletDefinition.getFName();
       
        //Get the parameters used for the portlet execution
        final Map<String, List<String>> parameters = getParameters(portalRequest, portletWindowId, renderRequest);
       
View Full Code Here


        final String userName = person.getUserName();
        final Set<IPortletEntity> portletEntities = this.portletEntityDao.getPortletEntitiesForUser(userId);

        org.dom4j.Element preferencesElement = null;
        for (final Iterator<IPortletEntity> entityItr = portletEntities.iterator(); entityItr.hasNext();) {
            final IPortletEntity portletEntity = entityItr.next();
            final List<IPortletPreference> preferencesList = portletEntity.getPortletPreferences();

            //Only bother with entities that have preferences
            if (!preferencesList.isEmpty()) {
                final String layoutNodeId = portletEntity.getLayoutNodeId();
                final Pathref dlmPathref = nodeReferenceFactory.getPathrefFromNoderef(userName, layoutNodeId, layout);
                if (dlmPathref == null) {
                    logger.warn("{} in user {}'s layout has no corresponding layout or portlet information and will be ignored", portletEntity, userName);
                    continue;
                }
View Full Code Here

                final String prefName = entry.attributeValue("name");
               
                final Noderef dlmNoderef = nodeReferenceFactory.getNoderefFromPathref(person.getUserName(), dlmPathRef, fname, false, layout);
               
                if (dlmNoderef != null && fname != null) {
                    final IPortletEntity portletEntity = this.getPortletEntity(fname, dlmNoderef.toString(), ownerUserId);
                    oldPortletEntities.remove(portletEntity);
                   
                    final List<IPortletPreference> portletPreferences = portletEntity.getPortletPreferences();
                   
                    final List<org.dom4j.Element> valueElements = entry.selectNodes("value");
                    final List<String> values = new ArrayList<String>(valueElements.size());
                    for (final org.dom4j.Element valueElement : valueElements) {
                        values.add(valueElement.getText());
                    }
                   
                    portletPreferences.add(new PortletPreferenceImpl(prefName, false, values.toArray(new String[values.size()])));
                   
                   
                    this.portletEntityDao.updatePortletEntity(portletEntity);
                }
            }
           
            //Delete all portlet preferences for entities that were not imported
            for (final IPortletEntity portletEntity : oldPortletEntities) {
                portletEntity.setPortletPreferences(null);

                if (portletEntityRegistry.shouldBePersisted(portletEntity)) {
                    this.portletEntityDao.updatePortletEntity(portletEntity);
                }
                else {
View Full Code Here

        }
    }

    protected IPortletEntity getPortletEntity(String fName, String layoutNodeId, int userId) {
        //Try getting the entity
        final IPortletEntity portletEntity = this.portletEntityDao.getPortletEntity(layoutNodeId, userId);
        if (portletEntity != null) {
            return portletEntity;
        }

        //Load the portlet definition
View Full Code Here

               
                final EntityIdentifier ei = person.getEntityIdentifier();
                final AuthorizationService authorizationService = AuthorizationService.instance();
                final IAuthorizationPrincipal ap = authorizationService.newPrincipal(ei.getKey(), ei.getType());
               
                final IPortletEntity portletEntity = portletWindow.getPortletEntity();
                final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
               
                if (!ap.canConfigure(portletDefinition.getPortletDefinitionId().getStringId())) {

                    logger.error("User {} attempted to use portlet {} in {} but lacks permission to use that mode.  " +
                            "THIS MAY BE AN ATTEMPT TO EXPLOIT A HISTORICAL SECURITY FLAW.  " +
View Full Code Here

            return true;
        if (obj == null)
            return false;
        if (!IPortletEntity.class.isAssignableFrom(obj.getClass()))
            return false;
        IPortletEntity other = (IPortletEntity) obj;
        if (this.layoutNodeId == null) {
            if (other.getLayoutNodeId() != null)
                return false;
        }
        else if (!this.layoutNodeId.equals(other.getLayoutNodeId()))
            return false;
        if (this.portletDefinition == null) {
            if (other.getPortletDefinition() != null)
                return false;
        }
        else if (!this.portletDefinition.equals(other.getPortletDefinition()))
            return false;
        if (this.userId != other.getUserId())
            return false;
        return true;
    }
View Full Code Here

        final UrlType urlType = portalUrlBuilder.getUrlType();
        final UrlState urlState;
        final String resourceId;
        if (targetedPortletWindowId != null) {
            final IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow(request, targetedPortletWindowId);
            final IPortletEntity portletEntity = portletWindow.getPortletEntity();
           
            //Add folder information if available: /f/tabId
            final String channelSubscribeId = portletEntity.getLayoutNodeId();
            final List<String> folderNames = urlNodeSyntaxHelper.getFolderNamesForLayoutNode(request, channelSubscribeId);
            if (!folderNames.isEmpty()) {
                url.addPath(FOLDER_PATH_PREFIX);
                for (final String folderName : folderNames) {
                    url.addPath(folderName);
View Full Code Here

                final IPortletRequestInfo portletRequestInfo = portalRequestInfo.getTargetedPortletRequestInfo();
               
                if (portletRequestInfo != null) {
                    final IPortletWindowId targetWindowId = portletRequestInfo.getPortletWindowId();
                    final IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow(request, targetWindowId);
                    final IPortletEntity portletEntity = portletWindow.getPortletEntity();
                   
                    final String channelSubscribeId = portletEntity.getLayoutNodeId();
                   
                    this.stylesheetUserPreferencesService.setStylesheetParameter(request, PreferencesScope.STRUCTURE, "userLayoutRoot", channelSubscribeId);
                   
                    if (userLayoutManager instanceof TransientUserLayoutManagerWrapper) {
                        // get wrapper implementation for focusing
View Full Code Here

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

        return getModifiedTimeout(portletDefinition, request, portletDefinition.getTimeout());
    }

    protected IPortletDefinition getPortletDefinition(IPortletWindowId portletWindowId, HttpServletRequest request) {
        final IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow(request, portletWindowId);
        final IPortletEntity parentPortletEntity = portletWindow.getPortletEntity();
        return parentPortletEntity.getPortletDefinition();
    }
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.