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.
Solved! Go to Solution.
Views
Replies
Total Likes
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?
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?
Views
Likes
Replies