I am attempting to add new content to the "tools" > "general" tab within aem. To get the node structure accurate, I have overlaid the node directory /libs/cq/core/content/nav/tools/general, then created the necessary node underneath general for my content.
The issue is when I try to recreate this structure within my codebase and get build errors. When I copy the node structure exactly as it is in the CRXDE after overlaying, below are the following errors. I have updated the filter.xml file as well. Is there something I am missing within the ui.apps pom.xml file perhaps?
As you can see it mentions there's an issue with the node type nt:unstructured being a child of nt:folder. But no where in my structure is there a parent to these nodes with nt:folder. I must be misinterpreting something here, because this error does not make sense to me.
--------------------------------------------------
[ERROR] ValidationViolation: "jackrabbit-nodetypes: Node '{}nav [nt:unstructured]' is not allowed as child of not contained node with potential default types '[nt:folder]': Could not find matching child node definition in parent's node type", filePath=jcr_root\apps\cq\core\content\nav\.content.xml, nodePath=/apps/cq/core/content/nav, line=3, column=39
[ERROR] ValidationViolation: "jackrabbit-nodetypes: Node '{}tools [nt:unstructured]' is not allowed as child of not contained node with potential default types '[nt:folder]': Could not find matching child node definition in parent's node type", filePath=jcr_root\apps\cq\core\content\nav\.content.xml, nodePath=/apps/cq/core/content/nav/tools, line=4, column=46
[ERROR] ValidationViolation: "jackrabbit-nodetypes: Node '{}general [nt:unstructured]' is not allowed as child of not contained
node with potential default types '[nt:folder]': Could not find matching child node definition in parent's node type", filePath=jcr_root\apps\cq\core\content\nav\.content.xml, nodePath=/apps/cq/core/content/nav/tools/general, line=5, column=53
---------------------------------------------------
Solved! Go to Solution.
Views
Replies
Total Likes
With the filter root being
<filter root="/apps/cq/core/content/nav/tools/general"/>
all nodes you declared in the hierarchy (for example apps/cq/core/content) are ignored by the plugin and the content structure is build based on the default node type for structures (nt:folder). That means even when you define apps/cq/core/content as a nt:unstructured, the plugin ignores it.
That also means, that changing the filter root to "/apps/cq" makes the plugin taking your definitions into account.
I discovered the issue, but the resolution does not make sense to me. In the filter.xml file I had:
<filter root="/apps/cq/core/content/nav/tools/general"/>
If a node doesn't exist in crx and you are trying to upload a child node under it using package manager or build, it will automatically create the parent node with nt:folder.
Hi thanks for the reply,
But I am not sure it relates specifically to my case. My errors were showing as a result of trying to build the package with maven, prior to any type of installation. Within my code structure, I had specified each of the node types within each .content.xml file for the following paths and nodes: /apps/cq/core/content/nav/tools/general, and none were of type nt:folder. So within my structure, all nodes were present and defined correctly according to the node types for libs.
Let me know if I am misinterpreting what you're saying, or if what I mentioned here makes more sense now.
Thank you for clarifying.
You correctly understood what I've responded above. If the parent nodes already exist, my explanation doesn't help your question. So, I need to think this differently.
With the filter root being
<filter root="/apps/cq/core/content/nav/tools/general"/>
all nodes you declared in the hierarchy (for example apps/cq/core/content) are ignored by the plugin and the content structure is build based on the default node type for structures (nt:folder). That means even when you define apps/cq/core/content as a nt:unstructured, the plugin ignores it.
That also means, that changing the filter root to "/apps/cq" makes the plugin taking your definitions into account.
Interesting. So even if I am defining all levels of filter roots within the ui.app.structure pom's filevault-package-maven-plugin file per documentation, like so:
you could define all nodes in the path /apps/cq/core/content/nav/tools/ to nt:unstructured nodes (by providing a proper .content.xml or whatever way you prefer); because then filevault never falls back to its defaults (which is a nt:folder for a folder in your content structure). Then the simplest case with a filter root of /apps/cq would be sufficient.
Sorry, I worded my previous comment strange. What you just explained is exactly how I had things structured, per the documentation, and the build was still failing. I had all .context.xml files defined, as well as all filter root paths defined. That's was what so confusing to me as why it kept failing.
Views
Likes
Replies
Views
Likes
Replies