Search in sources :

Example 1 with BulkActionGenerator

use of com.evolveum.midpoint.studio.impl.browse.BulkActionGenerator in project midpoint-studio by Evolveum.

the class UploadTestValidateResourceTask method processObject.

@Override
public ProcessObjectResult processObject(MidPointObject obj) throws Exception {
    ProcessObjectResult por = super.processObject(obj);
    OperationResult testConnectionResult = por.result();
    String name = obj.getName();
    if (testConnectionResult != null && !testConnectionResult.isSuccess()) {
        printProblem("Skipping resource validation for " + name + ", there was a problem with upload/test");
        return por;
    }
    if (!ObjectTypes.RESOURCE.equals(obj.getType())) {
        printProblem("Can't validate resource for " + name + ", because it's " + obj.getType().getClassDefinition().getName());
        return por;
    }
    GeneratorOptions genOptions = new GeneratorOptions();
    BulkActionGenerator gen = new BulkActionGenerator(BulkActionGenerator.Action.VALIDATE);
    String requestString = gen.generateFromSourceObject(obj, genOptions, getProject());
    ExecuteScriptResponseType response = client.execute(requestString);
    OperationResultType res = response.getResult();
    OperationResult executionResult = OperationResult.createOperationResult(res);
    return validateOperationResult("validate", executionResult, obj.getName());
}
Also used : ExecuteScriptResponseType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ExecuteScriptResponseType) GeneratorOptions(com.evolveum.midpoint.studio.impl.browse.GeneratorOptions) OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) BulkActionGenerator(com.evolveum.midpoint.studio.impl.browse.BulkActionGenerator) ProcessObjectResult(com.evolveum.midpoint.studio.action.transfer.ProcessObjectResult)

Aggregations

OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 ProcessObjectResult (com.evolveum.midpoint.studio.action.transfer.ProcessObjectResult)1 BulkActionGenerator (com.evolveum.midpoint.studio.impl.browse.BulkActionGenerator)1 GeneratorOptions (com.evolveum.midpoint.studio.impl.browse.GeneratorOptions)1 ExecuteScriptResponseType (com.evolveum.midpoint.xml.ns._public.common.api_types_3.ExecuteScriptResponseType)1 OperationResultType (com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType)1