0

As per my requirement, I need to read some values from properties file when CQ starts. I'm thinking for a solution where I can update crx-quickstart\conf\sling.properties depending on my environment and then when CQ will start then it should read value from this properties file and then I can read from OSGI service. Any advice on how to read from sling.properties file?

Another solution that I'm thinking to create OSGI service which will read from some.properties under c:/somefolder/myprop.properties and then I use @Reference.

Please let me know which approach is better.

Pakira
  • 1,951
  • 3
  • 25
  • 54

2 Answers2

0

Why do you need to read properties when CQ starts? For what? Can you tell us something about the real requirements?

With this amount of information I would create an OSGi bundle with a service that takes such information not from a properties file but from OSGi configuration that can then be stored within the repository or at filesystem level under crx-quickstart/launchap/config.

HTH Davide

davide
  • 232
  • 2
  • 7
0

sound like you need run modes and then use environment configuration nodes of the run mode for a service

http://dev.day.com/docs/en/cq/5-5/deploying/configuring_cq.html#Run Modes

ssmithstone
  • 1,219
  • 1
  • 10
  • 21