Skip to content

Commit

Permalink
Initial objects: Replacement of XML queries by MQL. (some reports lef…
Browse files Browse the repository at this point in the history
…t with XML because of WP:9618)

(cherry picked from commit ef3c2a0)
  • Loading branch information
mspanik committed Apr 19, 2024
1 parent b6a2e35 commit 3444831
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 180 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<objectCollection xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
oid="00000000-0000-0000-0001-000000000284">
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
oid="00000000-0000-0000-0001-000000000284">
<name>All audit records</name>
<type>AuditEventRecordType</type>
<filter>
<q:all/>
</filter>
<defaultView>
<column id="1">
<name>timestampColumn</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,9 @@
<name>Audit records in 24h</name>
<type>AuditEventRecordType</type>
<filter>
<!-- TODO: Convert to Axiom Query -->
<q:and>
<q:equal>
<q:path>eventStage</q:path>
<q:value>execution</q:value>
</q:equal>
<q:greater>
<q:path>timestamp</q:path>
<expression>
<script>
<code>
calendar = basic.addDuration(basic.currentDateTime(), "-P1D");
return calendar;
</code>
</script>
</expression>
</q:greater>
</q:and>
<q:text>
eventStage = 'execution'
and timestamp > `basic.addDuration(basic.currentDateTime(), "-P1D")`
</q:text>
</filter>
</objectCollection>
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,11 @@
<name>Error audit records in 24h</name>
<type>AuditEventRecordType</type>
<filter>
<!-- TODO: Convert to Axiom Query
<q:text>
eventStage = "execution"
and outcome = "fatal_error"
and timestamp = `basic.addDuration(basic.currentDateTime(), "-P1D")
eventStage = 'execution'
and outcome = 'fatal_error'
and timestamp > `basic.addDuration(basic.currentDateTime(), "-P1D")`
</q:text>
-->
<q:and>
<q:equal>
<q:path>eventStage</q:path>
<q:value>execution</q:value>
</q:equal>
<q:equal>
<q:path>outcome</q:path>
<q:value>fatal_error</q:value>
</q:equal>
<q:greater>
<q:path>timestamp</q:path>
<expression>
<script>
<code>
calendar = basic.addDuration(basic.currentDateTime(), "-P1D");
return calendar;
</code>
</script>
</expression>
</q:greater>
</q:and>
</filter>
<domain>
<collectionRef oid="00000000-0000-0000-0001-000000000285" type="c:ObjectCollectionType"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,11 @@
<name>Modification audit records in 24h</name>
<type>AuditEventRecordType</type>
<filter>
<!-- TODO: Convert to Axiom Query -->
<q:and>
<q:equal>
<q:path>eventStage</q:path>
<q:value>execution</q:value>
</q:equal>
<q:or>
<q:equal>
<q:path>eventType</q:path>
<q:value>modifyObject</q:value>
</q:equal>
<q:equal>
<q:path>eventType</q:path>
<q:value>addObject</q:value>
</q:equal>
<q:equal>
<q:path>eventType</q:path>
<q:value>deleteObject</q:value>
</q:equal>
</q:or>
<q:greater>
<q:path>timestamp</q:path>
<expression>
<script>
<code>
calendar = basic.addDuration(basic.currentDateTime(), "-P1D");
return calendar;
</code>
</script>
</expression>
</q:greater>
</q:and>
<q:text>
eventStage = 'execution'
and ( eventType = 'modifyObject' or eventType = 'addObject' or eventType = 'deleteObject')
and timestamp > `basic.addDuration(basic.currentDateTime(), "-P1D")`
</q:text>
</filter>
<domain>
<collectionRef oid="00000000-0000-0000-0001-000000000285" type="c:ObjectCollectionType"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
oid="00000000-0000-0000-0001-000000000280">
<name>All certification campaigns</name>
<type>AccessCertificationCampaignType</type>
<filter>
<q:all/>
</filter>
<getOptions>
<option id="1">
<selector>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
oid="00000000-0000-0000-0001-000000000008">
<name>All shadows</name>
<type>ShadowType</type>
<filter>
<q:all/>
</filter>
<getOptions>
<option id="1">
<options>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,13 @@
<name>My cases</name>
<type>CaseType</type>
<filter>
<!-- TODO: Convert to Axiom Query -->
<q:and>
<q:ref>
<q:path>requestorRef</q:path>
<expression>
<script>
<code>
import com.evolveum.midpoint.xml.ns._public.common.common_3.*
new ObjectReferenceType().oid(midpoint.principalOid)
</code>
</script>
</expression>
</q:ref>
<q:not>
<q:equal>
<q:path>state</q:path>
<q:value>closed</q:value>
</q:equal>
</q:not>
</q:and>
<q:text>
state != 'closed'
and requestorRef = ```
import com.evolveum.midpoint.xml.ns._public.common.common_3.*
new ObjectReferenceType().oid(midpoint.principalOid)
```
</q:text>
</filter>
<baseCollection>
<collectionRef oid="00000000-0000-0000-0000-000000000341" relation="org:default" type="c:ArchetypeType"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
</assignment>
<objectCollection>
<collection>
<filter>
<q:all/>
</filter>
<!-- Type is declared in the view element. -->
</collection>
<view>
<column id="2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,7 @@
<collection>
<!-- Type is declared in the view element. -->
<filter>
<q:inOid>
<c:expression>
<c:script>
<c:code>simulationResultRef?.oid</c:code>
</c:script>
</c:expression>
<q:considerOwner>true</q:considerOwner>
</q:inOid>
<q:text>. ownedByOid `simulationResultRef?.oid`</q:text>
</filter>
</collection>
<view>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,7 @@
<collection>
<!-- Type is declared in the view element. -->
<filter>
<q:inOid>
<c:expression>
<c:script>
<c:code>simulationResultRef?.oid</c:code>
</c:script>
</c:expression>
<q:considerOwner>true</q:considerOwner>
</q:inOid>
<q:text>. ownedByOid `simulationResultRef?.oid`</q:text>
</filter>
</collection>
<view>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,7 @@
<collection>
<!-- Type is declared in the view element. -->
<filter>
<q:inOid>
<c:expression>
<c:script>
<c:code>simulationResultRef?.oid</c:code>
</c:script>
</c:expression>
<q:considerOwner>true</q:considerOwner>
</q:inOid>
<q:text>. ownedByOid `simulationResultRef?.oid`</q:text>
</filter>
</collection>
<view>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,7 @@
<collection>
<!-- Type is declared in the view element. -->
<filter>
<q:inOid>
<c:expression>
<c:script>
<c:code>simulationResultRef?.oid</c:code>
</c:script>
</c:expression>
<q:considerOwner>true</q:considerOwner>
</q:inOid>
<q:text>. ownedByOid `simulationResultRef?.oid`</q:text>
</filter>
</collection>
<view>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,7 @@
<object id="21">
<type>RoleType</type>
<filter>
<q:equal>
<q:path>requestable</q:path>
<q:value>true</q:value>
</q:equal>
<q:text>requestable = true</q:text>
</filter>
</object>
<!-- Note: for production use you should consider limiting the items that can be read. -->
Expand Down Expand Up @@ -136,10 +133,7 @@
<target id="23">
<type>RoleType</type>
<filter>
<q:equal>
<q:path>requestable</q:path>
<q:value>true</q:value>
</q:equal>
<q:text>requestable = true</q:text>
</filter>
</target>
<relation>org:default</relation> <!-- only assignments with the default (member) relation can be requested -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1409,16 +1409,7 @@
<connectorRef type="ConnectorType">
<resolutionTime>run</resolutionTime>
<filter>
<q:and>
<q:equal>
<q:path>connectorType</q:path>
<q:value>org.identityconnectors.databasetable.DatabaseTableConnector</q:value>
</q:equal>
<q:equal>
<q:path>available</q:path>
<q:value>true</q:value>
</q:equal>
</q:and>
<q:text>connectorType = 'org.identityconnectors.databasetable.DatabaseTableConnector' and available = true</q:text>
</filter>
</connectorRef>
</resourceDetailsPage>
Expand Down Expand Up @@ -1457,16 +1448,7 @@
<connectorRef type="ConnectorType">
<resolutionTime>run</resolutionTime>
<filter>
<q:and>
<q:equal>
<q:path>connectorType</q:path>
<q:value>com.evolveum.polygon.connector.ldap.LdapConnector</q:value>
</q:equal>
<q:equal>
<q:path>available</q:path>
<q:value>true</q:value>
</q:equal>
</q:and>
<q:text>connectorType = 'com.evolveum.polygon.connector.ldap.LdapConnector' and available = true</q:text>
</filter>
</connectorRef>
</resourceDetailsPage>
Expand Down Expand Up @@ -1505,16 +1487,7 @@
<connectorRef type="ConnectorType">
<resolutionTime>run</resolutionTime>
<filter>
<q:and>
<q:equal>
<q:path>connectorType</q:path>
<q:value>com.evolveum.polygon.connector.ldap.ad.AdLdapConnector</q:value>
</q:equal>
<q:equal>
<q:path>available</q:path>
<q:value>true</q:value>
</q:equal>
</q:and>
<q:text>connectorType = 'com.evolveum.polygon.connector.ldap.ad.AdLdapConnector' and available = true</q:text>
</filter>
</connectorRef>
</resourceDetailsPage>
Expand Down

0 comments on commit 3444831

Please sign in to comment.