Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
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.
formatter.format("create path %s(%s) %n", path, type)
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:
create path /content/subtree(nt:unstructured)/example.com(sling:Folder mixin mix:referenceable)
Attachments
Issue Links
- is related to
-
SLING-9961 DefaultAclManager: redundant creation of intermediate path
- Closed
- links to