Uploaded image for project: 'Jackrabbit FileVault'
  1. Jackrabbit FileVault
  2. JCRVLT-479

jackrabbit-nodetypes validator: validation fails "overeager" for autocreated properties

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.6
    • 3.4.8
    • vlt
    • None

    Description

      having a property node type definition defined for validation (e.g. from https://github.com/Netcentric/aem-nodetypes) may lead to problems when the node type definition contains properties defined as autocreated.

      example:

      [cq:Tag] > mix:title, nt:hierarchyNode
        orderable
        - * (undefined) multiple
        - * (undefined)
        - sling:resourceType (string) = 'cq/tagging/components/tag' mandatory autocreated
        + * (nt:base) = cq:Tag version
      

      the problem is that a package exported from the repository usually contains this property and then the validation fails (although the property has exactly the value given as default value here). leading to a failed build with:

      [ERROR] ValidationViolation: "jackrabbit-nodetypes: Property 'sling:resourceType' [String] is not allowed in node with potential default types [cq:Tag]: Property is auto-created and can not be manually added", filePath=jcr_root\content\_cq_tags\sample\.content.xml, nodePath=/content/cq:tags/sample, line=6, column=52
      

      sample project to reproduce the problem: https://github.com/stefanseifert/filevault-package-maven-plugin-validation-issues/tree/master/content-packages/sample-content

      the code currently has a hardcoded list of properties to ignore this behavior (jcr:primaryType, jcr:mixingTypes). but this does not help for other properties. i'm wondering if this validation is really helpful or should be removed or disabled? alternatively the list of allowed protected properties could be made configurable.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sseifert Stefan Seifert
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: