Package org.jasig.portal.portlet.om

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


    public void testGetTransientWindow() throws Exception {
        final TransientPortletWindowRegistryImpl transientPortletWindowRegistry = new TransientPortletWindowRegistryImpl();
       
        final HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
        final HttpSession session = EasyMock.createMock(HttpSession.class);
        final IPortletWindowId sourcePortletWindowId = EasyMock.createMock(IPortletWindowId.class);
        final IPortletWindow sourcePortletWindow = EasyMock.createMock(IPortletWindow.class);
        final IPortletEntityId portletEntityId = EasyMock.createMock(IPortletEntityId.class);
        final IPortletEntityRegistry portletEntityRegistry = EasyMock.createMock(IPortletEntityRegistry.class);
        final IPortletDefinitionRegistry portletDefinitionRegistry = EasyMock.createMock(IPortletDefinitionRegistry.class);
        final IPortletDefinition portletDefinition = EasyMock.createMock(IPortletDefinition.class);
        final IPortletEntity portletEntity = EasyMock.createMock(IPortletEntity.class);
       
        final ConcurrentHashMap<Object, Object> transientPortletWindowMap = new ConcurrentHashMap<Object, Object>();
       
        final ConcurrentHashMap<Object, Object> portletWindowMap = new ConcurrentHashMap<Object, Object>();
        portletWindowMap.put(sourcePortletWindowId, sourcePortletWindow);
       
        EasyMock.expect(sourcePortletWindowId.getStringId()).andReturn("pwid1");
        EasyMock.expect(request.getSession(false)).andReturn(session);
        EasyMock.expect(session.getAttribute(WebUtils.SESSION_MUTEX_ATTRIBUTE)).andReturn(session);
        EasyMock.expect(session.getAttribute(PortletWindowRegistryImpl.PORTLET_WINDOW_MAP_ATTRIBUTE)).andReturn(portletWindowMap);
        EasyMock.expect(sourcePortletWindow.getPortletEntityId()).andReturn(portletEntityId);
        EasyMock.expect(request.getAttribute(PortalWebUtils.REQUEST_MUTEX_ATTRIBUTE)).andReturn(request).times(2);
        EasyMock.expect(request.getAttribute(TransientPortletWindowRegistryImpl.TRANSIENT_PORTLET_WINDOW_MAP_ATTRIBUTE)).andReturn(transientPortletWindowMap).times(2);
        EasyMock.expect(portletEntityId.getStringId()).andReturn("peid1").times(2);
        EasyMock.expect(portletEntityRegistry.getParentPortletDefinition(portletEntityId)).andReturn(portletDefinition);
        EasyMock.expect(portletDefinitionRegistry.getPortletDescriptorKeys(portletDefinition)).andReturn(new Tuple<String, String>("pdk1.k", "pdk1.v"));
        EasyMock.expect(portletEntityRegistry.getPortletEntity("peid1")).andReturn(portletEntity);               
        EasyMock.expect(portletEntity.getPortletEntityId()).andReturn(portletEntityId);
               
       
        EasyMock.replay(request, session, sourcePortletWindowId, sourcePortletWindow, portletEntityId,
                portletEntityRegistry, portletDefinitionRegistry, portletDefinition, portletEntity);
       
       
        transientPortletWindowRegistry.setPortletEntityRegistry(portletEntityRegistry);
        transientPortletWindowRegistry.setPortletDefinitionRegistry(portletDefinitionRegistry);
       
        final IPortletWindowId portletWindowId = transientPortletWindowRegistry.createTransientPortletWindowId(request, sourcePortletWindowId);
       
        final IPortletWindow portletWindow1 = transientPortletWindowRegistry.getPortletWindow(request, portletWindowId);
       
        final IPortletWindow portletWindow2 = transientPortletWindowRegistry.getOrCreatePortletWindow(request, portletWindowId.toString(), portletEntityId);
       
        assertTrue(portletWindow1 == portletWindow2);
        assertEquals(1, transientPortletWindowMap.size());
        assertEquals(TransientPortletWindowRegistryImpl.TRANSIENT_WINDOW_ID_PREFIX + "peid1", portletWindowId.getStringId());
        assertEquals(TransientPortletWindowRegistryImpl.TRANSIENT_WINDOW_ID_PREFIX + "peid1", portletWindow2.getPortletWindowId().getStringId());
        assertEquals("pdk1.k", portletWindow2.getContextPath());
        assertEquals("pdk1.v", portletWindow2.getPortletName());
        assertEquals("peid1", portletWindow2.getPortletEntityId().getStringId());
View Full Code Here


       
        replay(portalRequestUtils);
        portletUrlSyntaxProvider.setPortalRequestUtils(portalRequestUtils);
       
        final IPortletEntityId portletEntityId = new MockPortletEntityId("entityId1");
        final IPortletWindowId portletWindowId = new MockPortletWindowId("windowId1");
        final IPortletWindow portletWindow = new MockPortletWindow(portletWindowId, portletEntityId, "portletApp", "portletName");
       
        final ChannelRuntimeData channelRuntimeData = new ChannelRuntimeData();
        channelRuntimeData.setBaseActionURL("base/action.url");
       
View Full Code Here

        expect(portalRequestUtils.getOriginalPortletAdaptorRequest(request)).andReturn(request);
       
        portletUrlSyntaxProvider.setPortalRequestUtils(portalRequestUtils);
       
        final IPortletEntityId portletEntityId1 = new MockPortletEntityId("eId1");
        final IPortletWindowId portletWindowId1 = new MockPortletWindowId("wId1");
        final IPortletWindow portletWindow1 = new MockPortletWindow(portletWindowId1, portletEntityId1, "portletAppA", "portletNameA");
      
        final IPortletEntityId portletEntityId2 = new MockPortletEntityId("eId2");
        final IPortletWindowId portletWindowId2 = new MockPortletWindowId("wId2");
        final MockPortletWindow portletWindow2 = new MockPortletWindow(portletWindowId2, portletEntityId2, "portletAppB", "portletNameB");

       
        final ChannelRuntimeData channelRuntimeData = new ChannelRuntimeData();
        channelRuntimeData.setBaseActionURL("base/action.url");
View Full Code Here

        expect(portalRequestUtils.getOriginalPortletAdaptorRequest(request)).andReturn(request);
       
        portletUrlSyntaxProvider.setPortalRequestUtils(portalRequestUtils);
       
        final IPortletEntityId portletEntityId1 = new MockPortletEntityId("eId1");
        final IPortletWindowId portletWindowId1 = new MockPortletWindowId("wId1");
        final IPortletWindow portletWindow1 = new MockPortletWindow(portletWindowId1, portletEntityId1, "portletAppA", "portletNameA");
      
        final IPortletEntityId portletEntityId2 = new MockPortletEntityId("eId2");
        final IPortletWindowId portletWindowId2 = new MockPortletWindowId("wId2");
        final MockPortletWindow portletWindow2 = new MockPortletWindow(portletWindowId2, portletEntityId2, "portletAppB", "portletNameB");

       
        final ChannelRuntimeData channelRuntimeData = new ChannelRuntimeData();
        channelRuntimeData.setBaseActionURL("base/action.url");
View Full Code Here

        expect(portalRequestUtils.getOriginalPortletAdaptorRequest(request)).andReturn(request);
       
        portletUrlSyntaxProvider.setPortalRequestUtils(portalRequestUtils);
       
        final IPortletEntityId portletEntityId1 = new MockPortletEntityId("eId1");
        final IPortletWindowId portletWindowId1 = new MockPortletWindowId("wId1");
        final IPortletWindow portletWindow1 = new MockPortletWindow(portletWindowId1, portletEntityId1, "portletAppA", "portletNameA");
      
        final IPortletEntityId portletEntityId2 = new MockPortletEntityId("eId2");
        final IPortletWindowId portletWindowId2 = new MockPortletWindowId("wId2");
        final MockPortletWindow portletWindow2 = new MockPortletWindow(portletWindowId2, portletEntityId2, "portletAppB", "portletNameB");
      
        final IPortletEntityId portletEntityId3 = new MockPortletEntityId("eId3");
        final IPortletWindowId portletWindowId3 = new MockPortletWindowId("wId3");
        final MockPortletWindow portletWindow3 = new MockPortletWindow(portletWindowId3, portletEntityId3, "portletAppC", "portletNameC");

       
        final ChannelRuntimeData channelRuntimeData = new ChannelRuntimeData();
        channelRuntimeData.setBaseActionURL("base/action.url");
View Full Code Here

        expect(portalRequestUtils.getOriginalPortletAdaptorRequest(request)).andReturn(request);
       
        portletUrlSyntaxProvider.setPortalRequestUtils(portalRequestUtils);
       
        final IPortletEntityId portletEntityId1 = new MockPortletEntityId("eId1");
        final IPortletWindowId portletWindowId1 = new MockPortletWindowId("wId1");
        final IPortletWindow portletWindow1 = new MockPortletWindow(portletWindowId1, portletEntityId1, "portletAppA", "portletNameA");
      
        final IPortletEntityId portletEntityId2 = new MockPortletEntityId("eId2");
        final IPortletWindowId portletWindowId2 = new MockPortletWindowId("wId2");
        final MockPortletWindow portletWindow2 = new MockPortletWindow(portletWindowId2, portletEntityId2, "portletAppB", "portletNameB");
      
        final IPortletEntityId portletEntityId3 = new MockPortletEntityId("eId3");
        final IPortletWindowId portletWindowId3 = new MockPortletWindowId("wId3");
        final MockPortletWindow portletWindow3 = new MockPortletWindow(portletWindowId3, portletEntityId3, "portletAppC", "portletNameC");

       
        final ChannelRuntimeData channelRuntimeData = new ChannelRuntimeData();
        channelRuntimeData.setBaseActionURL("base/action.url");
View Full Code Here

    EasyMock.expect(portletCookieDao.addOrUpdatePortletCookie(portalCookie, portletCookie)).andReturn(portalCookie);
   
    PortletCookieServiceImpl cookieService = new PortletCookieServiceImpl();
    cookieService.setPortletCookieDao(portletCookieDao);
   
    IPortletWindowId mockWindowId = EasyMock.createMock(IPortletWindowId.class);
    EasyMock.replay(portletCookieDao, mockWindowId);
   
    MockHttpServletRequest request = new MockHttpServletRequest();
    cookieService.addCookie(request, mockWindowId, portletCookie);
   
View Full Code Here

    EasyMock.expect(portletCookieDao.addOrUpdatePortletCookie(portalCookie, portletCookie)).andReturn(portalCookie);
   
    PortletCookieServiceImpl cookieService = new PortletCookieServiceImpl();
    cookieService.setPortletCookieDao(portletCookieDao);
   
    IPortletWindowId mockWindowId = EasyMock.createMock(IPortletWindowId.class);
    EasyMock.replay(portletCookieDao, mockWindowId);
   
    MockHttpServletRequest request = new MockHttpServletRequest();
    cookieService.addCookie(request, mockWindowId, portletCookie);
   
View Full Code Here

    EasyMock.expect(portletCookieDao.createPortalCookie(PortletCookieServiceImpl.DEFAULT_MAX_AGE)).andReturn(portalCookie);
   
    PortletCookieServiceImpl cookieService = new PortletCookieServiceImpl();
    cookieService.setPortletCookieDao(portletCookieDao);
   
    IPortletWindowId mockWindowId = EasyMock.createMock(IPortletWindowId.class);
    EasyMock.replay(portletCookieDao, mockWindowId);
   
    MockHttpServletRequest request = new MockHttpServletRequest();
    cookieService.addCookie(request, mockWindowId, portletCookie);
   
View Full Code Here

    }

    @Test
    public void testPortletUrlById() throws Exception {
        final MockHttpServletRequest request = new MockHttpServletRequest();
        final IPortletWindowId portletWindowId = new MockPortletWindowId("w1");
       
        when(portalUrlProvider.getPortalUrlBuilderByLayoutNode(request, "foo", UrlType.RENDER)).thenReturn(portalUrlBuilder);
        when(portalUrlBuilder.getPortletUrlBuilder(portletWindowId)).thenReturn(portletUrlBuilder);
        when(portalUrlBuilder.getUrlString()).thenReturn("/uPortal/home/normal/render.uP?layoutUrl");
        when(portletWindowRegistry.getOrCreateDefaultPortletWindowByLayoutNodeId(request, "foo")).thenReturn(portletWindow);
View Full Code Here

TOP

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

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.