Examples of IPortletDefinitionId


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

            return null;
        }

        final String databaseChannelSubscribeId = portletEntity.getChannelSubscribeId();
        if (databaseChannelSubscribeId.startsWith(TransientUserLayoutManagerWrapper.SUBSCRIBE_PREFIX)) {
            final IPortletDefinitionId portletDefinitionId = portletEntity.getPortletDefinitionId();
            final IPortletDefinition portletDefinition = this.portletDefinitionRegistry.getPortletDefinition(portletDefinitionId);
            final IChannelDefinition channelDefinition = portletDefinition.getChannelDefinition();
            final String fname = channelDefinition.getFName();
           
            final IUserLayoutManager userLayoutManager = this.getUserLayoutManager();
View Full Code Here

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

               
                //remove the persistent ID mapping after the delete
                this.removePersistentId(portletEntityId);
               
                //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);
View Full Code Here

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

    @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

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

        expect(mockPortletWindow.getPortletEntityId()).andReturn(mockPortletEntityId);
        expect(mockPortletWindow.getWindowState()).andReturn(details.getWindowState());
        expect(mockPortletWindow.getPortletMode()).andReturn(details.getPortletMode());
        replay(mockPortletWindow);
       
        IPortletDefinitionId mockPortletDefinitionId = createMock(IPortletDefinitionId.class);
        replay(mockPortletDefinitionId);
        IChannelDefinition mockChannelDefinition = createMock(IChannelDefinition.class);
        expect(mockChannelDefinition.getFName()).andReturn(details.getChannelFName());
        replay(mockChannelDefinition);
        IPortletDefinition mockPortletDefinition = createMock(IPortletDefinition.class);
View Full Code Here

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

        if (channelDefinition == null || !channelDefinition.isPortlet()) {
            return null;
        }
       
        final IPortletDefinition portletDefinition = this.portletDefinitionRegistry.getPortletDefinition(channelDefinition.getId());
        final IPortletDefinitionId portletDefinitionId = portletDefinition.getPortletDefinitionId();
       
        return this.createRequestDispatcher(portletRequest, portletDefinitionId);
    }
View Full Code Here

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

        //get/create the portlet definition
        final int channelDefinitionId = channelDefinition.getId();
        final IPortletDefinition portletDefinition = this.portletDefinitionRegistry.getOrCreatePortletDefinition(channelDefinitionId);
       
        //get/create the portlet entity
        final IPortletDefinitionId portletDefinitionId = portletDefinition.getPortletDefinitionId();
        return this.portletEntityRegistry.getOrCreatePortletEntity(portletDefinitionId, channelSubscribeId, userId);
    }
View Full Code Here

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

        this.jpaChannelTypeDao = jpaChannelTypeDao;
    }

   
    public void testNoopOperations() throws Exception {
        final IPortletDefinitionId portletDefinitionId = new PortletDefinitionIdImpl(1);
        final IPortletDefinition nullPortDef1 = this.jpaPortletDefinitionDao.getPortletDefinition(portletDefinitionId);
        assertNull(nullPortDef1);
       
        final IPortletEntity nullPortEnt1 = this.jpaPortletEntityDao.getPortletEntity("chanSub1", 1);
        assertNull(nullPortEnt1);
View Full Code Here

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

            public IPortletDefinitionId call() throws Exception {
                final IPortletType channelType = jpaPortletTypeDao.createPortletType("BaseType", "foobar");
               
                //Create a definition
                final IPortletDefinition portletDef = jpaPortletDefinitionDao.createPortletDefinition(channelType, "fname1", "Test Portlet 1", "Test Portlet 1 Title", "/context1", "portletName1", false);
                final IPortletDefinitionId portletDefinitionId = portletDef.getPortletDefinitionId();

                when(portletDefinitionRegistry.getPortletDefinition(portletDefinitionId)).thenReturn(portletDef);
                when(portletDefinitionRegistry.getPortletDefinition(portletDefinitionId.getStringId())).thenReturn(portletDef);

                return portletDefinitionId;
            }
        });
    }
View Full Code Here

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

    }
   
    //persistent with prefs & not in db - create new & update
    @Test
    public void testPersistentWithPrefsNotInDb() throws Throwable {
        final IPortletDefinitionId portDefId1 = this.createDefaultPorltetDefinition();
        final String nodeId = "u1l1n1";
       
        //Mock setup
        final MockHttpServletRequest request = new MockHttpServletRequest();
       
        when(portalRequestUtils.getOriginalPortalRequest(request)).thenReturn(request);
        when(portalRequestUtils.getOriginalPortletOrPortalRequest(request)).thenReturn(request);
       
        when(userInstanceManager.getUserInstance(request)).thenReturn(userInstance);
        when(userInstance.getPreferencesManager()).thenReturn(preferencesManager);
        when(userInstance.getPerson()).thenReturn(person);
        when(preferencesManager.getUserLayoutManager()).thenReturn(userLayoutManager);
       
        when(userLayoutManager.getNode(nodeId)).thenReturn(node);
        when(node.getType()).thenReturn(LayoutNodeType.PORTLET);
        when(node.getChannelPublishId()).thenReturn(portDefId1.getStringId());
       
        final IPortletEntityId portletEntityId = this.execute(new Callable<IPortletEntityId>() {
            @Override
            public IPortletEntityId call() throws Exception {
                //T1 - Create the entity
View Full Code Here

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

    }
   
    //persistent with no prefs & not in db - noop
    @Test
    public void testPersistentNoPrefsNotInDb() throws Throwable {
        final IPortletDefinitionId portDefId1 = this.createDefaultPorltetDefinition();
        final String nodeId = "u1l1n1";
       
        //Mock setup
        final MockHttpServletRequest request = new MockHttpServletRequest();
       
        when(portalRequestUtils.getOriginalPortalRequest(request)).thenReturn(request);
        when(portalRequestUtils.getOriginalPortletOrPortalRequest(request)).thenReturn(request);
       
        when(userInstanceManager.getUserInstance(request)).thenReturn(userInstance);
        when(userInstance.getPreferencesManager()).thenReturn(preferencesManager);
        when(userInstance.getPerson()).thenReturn(person);
        when(preferencesManager.getUserLayoutManager()).thenReturn(userLayoutManager);
       
        when(userLayoutManager.getNode(nodeId)).thenReturn(node);
        when(node.getType()).thenReturn(LayoutNodeType.PORTLET);
        when(node.getChannelPublishId()).thenReturn(portDefId1.getStringId());

        final IPortletEntityId portletEntityId = this.execute(new Callable<IPortletEntityId>() {
            @Override
            public IPortletEntityId call() throws Exception {
                //T1 - Create the entity
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.