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

Enable / Disable scheduler via Context Aware Configuration

Avatar

Avatar
Level 1
ashishj32959934
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
ashishj32959934
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile
ashishj32959934
Level 1

23-03-2021

Hi All,

 

I created a scheduler which is having enable / disable configuration at OSGI level. I want to move this enable / disable checkbox to Context Aware Configuration so that it can be possible to enable it for different tenants. 

 

Is it possible to do that ?

View Entire Topic

Avatar

Avatar
Validate 1
Level 7
KiranVedantam1992
Level 7

Likes

159 likes

Total Posts

159 posts

Correct Reply

47 solutions
Top badges earned
Validate 1
Establish
Give Back 3
Give Back
Boost 50
View profile

Avatar
Validate 1
Level 7
KiranVedantam1992
Level 7

Likes

159 likes

Total Posts

159 posts

Correct Reply

47 solutions
Top badges earned
Validate 1
Establish
Give Back 3
Give Back
Boost 50
View profile
KiranVedantam1992
Level 7

23-03-2021

Hi @ashishj32959934,

 

yes, this is possible. Create a context-aware configuration and access it in the scheduler like this:

 

Resource contentResource = resourceResolver.getResource("/content/mysite/page1");

Resource configResource = configurationResourceResolver.getResource(contentResource, "my-bucket", "my-config");

 

More info here: https://sling.apache.org/documentation/bundles/context-aware-configuration/context-aware-configurati...

 

Hope this helps.

 

Thanks,

Kiran Vedantam.