Package org.exoplatform.services.organization

Examples of org.exoplatform.services.organization.User


        } catch (IdentityException e) {
            handleException("Cannot find user by email: " + email + "; ", e);

        }

        User user = null;

        if (plUser != null) {
            user = new UserImpl(plUser.getId());
            populateUser(user, session);
View Full Code Here


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

        User user = new UserImpl(userName);

        populateUser(user, session);

        return user;
View Full Code Here

    }

    public void save(OrganizationService service, boolean broadcast) throws Exception {
        GroupHandler groupHandler = service.getGroupHandler();
        MembershipTypeHandler mtHandler = service.getMembershipTypeHandler();
        User user = service.getUserHandler().findUserByName(user_);
        for (Membership membership : membership_) {
            if (user == null)
                user = service.getUserHandler().findUserByName(membership.getUserName());
            Group group = groupHandler.findGroupById(membership.getGroupId());
            MembershipType mt = mtHandler.findMembershipType(membership.getMembershipType());
View Full Code Here

            String id = event.getRequestContext().getRequestParameter(OBJECTID);
            UIPageIterator pageIterator = uiUserMembershipSelector.getChild(UIGrid.class).getUIPageIterator();
            int currentPage = pageIterator.getCurrentPage();
            OrganizationService service = uiUserMembershipSelector.getApplicationComponent(OrganizationService.class);
            service.getMembershipHandler().removeMembership(id, true);
            User user = service.getUserHandler().findUserByName(uiUserMembershipSelector.getUser());
            uiUserMembershipSelector.setUser(user);
            while (currentPage > pageIterator.getAvailablePage())
                currentPage--;
            pageIterator.setCurrentPage(currentPage);
        }
View Full Code Here

    @SuppressWarnings("unchecked")
    public List<User> getData() throws Exception {
        if (getMulti()) {
            for (Object obj : uiIterator_.getCurrentPageData()) {
                User user = (User) obj;
                UIFormCheckBoxInput<Boolean> uiFormCheckBoxInput = getUIFormCheckBoxInput(user.getUserName());
                if (uiFormCheckBoxInput == null) {
                    uiFormCheckBoxInput = new UIFormCheckBoxInput<Boolean>(user.getUserName(), user.getUserName(), false);
                    addUIFormInput(uiFormCheckBoxInput);
                }

                uiFormCheckBoxInput.setChecked(uiIterator_.isSelectedItem(user.getUserName()));
            }
        }
        return new ArrayList<User>(uiIterator_.getCurrentPageData());
    }
View Full Code Here

        getUIStringInput(FIELD_KEYWORD).setValue(value);
    }

    private void setSelectedItem() throws Exception {
        for (Object o : this.uiIterator_.getCurrentPageData()) {
            User u = (User) o;
            UIFormCheckBoxInput input = this.getUIFormCheckBoxInput(u.getUserName());
            if (input != null) {
                this.uiIterator_.setSelectedItem(u.getUserName(), input.isChecked());
            }
        }
    }
View Full Code Here

            uiApp.addMessage(new ApplicationMessage("UIAccountForm.msg.password-is-not-match", null, ApplicationMessage.ERROR));
            return false;
        }
        String username = getUIStringInput(USERNAME).getValue();
        if (newUser) {
            User user = service.getUserHandler().createUserInstance(username);
            invokeSetBindingField(user);
            // user.setPassword(Util.encodeMD5(pass1x)) ;
            if (service.getUserHandler().findUserByName(user.getUserName()) != null) {
                Object[] args = { user.getUserName() };
                uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.user-exist", args, ApplicationMessage.ERROR));
                return false;
            }

            Query query = new Query();
            query.setEmail(getUIStringInput("email").getValue());
            if (service.getUserHandler().findUsers(query).getAll().size() > 0) {
                Object[] args = { user.getUserName() };
                uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.email-exist", args, ApplicationMessage.ERROR));
                return false;
            }

            service.getUserHandler().createUser(user, true);
            reset();
            return true;
        }
        User user = service.getUserHandler().findUserByName(username);
        invokeSetBindingField(user);
        // user.setPassword(Util.encodeMD5(pass1x)) ;
        service.getUserHandler().saveUser(user, true);
        return true;
    }
View Full Code Here

   /**
    * {@inheritDoc}
    */
   public User findUserByName(String userName) throws Exception
   {
      User user = (User)userCache.get(userName);
      if (user != null)
         return user;

      user = userHandler.findUserByName(userName);
      if (user != null)
View Full Code Here

   /**
    * {@inheritDoc}
    */
   public User removeUser(String userName, boolean broadcast) throws Exception
   {
      User user = userHandler.removeUser(userName, broadcast);
      if (user != null)
      {
         userCache.remove(userName);
         userProfileCache.remove(userName);

View Full Code Here

      public UserHandlerImpl()
      {

         users = new LazyListImpl();

         User usr = new UserImpl("exo");
         usr.setPassword("exo");
         users.add(usr);

         usr = new UserImpl("admin");
         usr.setPassword("admin");
         users.add(usr);

         // TODO for what?
         usr = new UserImpl("weblogic");
         usr.setPassword("11111111");
         users.add(usr);

         usr = new UserImpl("__anonim");
         users.add(usr);

         // webos users
         usr = new UserImpl("root");
         usr.setPassword("exo");
         users.add(usr);

         usr = new UserImpl("john");
         usr.setPassword("exo");
         users.add(usr);

         usr = new UserImpl("james");
         usr.setPassword("exo");
         users.add(usr);

         usr = new UserImpl("mary");
         usr.setPassword("exo");
         users.add(usr);

         usr = new UserImpl("marry");
         usr.setPassword("exo");
         users.add(usr);

         usr = new UserImpl("demo");
         usr.setPassword("exo");
         users.add(usr);
      }
View Full Code Here

TOP

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

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.