Package org.jasig.portal

Examples of org.jasig.portal.IUserPreferencesManager


   * @param localeString
   */
  public void updateUserLocale(HttpServletRequest request, String localeString) {

    IUserInstance ui = userInstanceManager.getUserInstance(request);
    IUserPreferencesManager upm = ui.getPreferencesManager();
        final IUserProfile userProfile = upm.getUserProfile();
        LocaleManager localeManager = userProfile.getLocaleManager();


        if (localeString != null) {
         
          // build a new Locale[] array from the specified locale
            Locale userLocale = parseLocale(localeString);
            Locale[] locales = new Locale[] { userLocale };
           
            // set this locale in the session
            localeManager.setSessionLocales(locales);
           
            // if the current user is logged in, also update the persisted
            // user locale
            final IPerson person = ui.getPerson();
            if (!person.isGuest()) {
                try {
                    localeManager.persistUserLocales(new Locale[] { userLocale });
                    localeStore.updateUserLocales(person, new Locale[] { userLocale });
                   
                    // remove person layout framgent from session since it contains some of the data in previous
                    // translation and won't be cleared until next logout-login (applies when using
                    // RDBMDistributedLayoutStore as user layout store).
                    person.setAttribute(Constants.PLF, null);
                    upm.getUserLayoutManager().loadUserLayout(true);
                } catch (Exception e) {
                    throw new PortalException(e);
                }
            }
        }
View Full Code Here


    }

    @Override
    public IUrlNodeSyntaxHelper getCurrentUrlNodeSyntaxHelper(HttpServletRequest request) {
        final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
        final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
        final IUserProfile userProfile = preferencesManager.getUserProfile();
       
        final int themeStylesheetId = userProfile.getThemeStylesheetId();
        final IUrlNodeSyntaxHelper themeUrlSyntaxHelper = getUrlNodeSyntaxHelperForStylesheet(themeStylesheetId);
        if (themeUrlSyntaxHelper != null) {
            return themeUrlSyntaxHelper;
View Full Code Here

TOP

Related Classes of org.jasig.portal.IUserPreferencesManager

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.