Search in sources :

Example 1 with UserQuery

use of com.enonic.xp.security.UserQuery in project xp by enonic.

the class FindUsersHandler method execute.

public PrincipalsResultMapper execute() {
    final ConstraintExpr constraintExpr = QueryParser.parseCostraintExpression(this.query == null ? "" : this.query);
    final List<OrderExpr> orderExpressions = QueryParser.parseOrderExpressions(this.sort == null ? "" : this.sort);
    final QueryExpr queryExpr = QueryExpr.from(constraintExpr, orderExpressions);
    final UserQuery userQuery = UserQuery.create().from(this.start).size(this.count).queryExpr(queryExpr).build();
    final UserQueryResult result = this.securityService.get().query(userQuery);
    return new PrincipalsResultMapper(result.getUsers(), result.getTotalSize(), this.includeProfile);
}
Also used : ConstraintExpr(com.enonic.xp.query.expr.ConstraintExpr) QueryExpr(com.enonic.xp.query.expr.QueryExpr) OrderExpr(com.enonic.xp.query.expr.OrderExpr) UserQuery(com.enonic.xp.security.UserQuery) UserQueryResult(com.enonic.xp.security.UserQueryResult)

Aggregations

ConstraintExpr (com.enonic.xp.query.expr.ConstraintExpr)1 OrderExpr (com.enonic.xp.query.expr.OrderExpr)1 QueryExpr (com.enonic.xp.query.expr.QueryExpr)1 UserQuery (com.enonic.xp.security.UserQuery)1 UserQueryResult (com.enonic.xp.security.UserQueryResult)1