Package org.exoplatform.services.organization

Examples of org.exoplatform.services.organization.UserProfileHandler


    }

    @Override
    public <T extends AccessTokenContext> T getOAuthAccessToken(OAuthProviderType<T> oauthProviderType, String username) {
        try {
            UserProfileHandler userProfileHandler = orgService.getUserProfileHandler();
            UserProfile userProfile = userProfileHandler.findUserProfileByName(username);

            OAuthProviderProcessor<T> oauthProviderProcessor = oauthProviderType.getOauthProviderProcessor();
            return oauthProviderProcessor.getAccessTokenFromUserProfile(userProfile, this);
        } catch (Exception e) {
            throw new OAuthException(OAuthExceptionCode.PERSISTENCE_ERROR, e);
View Full Code Here


    }

    @Override
    public <T extends AccessTokenContext> void removeOAuthAccessToken(OAuthProviderType<T> oauthProviderType, String username) {
        try {
            UserProfileHandler userProfileHandler = orgService.getUserProfileHandler();
            UserProfile userProfile = userProfileHandler.findUserProfileByName(username);

            OAuthProviderProcessor<T> oauthProviderProcessor = oauthProviderType.getOauthProviderProcessor();
            oauthProviderProcessor.removeAccessTokenFromUserProfile(userProfile);

            userProfileHandler.saveUserProfile(userProfile, true);
        } catch (Exception e) {
            throw new OAuthException(OAuthExceptionCode.PERSISTENCE_ERROR, e);
        }
    }
View Full Code Here

    }

    @Override
    public <T extends AccessTokenContext> void updateOAuthInfo(OAuthProviderType<T> oauthProviderType, String username, String oauthUsername, T accessToken) {
        try {
            UserProfileHandler userProfileHandler = orgService.getUserProfileHandler();
            UserProfile userProfile = userProfileHandler.findUserProfileByName(username);

            userProfile.setAttribute(oauthProviderType.getUserNameAttrName(), oauthUsername);

            OAuthProviderProcessor<T> oauthProviderProcessor = oauthProviderType.getOauthProviderProcessor();
            oauthProviderProcessor.saveAccessTokenAttributesToUserProfile(userProfile, this, accessToken);
            userProfileHandler.saveUserProfile(userProfile, true);
        } catch (OAuthException oauthEx) {
            throw oauthEx;
        } catch (Exception e) {
            throw new OAuthException(OAuthExceptionCode.PERSISTENCE_ERROR, e);
        }
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);

      Object[] args = {"UserProfile", user_};
      WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
      UIApplication uiApp = context.getUIApplication();
      if (isnewUser)
View Full Code Here

TOP

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

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.