you did not document which value you have put to the Sling-Initial-Content header of your bundle. i assume it is something like:
<resource-path>;overwrite:=true;ignoreImportProviders:=xml;path:=/apps so, by definition [1], it's cleans everything below /apps. in your case you only want to deploy to /apps/test, but also you want to set some properties on /apps/test itself. that's a usecase that is indeed not ideally supported from the content loader in combination with JSON file format. for this special case you may combine multiple entries in Sling-InitialContent, e.g. <resource-path-1>;overwrite:=true;ignoreImportProviders:=xml;path:=/apps/test, <resource-path-2>;overwriteProperties:=true;path:=/apps resource-path-1 contains all your json files of the application, resource-path-2 just on test.json with the properties for the /apps/test node. please note: i've not tested this if this works at all! i never encountered this usecase myself. maybe you can change your usecase to avoid properties on the root node of the content load path. stefan [1] https://sling.apache.org/documentation/bundles/content-loading-jcr-contentloader.html >-----Original Message----- >From: Andreas Schaefer [mailto:[email protected]] >Sent: Thursday, August 1, 2019 11:12 PM >To: dev >Subject: Sling Initial Content with Root Folder properties > >Hi > >This might be a stupid question but I am stumbling here. > >If I have a folder structure like: > >/apps > /test > /subtest > >And I want to add properties to /apps/test like jcr:title. >For that I would need to create a file like this: > >SLING-INF/apps/test.json > >Now how would it set the sling initial content configuration to make >/apps/test to be updated but does not whip out /apps. >In the old, content package model we had .content.xml inside /apps/test so >there was no issue with having the root node properties updated. > >Cheers - Andy Schaefer
