@DTO public class UESRoleSearchQuery extends UESPagingCriteria
The search criteria specifies which roles to search for, whether to include system area in the search and how to return the result set (ordering and paging).
The query
attribute specifies which roles to search for as well
as ordering settings. Syntax rules are same as in case of other paging
commands. See UESQuery Documentation.
Some examples of queries are:
name~'director'
code='UNI%' AND name~'director' ORDER BY name DESC, code
(code='UNI%' AND name~'director') OR name='Universe manager'
code='UNI%' AND name~'director' AND stateType='active'
As can be seen, query looks a bit like SQL query. Fields that can be used for narrowing down the search are "name" (representing role name), "code" (representing role code) and stateType (representing role state). The query is not case-insensitive, exception being the value for "code" field which is case-sensitive.
The conditions (e.g. code='UNI%'
) can use "=" sign or "~" sign.
"=" sign is the same as SQL's LIKE operator. This also means that characters "%" and "_" are considered as wild-card characters. If it's necessary to find role containing such a character, add backslash before these characters.
"~" sign is used for fulltext queries which are described below. See also chapter "Restrictions".
Values must be enclosed in single quotes. If a single quote or a backslash is present in the value, it must be escaped by a backslash character.
Value used in the condition with "~" sign can contain words, phrases and word prefixes. Roles that will be found must contain all given terms, in any order, case-insensitively.
Phrases must be enclosed into double quotes. A term is considered as a word prefix, if it ends with '%' character.
name~'role\'s director%'
- finds "role's directors",
"A Director of Role's", ...
name~'The "James Bond"'
Note that characters '%' and '"' are considered special, so if they're required to be a part of a word, they must be escaped by using backslash character.
The query contains also information about ordering which is given in a SQL-like syntax (see example #2 at the beginning of the chapter). If ordering settings are not given, default order will be used (first by name ascending, then by code ascending).
The query gramatics is like this:
Paging settings (pageIndex
, pageSize
) specify how
many results to return and from which page to start (0-based). If maximum
number of results is not given, the command will return maximum number of
artifacts according to the system settings.
Modifier and Type | Field and Description |
---|---|
private java.lang.Boolean |
includeSystemArea
Whether to include system area in the search.
|
private java.lang.String |
query
The query for searching.
|
private java.lang.Boolean |
recursive
Whether to search recursively (including subordinate organizational units).
|
Modifier | Constructor and Description |
---|---|
protected |
UESRoleSearchQuery()
Creates a new instance of UESRoleSearchCriteria.
|
|
UESRoleSearchQuery(java.lang.String aQuery,
Creates a new instance of UESRoleSearchCriteria.
|
|
UESRoleSearchQuery(java.lang.String aQuery,
Creates a new instance of UESRoleSearchCriteria.
|
getPageIndex, getPageSize, setPageIndex, setPageSize
Optional query parameters are:
stateType
- represents role state.aQuery
- The query for searching.aIncludeSystemArea
- Whether to include system area in the search.
Defaults to false.aPageIndex
- Index of page to return (0-based). Defaults to 0.aPageSize
- The size of a page (number of result items to return).
Defaults to system maximum.aQuery
- The query for searching.aIncludeSystemArea
- Whether to include system area in the search.
Defaults to false.aRecursive
- Whether to search recursively (in the whole territory /
in the whole organizational unit including subordinate OUs).
Defaults to true.aPageIndex
- Index of page to return (0-based). Defaults to 0.aPageSize
- The size of a page (number of result items to return).
Defaults to system maximum.