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

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

本文整理了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

String getQueryKey(Query query, UserStatus userStatus) {
    StringBuilder sb = new StringBuilder();
    String SEP = ":::";

    sb.append(query.getEmail()).append(SEP).append(query.getFirstName()).append(SEP).append(query.getLastName())
        .append(SEP).append(query.getUserName()).append(SEP).append(query.getFromLoginDate()).append(SEP)
        .append(query.getToLoginDate()).append(SEP).append(userStatus.name()).append(SEP);

    return sb.toString();
  }
}

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

public void search(String keyword, String filter, String groupId) throws Exception
 Query q = new Query();
 if (keyword != null && (keyword = keyword.trim()).length() != 0)
   if (USER_NAME.equals(filter))
    q.setUserName(keyword);
    q.setLastName(keyword);
    q.setFirstName(keyword);
    q.setEmail(keyword);

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

if (q.getUserName() != null && q.getUserName().length() > 0)
  list.add("(" + ldapAttrMapping.userUsernameAttr + "=" + addAsterisks(q.getUserName()) + ")");
if (q.getFirstName() != null && q.getFirstName().length() > 0)
  list.add("(" + ldapAttrMapping.userFirstNameAttr + "=" + q.getFirstName() + ")");
if (q.getLastName() != null && q.getLastName().length() > 0)
  list.add("(" + ldapAttrMapping.userLastNameAttr + "=" + q.getLastName() + ")");
if (q.getEmail() != null && q.getEmail().length() > 0)
  list.add("(" + ldapAttrMapping.userMailAttr + "=" + q.getEmail() + ")");

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

query = new Query();
query.setUserName(username);
users = userHandler.findUsersByQuery(query, UserStatus.ANY);
if(users != null && users.getSize() > 0) {
query = new Query();
query.setEmail(email);
users = userHandler.findUsersByQuery(query, UserStatus.ANY);
if(users != null && users.getSize() > 0) {
  username = cookie.getValue();
  if(username != null && username.length() > 0) {
   query = new Query();
   query.setUserName(username);
   users = userHandler.findUsersByQuery(query, UserStatus.ANY);
   if(users != null && users.getSize() > 0) {

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

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

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

public void execute(Event<UIUserSelector> event) throws Exception
 {
   UIUserSelector uiSelectUserForm = event.getSource();
   String groupId = uiSelectUserForm.getSelectedGroup();
   OrganizationService service = uiSelectUserForm.getApplicationComponent(OrganizationService.class);
   PageList users = PageList.EMPTY_LIST;
   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);
 }
}

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

if (q.getUserName() == null && q.getEmail() != null && q.getFirstName() == null && q.getLastName() == null) {
  final User uniqueUser = findUserByUniqueAttribute(USER_EMAIL, q.getEmail(), userStatus);
  } else if (!q.getEmail().contains("*")) {
    return new ListAccess<User>() {
      public User[] load(int index, int length) throws Exception {
if (q.getUserName() != null) {
  String username = q.getUserName();
  if(!username.startsWith("*")) {
    username = "*" + username;
if (q.getEmail() != null) {
  qb.attributeValuesFilter(UserDAOImpl.USER_EMAIL, new String[] { q.getEmail() });
if (q.getFirstName() != null) {
  qb.attributeValuesFilter(UserDAOImpl.USER_FIRST_NAME, new String[] { q.getFirstName() });
if (q.getLastName() != null) {
  qb.attributeValuesFilter(UserDAOImpl.USER_LAST_NAME, new String[] { q.getLastName() });
if (q.getUserName() == null && q.getEmail() == null && q.getFirstName() == null && q.getLastName() == null) {
  list = new IDMUserListAccess(qb, 20, !countPaginatedUsers(), userStatus);
} else {

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

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

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

public UIUserSelector() throws Exception
{
 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
 UIPopupWindow uiPopup = addChild(UIPopupWindow.class, null, "UIPopupGroupSelector");
 uiPopup.setWindowSize(540, 0);
 UIGroupSelector uiGroup = createUIComponent(UIGroupSelector.class, null, null);
 uiPopup.setUIComponent(uiGroup);
 uiGroup.setId("GroupSelector");
 uiGroup.getChild(UITree.class).setId("TreeGroupSelector");
 uiGroup.getChild(UIBreadcumbs.class).setId("BreadcumbsGroupSelector");
}

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

/**
* Query( name = "" , standardSQL = "..." oracleSQL = "..." )
*/
public ListAccess<User> findUsersByQuery(Query orgQuery) throws Exception
{
 DBObjectQuery<UserImpl> dbQuery = new DBObjectQuery<UserImpl>(UserImpl.class);
 if (orgQuery.getUserName() != null)
 {
   dbQuery.addLIKE("UPPER(USER_NAME)", addAsterisk(orgQuery.getUserName().toUpperCase()));
 }
 if (orgQuery.getFirstName() != null)
 {
   dbQuery.addLIKE("UPPER(FIRST_NAME)", orgQuery.getFirstName().toUpperCase());
 }
 if (orgQuery.getLastName() != null)
 {
   dbQuery.addLIKE("UPPER(LAST_NAME)", orgQuery.getLastName().toUpperCase());
 }
 dbQuery.addLIKE("EMAIL", orgQuery.getEmail());
 dbQuery.addGT("LAST_LOGIN_TIME", orgQuery.getFromLoginDate());
 dbQuery.addLT("LAST_LOGIN_TIME", orgQuery.getToLoginDate());
 return new JDBCListAccess<User>(this, dbQuery.toQuery(), dbQuery.toCountQuery());
}

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

/**
* {@inheritDoc}
*/
public ListAccess<User> findUsersByQuery(Query q) throws Exception
{
 ObjectQuery oq = new ObjectQuery(UserImpl.class);
 if (q.getUserName() != null)
 {
   oq.addLIKE("UPPER(userName)", addAsterisk(q.getUserName().toUpperCase()));
 }
 if (q.getFirstName() != null)
 {
   oq.addLIKE("UPPER(firstName)", q.getFirstName().toUpperCase());
 }
 if (q.getLastName() != null)
 {
   oq.addLIKE("UPPER(lastName)", q.getLastName().toUpperCase());
 }
 oq.addLIKE("email", q.getEmail());
 oq.addGT("lastLoginTime", q.getFromLoginDate());
 oq.addLT("lastLoginTime", q.getToLoginDate());
 return new HibernateListAccess<User>(service_, oq.getHibernateQueryWithBinding(),
   oq.getHibernateCountQueryWithBinding(), oq.getBindingFields());
}

相关文章