Search in sources :

Example 51 with PrismPropertyDefinition

use of com.evolveum.midpoint.prism.PrismPropertyDefinition in project midpoint by Evolveum.

the class TestParseScriptingExpression method processParsings.

private void processParsings(SerializingFunction<PrismPropertyValue<ExpressionPipelineType>> serializer, String serId) throws Exception {
    PrismPropertyDefinition definition = getPrismContext().getSchemaRegistry().findPropertyDefinitionByElementName(SchemaConstants.S_PIPELINE);
    processParsings(ExpressionPipelineType.class, ExpressionPipelineType.COMPLEX_TYPE, definition, serializer, serId);
}
Also used : PrismPropertyDefinition(com.evolveum.midpoint.prism.PrismPropertyDefinition)

Example 52 with PrismPropertyDefinition

use of com.evolveum.midpoint.prism.PrismPropertyDefinition in project midpoint by Evolveum.

the class PropertyDelta method createDelta.

public static <O extends Objectable, T> PropertyDelta<T> createDelta(ItemPath propertyPath, Class<O> compileTimeClass, PrismContext prismContext) {
    PrismObjectDefinition<O> objectDefinition = prismContext.getSchemaRegistry().findObjectDefinitionByCompileTimeClass(compileTimeClass);
    PrismPropertyDefinition propDef = objectDefinition.findPropertyDefinition(propertyPath);
    return new PropertyDelta<T>(propertyPath, propDef, prismContext);
}
Also used : PrismPropertyDefinition(com.evolveum.midpoint.prism.PrismPropertyDefinition)

Example 53 with PrismPropertyDefinition

use of com.evolveum.midpoint.prism.PrismPropertyDefinition in project midpoint by Evolveum.

the class PropertyDelta method createReplaceEmptyDelta.

/**
	 * Create delta that deletes all values of the specified property.
	 */
public static <O extends Objectable> PropertyDelta createReplaceEmptyDelta(PrismObjectDefinition<O> objectDefinition, QName propertyName) {
    PrismPropertyDefinition propertyDefinition = objectDefinition.findPropertyDefinition(propertyName);
    if (propertyDefinition == null) {
        throw new IllegalArgumentException("No definition for " + propertyName + " in " + objectDefinition);
    }
    // hoping the prismContext is there
    PropertyDelta delta = new PropertyDelta(propertyName, propertyDefinition, objectDefinition.getPrismContext());
    delta.setValuesToReplace(new ArrayList<PrismPropertyValue>());
    return delta;
}
Also used : PrismPropertyDefinition(com.evolveum.midpoint.prism.PrismPropertyDefinition) PrismPropertyValue(com.evolveum.midpoint.prism.PrismPropertyValue)

Example 54 with PrismPropertyDefinition

use of com.evolveum.midpoint.prism.PrismPropertyDefinition in project midpoint by Evolveum.

the class PropertyDelta method createAddDelta.

public static <O extends Objectable> PropertyDelta createAddDelta(PrismContainerDefinition<O> containerDefinition, QName propertyName, Object... realValues) {
    PrismPropertyDefinition propertyDefinition = containerDefinition.findPropertyDefinition(propertyName);
    if (propertyDefinition == null) {
        throw new IllegalArgumentException("No definition for " + propertyName + " in " + containerDefinition);
    }
    // hoping the prismContext is there
    PropertyDelta delta = new PropertyDelta(propertyName, propertyDefinition, containerDefinition.getPrismContext());
    for (Object realVal : realValues) {
        delta.addValueToAdd(new PrismPropertyValue(realVal));
    }
    return delta;
}
Also used : PrismPropertyDefinition(com.evolveum.midpoint.prism.PrismPropertyDefinition) PrismObject(com.evolveum.midpoint.prism.PrismObject) PrismPropertyValue(com.evolveum.midpoint.prism.PrismPropertyValue)

Example 55 with PrismPropertyDefinition

use of com.evolveum.midpoint.prism.PrismPropertyDefinition in project midpoint by Evolveum.

the class PropertyDelta method createModificationReplaceProperty.

public static <T> PropertyDelta<T> createModificationReplaceProperty(ItemPath propertyPath, PrismObjectDefinition<?> objectDefinition, Collection<T> propertyValues) {
    PrismPropertyDefinition propDef = objectDefinition.findPropertyDefinition(propertyPath);
    // hoping the prismContext is there
    PropertyDelta<T> propertyDelta = new PropertyDelta<T>(propertyPath, propDef, objectDefinition.getPrismContext());
    Collection<PrismPropertyValue<T>> pValues = new ArrayList<PrismPropertyValue<T>>(propertyValues.size());
    for (T val : propertyValues) {
        pValues.add(new PrismPropertyValue<T>(val));
    }
    propertyDelta.setValuesToReplace(pValues);
    return propertyDelta;
}
Also used : PrismPropertyDefinition(com.evolveum.midpoint.prism.PrismPropertyDefinition) ArrayList(java.util.ArrayList) PrismPropertyValue(com.evolveum.midpoint.prism.PrismPropertyValue)

Aggregations

PrismPropertyDefinition (com.evolveum.midpoint.prism.PrismPropertyDefinition)134 PrismPropertyValue (com.evolveum.midpoint.prism.PrismPropertyValue)93 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)82 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)62 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)61 Test (org.testng.annotations.Test)60 PrismObject (com.evolveum.midpoint.prism.PrismObject)24 QName (javax.xml.namespace.QName)23 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)19 PrismPropertyDefinitionImpl (com.evolveum.midpoint.prism.PrismPropertyDefinitionImpl)18 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)15 Task (com.evolveum.midpoint.task.api.Task)12 ArrayList (java.util.ArrayList)12 ExpressionEvaluationContext (com.evolveum.midpoint.repo.common.expression.ExpressionEvaluationContext)11 ExpressionEvaluationException (com.evolveum.midpoint.util.exception.ExpressionEvaluationException)9 PrismContainerDefinition (com.evolveum.midpoint.prism.PrismContainerDefinition)8 PrismContext (com.evolveum.midpoint.prism.PrismContext)8 ObjectNotFoundException (com.evolveum.midpoint.util.exception.ObjectNotFoundException)8 ItemDefinition (com.evolveum.midpoint.prism.ItemDefinition)7 File (java.io.File)7