Package org.exoplatform.services.organization

Examples of org.exoplatform.services.organization.UserProfile


        UserHandler userHandler = this.orgService.getUserHandler();
        //This should find enabled user
        ListAccess<User> users = userHandler.findAllUsers();
        int size = users.getSize();
        for(User u : users.load(0, size)) {
            UserProfile profile = this.getProfile(u.getUserName());
            if(profile != null) {
                profiles.add(profile);
            }
        }
View Full Code Here


        if (filteredAttrs.isEmpty()) {
            return null;
        }

        UserProfile profile = new UserProfileImpl(userName, filteredAttrs);

        return profile;

    }
View Full Code Here

            }
            uiUserInfo.getChild(UIUserProfileInputSet.class).save(service, uiUserInfo.getUserName(), false);

            if (uiUserInfo.getUserName().equals(event.getRequestContext().getRemoteUser())) {
                UserProfileHandler hanlder = service.getUserProfileHandler();
                UserProfile userProfile = hanlder.findUserProfileByName(event.getRequestContext().getRemoteUser());
                String language = userProfile.getAttribute(Constants.USER_LANGUAGE);

                UIPortalApplication uiApp = Util.getUIPortalApplication();
                if (language == null || language.trim().length() < 1)
                    return;
                LocaleConfigService localeConfigService = event.getSource().getApplicationComponent(LocaleConfigService.class);
                LocaleConfig localeConfig = localeConfigService.getLocaleConfig(language);
                if (localeConfig == null)
                    localeConfig = localeConfigService.getDefaultLocaleConfig();
                PortalRequestContext prqCtx = Util.getPortalRequestContext();
                prqCtx.setLocale(localeConfig.getLocale());

                // GTNPORTAL-3244: A workaround to update localization in the popup messages
                ResourceBundle bundle = Util.getPortalRequestContext().getApplication().getResourceBundle(localeConfig.getLocale());
                for(AbstractApplicationMessage message : uiApp.getUIPopupMessages().getErrors()) {
                    message.setResourceBundle(bundle);
                }
                for(AbstractApplicationMessage message : uiApp.getUIPopupMessages().getWarnings()) {
                    message.setResourceBundle(bundle);
                }
                for(AbstractApplicationMessage message : uiApp.getUIPopupMessages().getInfos()) {
                    message.setResourceBundle(bundle);
                }
                Util.getPortalRequestContext().addUIComponentToUpdateByAjax(
                        uiApp.findFirstComponentOfType(UIWorkingWorkspace.class));
                Util.getPortalRequestContext().ignoreAJAXUpdateOnPortlets(true);
            }

            UIAccountEditInputSet accountInput = uiUserInfo.getChild(UIAccountEditInputSet.class);
            UIUserProfileInputSet userProfile = uiUserInfo.getChild(UIUserProfileInputSet.class);
            uiUserInfo.setRenderSibling(UIListUsers.class);
            accountInput.reset();
            userProfile.reset();
            event.getRequestContext().setProcessRender(true);
        }
View Full Code Here

   {
      user_ = user;
      if (user == null)
         return;
      OrganizationService service = getApplicationComponent(OrganizationService.class);
      UserProfile userProfile = service.getUserProfileHandler().findUserProfileByName(user);
      if (userProfile == null)
      {
         userProfile = service.getUserProfileHandler().createUserProfileInstance();
         userProfile.setUserName(user);
      }

      if (userProfile.getUserInfoMap() == null)
         return;
      for (UIComponent set : getChildren())
      {
         UIFormInputSet inputSet = (UIFormInputSet)set;
         for (UIComponent uiComp : inputSet.getChildren())
         {
            UIFormStringInput uiInput = (UIFormStringInput)uiComp;
            uiInput.setValue(userProfile.getAttribute(uiInput.getName()));
         }
      }
   }
View Full Code Here

   @SuppressWarnings("deprecation")
   public void save(OrganizationService service, String user, boolean isnewUser) throws Exception
   {
      user_ = user;
      UserProfileHandler hanlder = service.getUserProfileHandler();
      UserProfile userProfile = hanlder.findUserProfileByName(user_);

      if (userProfile == null)
      {
         userProfile = hanlder.createUserProfileInstance();
         userProfile.setUserName(user_);
      }

      for (UIComponent set : getChildren())
      {
         UIFormInputSet inputSet = (UIFormInputSet)set;
         for (UIComponent uiComp : inputSet.getChildren())
         {
            UIFormStringInput uiInput = (UIFormStringInput)uiComp;
            // if(uiInput.getValue() == null || uiInput.getValue().length() < 1)
            // continue;
            userProfile.getUserInfoMap().put(uiInput.getName(), uiInput.getValue());
         }
      }

      hanlder.saveUserProfile(userProfile, true);
View Full Code Here

      // TODO dang.tung - change layout when portal get language from UIPortal
      // (user and browser not support)
      // ----------------------------------------------------------------------------------------------------
      String portalAppLanguage = uiPortalApp.getLocale().getLanguage();
      OrganizationService orgService = getApplicationComponent(OrganizationService.class);
      UserProfile userProfile = orgService.getUserProfileHandler().findUserProfileByName(remoteUser);
      String userLanguage = userProfile.getUserInfoMap().get(Constants.USER_LANGUAGE);
      String browserLanguage = prContext.getRequest().getLocale().getLanguage();

      // in case: edit current portal, set skin and language for uiPortalApp
      if (uiPortal == null)
      {
View Full Code Here

      String user = context.getRemoteUser();
      String portalSkin = null;
     
      if (user != null)
      {
         UserProfile userProfile = orgService.getUserProfileHandler().findUserProfileByName(user);
         if (userProfile != null)
         {
            portalLanguage = userProfile.getUserInfoMap().get(Constants.USER_LANGUAGE);
            portalSkin = userProfile.getUserInfoMap().get(Constants.USER_SKIN);
         }
         else
         {
            if (log.isWarnEnabled())
               log.warn("Could not load user profile for " + user + ". Using default portal locale.");
View Full Code Here

         uiApp.localizeNavigations();
         OrganizationService orgService = event.getSource().getApplicationComponent(OrganizationService.class);
         String remoteUser = event.getRequestContext().getRemoteUser();
         if (remoteUser != null)
         {
            UserProfile userProfile = orgService.getUserProfileHandler().findUserProfileByName(remoteUser);
            userProfile.getUserInfoMap().put(Constants.USER_LANGUAGE, language);
            UserProfileHandler hanlder = orgService.getUserProfileHandler();
            hanlder.saveUserProfile(userProfile, true);
         }
      }
View Full Code Here

      {       
         return null;
      }

      // get the user profile cached in the prc during the start of the request
      UserProfile userProfile = (UserProfile)prc.getAttribute(UserProfileLifecycle.USER_PROFILE_ATTRIBUTE_NAME);

      // client context
      AbstractClientContext clientContext;
      Cookie[] cookies = servletRequest.getCookies();
      if (cookies != null)
View Full Code Here

        
         //Save the skin selection to the User Profile
         OrganizationService orgService = event.getSource().getApplicationComponent(OrganizationService.class);
         if (remoteUser != null)
         {
            UserProfile userProfile = orgService.getUserProfileHandler().findUserProfileByName(remoteUser);
            userProfile.getUserInfoMap().put(Constants.USER_SKIN, skin);
            UserProfileHandler hanlder = orgService.getUserProfileHandler();
            hanlder.saveUserProfile(userProfile, true);
         }
      }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.organization.UserProfile

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.