You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Konrad Windszus (JIRA)" <ji...@apache.org> on 2017/03/05 17:24:32 UTC

[jira] [Comment Edited] (SLING-6610) DefaultValidationFailure and DefaultValidationResult should use ValidationContext as parameter

    [ https://issues.apache.org/jira/browse/SLING-6610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15896446#comment-15896446 ] 

Konrad Windszus edited comment on SLING-6610 at 3/5/17 5:23 PM:
----------------------------------------------------------------

While the {{location}} and {{defaultResourceBundle}} are always used as set in the {{ValidationContext}}, this is not necessarily the case for the {{severity}} (SLING-5373). I wonder whether a default severity per validator (which can still be overwritten by each usage in the model) should rather be defined via an OSGi property on the Validator rather than in the code. That way the fallback handling for severities could be implemented in the {{ValidationServiceImpl}} instead of within the {{Validator}}


was (Author: kwin):
While the {{location}} and {{defaultResourceBundle}} are always used as set in the {{ValidationContext}}, this is not necessarily the case for the {{severity}} (SLING-5373). I wonder whether a default severity per validator (which can still be overwritten by each usage in the model) should rather be defined within an OSGi property on the Validator rather than in the code. That way the fallback handling for severities could be implemented in the {{ValidationServiceImpl}} instead of within the {{Validator}}

> DefaultValidationFailure and DefaultValidationResult should use ValidationContext as parameter
> ----------------------------------------------------------------------------------------------
>
>                 Key: SLING-6610
>                 URL: https://issues.apache.org/jira/browse/SLING-6610
>             Project: Sling
>          Issue Type: Improvement
>          Components: Extensions, Validation
>            Reporter: Oliver Lietz
>             Fix For: Validation 1.0.0
>
>
> {{ValidationContext}}:
> {noformat}
> public DefaultValidationFailure(@Nonnull ValidationContext validationContext, @Nonnull String messageKey, Object... messageArguments)
> {noformat}
> instead of {{location}}, {{severity}} and {{ResourceBundle}} from {{ValidationContext}}:
> {noformat}
> public DefaultValidationFailure(@Nonnull String location, Integer severity, @Nonnull ResourceBundle defaultResourceBundle, @Nonnull String messageKey, Object... messageArguments)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)