org.exoplatform.services.organization.Query类的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(246)

本文整理了Java中org.exoplatform.services.organization.Query类的一些代码示例,展示了Query类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query类的具体详情如下:
包路径:org.exoplatform.services.organization.Query
类名称:Query

Query介绍

暂无

代码示例

代码示例来源:origin: org.gatein.portal/exo.portal.component.identity

  1. String getQueryKey(Query query, UserStatus userStatus) {
  2. StringBuilder sb = new StringBuilder();
  3. String SEP = ":::";
  4. sb.append(query.getEmail()).append(SEP).append(query.getFirstName()).append(SEP).append(query.getLastName())
  5. .append(SEP).append(query.getUserName()).append(SEP).append(query.getFromLoginDate()).append(SEP)
  6. .append(query.getToLoginDate()).append(SEP).append(userStatus.name()).append(SEP);
  7. return sb.toString();
  8. }
  9. }

代码示例来源:origin: org.exoplatform.portal/exo.portal.webui.eXo

  1. public void search(String keyword, String filter, String groupId) throws Exception
  2. Query q = new Query();
  3. if (keyword != null && (keyword = keyword.trim()).length() != 0)
  4. if (USER_NAME.equals(filter))
  5. q.setUserName(keyword);
  6. q.setLastName(keyword);
  7. q.setFirstName(keyword);
  8. q.setEmail(keyword);

代码示例来源:origin: org.exoplatform.core/exo.core.component.organization.ldap

  1. if (q.getUserName() != null && q.getUserName().length() > 0)
  2. list.add("(" + ldapAttrMapping.userUsernameAttr + "=" + addAsterisks(q.getUserName()) + ")");
  3. if (q.getFirstName() != null && q.getFirstName().length() > 0)
  4. list.add("(" + ldapAttrMapping.userFirstNameAttr + "=" + q.getFirstName() + ")");
  5. if (q.getLastName() != null && q.getLastName().length() > 0)
  6. list.add("(" + ldapAttrMapping.userLastNameAttr + "=" + q.getLastName() + ")");
  7. if (q.getEmail() != null && q.getEmail().length() > 0)
  8. list.add("(" + ldapAttrMapping.userMailAttr + "=" + q.getEmail() + ")");

代码示例来源:origin: exoplatform/platform

  1. query = new Query();
  2. query.setUserName(username);
  3. users = userHandler.findUsersByQuery(query, UserStatus.ANY);
  4. if(users != null && users.getSize() > 0) {
  5. query = new Query();
  6. query.setEmail(email);
  7. users = userHandler.findUsersByQuery(query, UserStatus.ANY);
  8. if(users != null && users.getSize() > 0) {
  9. username = cookie.getValue();
  10. if(username != null && username.length() > 0) {
  11. query = new Query();
  12. query.setUserName(username);
  13. users = userHandler.findUsersByQuery(query, UserStatus.ANY);
  14. if(users != null && users.getSize() > 0) {

代码示例来源:origin: exoplatform/platform

  1. if (!errorFields.contains("emailAddress")) {
  2. try {
  3. Query query = new Query();
  4. query.setEmail(email);
  5. ListAccess<User> users = orgService.getUserHandler().findUsersByQuery(query, UserStatus.ANY);
  6. if (users != null && users.getSize() > 0) {

代码示例来源:origin: org.exoplatform.portal/exo.portal.webui.eXo

  1. public void execute(Event<UIUserSelector> event) throws Exception
  2. {
  3. UIUserSelector uiSelectUserForm = event.getSource();
  4. String groupId = uiSelectUserForm.getSelectedGroup();
  5. OrganizationService service = uiSelectUserForm.getApplicationComponent(OrganizationService.class);
  6. PageList users = PageList.EMPTY_LIST;
  7. if (groupId != null && groupId.trim().length() != 0)
  8. {
  9. if (service.getGroupHandler().findGroupById(groupId) != null)
  10. {
  11. users = uiSelectUserForm.removeDuplicate(service.getUserHandler().findUsersByGroup(groupId));
  12. }
  13. }
  14. else
  15. {
  16. users = service.getUserHandler().findUsers(new Query());
  17. }
  18. users.setPageSize(10);
  19. uiSelectUserForm.uiIterator_.setPageList(users);
  20. uiSelectUserForm.setKeyword(null);
  21. event.getRequestContext().addUIComponentToUpdateByAjax(uiSelectUserForm);
  22. }
  23. }

代码示例来源:origin: org.gatein.portal/exo.portal.component.identity

  1. if (q.getUserName() == null && q.getEmail() != null && q.getFirstName() == null && q.getLastName() == null) {
  2. final User uniqueUser = findUserByUniqueAttribute(USER_EMAIL, q.getEmail(), userStatus);
  3. } else if (!q.getEmail().contains("*")) {
  4. return new ListAccess<User>() {
  5. public User[] load(int index, int length) throws Exception {
  6. if (q.getUserName() != null) {
  7. String username = q.getUserName();
  8. if(!username.startsWith("*")) {
  9. username = "*" + username;
  10. if (q.getEmail() != null) {
  11. qb.attributeValuesFilter(UserDAOImpl.USER_EMAIL, new String[] { q.getEmail() });
  12. if (q.getFirstName() != null) {
  13. qb.attributeValuesFilter(UserDAOImpl.USER_FIRST_NAME, new String[] { q.getFirstName() });
  14. if (q.getLastName() != null) {
  15. qb.attributeValuesFilter(UserDAOImpl.USER_LAST_NAME, new String[] { q.getLastName() });
  16. if (q.getUserName() == null && q.getEmail() == null && q.getFirstName() == null && q.getLastName() == null) {
  17. list = new IDMUserListAccess(qb, 20, !countPaginatedUsers(), userStatus);
  18. } else {

代码示例来源:origin: org.exoplatform.portal/exo.portal.webui.eXo

  1. Query query = new Query();
  2. query.setEmail(getUIStringInput("email").getValue());
  3. if (service.getUserHandler().findUsers(query).getAll().size() > 0)

代码示例来源:origin: org.exoplatform.portal/exo.portal.webui.eXo

  1. public UIUserSelector() throws Exception
  2. {
  3. addUIFormInput(new UIFormStringInput(FIELD_KEYWORD, FIELD_KEYWORD, null));
  4. addUIFormInput(new UIFormSelectBox(FIELD_FILTER, FIELD_FILTER, getFilters()));
  5. addUIFormInput(new UIFormStringInput(FIELD_GROUP, FIELD_GROUP, null));
  6. isShowSearch_ = true;
  7. OrganizationService service = getApplicationComponent(OrganizationService.class);
  8. ObjectPageList objPageList = new ObjectPageList(service.getUserHandler().findUsers(new Query()).getAll(), 10);
  9. uiIterator_ = new UIPageIterator();
  10. uiIterator_.setPageList(objPageList);
  11. uiIterator_.setId("UISelectUserPage");
  12. // create group selector
  13. UIPopupWindow uiPopup = addChild(UIPopupWindow.class, null, "UIPopupGroupSelector");
  14. uiPopup.setWindowSize(540, 0);
  15. UIGroupSelector uiGroup = createUIComponent(UIGroupSelector.class, null, null);
  16. uiPopup.setUIComponent(uiGroup);
  17. uiGroup.setId("GroupSelector");
  18. uiGroup.getChild(UITree.class).setId("TreeGroupSelector");
  19. uiGroup.getChild(UIBreadcumbs.class).setId("BreadcumbsGroupSelector");
  20. }

代码示例来源:origin: org.exoplatform.core/exo.core.component.organization.jdbc

  1. /**
  2. * Query( name = "" , standardSQL = "..." oracleSQL = "..." )
  3. */
  4. public ListAccess<User> findUsersByQuery(Query orgQuery) throws Exception
  5. {
  6. DBObjectQuery<UserImpl> dbQuery = new DBObjectQuery<UserImpl>(UserImpl.class);
  7. if (orgQuery.getUserName() != null)
  8. {
  9. dbQuery.addLIKE("UPPER(USER_NAME)", addAsterisk(orgQuery.getUserName().toUpperCase()));
  10. }
  11. if (orgQuery.getFirstName() != null)
  12. {
  13. dbQuery.addLIKE("UPPER(FIRST_NAME)", orgQuery.getFirstName().toUpperCase());
  14. }
  15. if (orgQuery.getLastName() != null)
  16. {
  17. dbQuery.addLIKE("UPPER(LAST_NAME)", orgQuery.getLastName().toUpperCase());
  18. }
  19. dbQuery.addLIKE("EMAIL", orgQuery.getEmail());
  20. dbQuery.addGT("LAST_LOGIN_TIME", orgQuery.getFromLoginDate());
  21. dbQuery.addLT("LAST_LOGIN_TIME", orgQuery.getToLoginDate());
  22. return new JDBCListAccess<User>(this, dbQuery.toQuery(), dbQuery.toCountQuery());
  23. }

代码示例来源:origin: org.exoplatform.core/exo.core.component.organization.jdbc

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public ListAccess<User> findUsersByQuery(Query q) throws Exception
  5. {
  6. ObjectQuery oq = new ObjectQuery(UserImpl.class);
  7. if (q.getUserName() != null)
  8. {
  9. oq.addLIKE("UPPER(userName)", addAsterisk(q.getUserName().toUpperCase()));
  10. }
  11. if (q.getFirstName() != null)
  12. {
  13. oq.addLIKE("UPPER(firstName)", q.getFirstName().toUpperCase());
  14. }
  15. if (q.getLastName() != null)
  16. {
  17. oq.addLIKE("UPPER(lastName)", q.getLastName().toUpperCase());
  18. }
  19. oq.addLIKE("email", q.getEmail());
  20. oq.addGT("lastLoginTime", q.getFromLoginDate());
  21. oq.addLT("lastLoginTime", q.getToLoginDate());
  22. return new HibernateListAccess<User>(service_, oq.getHibernateQueryWithBinding(),
  23. oq.getHibernateCountQueryWithBinding(), oq.getBindingFields());
  24. }

相关文章