On Thu, Apr 21, 2011 at 12:33 PM, Alessandro Novarini <[email protected]> wrote: > Thanks for pointing me to the right place. > > Please tell me now if I get it right: > > Each bundle can provide an initial content, specifying it into its own > manifest file, using the header named Sling-Initial-Content. > So, for example, if I need to have a content such as > > /var/sling > > I should have something like the following line in my manifest: > > Sling-Initial-Content: SLING-INF/content/var, SLING-INF/content/var/sling
This will only work if the bundle includes a directory SLING-INF/content/var - then the contents of that directory will be loaded at the same repository path, SLING-INF/content/var (which is obviously not what you want). Add the 'path' parameter to the header to specify where the content should go: Sling-Initial-Content: SLING-INF/content/var;path:=/var, SLING-INF/content/var/sling;path:=/var/sling Also check the other parameters available: http://sling.apache.org/site/content-loading.html#ContentLoading-InitialContentLoading but .. > Now, I stopped the bundle org.apache.sling.jcr.jackrabbit.server and started > my custom one, so at first I guessed that, if some content was loaded, I > would find its definition in the bundle I stopped. > > Needless to say that I didn't find anything like that in the > jackrabbit.server manifest, so I tried a deep search in all the sources, but > with no luck. I think the /var/sling stuff is created on a as-needed basis (not as initial content). When a piece of Sling code needs to write something under /var/sling, the necessary ancestor nodes are created if they do not already exist. E.g., see o.a.s.event.impl.AbstractRepositoryEventHandler#startWriterSession - the call to this.createPath is key here. -- Vidar S. Ramdal <[email protected]> - http://www.idium.no Sommerrogata 13-15, N-0255 Oslo, Norway + 47 22 00 84 00 Quando omni flunkus moritatus!
