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.
Solved! Go to Solution.
Views
Replies
Total Likes
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
@Adilmo Can you go to /system/console/components or /system/console/configuration and see if you are able to see your service class? If yes try to click/open and see what is the PID it is populating..
Even you can fill the configuration from osgi console once, copy the content to your local config file and then delete the file
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
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
Views
Replies
Total Likes
Views
Replies
Total Likes
probably you should check activate and modified annotations
@activate
@Modified
protected void activate(final Config config) {
myParameter = config.myParameter();
}
Other example you can find on https://github.com/adobe/aem-guides-wknd/blob/archetype-18.1/ui.apps/src/main/content/jcr_root/apps/...
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
hi, You can check examples from https://github.com/Adobe-Consulting-Services/acs-aem-commons/tree/master/ui.apps/src/main/content/jc...
I don't have any now but I will setup a package and share with you.
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies