Skip to content

Commit

Permalink
Merge branch 'docs/cleanup-4.8' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
… into docs/cleanup-4.8
  • Loading branch information
matusmacik committed Mar 13, 2024
2 parents 79e14e8 + 8a4d0bb commit 4a63314
Show file tree
Hide file tree
Showing 3 changed files with 352 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ metadata/createTimestamp > ```
----

The syntax for multi-line expressions is a bit more elaborated, multi-line script
starts with triple backticks (`{triple-backtick}`), followed by new-line.
starts with triple backticks followed by new-line (`{triple-backtick}\n`).
Script body is closed by triple backticks (`{triple-backtick}`). This minimizes
need for escaping most of the quotes or sequences inside the script body.

Expand Down
73 changes: 58 additions & 15 deletions docs/concepts/query/midpoint-query-language/introduction.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ In its simplest form it is a name of object _property_, or names of items and co
=== Filter Name
Item path is followed by filter name or its alias, which specifies which filtering condition should be used.

Following tables summarizes common property filters:

==== Comparison filters

Following tables summarizes common property filters:

[options="header", cols="15,10,30", width=70]
|====
| Name | Alias | Description
Expand Down Expand Up @@ -91,6 +91,8 @@ List of all matching rules is defined in xref:../../matching-rules.adoc[matching

==== String filters

Following table summarizes additional filters that can be applied on string and polystring values.

[options="header", cols="15,40", width=70]
|====
| Name | Description
Expand All @@ -107,9 +109,55 @@ Value is usually a string literal, enclosed in double quotes.
However, value may take various forms.
For example, it may be a path of another item, e.g. in case when the query compares two items.
The value may be also quite complex.
The exact form of the value part of the filter depends on the operator.

Numeric values and QNames does not need double quotes.
The exact form of the value part of the filter depends on the operator and type of the value.

==== Querying values of different types

The exact syntax of queries for values of different types is described in the following table:

[options="header", cols="10,30, 60", width=80]
|====
| Type | Query | Note

| boolean
| `extension/coreMember = true`
| Boolean values do not need quotes. Allowed values are `true` and `false`.

| string
| `emailAddress endsWith "testorg.com"`
| String values are enclosed in quotes (') or double quotes (").

| PolystringType
| `givenName = 'Adam'`
| Values of PolystringType are enclosed in quotes (') or double quotes (").

| int
| `extension/height > 170`
| Number values do not need quotes. Only common property filters (=,>, ..) are defined for number types.

| float
| `extension/perfScore > 1.05`
| Number values do not need quotes. Only common property filters (=,>, ..) are defined for number types.

| dateTime
| `metadata/createTimestamp >= "2024-03-01"`
| DateTime values are enclosed in quotes (') or double quotes ("). It can be compared as dates or date and time - written in format of xref:https://en.wikipedia.org/wiki/ISO_8601[ISO-8601].

|
| `metadata/createTimestamp >= "2024-03-01T15:30:00"`
| While comparing time values. DateTime values entered without timezone are considered to be in the same timezone as running midPoint.

|
| `extension/empStartDate >= "2019-10-01" and extension/empStartDate < "2019-10-02"`
| As datetime values contain exact time value up to milliseconds you need to compare dates as intervals. See examples.

| ObjectReferenceType
| `assignment/targetRef/@/name = "End user"`
| Object references are queries using `matches` filter or dereferencing operator `@`. See <<Advanced filters>> chapter below.
|====



=== Logical Filters

Expand Down Expand Up @@ -137,7 +185,7 @@ There is a usual set of logic operators:
| Any of the subfilters is true.

| `not`
| `givenName not startsWith "J"`
| `givenName not startsWith "J"` +
`givenName != "John"`
| Logical negation. Not prefixes filter name (as seen in example).

Expand Down Expand Up @@ -211,9 +259,9 @@ The second filter with match user who has an assignment which starts in 2022 and
=== Reference Filters

Reference filters allows to match on references themselves using
<<Reference matches filter, matches>> or on properties of referenced objects using <<Dereferencing, dereferencing>>
`matches` filter on properties of referenced objects using dereferencing operator (`@`).

You can also perform inverse search using <<referencedBy filter, referencedBy>> to search
You can also perform inverse queries using `referencedBy` filter to search
for object by properties of it's referencer (e.g. search roles by properties of its members).

==== Reference matches filter
Expand Down Expand Up @@ -256,7 +304,7 @@ IMPORTANT: If you need to match referenced object on multiple properties you sho

==== Dereferencing inside reference matches filter

NOTE: This feature is currently supported in midPoint 4.6 Postgres native repository only
NOTE: This feature is currently supported in midPoint native repository only

If user wants to match on properties of reference itself and also on properties of it's target
it is possible now, using dereferencing inside `reference matches` filter.
Expand Down Expand Up @@ -305,7 +353,7 @@ The short query syntax is:

==== ownedBy Filter

NOTE: Filter is currently supported in midPoint 4.6 Postgres native repository only
NOTE: Filter is currently supported in midPoint native repository only

ownedBy filter allows for matching indexed containers based on properties of their parent (owning object or container).

Expand Down Expand Up @@ -431,9 +479,8 @@ allows us to filter on properties of the target
----

==== All roles, which are assigned using inducement
NOTE: Filter is currently supported in midPoint 4.6 Postgres native repository only
NOTE: Filter is currently supported in midPoint native repository only

// All roles which are assigned using inducement
.midPoint Query
----
. referencedBy (
Expand Down Expand Up @@ -464,7 +511,3 @@ assignment/targetRef/@ matches (
)
----


//=== Query in configuration object

//TODO - tu ako dat query do tasku na recompute vsetkych userov, ktori maju rolu "End user"

0 comments on commit 4a63314

Please sign in to comment.