You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2020/11/26 17:00:07 UTC

[jira] [Comment Edited] (JCRVLT-479) jackrabbit-nodetypes validator: validation fails "overeager" for protected properties

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

Konrad Windszus edited comment on JCRVLT-479 at 11/26/20, 4:59 PM:
-------------------------------------------------------------------

The problem here is the "autocreated" which is orthogonal to "protected" (https://docs.adobe.com/content/docs/en/spec/jcr/2.0/3_Repository_Model.html#3.7.2.3%20Auto-Created). I think for "autocreated" non-protected properties we need to relax the validation.

jcr:primaryType and jcr:mixinType are different, because FileVault has code that treats them differently during import. Therefore those are hard-coded. "autocreated" properties are not treated specially by FileVault import.


was (Author: kwin):
The problem here is the "autocreated" which is orthogonal to "protected" (https://docs.adobe.com/content/docs/en/spec/jcr/2.0/3_Repository_Model.html#3.7.2.3%20Auto-Created). I think for "autocreated" non-protected properties we need to relax the validation.

jcr:primaryType and jcr:mixinType are different, because FileVault has code that treats them differently during import. There those are hard-coded. "autocreated" properties are not treated specially by FileVault import.

> jackrabbit-nodetypes validator: validation fails "overeager" for protected properties
> -------------------------------------------------------------------------------------
>
>                 Key: JCRVLT-479
>                 URL: https://issues.apache.org/jira/browse/JCRVLT-479
>             Project: Jackrabbit FileVault
>          Issue Type: Improvement
>          Components: vlt
>    Affects Versions: 3.4.6
>            Reporter: Stefan Seifert
>            Priority: Major
>
> 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:
> {noformat}
> [cq:Tag] > mix:title, nt:hierarchyNode
>   orderable
>   - * (undefined) multiple
>   - * (undefined)
>   - sling:resourceType (string) = 'cq/tagging/components/tag' mandatory autocreated
>   + * (nt:base) = cq:Tag version
> {noformat}
> 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:
> {noformat}
> [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
> {noformat}
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)