Examples of IChannelDefinition


Examples of org.jasig.portal.channel.IChannelDefinition

        try {

            // Next see if it's a <channel> element...
            if (e.getName().equals("channel")) {
                IChannelDefinition def = ChannelRegistryStoreFactory.getChannelRegistryStoreImpl().getChannelDefinition(e.getText());
                return String.valueOf(def.getId());
            }

            // Must be a group...
            Class[] leafTypes = new Class[] {IPerson.class, IChannelDefinition.class};
            for (int i=0; i < leafTypes.length && rslt == null; i++) {
View Full Code Here

Examples of org.jasig.portal.channel.IChannelDefinition

        assertEquals(0, this.countRowsInTable("STATS_FOLDER"));
        assertEquals(0, this.countRowsInTable("STATS_RENDER_TIME"));
       
       
       
        final IChannelDefinition channelDefinition = EasyMock.createMock(IChannelDefinition.class);
        EasyMock.expect(channelDefinition.getId()).andReturn(1).anyTimes();
        EasyMock.expect(channelDefinition.getName()).andReturn("TestChannelDef").anyTimes();
        EasyMock.replay(channelDefinition);
       
       
       
        portalEvent = new PublishedChannelDefinitionPortalEvent(this, person, channelDefinition);
View Full Code Here

Examples of org.jasig.portal.channel.IChannelDefinition

    public void testAllDefinitionDaoMethods() throws Exception {
        final IChannelType channelType = this.jpaChannelTypeDao.createChannelType("BaseType", IChannelType.class.getName(), "foobar");
        this.checkPoint();
       
        //Create a definition
        final IChannelDefinition chanDef1 = this.jpaChannelDefinitionDao.createChannelDefinition(channelType, "fname1", IPortletAdaptor.class.getName(), "Test Portlet 1", "Test Portlet 1 Title");
        final IPortletDefinition portDef1 = this.jpaPortletDefinitionDao.getPortletDefinition(chanDef1.getId());
        this.checkPoint();
       
        //Try all of the retrieval options
        final IPortletDefinition portDef1a = this.jpaPortletDefinitionDao.getPortletDefinition(portDef1.getPortletDefinitionId());
        assertEquals(portDef1, portDef1a);
       
        //Create a second definition with the same app/portlet
        final IChannelDefinition chanDef2 = this.jpaChannelDefinitionDao.createChannelDefinition(channelType, "fname2", IPortletAdaptor.class.getName(), "Test Portlet 2", "Test Portlet 2 Title");
        IPortletDefinition portDef2 = this.jpaPortletDefinitionDao.getPortletDefinition(chanDef2.getId());
        this.checkPoint();
       
       
        // Add some preferences
        portDef2 = this.jpaPortletDefinitionDao.getPortletDefinition(portDef2.getPortletDefinitionId());
View Full Code Here

Examples of org.jasig.portal.channel.IChannelDefinition

    public void testAllEntityDaoMethods() throws Exception {
        final IChannelType channelType = this.jpaChannelTypeDao.createChannelType("BaseType", IChannelType.class.getName(), "foobar");
        this.checkPoint();
       
        //Create a definition
        final IChannelDefinition chanDef1 = this.jpaChannelDefinitionDao.createChannelDefinition(channelType, "fname1", IPortletAdaptor.class.getName(), "Test Portlet 1", "Test Portlet 1 Title");
        IPortletDefinition portDef1 = this.jpaPortletDefinitionDao.getPortletDefinition(chanDef1.getId());
        this.checkPoint();
       
        IPortletEntity portEnt1 = this.jpaPortletEntityDao.createPortletEntity(portDef1.getPortletDefinitionId(), "chanSub1", 1);
        this.checkPoint();
       
       
        final IPortletEntity portEnt1a = this.jpaPortletEntityDao.getPortletEntity(portEnt1.getPortletEntityId());
        assertEquals(portEnt1, portEnt1a);
       
        final IPortletEntity portEnt1b = this.jpaPortletEntityDao.getPortletEntity("chanSub1", 1);
        assertEquals(portEnt1, portEnt1b);
       
        final Set<IPortletEntity> portletEntities1 = this.jpaPortletEntityDao.getPortletEntities(portDef1.getPortletDefinitionId());
        assertEquals(Collections.singleton(portEnt1), portletEntities1);
       
        final Set<IPortletEntity> portletEntitiesByUser = this.jpaPortletEntityDao.getPortletEntitiesForUser(1);
        assertEquals(Collections.singleton(portEnt1), portletEntitiesByUser);
       
       
       
       
        //Try deleting whole tree
        portDef1 = this.jpaPortletDefinitionDao.getPortletDefinition(portDef1.getPortletDefinitionId());
        portDef1.getPortletPreferences().getPortletPreferences().add(new PortletPreferenceImpl("defpref1", false, "dpv1", "dpv2"));
        this.jpaPortletDefinitionDao.updatePortletDefinition(portDef1);
        this.checkPoint();
       
       
        portEnt1 = this.jpaPortletEntityDao.getPortletEntity(portEnt1.getPortletEntityId());
        portEnt1.getPortletPreferences().getPortletPreferences().add(new PortletPreferenceImpl("entpref1", false, "epv1", "epv2"));
        this.jpaPortletEntityDao.updatePortletEntity(portEnt1);
        this.checkPoint();

       
        final IChannelDefinition chanDef2 = this.jpaChannelDefinitionDao.getChannelDefinition(chanDef1.getId());
        this.jpaChannelDefinitionDao.deleteChannelDefinition(chanDef2);
        this.checkPoint();
       
       
        final Set<IPortletEntity> portletEntities2 = this.jpaPortletEntityDao.getPortletEntities(portDef1.getPortletDefinitionId());
View Full Code Here

Examples of org.jasig.portal.channel.IChannelDefinition

        final IUserPreferencesManager userPreferencesManager = createMock(IUserPreferencesManager.class);
        final IUserLayoutManager userLayoutManager = createMock(IUserLayoutManager.class);
        final IUserLayoutChannelDescription userLayoutChannelDescription = createMock(IUserLayoutChannelDescription.class);
        final IPortletDefinitionRegistry portletDefinitionRegistry = createMock(IPortletDefinitionRegistry.class);
        final IPortletDefinition portletDefinition = createMock(IPortletDefinition.class);
        final IChannelDefinition channelDefinition = createMock(IChannelDefinition.class);
        final IPerson person = createMock(IPerson.class);
        final IPortletEntityRegistry portletEntityRegistry = createMock(IPortletEntityRegistry.class);
        final IPortletEntity portletEntity = createMock(IPortletEntity.class);
        final IPortletWindow portletWindow = createMock(IPortletWindow.class);
       
        final MockPortletDefinitionId portletDefinitionId = new MockPortletDefinitionId("42");
        final MockPortletEntityId portletEntityId = new MockPortletEntityId("subId1");
        final MockPortletWindowId portletWindowId = new MockPortletWindowId("windowId1");
       
        expect(userInstanceManager.getUserInstance(request)).andReturn(userInstance);
        expect(userInstance.getPreferencesManager()).andReturn(userPreferencesManager);
        expect(userPreferencesManager.getUserLayoutManager()).andReturn(userLayoutManager);
        expect(userLayoutManager.getSubscribeId("my-info-student-center-home")).andReturn("subId1");
        expect(userLayoutManager.getNode("subId1")).andReturn(userLayoutChannelDescription);
        expect(userLayoutChannelDescription.getChannelPublishId()).andReturn("42");
        expect(portletDefinitionRegistry.getPortletDefinition(42)).andReturn(portletDefinition);
        expect(portletDefinition.getChannelDefinition()).andReturn(channelDefinition);
        expect(channelDefinition.isPortlet()).andReturn(true);
        expect(userInstance.getPerson()).andReturn(person);
        expect(portletDefinition.getPortletDefinitionId()).andReturn(portletDefinitionId);
        expect(person.getID()).andReturn(37);
        expect(portletEntityRegistry.getOrCreatePortletEntity(portletDefinitionId, "subId1", 37)).andReturn(portletEntity);
        expect(portletEntity.getPortletEntityId()).andReturn(portletEntityId);
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.