Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Apache Sling Context-Aware Configuration - Override via OSGi configuration

Avatar

Avatar
Validate 1
Level 2
aem65user
Level 2

Likes

8 likes

Total Posts

8 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Give Back
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
aem65user
Level 2

Likes

8 likes

Total Posts

8 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Give Back
Boost 5
Boost 3
Boost 1
View profile
aem65user
Level 2

05-03-2020

I am investigating the feasibility of overriding the Context Aware values using OSGi configurations as stated in this document https://sling.apache.org/documentation/bundles/context-aware-configuration/context-aware-configurati...

 

Essentially this is for having different values based on run mode configurations. Not for production environment.

 

For example, I am taking the a sample implementation created by Jörg here. If I want to overwrite the value of the property 'approverGroup' in  caconfig file following the above doc by providing a run mode config for the factory for e.g  org.apache.sling.caconfig.impl.override.OsgiConfigurationOverrideProvider-test1. Is the value for 'overrides' property something like this to do the job. I tried below and it doesn't seem to work. Or am I missing something else?

[/content/test/en]de.joerghoh.cqdump.caconfig.workflow.CaConfigParticipantStepChooserConfig/approverGroup =osgi-approver

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 2
aem65user
Level 2

Likes

8 likes

Total Posts

8 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Give Back
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
aem65user
Level 2

Likes

8 likes

Total Posts

8 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Give Back
Boost 5
Boost 3
Boost 1
View profile
aem65user
Level 2

08-03-2020

The correct config is as following to override via OSGi

overrides="[[/content/test/en]de.joerghoh.cqdump.caconfig.workflow.CaConfigParticipantStepChooserConfig/approverGroup="osgi-approver"]"

 

Corrected the answer as the fix was to change the quotes after the equals sign. 

Answers (1)

Answers (1)

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,429 likes

Total Posts

3,300 posts

Correct Reply

937 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,429 likes

Total Posts

3,300 posts

Correct Reply

937 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

05-03-2020

Both Context aware config and osgi config are different. Context aware config works based on path and OSGi config based on repo/web console value.

 

But whenever you wanna use CAC there you can make a check for user/group to use OSGi config instead of CAC.