Package org.exoplatform.services.organization

Examples of org.exoplatform.services.organization.UserProfile


        if (foundUser == null) {
            return null;
        }

        UserProfile up = getProfile(userName);

        //
        if (up == null) {
            up = NOT_FOUND;
        }
View Full Code Here


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

        UserProfile profile = new UserProfileImpl(userName, filteredAttrs);

        return profile;

    }
View Full Code Here

    @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

    @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

    @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

    @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);

            OAuthProviderProcessor<T> oauthProviderProcessor = oauthProviderType.getOauthProviderProcessor();
            oauthProviderProcessor.saveAccessTokenAttributesToUserProfile(userProfile, this, accessToken);
            userProfileHandler.saveUserProfile(userProfile, true);
        } catch (OAuthException oauthEx) {
View Full Code Here

         {
            try
            {
               // NameNotFoundException here if profile does not exists
               Attributes attrs = ctx.getAttributes(profileDN);
               UserProfile profile = ldapAttrMapping.attributesToProfile(attrs).getUserProfile();
               if (broadcast)
                  preDelete(profile);

               ctx.destroySubcontext(profileDN);
              
View Full Code Here

            throw new InvalidNameException("User " + username + " not exists");
        }

        boolean isNew = true;
        if (broadcast) {
            UserProfile found = getProfile(profile.getUserName());
            isNew = found == null;
        }

        if (broadcast) {
            preSave(profile, isNew);
View Full Code Here

        }

    }

    public UserProfile removeUserProfile(String userName, boolean broadcast) throws Exception {
        UserProfile profile = getProfile(userName);

        if (profile != null) {
            try {
                if (broadcast) {
                    preDelete(profile);
View Full Code Here

        if (foundUser == null) {
            return null;
        }

        UserProfile up = getProfile(userName);

        //
        if (up == null) {
            up = NOT_FOUND;
        }
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.