Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-4922

Validator should be allowed to get the resource on which validation was triggered

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • Validation 1.0.0
    • Validation
    • None

    Description

      Currently the Validator interface only gets the ValueMap on which the validation has been called (https://github.com/apache/sling/blob/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/Validator.java#L75). But sometimes this is not enough because more information need to be evaluated in the validator.
      For example the resource path or even the original resource is now completely inaccessible (except via weird workaround like casting to JcrPropertyMap and calling the deprecated getPath() on it). Therefore the validator should also get the resource on which the validation has been called originally (this must be null in case the validation has been triggered directly on a ValueMap).
      That way it would be possible to e.g. get information about the container resource or get a Sling Model of that resource.

      Attachments

        Activity

          People

            kwin Konrad Windszus
            kwin Konrad Windszus
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: