Setting properties in Adobe CQ5

Tags: osgi cq5 sling
By : Kostya
Source: Stackoverflow.com
Question!

I'm working on CQ5 based app, which is a whole new area for me as I was mainly working on Spring based web-apps before.

The app is maven project based on Blue-prints archetype(http://www.cqblueprints.com/xwiki/bin/view/Blue+Prints/The+CQ+Project+Maven+Archetype).

Now I have a question, what is a standard approach to add some properties, that would normally go to config.properties (or alike) file in standard web-app. Properties that contain things like hostNames, accountNumbers and alike.

Cheers.

By : Kostya


Answers

ConfigService example may not be the best approach since the ComponentContext should only be depended upon during component activation and deactivation.

By : David


Thanks a lot to Bertrand, your answer really pointed me in the right direction.

What I did was I created .ConfigService.xml for each of my ran modes, which looks like that:

By : Kostya


This video can help you solving your question :)
By: admin