Skip to content

Commit

Permalink
Merge branch 'docs/cleanup-4.8' into support-4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
matusmacik committed Apr 12, 2024
2 parents 8420a5e + 31b36f6 commit a8f3a53
Show file tree
Hide file tree
Showing 13 changed files with 181 additions and 756 deletions.
41 changes: 36 additions & 5 deletions docs/misc/reports/create-report-guide/advanced/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ To do this add the example text into the following xml container:
[source.xml]
----
<collection>
<!--Add the filter here-->
<filter>
<text>
<!--Add the filter here-->
</text>
</filter>
<baseCollectionRef>
.....
</baseCollectionRef>
Expand All @@ -71,10 +76,8 @@ After the collection is added
The name of the parameter will be *'resource'* , so we have to use it in the collection filter.

.Filter
[source,xml]
[source,midpoint-query]
----
<filter>
<q:text>
. type ShadowType and resourceRef = yaml```
expression:
queryInterpretationOfNoValue: "filterAll"
Expand All @@ -90,7 +93,35 @@ expression:
ort.setRelation(resource.getRelation());
ort.setType(resource.getTargetType());
return ort;
```</q:text>
```
----

[source,xml]
----
<filter xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3">
<q:ref>
<q:path>resourceRef</q:path>
<expression>
<queryInterpretationOfNoValue>filterAll</queryInterpretationOfNoValue>
<script>
<objectVariableMode>prismReference</objectVariableMode>
<code>
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType;
if (!resource) {
return null;
}
ObjectReferenceType ort = new ObjectReferenceType();
ort.setOid(resource.getOid());
ort.setRelation(resource.getRelation());
ort.setType(resource.getTargetType());
return ort;
</code>
</script>
</expression>
</q:ref>
</filter>
----

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
:page-wiki-metadata-create-date: 2020-08-18T15:06:52.473+02:00
:page-wiki-metadata-modify-user: lskublik
:page-wiki-metadata-modify-date: 2020-09-07T09:26:13.342+02:00
:page-upkeep-status: Green
:page-upkeep-status: green

Please see xref:/midpoint/reference/misc/reports/configuration/#new-report[Report configuration] for basic information about configuration variables.

Expand Down
Binary file not shown.
131 changes: 30 additions & 101 deletions docs/misc/reports/examples/example-policysituation/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,120 +6,46 @@
:page-wiki-metadata-create-date: 2020-05-04T13:00:25.101+02:00
:page-wiki-metadata-modify-user: lskublik
:page-wiki-metadata-modify-date: 2020-05-04T14:37:22.496+02:00
:page-upkeep-status: green

Please see xref:/midpoint/reference/admin-gui/dashboards/configuration/[Dashboard configuration] for basic information about configuration variables.


== Usecase

Administrator needs display all users which have value of description is 'Created by mP'
== Example use-case

The Administrator needs to display all users which have value of description set as 'Created by mP'

== Configuration

As first we need configure policy rule. In this Example we add next snippet of configuration to our system configuration in Midpoint.
At first, we need to configure a policy rule. In this Example we add the following snippet of configuration to our system configuration in Midpoint.

.Snippet of system configuration
[source,xml]
----
<systemConfiguration>
...
<globalPolicyRule>
<name>test</name>
<policyConstraints>
<objectState>
<filter>
<q:equal>
<q:path>description</q:path>
<q:value>Created by midPoint</q:value>
</q:equal>
</filter>
</objectState>
</policyConstraints>
<policySituation>#userCreatedByMidpoint</policySituation>
<policyActions>
<record/>
</policyActions>
<focusSelector>
<type>UserType</type>
<filter>
<q:all/>
</filter>
</focusSelector>
</globalPolicyRule>
...
</systemConfiguration>
----
.*Example System Config configuration*
[%collapsible]
====
sampleRef::samples/misc/system-policy-rec.xml[]
====

Now, we have to recompute all users in order to set our policySituation for them, when they meet the criteria of our filter.
In this situation we can use jasper report in Midpoint and modify search query base-on our policySituation or use dashboard reports with object collection, in this example we use dashboard report.
We need configure object collection for users with policySituation.

.Object collection
[source,xml]
----
<objectCollection oid="72b1f98e-f587-4b9f-b92b-72e251dbb266">
<name>Users with policySituation</name>
<type>UserType</type>
<filter>
<equal>
<path>policySituation</path>
<value>#userCreatedByMidpoint</value>
</equal>
</filter>
</objectCollection>
Afterwards We need to configure object collection for users with policySituation.

.*Example ObjectCollection configuration*
[%collapsible]
====
sampleRef::samples/objectCollection/users-with-policySituation.xml[]
====

----

When we have object collection, then import Dashboard object with widget for our object collection.
When we have the object collection in place, we want to set up an import Dashboard object with a widget for our object collection.

.Dashboard
[source,xml]
----
<dashboard oid="72b1f98e-f587-4b9f-b92b-72e251da3456">
<name>users-created-by-mp-dashboard</name>
<display>
<label>Users created by mP dashboard</label>
</display>
<widget>
<identifier>users</identifier>
<display>
<label>Users created by mP</label>
<color>#00a65a</color>
<icon>
<cssClass>fa fa-user</cssClass>
</icon>
</display>
<data>
<sourceType>objectCollection</sourceType>
<collection>
<collectionRef oid="72b1f98e-f587-4b9f-b92b-72e251dbb266" type="ObjectCollectionType"/>
</collection>
</data>
<presentation>
<dataField>
<fieldType>value</fieldType>
<expression>
<proportional>
<style>value-only</style>
</proportional>
</expression>
</dataField>
<dataField>
<fieldType>unit</fieldType>
<expression>
<value>users</value>
</expression>
</dataField>
</presentation>
</widget>
</dashboard>
----
.*Example Dashboard configuration*
[%collapsible]
====
sampleRef::samples/dashboard/users-policy-situation.xml[]
====

After successful import of dashboard object and reload of page you can see dashboard in menu *Dashboards* > *Users created by mP dashboard*.
After the successful import of the dashboard object you can see the dashboard in the menu *Dashboards* > *Users created by mP dashboard*.

We want report with table of users created by Midpoint, so we import dashboard report.
We want to report it out as a table of users created by Midpoint, for this we can use a dashboard report.


.Report
Expand All @@ -133,10 +59,13 @@ We want report with table of users created by Midpoint, so we import dashboard r
</report>
----

Now we can run report in report menu, show task, and download report.
Every report from dashboard is in HTML format.
Now we can run the report in the report menu, show task, and download report.


Report:
== See Also

image::image2020-5-4_13-34-2.png[]
- xref:/midpoint/reference/misc/reports/examples/[Report Examples]
- xref:/midpoint/reference/misc/reports/configuration/[Report Configuration]
- xref:/midpoint/reference/misc/reports/configuration/collection-report.adoc[Collection Based Reports]
- xref:/midpoint/reference/misc/reports/configuration/dashboard-report.adoc[Dashboard Based Reports]
- xref:/midpoint/reference/concepts/query/#reference-query[Reference Query]
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
:page-wiki-metadata-create-date: 2020-05-04T13:35:21.566+02:00
:page-wiki-metadata-modify-user: lskublik
:page-wiki-metadata-modify-date: 2020-09-04T08:41:08.212+02:00
:page-upkeep-status: Green
:page-upkeep-status: green

Please see xref:/midpoint/reference/admin-gui/dashboards/configuration/[Dashboard configuration] for basic information about configuration variables and Auditing-Custom column for steps how to add custom column.

Expand Down
Binary file not shown.
132 changes: 22 additions & 110 deletions docs/misc/reports/examples/example-report-number-of-members/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,129 +6,41 @@
:page-wiki-metadata-create-date: 2020-05-04T12:41:02.412+02:00
:page-wiki-metadata-modify-user: lskublik
:page-wiki-metadata-modify-date: 2020-07-27T09:14:49.594+02:00
:page-upkeep-status: green

Please see xref:/midpoint/reference/admin-gui/dashboards/configuration/[Dashboard configuration] for basic information about configuration variables.


== Usecase

Administrator needs display all roles with number of members.
== Example use-case

Administrator needs to display all roles with the number of their members.

== Configuration

As first we need configure object collection for all roles.

.Object collection
[source,xml]
----
<objectCollection oid="72b1f98e-f587-4b9f-b92b-72e251dbb255">
<name>All roles</name>
<type>RoleType</type>
<filter>
<all/>
</filter>
</objectCollection>
----

When we have object collection, then import Dashboard object with widget for our object collection.

.Dashboard
[source,xml]
----
<dashboard oid="72b1f98e-f587-4b9f-b92b-72e251da2345">
<name>role-dashboard</name>
<display>
<label>Role dashboard</label>
</display>
<widget>
<identifier>roles</identifier>
<display>
<label>Number of roles</label>
<color>#00a65a</color>
<icon>
<cssClass>fe fe-role_icon</cssClass>
</icon>
</display>
<data>
<sourceType>objectCollection</sourceType>
<collection>
<collectionRef oid="72b1f98e-f587-4b9f-b92b-72e251dbb255" type="ObjectCollectionType"/>
</collection>
</data>
<presentation>
<dataField>
<fieldType>value</fieldType>
<expression>
<proportional>
<style>value-only</style>
</proportional>
</expression>
</dataField>
<dataField>
<fieldType>unit</fieldType>
<expression>
<value>roles</value>
</expression>
</dataField>
<view>
<column>
<name>nameColumn</name>
<path>name</path>
<display>
<label>Name</label>
</display>
</column>
<column>
<name>members</name>
<display>
<label>Members</label>
</display>
<previousColumn>nameColumn</previousColumn>
<export>
<expression>
<script>
<code>
import com.evolveum.midpoint.prism.query.*
import com.evolveum.midpoint.xml.ns._public.common.common_3.*
query = prismContext.queryFor(UserType.class).item(AssignmentHolderType.F_ROLE_MEMBERSHIP_REF).ref(object.getOid()).build();
objects = midpoint.searchObjects(UserType.class, query)
return objects.size();
</code>
</script>
</expression>
</export>
</column>
</view>
</presentation>
</widget>
</dashboard>
----
As the first step we need to configure an object collection for all roles.

After successful import of dashboard object and reload of page you can see dashboard in menu *Dashboards* > *Role dashboard*.
.*Example Object Collection*
[%collapsible]
====
sampleRef::samples/objectCollection/all-roles.xml[]
====

We want report with table of roles, so we import dashboard report.
We want a report with table of roles for this we configure the report definition.

.*Example Report Configuration*
[%collapsible]
====
sampleRef::samples/reports/roles-and-members.xml[]
====

.Report
[source,xml]
----
<report>
<name>Roles dashboard report</name>
<dashboard>
<dashboardRef oid="72b1f98e-f587-4b9f-b92b-72e251da2345" type="DashboardType"/>
</dashboard>
</report>
----
Now we can run the report in the report menu, and download the report.

Now we can run report in report menu, show task, and download report.
Every report from dashboard is in HTML format.
== See Also

- xref:/midpoint/reference/misc/reports/examples/[Report Examples]
- xref:/midpoint/reference/misc/reports/configuration/[Report Configuration]
- xref:/midpoint/reference/misc/reports/configuration/collection-report.adoc[Collection Based Reports]
- xref:/midpoint/reference/misc/reports/configuration/dashboard-report.adoc[Dashboard Based Reports]
- xref:/midpoint/reference/concepts/query/#reference-query[Reference Query]

Report:

image::image2020-5-4_12-56-18.png[]
Binary file not shown.

0 comments on commit a8f3a53

Please sign in to comment.