Hi all

I am working on "older" Sling setups that do not yet use the feature
model to describe instances. Rather they leverage the OSGi Installer
for deployment of bundles and configurations.

Currently I am looking into using Repoinit for setting up
Service-Users and ACLs, and possibly also paths and groups. The
current implementation of the Repoinit JCR bundle allows setting up
factory configurations with "scripts" and "references". Scripts are
little (or not so little) snippets of Repoinit DSL, references are
URLs to files containing Repoinit DSL. So far so good.

For a maintainable setup, the Repoinit DSL should be checked into Git
(or SCM of choice). However, as Dan already noticed in "SLING-9524 -
Add Support for Bundle URL References", it is not currently possible
to reference bundle resources in a stable fashion. This renders the
"references" Configuration virtually useless (that may be too harsh,
maybe I am missing something). The "scripts" configurations work, but
they require the Repoinit DSL to be embedded in a configuration file,
typically requiring escaping and all on one line.

To improve the situation I have two suggestions.

(1) Add support for a Bundle-Header (e.g. Sling-RepoInit) with a comma
separated list of paths to bundle resources. This would allow
embedding Repoinit Files into bundles, which could be useful for
keeping service-users creation and bundles together. However, this
solution would not lend itself to supplying runmode-specific Repoinit
files. Of course the header could be extended to support a runmode
qualifier, but to me at least it starts to feel a little wrong when
bundles (i.e. code) have to know so much about runmodes (i.e.
deployments).

(2) Add OSGiInstaller support for Repoinit files. I.e. recognize files
in "install" or "config" folders with a ".txt" extension that can be
parsed by the RepoInitParser. This requires separate deployment, e.g.
via a content-package. However, runmode support then comes out of the
box.

I could imagine adding one or both of these solutions to the Repoinit
JCR bundle.

Any thoughts on this? Are there any concerns regarding security or
other objections?

Thanks
Julian

Reply via email to