Skip to content

Commit

Permalink
Merge branch 'docs/cleanup-4.8' of github.com:Evolveum/midpoint into …
Browse files Browse the repository at this point in the history
…docs/cleanup-4.8
  • Loading branch information
dejavix committed Jan 10, 2024
2 parents e8bbab0 + 733eb0e commit f6c11cb
Show file tree
Hide file tree
Showing 12 changed files with 2,689 additions and 2,510 deletions.
2,459 changes: 15 additions & 2,444 deletions docs/concepts/query/index.adoc

Large diffs are not rendered by default.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 7 additions & 6 deletions docs/concepts/query/midpoint-query-language/errors/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The {http://midpoint.evolveum.com/xml/ns/public/common/common-3} is the namespac
| Find user with name "adam"

| Query
| namex = "adam"
| `namex = "adam"`

| Error message
| Path *namex* is not present in type {http://midpoint.evolveum.com/xml/ns/public/common/common-3} *UserType*
Expand All @@ -45,10 +45,11 @@ The {http://midpoint.evolveum.com/xml/ns/public/common/common-3} is the namespac
| In this case the reason for error was typo: _namex_ vs _name_

| Correct query
| name = "adam"
| `name = "adam"`

| Troubleshooting hints
a| * Verify, that the attribute is present in the object type you are searching. You can check it at xref:../searchable-items.adoc[searchable items] page.
* Attribute _name_ differs from name that is displayed in GUI (the _displayName_). Search is using name of the attribute. The translation between _name_ and _displayName_ (english) is described at xref:../searchable-items.adoc[searchable items] page.
* Verify, that you don't have typo (e.g. case mismatch) in the name of the property
* Verify, that the view is displaying the object type you want to search. You can see its name at the end of the error message.
|====
Expand All @@ -63,7 +64,7 @@ image:err-definition-is-not-property.png[Error definition is not property]
| Find all users with assigned role "System user".

| Query
| assignment/targetRef = "System user"
| `assignment/targetRef = "System user"`

| Error message
| Definition PRD:{.../common/common-3} *targetRef* {.../common/common-3}ObjectReferenceType[0,1],RAM is not property
Expand All @@ -73,7 +74,7 @@ a| The targetRef is a reference to an object. Not to a searchable property. +
To search for the assigned object name you need to reference properties within the object. E.g. its name.

| Correct query
| assignment/targetRef/@/name = "System user"
| `assignment/targetRef/@/name = "System user"`

| Troubleshooting hints
a| * Verify, that the attribute is present in the object type you are searching. You can check it at xref:../searchable-items.adoc[searchable items] page.
Expand All @@ -92,7 +93,7 @@ image:err-cannot-find-enum-value.png[Error cannot find enum value foe string]
| Find all users with normal lockout status.

| Query
| activation/lockoutStatus = "Normal"
| `activation/lockoutStatus = "Normal"`

| Error message
| Cannot find enum value for string *'Normal'* in class com.evolveum.midpoint.xml.ns._public.common.common_3.*LockoutStatusType*
Expand All @@ -101,7 +102,7 @@ image:err-cannot-find-enum-value.png[Error cannot find enum value foe string]
a| The schema defines enumerated value for this attribute. In this case the allowed values are "normal" and "locked". All lowercase.

| Correct query
a| activation/lockoutStatus = "normal"
a| `activation/lockoutStatus = "normal"`

| Troubleshooting hints
a| * Search for allowed values in schema definition. Schemas are described in
Expand Down
108 changes: 48 additions & 60 deletions docs/concepts/query/midpoint-query-language/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,49 @@ Not all items in midPoint objects are searchable. The list of searchable items (

NOTE: The new query language is undergoing rename from 'Axiom' to 'midPoint Query Language' since midPoint version 4.8. As the Axiom name is well known, it can be still for some time referenced also with this name. Please consider _Axiom Query Language_ and _midPoint Query Language_ as synonyms.

This document provides introduction to the _midPoint Query Language_ for the users.
This document provides introduction to the *midPoint Query Language*.
Some details are omitted, and there are some simplifications for clarity.
Detail developer specification of the query language is provided in xref:/midpoint/devel/axiom/[Axiom section of this site].

== The Basics

== Using midPoint Query Language in midPoint

Basic search panel is shown in GUI above each view by default. It displays basic search options that are easy to use by end users.

MidPoint Query language is complex as it needs to . It is expected to be used by slightly skilled users and midPoint professionals.
Interface for entering queries in midPoint query language can be enabled by switching the search option from _Basic_ to _Advanced_.

image:advanced-query-select.png[Select Advanced query]

For starting with midPoint query in GUI, please check xref:/midpoint/guides/gui-midpoint-query-examples/[GUI: Advanced search - EXAMPLES] document.

You can test the queries directly in GUI. Starting in All users view. It is easy and straightforward.
As an example, to select all users with given name starting with "J" just enter `givenName startsWith "J"` to search bar and click search button.

MidPoint provides xref:../query-in-midpoint/index.adoc#_query_playground[query playground] feature that allows administrator more advanced experimenting with midPoint queries.

=== Using in XML

Advanced query filters can be used in any configuration place, normal XML filters
would be used. Advanced query filter is wrapped inside `<text>`
element inside `<filter>` element.

.Example XML
[source, xml]
----
<filter>
<text>roleMembershipRef matches (relation = manager)</text>
</filter>
----

.Example YAML
[source, yaml]
----
filter:
text: roleMembershipRef matches (relation = manager)
----


== Introduction to midPoint Query Language

The midPoint Query Language is designed to allow specification of a complex queries.
Yet the basic structure of the language is relative simple and easy to understand.
Expand Down Expand Up @@ -88,14 +126,14 @@ For example `activation/validFrom > activation/validTo` should return all object

==== String filters

[options="header", cols="15,10,30", width=70]
[options="header", cols="15,40", width=70]
|====
| Name | Value | Description
| Name | Description

| `startsWith` | | Matches if item starts with specified string.
| `contains` | | Matches string property if it contains specified substring.
| `endsWith` | | Matches string property if it ends with specified substring.
| `fullText` | | Performs full text search. Item path must be dot (.)
| `startsWith` | Matches if item starts with specified string.
| `contains` | Matches string property if it contains specified substring.
| `endsWith` | Matches string property if it ends with specified substring.
| `fullText` | Performs full text search. Item path must be dot (.)
|====

=== Value
Expand All @@ -108,8 +146,6 @@ The exact form of the value part of the filter depends on the operator.

Numeric values and QNames does not need double quotes.



=== Logical Filters

Logical filters are used to combine several sub-filters into one filter or to
Expand Down Expand Up @@ -150,7 +186,6 @@ familyName = "Doe" and (givenName = "John" or givenName ="Bill")

== Advanced filters


=== matches filter

`matches` filter operates on the container or structured value and specifies conditions that must be met by a single container value.
Expand Down Expand Up @@ -317,56 +352,13 @@ These filters operate on object as a whole, so item path must be `.` (the dot).

=== Other filters

[options="header", cols="10,10,30", width=70]
[options="header",cols="10,10,30",width=70]
|===
| Name | Value | Description
| exists | N/A | Matches if item exists (has any value). Filter does not have value.
| type | object type | Matches if object is of specified type. Usually used in combination with `and` filter for dereferenced objects, or it is needed to match on property defined in more specific type.
|===

== Using midPoint Query Language in midPoint

=== Using in GUI

.midPoint 4.8 and never

Basic search query is shown above each view by default. User can switch to advanced query by clicking the query button and selecting the `Advanced` option.

.midPoint 4.5, 4.6, 4.7

Basic search query is shown above each view by default. User can switch to advanced query by clicking the query button and selecting the `Axiom query` as one of the search options.

.midPoint 4.4

New query language is experimental feature in midPoint 4.4, so it needs to be explicitly enabled in GUI.

. In Admin GUI, navigate to Configuration -> System -> Admin GUI
. Click Show Empty fields in Admin GUI Configuration section
. Select True in Enable experimental features
. Save configuration changes, logout and login in order to changes to be applied.

After logout and back login to GUI, you can click on down arrow in search field to select `Axiom query` as one of the search options.

=== Using in XML

Advanced query filters are usable in any configuration place, normal XML filters
would be used. Advanced query filter is wrapped inside `<text>`
element inside `<filter>` element.

.Example XML
[source, xml]
----
<filter>
<text>roleMembershipRef matches (relation = manager)</text>
</filter>
----

.Example YAML
[source, yaml]
----
filter:
text: roleMembershipRef matches (relation = manager)
----

== Motivation, Origin and Future

Expand All @@ -382,7 +374,3 @@ Since midPoint 4.5, midPoint Query Language is fully supported and recommended o
The midPoint Query Language is a full replacement for XML-based language.
The XML-based language will be still supported for some time, but it will be dropped eventually.
Users of XML-based query language should migrate to midPoint Query Language as soon as possible.

== See Also

* xref:/midpoint/projects/midscale/design/query-language/[Query language design notes (midScale)]

0 comments on commit f6c11cb

Please sign in to comment.