Package org.jasig.portal

Examples of org.jasig.portal.IUserProfile


        when(userInstance.getPerson()).thenReturn(person);
       
        final IUserPreferencesManager preferencesManager = mock(IUserPreferencesManager.class);
        when(userInstance.getPreferencesManager()).thenReturn(preferencesManager);
       
        final IUserProfile userProfile = mock(IUserProfile.class);
        when(preferencesManager.getUserProfile()).thenReturn(userProfile);
       
        final IUserLayoutManager userLayoutManager = mock(IUserLayoutManager.class);
        when(preferencesManager.getUserLayoutManager()).thenReturn(userLayoutManager);
       
        final IUserLayout userLayout = mock(IUserLayout.class);
        when(userLayoutManager.getUserLayout()).thenReturn(userLayout);
       
        when(userProfile.getThemeStylesheetId()).thenReturn(1);
       
        final IStylesheetDescriptor stylesheetDescriptor = mock(IStylesheetDescriptor.class);
        when(stylesheetDescriptorDao.getStylesheetDescriptor(1)).thenReturn(stylesheetDescriptor);
       
        final ILayoutAttributeDescriptor skinLayoutAttributeDescriptor = mock(ILayoutAttributeDescriptor.class);
View Full Code Here


        final IPerson person = mock(IPerson.class);
        when(person.getID()).thenReturn(1);
       
       
        final IUserProfile userProfile = mock(IUserProfile.class);
        when(userProfile.getProfileId()).thenReturn(1);
       
        final long supId = this.execute(new Callable<Long>() {
            @Override
            public Long call() throws Exception {
                final IStylesheetDescriptor stylesheetDescriptor = stylesheetDescriptorDao.getStylesheetDescriptor(ssdId);
View Full Code Here

        try {
            this.userLayoutStore.setProfileImportExportCache(layoutCache);
            this.userLayoutStore.setLayoutImportExportCache(profileCache);

            final IUserProfile userProfile = userLayoutStore.getUserProfileByFname(person, UserProfile.DEFAULT_PROFILE_FNAME);
            final Element layoutElement = userLayoutStore.exportLayout(person, userProfile);
           
            return layoutElement;
        }
        finally {
View Full Code Here

            IPortletWindow portletWindow, P propertiesPopulator) {
       
        // get the current user profile
        IUserInstance ui = userInstanceManager.getUserInstance(portletRequest);
        IUserPreferencesManager upm = ui.getPreferencesManager();
        IUserProfile profile = upm.getUserProfile();
       
        // get the theme for this profile
        long themeId = profile.getThemeStylesheetId();
        IStylesheetDescriptor theme = stylesheetDao.getStylesheetDescriptor(themeId);

        // set the theme name as a portlet response property
        final String themeName = theme.getName();
        propertiesPopulator.put(IPortletRenderer.THEME_NAME_PROPERTY, themeName);
View Full Code Here

    }

    protected IStylesheetDescriptor getThemeStylesheetDescriptor(HttpServletRequest request) {
        final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
        final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
        final IUserProfile userProfile = preferencesManager.getUserProfile();
        final int themeStylesheetId = userProfile.getThemeStylesheetId();
       
        return stylesheetDescriptorDao.getStylesheetDescriptor(themeStylesheetId);
    }
View Full Code Here

        final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
       
        final IPerson person = userInstance.getPerson();

        final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
        final IUserProfile userProfile = preferencesManager.getUserProfile();
       
        final int stylesheetId = prefScope.getStylesheetId(userProfile);
        final IStylesheetDescriptor stylesheetDescriptor = this.stylesheetDescriptorDao.getStylesheetDescriptor(stylesheetId);
       
        return new StylesheetPreferencesKey(person, userProfile, stylesheetDescriptor);
View Full Code Here

    @Override
    public IStylesheetDescriptor getStylesheetDescriptor(HttpServletRequest request, PreferencesScope prefScope) {
        final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
       
        final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
        final IUserProfile userProfile = preferencesManager.getUserProfile();
       
        final int stylesheetId = prefScope.getStylesheetId(userProfile);
        return this.stylesheetDescriptorDao.getStylesheetDescriptor(stylesheetId);
    }
View Full Code Here

    person.setID(uid);

    IUserLayoutStore userLayoutStore = UserLayoutStoreLocator.getUserLayoutStore();
    try {
      // determine user profile           
      IUserProfile userProfile = userLayoutStore.getUserProfileByFname(person, DEFAULT_LAYOUT_FNAME);

      // Finally set the layout id to 0.  This orphans the existing layout but it will be replaced by the default
      // when the user logs in
      userProfile.setLayoutId(0);           

      // persist the change
      userLayoutStore.updateUserProfile(person, userProfile);
      logger.info("resetUserLayout complete for " + person);
    } catch (Exception e) {
View Full Code Here

     * @param owner
     * @throws Exception
     */
    private void saveLayout(UserView view, IPerson owner) throws Exception
    {
        IUserProfile profile = new UserProfile();
        profile.setProfileId(view.profileId);
        userLayoutStore.setUserLayout(owner, profile, view.layout, true, false);
    }
View Full Code Here

        Document layout = null;

        try
        {
            // fix hard coded 1 later for multiple profiles
            IUserProfile profile = userLayoutStore.getUserProfileByFname(owner, "default");
            profile.setLocaleManager(new LocaleManager(owner, new Locale[] { locale }));
           
            // see if we have structure & theme stylesheets for this user yet.
            // If not then fall back on system's selected stylesheets.
            if (profile.getStructureStylesheetId() == 0 ||
                    profile.getThemeStylesheetId() == 0)
                profile = userLayoutStore.getSystemProfileByFname(profile.getProfileFname());
           
            view.profileId = profile.getProfileId();
            view.profileFname = profile.getProfileFname();
            view.layoutId = profile.getLayoutId();
//            view.structureStylesheetId = profile.getStructureStylesheetId();
//            view.themeStylesheetId = profile.getThemeStylesheetId();
           
            layout = userLayoutStore.getFragmentLayout( owner, profile );
            Element root = layout.getDocumentElement();
View Full Code Here

TOP

Related Classes of org.jasig.portal.IUserProfile

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.