Shashi
Shashi

Reputation: 746

Why Sling Configuration has two different formats

in Sling, configuration can be deployed either via a sling:osgiConfig node and via a nt:file node having the configuration values.
When i make some changes in Felix Console in some configuration deployed via sling:osgiConfig node, it gets converted to nt:file format.

Why there are these two different formats for configurations in Sling. is there any significant difference between the two?

Upvotes: 2

Views: 638

Answers (2)

Bertrand Delacretaz
Bertrand Delacretaz

Reputation: 6100

I'd say this is mostly for historical reasons, in some cases it's more convenient to provide configurations as hierarchical resources (sling:OsgiConfig) and if the config is coming from a filesystem for example, files are more convenient.

Upvotes: 3

SubSul
SubSul

Reputation: 2563

@Shashi sling:osgiConfig changing to nt:file when you make changes in felix console is expected behaviour. This will not cause any issue when you try to read the config value from java class. You will just not be able to edit the run mode config via crxde when it has changed to nt:file as it stores data as binary content.

However there is a way to disable this behaviour, you will have to uncheck "Enable Write Back" at /system/console/configMgr/org.apache.sling.installer.provider.jcr.impl.JcrInstaller as mentioned in this thread.

OSGi config best practices

Upvotes: 2

Related Questions