Programatically create OSGi configuration field
Hi Folks,
Is there any way to create OSGi configuration field dynamically?
For example: create a OSGi field dropdown whose values comes as a response from some API.
Hi Folks,
Is there any way to create OSGi configuration field dynamically?
For example: create a OSGi field dropdown whose values comes as a response from some API.
Hi Arpit 🙂
Unfortunately I don't think so because configuration are built using Java backend classes annotated with annotations from org.osgi.service.metatype.annotations such as @ObjectClassDefinition to define a configuration and @AttributeDefinition to define an attribute of that configuration
If we look at the @AttributeDefinition documentation we can see that it is processed at compile-time and not run-time, so no possibility for the backend to call an API to populate a list of option 😕😕

The fronted libraries loaded on the configuration page do not come from /libs but from /system/console/res/lib, so it's not possible to override them either.
I'm curious, what's your use-case?
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.