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

Reading sling:OsgiConfig into @ObjectClassDefinition

Avatar

Avatar
Validate 1
Level 2
Adilmo
Level 2

Likes

6 likes

Total Posts

65 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
Adilmo
Level 2

Likes

6 likes

Total Posts

65 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile
Adilmo
Level 2

20-08-2020

We have a OSGI Service (using R7 DS annotation). We are using OCD as innerclass within the service.

Also, we would like the component to read properties from the predefined sling:osgiconfig nodes in JCR.

Configuration policy is defined as required.

When the component/service load it goes into a "no config" state.

Need help to read these configs from sling:osgiConfig nodes.

View Entire Topic

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,358 likes

Total Posts

3,228 posts

Correct Reply

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

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,358 likes

Total Posts

3,228 posts

Correct Reply

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

22-08-2020

Why do you want to read sling:OsgiConfig values inside OCD?

OCD is used to declare the OSGi config structure.

 

You can declare OCD the same as config values but in the end, the value will be read from the defined value in repository.

 

Example

https://github.com/arunpatidar02/aem63app-repo/blob/master/java/SimpleScheduledTask.java