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 8, 2024
2 parents 3dafbf2 + 1fedcc7 commit f6a5e49
Show file tree
Hide file tree
Showing 11 changed files with 239 additions and 130 deletions.
27 changes: 3 additions & 24 deletions docs/concepts/query/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Examples of queries:
** "give me all rows for this particular lookup table that start with this prefix",
** "give me all work items allocated to particular user".

* A *reference query* (limited support since 4.7), for example:
* A *reference query*, for example:

** "give me all the role membership references for all the users",
** "give me all projection (link) refs for a given resource".
Expand Down Expand Up @@ -153,8 +153,6 @@ which can be used on GUI or embedded in other filters via `text` element.
hard-core customizations (e.g. with xref:/midpoint/reference/deployment/maven-overlay-project.adoc[midPoint Overlay] mechanism)
but also for xref:/midpoint/reference/expressions/expressions/script/[script expressions] written typically in Groovy language.

[IMPORTANT]
MidPoint Query Language is experimentally available since 4.3 and fully supported since 4.5.

Here is an example of the same filter in various representations:

Expand Down Expand Up @@ -319,9 +317,6 @@ Item path on the right side has a limited support only for repository engine.
The following table summarizes filters that are based on the object/container or its items.
Most of the filters use an item path to an item on the "left side", but some of these filters
work with the whole object (or container) because the path is either not relevant or implied.
Finally, since version 4.6, Ref filter optionally supports so-called "target filter" which makes it technically a complex filter; its description in the following table does not cover this usage.

// TODO: Description out of this, only to detail sections lower

[%autowidth]
|===
Expand Down Expand Up @@ -790,7 +785,7 @@ This feature is a part of midPoint 3.4 and above.
====
While `exists` works as expected with complex combination of conditions for the common multi-value container
(like assignment in the example above), `not` with `exists` behavior works properly only with the new Native repository.
Native repository (available since midPoint 4.4) translates `exists` filter to SQL `EXISTS` and `NOT`
Native repository translates `exists` filter to SQL `EXISTS` and `NOT`
is applied to the SQL `EXISTS` resulting in `NOT EXISTS` query, which works as expected.
`exists` for the old Generic repo was implemented using `LEFT JOIN` which works fine for positive
Expand All @@ -803,10 +798,6 @@ See https://jira.evolveum.com/browse/MID-7203[MID-7203].

==== Ref filter with target filter

++++
{% include since.html since="4.6" %}
++++

[IMPORTANT]
Ref filter with nested target filter is supported only for repository searches.

Expand Down Expand Up @@ -963,10 +954,6 @@ must match any of the provided values *and* the target object for the matching r

==== OwnedBy filter

++++
{% include since.html since="4.6" %}
++++

[IMPORTANT]
This filter is supported only for repository searches.

Expand Down Expand Up @@ -1308,10 +1295,6 @@ However, this is meaningless, because the same conditions can be applied directl

==== ReferencedBy filter

++++
{% include since.html since="4.6" %}
++++

[IMPORTANT]
This filter is supported only for the xref:/midpoint/reference/repository/native-postgresql/[Native repository].

Expand Down Expand Up @@ -2154,10 +2137,6 @@ Ordering objects by items inside multi-value container have unclear semantics an

== Reference query

++++
{% include since.html since="4.7" %}
++++

[IMPORTANT]
====
* Reference query is only supported with the xref:/midpoint/reference/repository/native-postgresql/[Native repository].
Expand Down Expand Up @@ -2441,7 +2420,7 @@ so even then the distinct option is useless and, when honoured, can potentially

=== Fluent API script translation

Since version 4.6, Query playground offers an option to translate queries from fluent API scripts.
Query playground offers an option to translate queries from fluent API scripts.
This way you can debug the Groovy code for an expression directly in the GUI before using it.

To do this, follow these steps:
Expand Down
3 changes: 0 additions & 3 deletions docs/concepts/query/midpoint-query-language/basic-usage.adoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
= Basic usage of midPoint Query Language
:page-nav-title: Basic usage
:page-display-order: 100
:page-since: "4.4"
:page-since-improved: [ "4.5", "4.6", "4.7", "4.8" ]


This document provides information and examples of queries in midPoint Query Language, mainly used in objects while configuration of midPoint itself.
Expand Down Expand Up @@ -48,7 +46,6 @@ Where:


== Users with account on specific resource
NOTE: This filter was tested to be working since midPoint 4.4

Search for users, which have account specified resource, with default intent.

Expand Down
6 changes: 0 additions & 6 deletions docs/concepts/query/midpoint-query-language/errors.adoc

This file was deleted.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
143 changes: 143 additions & 0 deletions docs/concepts/query/midpoint-query-language/errors/index.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
= Errors While Querying with midPoint Query Language
:page-nav-title: Errors while querying
:page-display-order: 500
:page-toc: top
:toclevels: 3
:sectnums:
:sectnumlevels: 3


While searching with midPoint Query Language you can encounter various error messages.
Some of them can be quite cryptic, especially for new users.

== Error messages in GUI

Error messages in GUI are displayed below the query.


=== Path is not present in type

image::err-path-is-not-present.png[Error path is not present]

In this case administrator wanted to search for user with name "adam".

Midpoint says that attribute namex can't be found in the object type UserType that is displayed in the view Users we are searching.

This is the most typical error you can encounter.
It is caused by incorrect identification of property (attribute) in query.
Often this error is caused by typo in the name of the attribute.
In the example above it is additional "x" in _name_.

The {http://midpoint.evolveum.com/xml/ns/public/common/common-3} is the namespace of the type UserType. You can ignore it at this place.

[cols="15h,50" width=85%]
|====
| Request
| Find user with name "adam"

| Query
| namex = "adam"

| Error message
| Path *namex* is not present in type {http://midpoint.evolveum.com/xml/ns/public/common/common-3} *UserType*

| Reason
| In this case the reason for error was typo: _namex_ vs _name_

| Correct query
| 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.
* 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.
|====

=== Definition is not property

image:err-definition-is-not-property.png[Error definition is not property]

[cols="15h,50" width=85%]
|====
| Request
| Find all users with assigned role "System user".

| Query
| assignment/targetRef = "System user"

| Error message
| Definition PRD:{.../common/common-3} *targetRef* {.../common/common-3}ObjectReferenceType[0,1],RAM is not property

| Reason
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"

| 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.
* Use dereferencing operator "@" for referencing attributes of the assigned object.

|====


=== Cannot find enum value for string

image:err-cannot-find-enum-value.png[Error cannot find enum value foe string]

[cols="15h,50" width=85%]
|====
| Request
| Find all users with normal lockout status.

| Query
| activation/lockoutStatus = "Normal"

| Error message
| Cannot find enum value for string *'Normal'* in class com.evolveum.midpoint.xml.ns._public.common.common_3.*LockoutStatusType*

| Reason
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"

| Troubleshooting hints
a| * Search for allowed values in schema definition. Schemas are described in
xref:../../../../schema/schemadoc.adoc[SchemaDoc].
Select version according your midPoint version. +
In this case search in schema "common/common-3" for "LockoutStatusType"

// Alternatively, you can search midPoint schema files #on github# for verification.
// TODO - for this case - linka na github na schema file.
|====



//=== Unknown type for conversion
// in audit search

////
[cols="15h,50" width=85%]
|====
| Request
|
| Query
|
| Error
|
| Reason
a|
| Correct query
|
| Troubleshooting hints
a|
|====
////

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
= Using expressions in midPoint Query Language
:page-nav-title: Expressions
:page-display-order: 200
:page-since: "4.5"
:page-toc: top

:triple-backtick: ```
Expand Down
4 changes: 1 addition & 3 deletions docs/concepts/query/midpoint-query-language/index.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
= midPoint Query Language
:page-since: "4.4"
:page-since-improved: [ "4.5", "4.6", "4.7", "4.8" ]
:page-toc: top
:toclevels: 3
:sectnums:
Expand Down Expand Up @@ -377,7 +375,7 @@ The concepts of the language are based on xref:/midpoint/devel/axiom/[Axiom data
MidPoint Query Language is replacing an old xref:../xml-query-language/[XML-based query language].
The new language is more natural, user-friendly and better aligned with foundations of xref:/midpoint/devel/axiom/[Axiom data modeling].

MidPoint Query Language is a relative new development, introduced in midPoint 4.3.
MidPoint Query Language was introduced in midPoint 4.3.
It was almost fully supported in midPoint 4.4 LTS, except for embedded expression.
Since midPoint 4.5, midPoint Query Language is fully supported and recommended option.

Expand Down

0 comments on commit f6a5e49

Please sign in to comment.