Hi all I am currently evaluating if we could use the Sling Installer to handle all the various configuration data needed by the different Stanbol components e.g. - open NLP models - Solr Indexes for the Entityhub - Knowledge Bases (thinking of a Jena TDB Triple Stores with data) - maybe even Kres Ontologies, Rules ... ?!
The Sling Installer provides a plug-in system for "Sling installer factories". Currently there is only a single implementation that handles configuration files [1] but as far as I can currently tell it should be possible to create your own implementation that could install configurations as mentioned in the above list. Managing the Configuration by the user would be very easy. By adding the "org.apache.sling/org.apache.sling.installer.provider.file" bundle a "installer" directory is created in the "sling.home" directory. This directory could be used to add/update/remove configurations. Within the launcher we would need to add such data within the "resources/install" folder. The Sling Lauchpad will parse such resource to the Sling Installer as Installable Resource with the type "InstallableResource.TYPE_FILE". A final Question: Is there a possibility that the Sling Installer also processes resources within deployed bundles. Because sometimes it would be even more convenient to combine a set of configurations to a single bundle (e.g. a local index of dbPedia + the Service configuration to start the SolrYard for this index). Also within the Launcher Project it would be easier to use a bundle (at let mvn do all the downloading) as to manually copy the required data into the "resources/install" folder. Here an example describing such an use case in more details: Lets assume a bundle that contains the following "resources/config/" -> some config files that init the needed OSGI components "resrouces/install" -> some files that need to be installed. The correct Stanbol Installer Factory is called by evaluating the extension Now the user drops this Bundle into the "/sling/installer" folder (1) Sling installs the new Bundle (2) Sling recognizes that this Bundle contains some resources it needs to process (3) Sling parses the files within the "resources/install" folder to the Stanbol Installer Factory (4) Sling parses the files within the "resources/install" to [1]. By that way the needed Services are created by using the ConfigAdminService My question is if Sling already provides some functionality for (2). I would like to have some feedback about this proposal. I there is the opinion that something like that would make sense I will create an Issue and implement a first demonstrator. WDYT Rupert Westenthaler [1] http://svn.apache.org/viewvc/sling/trunk/installer/factories/configuration/ [2] http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/ ---------- Forwarded message ---------- From: Bertrand Delacretaz <[email protected]> Date: Fri, Mar 4, 2011 at 6:06 PM Subject: Re: Default OSGi configs (was: Redesigning the Entityhub Configuration) To: [email protected] On Thu, Mar 3, 2011 at 9:16 AM, Rupert Westenthaler <[email protected]> wrote: > On Wed, Mar 2, 2011 at 3:59 PM, Bertrand Delacretaz > <[email protected]> wrote: >> ...Using Sling's org.apache.sling.launchpad.installer bundle, configs >> included as text files in the runnable jar, under resources/config, >> are installed at startup... >... > +1 This would be the preferred solution to provide the configuration of the > core components for the Entityhub... Ok, I have added an example config to the enhancer launcher in http://issues.apache.org/jira/browse/STANBOL-110 including a test that verifies its presence. To add similar configs in other launchers you'll need to add a few Sling utility bundles, see http://svn.apache.org/viewvc?view=revision&revision=1078044 -Bertrand -- | Rupert Westenthaler [email protected] | Bodenlehenstraße 11 ++43-699-11108907 | A-5500 Bischofshofen
