Package org.exoplatform.services.organization

Examples of org.exoplatform.services.organization.Query


         uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.user-exist", args));
         return false;
      }

      //Check if mail address is already used
      Query query = new Query();
      query.setEmail(getEmail());
      if (userHandler.findUsers(query).getAll().size() > 0)
      {
         Object[] args = {username};
         uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.email-exist", args));
         return false;
View Full Code Here


   static public class NewAccountAddedActionListener extends EventListener<UIOrganizationPortlet>
   {
      public void execute(Event<UIOrganizationPortlet> event) throws Exception
      {
         UIListUsers uiListUsers = event.getSource().findFirstComponentOfType(UIListUsers.class);
         uiListUsers.search(new Query());
      }
View Full Code Here

      super(OPTIONS_);
      grid_ = addChild(UIGrid.class, null, "UIListUsersGird");
      grid_.configure(USER_NAME, USER_BEAN_FIELD, USER_ACTION);
      grid_.getUIPageIterator().setId("UIListUsersIterator");
      grid_.getUIPageIterator().setParent(this);
      search(new Query());
   }
View Full Code Here

   @Override
   public void processRender(WebuiRequestContext context) throws Exception
   {
      int curPage = grid_.getUIPageIterator().getCurrentPage();
      if (lastQuery_ == null)
         lastQuery_ = new Query();
      search(lastQuery_);
      grid_.getUIPageIterator().setCurrentPage(curPage);
      grid_.getUIPageIterator().getCurrentPageData();
      super.processRender(context);
   }
View Full Code Here

      }
   }

   public void quickSearch(UIFormInputSet quickSearchInput) throws Exception
   {
      Query query = new Query();
      UIFormStringInput input = (UIFormStringInput)quickSearchInput.getChild(0);
      UIFormSelectBox select = (UIFormSelectBox)quickSearchInput.getChild(1);
      String name = input.getValue();
      if (name == null || name.equals(""))
      {
         search(new Query());
         return;
      }
      if (name.indexOf("*") < 0)
      {
         if (name.charAt(0) != '*')
            name = "*" + name;
         if (name.charAt(name.length() - 1) != '*')
            name += "*";
      }
      name = name.replace('?', '_');
      String selectBoxValue = select.getValue();
      if (selectBoxValue.equals(USER_NAME))
         query.setUserName(name);
      if (selectBoxValue.equals(LAST_NAME))
         query.setLastName(name);
      if (selectBoxValue.equals(FIRST_NAME))
         query.setFirstName(name);
      if (selectBoxValue.equals(EMAIL))
         query.setEmail(name);
      search(query);
   }
View Full Code Here

         String username = event.getRequestContext().getRequestParameter(OBJECTID);
         UIListUsers uiListUsers = event.getSource();
         OrganizationService service = uiListUsers.getApplicationComponent(OrganizationService.class);
         if (service.getUserHandler().findUserByName(username) == null)
         {
            uiListUsers.search(new Query());
            return;
         }
         uiListUsers.setRendered(false);
         UIUserManagement uiUserManager = uiListUsers.getParent();
         UIUserInfo uiUserInfo = uiUserManager.getChild(UIUserInfo.class);
View Full Code Here

        addUIFormInput(new UIFormStringInput(FIELD_KEYWORD, FIELD_KEYWORD, null));
        addUIFormInput(new UIFormSelectBox(FIELD_FILTER, FIELD_FILTER, getFilters()));
        addUIFormInput(new UIFormStringInput(FIELD_GROUP, FIELD_GROUP, null));
        isShowSearch_ = true;
        OrganizationService service = getApplicationComponent(OrganizationService.class);
        ObjectPageList objPageList = new ObjectPageList(service.getUserHandler().findUsers(new Query()).getAll(), 10);
        uiIterator_ = new UIPageIterator();
        uiIterator_.setPageList(objPageList);
        uiIterator_.setId("UISelectUserPage");

        // create group selector
View Full Code Here

        this.isShowSearchUser = isShowSearchUser;
    }

    public void search(String keyword, String filter, String groupId) throws Exception {
        OrganizationService service = getApplicationComponent(OrganizationService.class);
        Query q = new Query();
        if (keyword != null && (keyword = keyword.trim()).length() != 0) {
            if (keyword.indexOf("*") < 0) {
                if (keyword.charAt(0) != '*')
                    keyword = "*" + keyword;
                if (keyword.charAt(keyword.length() - 1) != '*')
                    keyword += "*";
            }
            keyword = keyword.replace('?', '_');
            if (USER_NAME.equals(filter)) {
                q.setUserName(keyword);
            }
            if (LAST_NAME.equals(filter)) {
                q.setLastName(keyword);
            }
            if (FIRST_NAME.equals(filter)) {
                q.setFirstName(keyword);
            }
            if (EMAIL.equals(filter)) {
                q.setEmail(keyword);
            }
        }
        List results = new CopyOnWriteArrayList();
        results.addAll(service.getUserHandler().findUsers(q).getAll());
        // remove if user doesn't exist in selected group
View Full Code Here

            if (groupId != null && groupId.trim().length() != 0) {
                if (service.getGroupHandler().findGroupById(groupId) != null) {
                    users = uiSelectUserForm.removeDuplicate(service.getUserHandler().findUsersByGroup(groupId));
                }
            } else {
                users = service.getUserHandler().findUsers(new Query());
            }
            users.setPageSize(10);
            uiSelectUserForm.uiIterator_.setPageList(users);
            uiSelectUserForm.setKeyword(null);
            event.getRequestContext().addUIComponentToUpdateByAjax(uiSelectUserForm);
View Full Code Here

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

TOP

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

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.