use of com.enonic.xp.content.ContentValidator in project xp by enonic.
the class ValidateContentDataCommand method execute.
ValidationErrors execute() {
final ContentType contentType = contentTypeService.getByName(new GetContentTypeParams().contentTypeName(contentTypeName));
Preconditions.checkArgument(contentType != null, "ContentType [%s] not found", contentTypeName);
final ContentValidatorParams validatorParams = contentValidatorParamsBuilder.contentType(contentType).build();
for (ContentValidator contentValidator : contentValidators) {
if (contentValidator.supports(contentTypeName)) {
contentValidator.validate(validatorParams, resultBuilder);
}
}
return this.resultBuilder.build();
}
Aggregations