Search in sources :

Example 6 with UserQueryParams

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;
}
Also used : User(org.hisp.dhis.user.User) UserQueryParams(org.hisp.dhis.user.UserQueryParams)

Example 7 with UserQueryParams

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;
}
Also used : OrganisationUnit(org.hisp.dhis.organisationunit.OrganisationUnit) UserQueryParams(org.hisp.dhis.user.UserQueryParams)

Aggregations

UserQueryParams (org.hisp.dhis.user.UserQueryParams)7 User (org.hisp.dhis.user.User)4 Date (java.util.Date)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Objects (org.hisp.dhis.common.Objects)1 Pager (org.hisp.dhis.common.Pager)1 OrganisationUnit (org.hisp.dhis.organisationunit.OrganisationUnit)1 Query (org.hisp.dhis.query.Query)1 IncomingSms (org.hisp.dhis.sms.incoming.IncomingSms)1 SmsMessageStatus (org.hisp.dhis.sms.incoming.SmsMessageStatus)1 UserInvitationStatus (org.hisp.dhis.user.UserInvitationStatus)1 DateTime (org.joda.time.DateTime)1