0
votes

what is the use of sling run modes property in sling.properties file?

I have a osgi felix bundle that installed onto aem admin bundle console through aem cq5 package manager.

**

configuration properties of one of the bundle service is not available unless I put the following line in cq5/config/sling.properties file. sling.run.modes=author,sandbox why is this so ? what is the importance of sling.run.modes ?

**

Thank you, Sri

1

1 Answers

2
votes

Run modes allow you to tune your AEM instance for a specific purpose; for example author or publish, test, development, intranet or others. Exampe: For dev: sling.run.modes=author,dev

use of run mode is, example - i have a config.author.prod and config.author.dev in crxd/e. Based on the run mode instance, the OSGI Bundle will pick the corresponding config.author.dev or prod configuration settings defined in nt:unstructured and start working.

Ref: https://docs.adobe.com/docs/en/cq/5-6-1/deploying/configure_runmodes.html

Ref: https://helpx.adobe.com/experience-manager/kb/RunModeDependentConfigAndInstall.html

Define a respository-based configuration for a single instance There are two ways to configure CQ5.

Configure the Apache Felix Web Management Console

The configuration on the Apache Felix Web Management Console (http://:/system/console/configMgr) is always specific for the current instance. You can find a description in the documentation: http://dev.day.com/content/docs/v5_2/html-resources/cq5_guide_system_administrator/ch05s03.html

Repository-based configuration

It is also possible to store configuration in the CRX repository as nodes of nodetype sling:OsgiConfig.

For more information, see http://dev.day.com/content/docs/v5_2/html-resources/cq5_guide_system_administrator/ch05s02.html

With this method, it is possible to share configuration among several instances. The name of these nodes must be equal to the Persistent Identity (PID) of the configuration (for example, the name of the service). If you look at http://:/system/console/config, you see these names listed as service.pid properties. These configuration nodes have to be child-nodes of nodetype nt:folder with a name starting with config followed with a dot. All the run-modes that the config applies to are also separated with a dot.

Examples: config.author, config.publish, config.author.dev, config.author.foo.dev, and so on.