Search in sources :

Example 1 with ResourceValidator

use of com.evolveum.midpoint.model.api.validator.ResourceValidator in project midpoint by Evolveum.

the class ResourceWizardIssuesModel method load.

@NotNull
@Override
protected WizardIssuesDto load() {
    final WizardIssuesDto issuesDto = new WizardIssuesDto();
    if (!resourceModel.isLoaded()) {
        // e.g. in first two wizard steps (IT PROBABLY DOES NOT WORK AS EXPECTED)
        return issuesDto;
    }
    ResourceValidator validator = wizardPage.getResourceValidator();
    ValidationResult validationResult = validator.validate(resourceModel.getObject(), Scope.QUICK, WebComponentUtil.getCurrentLocale(), wizardPage.createSimpleTask("validate"), new OperationResult("validate"));
    issuesDto.fillFrom(validationResult);
    issuesDto.sortIssues();
    return issuesDto;
}
Also used : ResourceValidator(com.evolveum.midpoint.model.api.validator.ResourceValidator) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ValidationResult(com.evolveum.midpoint.model.api.validator.ValidationResult) WizardIssuesDto(com.evolveum.midpoint.web.component.wizard.resource.dto.WizardIssuesDto) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ResourceValidator (com.evolveum.midpoint.model.api.validator.ResourceValidator)1 ValidationResult (com.evolveum.midpoint.model.api.validator.ValidationResult)1 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 WizardIssuesDto (com.evolveum.midpoint.web.component.wizard.resource.dto.WizardIssuesDto)1 NotNull (org.jetbrains.annotations.NotNull)1