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

Programatically create OSGi configuration field

Avatar

Avatar
Validate 1
MVP
ArpitVarshney
MVP

Likes

135 likes

Total Posts

185 posts

Correct Reply

36 solutions
Top badges earned
Validate 1
Establish
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
MVP
ArpitVarshney
MVP

Likes

135 likes

Total Posts

185 posts

Correct Reply

36 solutions
Top badges earned
Validate 1
Establish
Give Back 5
Give Back 3
Give Back 25
View profile
ArpitVarshney
MVP

25-03-2020

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.

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
MVP
Theo_Pendle
MVP

Likes

236 likes

Total Posts

251 posts

Correct Reply

105 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 10
Ignite 1
View profile

Avatar
Validate 1
MVP
Theo_Pendle
MVP

Likes

236 likes

Total Posts

251 posts

Correct Reply

105 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 10
Ignite 1
View profile
Theo_Pendle
MVP

26-03-2020

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  😕

Selection_055.png

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? 

Answers (0)