Skip to content

Commit

Permalink
Add ShadowOwnerReferenceSearchExpressionEvaluator
Browse files Browse the repository at this point in the history
(Experimental implementation; work in progress.)
  • Loading branch information
mederly committed Apr 17, 2024
1 parent 0874bc4 commit 8cba3d1
Show file tree
Hide file tree
Showing 35 changed files with 597 additions and 614 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

package com.evolveum.midpoint.schema.statistics;

import com.evolveum.midpoint.prism.PrismContext;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.PrismObjectDefinition;
import com.evolveum.midpoint.prism.polystring.PolyString;
import com.evolveum.midpoint.schema.util.ObjectTypeUtil;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;
Expand Down Expand Up @@ -45,7 +43,7 @@ public IterationItemInformation(PrismObject<? extends ObjectType> object) {
}

private QName determineTypeName(PrismObject<? extends ObjectType> object) {
return ObjectTypeUtil.getObjectType(object.asObjectable());
return ObjectTypeUtil.getObjectTypeName(object.asObjectable());
}

public IterationItemInformation(ShadowType shadow) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,8 @@ public static String getDetailedDisplayName(Objectable objectable) {
* Returns the type name for an object.
* (This really belongs somewhere else, not here.)
*/
public static QName getObjectType(ObjectType object) {
@Contract("!null -> !null; null -> null")
public static QName getObjectTypeName(ObjectType object) {
if (object == null) {
return null;
}
Expand All @@ -1114,7 +1115,7 @@ public static QName getObjectType(ObjectType object) {
}
Class<? extends Objectable> clazz = object.asPrismObject().getCompileTimeClass();
if (clazz == null) {
return null;
throw new IllegalStateException("No compile-time class for " + object);
}
PrismObjectDefinition<?> defFromRegistry =
PrismContext.get().getSchemaRegistry().findObjectDefinitionByCompileTimeClass(clazz);
Expand All @@ -1125,6 +1126,12 @@ public static QName getObjectType(ObjectType object) {
}
}

/** A convenience variant of {@link #getObjectTypeName(ObjectType)}. */
@Contract("!null -> !null; null -> null")
public static QName getObjectTypeName(PrismObject<? extends ObjectType> object) {
return getObjectTypeName(asObjectable(object));
}

public static boolean isIndestructible(@NotNull ObjectType object) {
return Boolean.TRUE.equals(object.isIndestructible());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6764,17 +6764,55 @@
<xsd:annotation>
<xsd:documentation>
Relation that will be set for new reference.
Mutually exclusive with "relationExpression".
</xsd:documentation>
<xsd:appinfo>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="relationExpression" type="tns:ExpressionType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Expression that will provide the relation for the new reference.
Should provide at most one value.
Mutually exclusive with "relation".
</xsd:documentation>
<xsd:appinfo>
<a:since>4.9</a:since>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="referenceSearch" type="tns:ReferenceSearchExpressionEvaluatorType" substitutionGroup="tns:expressionEvaluator"/>

<xsd:complexType name="ShadowOwnerReferenceSearchExpressionEvaluatorType">
<xsd:annotation>
<xsd:documentation>
An expression evaluator that provides a reference to the owner of the shadow in question.
Applicable to association values.

Some of the inherited properties have little sense here and/or are simply ignored.
In particular, explicit filter(s) are not allowed when this expression evaluator is used.
</xsd:documentation>
<xsd:appinfo>
<a:since>4.9</a:since>
</xsd:appinfo>
<!-- Later: applicable to shadows and references to shadows. -->
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="tns:ReferenceSearchExpressionEvaluatorType">
<xsd:sequence>
<!-- Nothing for now -->
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="shadowOwnerReferenceSearch" type="tns:ShadowOwnerReferenceSearchExpressionEvaluatorType"
substitutionGroup="tns:expressionEvaluator"/>

<xsd:complexType name="ShadowDiscriminatorExpressionEvaluatorType">
<xsd:annotation>
<xsd:documentation>
Expand Down

0 comments on commit 8cba3d1

Please sign in to comment.