Examples of findUserProfileByName()


Examples of org.exoplatform.services.organization.UserProfileHandler.findUserProfileByName()

    @SuppressWarnings("deprecation")
    public boolean 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_);
        }
View Full Code Here

Examples of org.exoplatform.services.organization.UserProfileHandler.findUserProfileByName()

                PortalRequestContext portalRequestContext = Util.getPortalRequestContext();

                // Save OAuth username as part of user profile of new user
                OrganizationService orgService = uiRegisterForm.getApplicationComponent(OrganizationService.class);
                UserProfileHandler profileHandler = orgService.getUserProfileHandler();
                UserProfile newUserProfile = profileHandler.findUserProfileByName(newUser.getUserName());

                AuthenticationRegistry authRegistry = uiRegisterForm.getApplicationComponent(AuthenticationRegistry.class);
                HttpServletRequest httpRequest = portalRequestContext.getRequest();
                OAuthPrincipal oauthPrincipal = (OAuthPrincipal)authRegistry.getAttributeOfClient(httpRequest, OAuthConstants.ATTRIBUTE_AUTHENTICATED_OAUTH_PRINCIPAL);
View Full Code Here

Examples of org.exoplatform.services.organization.UserProfileHandler.findUserProfileByName()

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

            OAuthProviderProcessor<T> oauthProviderProcessor = oauthProviderType.getOauthProviderProcessor();
View Full Code Here

Examples of org.exoplatform.services.organization.UserProfileHandler.findUserProfileByName()

    @Override
    public <T extends AccessTokenContext> T getOAuthAccessToken(OAuthProviderType<T> oauthProviderType, String username) {
        try {
            UserProfileHandler userProfileHandler = orgService.getUserProfileHandler();
            UserProfile userProfile = userProfileHandler.findUserProfileByName(username);
            if(userProfile == null) {
                //If use have not profile, he also have not OauthAccessToken
                return null;
            }
View Full Code Here

Examples of org.exoplatform.services.organization.UserProfileHandler.findUserProfileByName()

    @Override
    public <T extends AccessTokenContext> void removeOAuthAccessToken(OAuthProviderType<T> oauthProviderType, String username) {
        try {
            UserProfileHandler userProfileHandler = orgService.getUserProfileHandler();
            UserProfile userProfile = userProfileHandler.findUserProfileByName(username);
            if(userProfile == null) {
                //Don't need to remove OauthAccessToken if user-profile does not exists
                return;
            }
View Full Code Here

Examples of org.exoplatform.services.organization.UserProfileHandler.findUserProfileByName()

    @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);
            if(userProfile == null) {
                userProfile = userProfileHandler.createUserProfileInstance(username);
            }

            userProfile.setAttribute(oauthProviderType.getUserNameAttrName(), oauthUsername);
View Full Code Here

Examples of org.exoplatform.services.organization.UserProfileHandler.findUserProfileByName()

            }
            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;
View Full Code Here

Examples of org.exoplatform.services.organization.UserProfileHandler.findUserProfileByName()

   @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_);
View Full Code Here

Examples of org.exoplatform.services.organization.UserProfileHandler.findUserProfileByName()

         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;
View Full Code Here

Examples of org.exoplatform.services.organization.UserProfileHandler.findUserProfileByName()

                PortalRequestContext portalRequestContext = Util.getPortalRequestContext();

                // Save OAuth username as part of user profile of new user
                OrganizationService orgService = uiRegisterForm.getApplicationComponent(OrganizationService.class);
                UserProfileHandler profileHandler = orgService.getUserProfileHandler();
                UserProfile newUserProfile = profileHandler.findUserProfileByName(newUser.getUserName());

                AuthenticationRegistry authRegistry = uiRegisterForm.getApplicationComponent(AuthenticationRegistry.class);
                HttpServletRequest httpRequest = portalRequestContext.getRequest();
                OAuthPrincipal oauthPrincipal = (OAuthPrincipal)authRegistry.getAttributeOfClient(httpRequest, OAuthConstants.ATTRIBUTE_AUTHENTICATED_OAUTH_PRINCIPAL);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.