Reputation: 45
I need a way to retrieve Kura compontents metadata. For instance, when you add a new component from the Kura web interface, you are prompted with a data form which has different fields according to the component you've added. Some of these fields are required and some are not, some of them require a value in a specific range and some are up to the user, etc. I would like to know if there is a Kura API that could give such data, like information about the data a component needs and what type of data. I was giving a look at the classes ComponentConfiguration
and ConfigurationService
but I didn't find anything useful. Is there a way to retrieve and get such data?
Upvotes: 0
Views: 70
Reputation: 499
Actually, there are three ways to obtain what you need in Kura 5.1.1:
rest.configuration
permission assigned to the user you use.Upvotes: 0
Reputation: 136
If you implement an OSGi bundle that implements the ConfigurableComponent
interface, then all the metatype data will be passed as a Map<String, Object>
to the activation and updating hook methods. You can then extract the inserted value by specifying the key of the searched property.
In the Kura documentation you can find some examples.
Upvotes: 0
Reputation: 1324
Just share my understanding of Kura, FYI.
As we know, Kura is based on OSGi framework and provides some extra features like MQTT integration and friendly user interfaces, etc.
So, at its core, Kura shall be agnostic to user component's implementation, the interfaces like ComponentConfiguration
and ConfigurationService
are only helping Kura to compose user interfaces, but not designed to understand the configuration details.
In my opinion, Kura will not provide such APIs to describe the details of components' configuration, but you can write a component to read from your target components via above-mentioned interfaces and try to understand according to some beforehand knowledge.
Upvotes: 1