Examples of UserHandler


Examples of org.exoplatform.services.organization.UserHandler

         // Invalidate the captcha image
         PortalRequestContext prContext = Util.getPortalRequestContext();
         UIRegisterForm registerForm = event.getSource();
         OrganizationService orgService = registerForm.getApplicationComponent(OrganizationService.class);
         UserHandler userHandler = orgService.getUserHandler();
         WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
         UIRegisterInputSet registerInput = registerForm.getChild(UIRegisterInputSet.class);

         if (registerInput.save(userHandler, context))
         {
View Full Code Here

Examples of org.exoplatform.services.organization.UserHandler

         }
      }

      private boolean usernameIsUsed(String username, OrganizationService orgService)
      {
         UserHandler userHandler = orgService.getUserHandler();
         try
         {
            if (userHandler.findUserByName(username) != null)
            {
               return true;
            }
         }
         catch (Exception ex)
View Full Code Here

Examples of org.exoplatform.services.organization.UserHandler

    public static class SubscribeActionListener extends EventListener<UIRegisterForm> {
        @Override
        public void execute(Event<UIRegisterForm> event) throws Exception {
            UIRegisterForm registerForm = event.getSource();
            OrganizationService orgService = registerForm.getApplicationComponent(OrganizationService.class);
            UserHandler userHandler = orgService.getUserHandler();
            WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
            UIRegisterInputSet registerInput = registerForm.getChild(UIRegisterInputSet.class);

            if (registerInput.save(userHandler, context)) {
                // TODO: Add Account Activating feature
View Full Code Here

Examples of org.exoplatform.services.organization.UserHandler

                        ApplicationMessage.INFO));
            }
        }

        private boolean usernameIsUsed(String username, OrganizationService orgService) {
            UserHandler userHandler = orgService.getUserHandler();
            try {
                if (userHandler.findUserByName(username) != null) {
                    return true;
                }
            } catch (Exception ex) {
                log.error(ex.getMessage(), ex);
            }
View Full Code Here

Examples of org.exoplatform.services.organization.UserHandler

        this.codec = codecInitializer.getCodec();
    }

    @Override
    public User findUserByOAuthProviderUsername(OAuthProviderType oauthProviderType, String oauthProviderUsername) {
        UserHandler userHandler = orgService.getUserHandler();

        // TODO: Ugly, but it's used due to OrganizationService API limitations because it doesn't allow to find user by unique userProfile attribute
        try {
            Method m = userHandler.getClass().getDeclaredMethod("findUserByUniqueAttribute", String.class, String.class, UserStatus.class);
            return (User)m.invoke(userHandler, oauthProviderType.getUserNameAttrName(), oauthProviderUsername, UserStatus.ANY);
        } catch (NoSuchMethodException e) {
            String error = "Method findUserByUniqueAttribute(String, String, boolean) is not available on userHandler object " + userHandler +
                    "of class " + userHandler.getClass();
            log.error(error);
            throw new OAuthException(OAuthExceptionCode.PERSISTENCE_ERROR, error, e);
        } catch (Exception e) {
            throw new OAuthException(OAuthExceptionCode.PERSISTENCE_ERROR, e);
        }
View Full Code Here

Examples of org.exoplatform.services.organization.UserHandler

    public void saveUserProfile(UserProfile profile, boolean broadcast) throws Exception {
        // We need to check if userProfile exists, because organization API is limited and it doesn't have separate methods for
        // "creation" and for "update" of user profile :/

        String username = profile.getUserName();
        UserHandler userHandler = this.orgService.getUserHandler();
        //This is temporary because disabled user feature is not implemented
        //userHandler.findUserByName(username, true)
        User user = userHandler.findUserByName(username);
        if(user == null) {
            throw new InvalidNameException("User " + username + " not exists");
        }

        boolean isNew = true;
View Full Code Here

Examples of org.exoplatform.services.organization.UserHandler

    }

    public Collection findUserProfiles() throws Exception {
        List<UserProfile> profiles = new LinkedList<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

Examples of org.exoplatform.services.organization.UserHandler

        }

        private MembershipUser toMembershipUser(Membership membership) throws Exception {
            OrganizationService service = getApplicationComponent(OrganizationService.class);
            String userName = membership.getUserName();
            UserHandler handler = service.getUserHandler();
            User user = handler.findUserByName(userName);
            if (user == null)
                return null;
            return new MembershipUser(user, membership.getMembershipType(), membership.getId());
        }
View Full Code Here

Examples of org.exoplatform.services.organization.UserHandler

    public static class SubscribeActionListener extends EventListener<UIRegisterForm> {
        @Override
        public void execute(Event<UIRegisterForm> event) throws Exception {
            UIRegisterForm registerForm = event.getSource();
            OrganizationService orgService = registerForm.getApplicationComponent(OrganizationService.class);
            UserHandler userHandler = orgService.getUserHandler();
            WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
            UIRegisterInputSet registerInput = registerForm.getChild(UIRegisterInputSet.class);

            if (registerInput.save(userHandler, context)) {
                // TODO: Add Account Activating feature
View Full Code Here

Examples of org.exoplatform.services.organization.UserHandler

                        ApplicationMessage.INFO));
            }
        }

        private boolean usernameIsUsed(String username, OrganizationService orgService) {
            UserHandler userHandler = orgService.getUserHandler();
            try {
                if (userHandler.findUserByName(username) != null) {
                    return true;
                }
            } catch (Exception ex) {
                log.error(ex.getMessage(), ex);
            }
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.