File based bundle configuration
During development and deployment process it can be a pain have to reconfigure all your bundles in the Felix web interface.
Stanbol offer the bundleconfig mechanism that allow you to save this configurations and apply them automatically.
A bundleconfig artifact is a Maven project with this structure :
mybundlelistFolder | |- pom.xml |- src |- main |- resources |- config |- config1.conf |- config2.conf |- ....
The pom.xml has nothing special. You can copy this one for example and only adapt group and artifact ID to suit your project naming convention.
The configurations are held by files in the src/main/resources/config folder. This configurations files :
- need to respect this naming convention :
- {bundleArtifactID}-{uniqueID}.conf, where {uniqueID} can be anything but unique to not be overloaded.
- for example a configuration file with this name "org.apache.stanbol.enhancer.engines.keywordextraction.engine.KeywordLinkingEngine-entityhub.config" will be used to configure the Keyword Linking Engine bundle.
- contains key-values pairs lines where :
- the key is the fully qualified name of the property (example : org.apache.stanbol.enhancer.engines.keywordextraction.maxSuggestions)
- and the value is a string that contains the needed value for the property. To ensure a correct binding between the value in the configuration file and the property's Java type, this conventions are helpfull :
- "my value" : for String properties
- B"false" : for boolean properties
- I"5" : for int properties
- ["value1","value2"] : for String collection properties
Of course, this bundleconfig bundle can be added to your custom launcher and bundlelist, just be careful to define a higher startlevel to your bundleconfig than the configured bundles' startlevel.