[ 
https://issues.apache.org/jira/browse/SLING-9962?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Karl Pauls resolved SLING-9962.
-------------------------------
    Resolution: Fixed

> DefaultAclManager#addPaths prone to causing ConstraintViolationException
> ------------------------------------------------------------------------
>
>                 Key: SLING-9962
>                 URL: https://issues.apache.org/jira/browse/SLING-9962
>             Project: Sling
>          Issue Type: Bug
>          Components: Content-Package to Feature Model Converter
>            Reporter: Angela Schreiber
>            Priority: Major
>             Fix For: Content-Package to Feature Model Converter 1.0.26
>
>
> As discussed in SLING-9961 I suspect that {{DefaultAclManager.addPaths}} is 
> prone to cause {{ConstraintViolationException}} for the following reason:
> - method {{computePathType}} returns a default type (in this case 
> _sling:Folder_) if no primary type can be detected from the content package, 
> without verifying if that node type was legal at the target destination.
> - method {{addPaths}} generates the following repo-init statements: 
> {{formatter.format("create path (%s) %s%n", type, path)}} thus attempting to 
> create all intermediate paths with the same primary type.
> as far as i know Jackrabbit fVault content packages may leave out definitions 
> of intermediate nodes if those are known to already exist (or be created by 
> another package) and only start adding _.content.xml_ for those nodes that 
> actually need to be created.
> i haven't tested it but IMO, the converter should refrain from using a 
> default primary type if the content package doesn't define it. instead it 
> should probably generated repo-init statements as follows or (alternatively) 
> omit paths for which the content packages doesn't allow to unambiguously 
> create the right content structure.
> {code}
> formatter.format("create path %s(%s) %n", path, type)
> {code}
> also creation of intermediate paths could be simplified by using the 
> following repo-init structure, that allows to specify the type of each node 
> in the hierarchy to be created:
> {code}
> create path /content/subtree(nt:unstructured)/example.com(sling:Folder mixin 
> mix:referenceable)
> {code}



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

Reply via email to