On Fri, Oct 30, 2009 at 7:51 PM, Alexander Klimetschek <[email protected]> wrote:
> On Fri, Oct 30, 2009 at 18:21, Vidar Ramdal <[email protected]> wrote:
>> Is there a way to provide configuration files (*.config) as
>> initial-content in a bundle?
>>
>> We need to set a config property for the Authorization Header
>> Authenticator, and I've found the config file under the
>> sling/config/org/o/a/s/httpauth/impl/AuthorizationHeaderAuthenticationHandler.config
>> - which I have edited.
>> Now, I'd like to apply this configuration when I install a bundle.
>>
>> Is that possible, and how?
>
> Yes, using the jcrinstall bundle and creating a sling:OsgiConfig node
> (which you can easily define as initial content). The node must reside
> in a "config" folder [...]

You mean "install", right?

> and have the name of the service pid, ie. the
> class name. For Example:
>
> /libs/sling/config/org.apache.sling.commons.log.LogManager
>
> The properties of this node will be mapped one to one on OSGI config
> properties, eg.
>
> org.apache.sling.commons.log.level = info
> (string property)
>
> See also "Install, modify and remove a configuration" on
> http://sling.apache.org/site/jcr-installer-jcrjcrinstall-and-osgiinstaller.html


I'm struggling to get this to work. When I manually create a
LogManager.factory.config configuration (through the web console), the
configuration appears on the "Configurations" drop down list. Also, a
.config file is created in the
sling/config/o/a/s/c/log/LogManager/factory/config directory, called
dc2c6dfb-47c4-40c8-bf55-1651bb557504.config.
The configuration also works: The custom logging I've set up is working.

Now, to avoid having to set this up manually each time I deploy my
application, I thought I could just put that file in my bundle, and
loading it as initial content under
/apps/mybundle/install/dc2c6dfb-47c4-40c8-bf55-1651bb557504.config
Granted, the file gets picked up by JCRInstaller. In the
aforementioned directory I now get an empty *folder* called dc2c6dfb.
OK, maybe JCRInstaller chokes on the dashes (-) in the filename, so I
removed those, renaming the file in my bundle to
c2c6dfb47c440c8bf551651bb557504.config

When installing the bundle again, the file pops up in the correct
directory - but not on the drop down list on
/system/console/configMgr. And the configuration is not working.

What am I doing wrong? (I'm not really experienced with OSGI config stuff).



-- 
Vidar S. Ramdal <[email protected]> - http://www.idium.no
Sommerrogata 13-15, N-0255 Oslo, Norway
+ 47 22 00 84 00 / +47 21 531941, ext 2070

Reply via email to