Package org.jasig.portal.user

Examples of org.jasig.portal.user.IUserInstanceManager


    /**
     * @deprecated Use {@link org.jasig.portal.user.IUserInstanceManager#getUserInstance(HttpServletRequest)} instead.
     */
    public static IUserInstance getUserInstance(HttpServletRequest request) throws PortalException {
        final IUserInstanceManager userInstanceManager = UserInstanceManagerLocator.getUserInstanceManager();
        return userInstanceManager.getUserInstance(request);
    }
View Full Code Here


            request.setCharacterEncoding("UTF-8");
        } catch (UnsupportedEncodingException uee) {
            log.error("Unable to set UTF-8 character encoding!", uee);
        }
       
        final IUserInstanceManager userInstanceManager = UserInstanceManagerLocator.getUserInstanceManager();
       
        //Add request and response wrappers
        res = new PortalHttpServletResponseWrapper(res);
        final IWritableHttpServletRequest writableRequest = new PortalHttpServletRequestWrapper(request, res, userInstanceManager);
       
View Full Code Here

        try {
            final IRequestParameterProcessorController requestProcessorController = RequestParameterProcessorControllerLocator.getRequestParameterProcessorController();
            requestProcessorController.processParameters(writableRequest, res);

            // Retrieve the user's UserInstance object
            final IUserInstanceManager userInstanceManager = UserInstanceManagerLocator.getUserInstanceManager();
            final IUserInstance userInstance = userInstanceManager.getUserInstance(writableRequest);
           
            // fire away
            final IPortalRenderingPipeline portalRenderingPipeline = PortalRenderingPipelineLocator.getPortalRenderingPipeline();
            portalRenderingPipeline.renderState(writableRequest, res, userInstance);
        }
View Full Code Here

  }

  public void doPost(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {

      IUserInstanceManager userInstanceManager = null;
      IUserInstance ui = null;
    IPerson per = null;
    UserPreferencesManager upm = null;
    IUserLayoutManager ulm = null;

    // make sure the user has a current session
    if (request.getSession(false) == null) {
      log.warn("Attempting to use AJAX preferences as GUEST user");
      printError(response, "Your session has timed out.  Please log in again to make changes to your layout.");
      return;
    }

    try {
            final WebApplicationContext applicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(this.getServletContext());
            userInstanceManager = (IUserInstanceManager) applicationContext.getBean("userInstanceManager", IUserInstanceManager.class);

           
      // Retrieve the user's UserInstance object
      ui = userInstanceManager.getUserInstance(request);

      // Retrieve the user's IPerson object
      per = ui.getPerson();

      // ensure that the user is currently logged in
View Full Code Here

        expect(mockPortletEntity.getPortletDefinitionId()).andReturn(mockPortletDefinitionId);
        replay(mockPortletEntity);
        // END transient mock objects

        // BEGIN mock dependencies for PortalUrlProviderImpl
        IUserInstanceManager mockUserInstanceManager= createMock(IUserInstanceManager.class);
        expect(mockUserInstanceManager.getUserInstance(details.getHttpServletRequest())).andReturn(mockUser).times(2);
        replay(mockUserInstanceManager);
   
        IPortletDefinitionRegistry mockPortletDefinitionRegistry = createMock(IPortletDefinitionRegistry.class);
        expect(mockPortletDefinitionRegistry.getPortletDefinition(mockPortletDefinitionId)).andReturn(mockPortletDefinition);
        replay(mockPortletDefinitionRegistry);
View Full Code Here

        catch (IllegalArgumentException iae) {
        }
       
       
        final IPortletWindowRegistry portletWindowRegistry = createMock(IPortletWindowRegistry.class);
        final IUserInstanceManager userInstanceManager = createMock(IUserInstanceManager.class);
        final IUserInstance userInstance = createMock(IUserInstance.class);
        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");
View Full Code Here

    public void testThemeStylesheetUserPreferences() throws Exception {
        //Setup mocks
        final HttpServletRequest request = new MockHttpServletRequest();
        request.getSession(); //initialize the session
        final IStylesheetDescriptorDao stylesheetDescriptorDao = mock(IStylesheetDescriptorDao.class);
        final IUserInstanceManager userInstanceManager = mock(IUserInstanceManager.class);
        final IStylesheetUserPreferencesDao stylesheetUserPreferencesDao = mock(IStylesheetUserPreferencesDao.class);
       
        final IUserInstance userInstance = mock(IUserInstance.class);
        when(userInstanceManager.getUserInstance(request)).thenReturn(userInstance);
       
        final IPerson person = mock(IPerson.class);
        when(userInstance.getPerson()).thenReturn(person);
       
        final IUserPreferencesManager preferencesManager = mock(IUserPreferencesManager.class);
View Full Code Here

TOP

Related Classes of org.jasig.portal.user.IUserInstanceManager

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.