Package org.exoplatform.services.organization

Examples of org.exoplatform.services.organization.UserProfile


        String user = context.getRemoteUser();
        String portalSkin = null;
        OrganizationService orgService = getApplicationComponent(OrganizationService.class);

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


    @SuppressWarnings("deprecation")
    public void setUserProfile(String user) throws Exception {
        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 boolean save(OrganizationService service, String user, boolean isnewUser) throws Exception {
        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());
            }
        }

        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        UIApplication uiApp = context.getUIApplication();
View Full Code Here

   {
      Session session = service_.openSession();
      try
      {
         UserProfileData upd = (UserProfileData)service_.findExactOne(session, queryFindUserProfileByName, userName);
         UserProfile profile = upd.getUserProfile();
         if (broadcast)
            preDelete(profile);

         session.delete(upd);
         session.flush();
View Full Code Here

   /**
    * {@inheritDoc}
    */
   public UserProfile findUserProfileByName(String userName) throws Exception
   {
      UserProfile up = (UserProfile)cache_.get(userName);
      if (up != null)
      {
         if (NOT_FOUND == up) //NOSONAR
         {
            return null;
View Full Code Here

    UserProfileHandler userProfileHandler = service.getUserProfileHandler();
    if (userProfileHandler==null) {
      SpagoBITracer.warning(SpagoBIConstants.NAME_MODULE, SecurityProviderUtilities.class.getName(),
                        "getUserProfileAttributes", " UserProfileHandler null");
    } else {
      UserProfile exoUserProfile = null;
      try {
        exoUserProfile = userProfileHandler.findUserProfileByName(userUniqueIdentifier);
      } catch (Exception e) {
        SpagoBITracer.critical(SpagoBIConstants.NAME_MODULE, SecurityProviderUtilities.class.getName(),
                        "getUserProfileAttributes", " Error while recovering user profile by name '"
                        + userUniqueIdentifier + "'", e);
        return userAttributes;
      }
      if (exoUserProfile == null){
        SpagoBITracer.critical(SpagoBIConstants.NAME_MODULE, SecurityProviderUtilities.class.getName(),
                                "getUserProfileAttributes", " exoUserProfile not found for user "
                                + userUniqueIdentifier);
        return userAttributes;
      } else {
        Map userInfoMap = exoUserProfile.getUserInfoMap();
        Set infoKeys = userInfoMap.keySet();
        Iterator infoKeyIter = infoKeys.iterator();
        while(infoKeyIter.hasNext()) {
          String labelcode = infoKeyIter.next().toString();
          String value = userInfoMap.get(labelcode) != null ?
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("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

         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("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

   @SuppressWarnings("unused")
   public void onStartRequest(final Application app, final WebuiRequestContext context) throws Exception
   {
     String user = context.getRemoteUser();
     UserProfile userProfile = null;
     if (user != null)
     {
       ExoContainer exoContainer = app.getApplicationServiceContainer();
       if (exoContainer != null)
       {
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.