Package org.jasig.portal.portlet.om

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


               
                //Setup an interim entity in its place
                final IPortletDefinitionId portletDefinitionId = portletEntity.getPortletDefinitionId();
                final String channelSubscribeId = portletEntity.getChannelSubscribeId();
                final int userId = portletEntity.getUserId();
                final IPortletEntity interimPortletEntity = this.createPortletEntity(portletDefinitionId, channelSubscribeId, userId);
               
                if (this.logger.isTraceEnabled()) {
                    this.logger.trace("Persistent portlet entity " + portletEntityId + " no longer has preferences. Deleted it and created InterimPortletEntity " + interimPortletEntity.getPortletEntityId());
                }
            }
        }
        else {
            //There are preferences on the interim entity, create an store it
            if (preferences.size() > 0) {
                final IPortletDefinitionId portletDefinitionId = portletEntity.getPortletDefinitionId();
                final String channelSubscribeId = portletEntity.getChannelSubscribeId();
                final int userId = portletEntity.getUserId();
                final IPortletEntity persistantEntity = this.portletEntityDao.createPortletEntity(portletDefinitionId, channelSubscribeId, userId);

                persistantEntity.setPortletPreferences(portletPreferences);
               
                this.portletEntityDao.updatePortletEntity(persistantEntity);
               
                //Remove the in-memory interim entity
                this.removeInterimPortletEntity(portletEntityId);
               
                //Setup the persistent ID mapping
                this.setPersistentIdMapping(portletEntityId, persistantEntity.getPortletEntityId());
               
                if (this.logger.isTraceEnabled()) {
                    this.logger.trace("InterimPortletEntity " + portletEntityId + " now has preferences. Deleted it and created persistent portlet entity " + persistantEntity.getPortletEntityId());
                }
            }
        }
    }
View Full Code Here


     */
    @Override
    public IPortletDefinition getParentPortletDefinition(IPortletEntityId portletEntityId) {
        Validate.notNull(portletEntityId, "portletEntityId can not be null");
       
        final IPortletEntity portletEntity = this.getPortletEntity(portletEntityId);
        final IPortletDefinitionId portletDefinitionId = portletEntity.getPortletDefinitionId();

        return this.portletDefinitionRegistry.getPortletDefinition(portletDefinitionId);
    }
View Full Code Here

            return true;
        }
        if (!(object instanceof IPortletEntity)) {
            return false;
        }
        IPortletEntity rhs = (IPortletEntity) object;
        return new EqualsBuilder().append(this.channelSubscribeId,
                rhs.getChannelSubscribeId()).append(this.userId,
                rhs.getUserId()).append(this.getPortletDefinitionId(),
                rhs.getPortletDefinitionId()).isEquals();
    }
View Full Code Here

            return true;
        }
        if (!(object instanceof IPortletEntity)) {
            return false;
        }
        IPortletEntity rhs = (IPortletEntity) object;
        return new EqualsBuilder()
            .append(this.channelSubscribeId, rhs.getChannelSubscribeId())
            .append(this.userId, rhs.getUserId())
            .append(this.getPortletDefinitionId(), rhs.getPortletDefinitionId())
            .isEquals();
    }
View Full Code Here

        final IPortletDefinition portletDefinition = this.portletDefinitionDao.getPortletDefinition(portletDefinitionId);
        if (portletDefinition == null) {
            throw new DataRetrievalFailureException("No IPortletDefinition exists for IPortletDefinitionId='" + portletDefinitionId + "'");
        }
       
        IPortletEntity portletEntity = new PortletEntityImpl(portletDefinition, channelSubscribeId, userId);
       
        this.entityManager.persist(portletEntity);

        return portletEntity;
    }
View Full Code Here

     */
    @Transactional
    public void deletePortletEntity(IPortletEntity portletEntity) {
        Validate.notNull(portletEntity, "portletEntity can not be null");
       
        final IPortletEntity persistentPortletEntity;
        if (this.entityManager.contains(portletEntity)) {
            persistentPortletEntity = portletEntity;
        }
        else {
            persistentPortletEntity = this.entityManager.merge(portletEntity);
View Full Code Here

        query.setHint("org.hibernate.cacheable", true);
        query.setHint("org.hibernate.cacheRegion", FIND_PORTLET_ENT_BY_CHAN_SUB_AND_USER_CACHE_REGION);
        query.setMaxResults(1);
       
        final List<IPortletEntity> portletEntities = query.getResultList();
        final IPortletEntity portletEntity = (IPortletEntity)DataAccessUtils.uniqueResult(portletEntities);
        return portletEntity;
    }
View Full Code Here

        if (this.isTransient(request, portletWindowId)) {
            final String portletWindowIdString = portletWindowId.getStringId();
            final String portletEntityIdString = portletWindowIdString.substring(TRANSIENT_WINDOW_ID_PREFIX.length());
           
            final IPortletEntityRegistry portletEntityRegistry = this.getPortletEntityRegistry();
            final IPortletEntity portletEntity = portletEntityRegistry.getPortletEntity(portletEntityIdString);
           
            return this.getTransientPortletWindow(request, portletWindowIdString, portletEntity.getPortletEntityId());
        }
       
        final Map<IPortletWindowId, IPortletWindow> portletWindowMap = this.getPortletWindowMap(request);
        if (portletWindowMap == null) {
            return null;
View Full Code Here

   
    /* (non-Javadoc)
     * @see org.jasig.portal.portlet.registry.IPortletWindowRegistry#getDefaultPortletWindowId(org.jasig.portal.portlet.om.IPortletEntityId)
     */
    public IPortletWindowId getDefaultPortletWindowId(IPortletEntityId portletEntityId) {
        final IPortletEntity portletEntity = this.portletEntityRegistry.getPortletEntity(portletEntityId);
        final String channelSubscribeId = portletEntity.getChannelSubscribeId();
        return this.createPortletWindowId(channelSubscribeId, portletEntityId);
    }
View Full Code Here

        if (portletWindow == null) {
            return null;
        }
       
        final IPortletEntityId parentPortletEntityId = portletWindow.getPortletEntityId();
        final IPortletEntity portletEntity = this.portletEntityRegistry.getPortletEntity(parentPortletEntityId);
        return portletEntity;
    }
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.