use of org.hisp.dhis.user.UserQueryParams in project dhis2-core by dhis2.
the class FindUserAction method execute.
@Override
public String execute() throws Exception {
updateRecipients(recipientCheckBox);
if (keyword != null) {
int index = keyword.indexOf(' ');
if (index != -1 && index == keyword.lastIndexOf(' ')) {
String[] keys = keyword.split(" ");
keyword = keys[0] + " " + keys[1];
}
}
UserQueryParams params = new UserQueryParams();
params.setQuery(keyword);
users = userService.getUsers(params);
if (users.size() == 1) {
User user = users.iterator().next();
userId = user.getId();
return REDIRECT;
}
foundUsers = users.size();
return SUCCESS;
}
use of org.hisp.dhis.user.UserQueryParams in project dhis2-core by dhis2.
the class GetOrgunitUserListAction method execute.
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@Override
public String execute() throws Exception {
OrganisationUnit organisationUnit = selectionManager.getSelectedOrganisationUnit();
UserQueryParams params = new UserQueryParams();
params.setQuery(key);
params.setOrganisationUnit(organisationUnit);
int count = userService.getUserCount(params);
this.paging = createPaging(count);
params.setFirst(paging.getStartPos());
params.setMax(paging.getPageSize());
users = userService.getUsers(params);
return SUCCESS;
}
Aggregations