Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Configurations with MetaType and Component References Support #387

Closed
stbischof opened this issue Nov 26, 2022 · 7 comments · Fixed by #390 or #391
Closed

add Configurations with MetaType and Component References Support #387

stbischof opened this issue Nov 26, 2022 · 7 comments · Fixed by #390 or #391
Labels
enhancement New feature or request

Comments

@stbischof
Copy link

Is your feature request related to a problem? Please describe.

I would like to like to add and edit a Configuration with more ui support. The current ui allows to add key value pairs with an Type. To a defines Config or Factory Pid. ther is so UI support on finding PIDs or configurable properties-

Describe the solution you'd like
I would like to have additional:

  • Section (Factory)-Pid
    • selection menu of of existing/creatable (Factory)-Pid
  • Section MetaType
    • uses MetaTypeDefinition to show all Properties that could be configures with Name/Description/Cardinality/Type/Options
  • Section SCR/DS
    • show all Component-Reference of the component with this pid to configure the target filter using the Configuration view.
    • calidate filter
    • UI support so select a Service By its Service-Pid or any ohter property
    • helpfull description like The filter expression (ldap) allows to filter concrete services by their service-properties. e.g. '(prop1=foo)' or '(&(prop1=foo)(!(prop2=bar)))', it is common to filter on service-pid with '(service.pid=the.pid.of.Service.e3133f18-4143-48af-be7e-526a4ada2fd0)'. In special cases a filter could avoid that any service is filtered using '(&(must.not.resolve=*)(!(must.not.resolve=*)))'.

Describe alternatives you've considered
nope

Additional context

example how it looks in Felix web-console then defining target filter as metatype ( not the best way)

image

@amitjoy
Copy link
Owner

amitjoy commented Nov 26, 2022

Hi @stbischof,

Thanks a lot for your feature requests. Some of the features you mentioned, I believe, already exist as of now.

The Configurations tab lists all configurations -

  • that have already been created in ConfigurationAdmin
  • all the metatype descriptions by which new configurations can be created

After the configuration is created, if the configuration has an associated metatype descriptor, the corresponding entry in the Configurations tab will show the metatype attributes and proper UI controls based on the metatype attribute definition type and cardinality too.

If you have a factory configuration with metatype, you will see the factory PID listed in a row in the Configurations tab and then you can expand, configure and save it and the new configuration will be created and listed as a new row in the Configurations tab.

Also note that, you can create a configuration based on the cardinality of the attribute definition as well.

For your last proposal, I would need a little bit more clarifications to understand it properly.

  1. If I understood you correctly, you would like to be able to configure the target filters of all the injected service references of the components that use this configuration, right?
  2. You would also like to select service/component that use a specific PID or any other property, right? This means, it could be a feature possibly in Services or Components tab. What do you think?
  3. As far as I know, currently web console also allows to create configurations based on metatype if metatype description for a configuration is available which is also supported by OSGi.fx. Could you kindly elaborate about the screenshot of the Felix Web Console you attached?

Eagerly looking forward to your further support.

@amitjoy amitjoy added the enhancement New feature or request label Nov 26, 2022
@stbischof
Copy link
Author

The Configurations tab lists all configurations -

    that have already been created in ConfigurationAdmin
    all the metatype descriptions by which new configurations can be created

this seems not work at my installation. will investigate

I would like to this feature when adding a new Configuration (same as when update later)
I thing Configuration is better place than service or Component.
Section in the UI:

  • Service-Properties
    • service.ranking
    • service.enable
  • Metatype
    • show all Information from Metatype ( names, descriptions, types, options, required)
  • Componenr-Reference Target filter
    • list all reference names with the current filter (add an dialog where you can select other services of the required ServiceType) and when selecting a service you can show all servicePropers of this service an select one or multiple service propertye. this properties are used to generate a filter
  • Additional Properties
    • like now in the Create New Configuration menu. add more free defines types

Screenshot from 2022-11-26 14-40-34

@amitjoy
Copy link
Owner

amitjoy commented Nov 26, 2022

In OSGi.fx application, you can go to Configurations tab, and go a bit below in the list, you will see some entries that are colored like this:

Screenshot 2022-11-26 at 17 23 56

These are the the metatype entries that have no bound location - that is, no configuration has been created yet.

If you expand one of the entries, you can see that it shows you the metatype attribute names, descriptions, default values and the proper controls based on the metatype attribute definition type. It also takes care of the cardinality - that means, if you have an attribute with multiple cardinality - it will let you add multiple values to it.

Screenshot 2022-11-26 at 17 24 19

On the other hand, the one you showed in the previous comment (OSGi.fx -> Actions -> Add New Configuration) is meant only for creating a simple ConfigurationAdmin configuration which supports the basic OSGi DTO types, otherwise, it will be really very complex for enabling any custom types.

In terms of Component-Reference Filter: You basically need to update the target filters of the component's references. Shouldn't it be in the format of referenceName.target? I can simply add these in the respective components, that is, one can go to Components tab, expand the respective component and then edit the target filters of all service references the component currently has. It will then create a new ConfigurationAdmin configuration if not already available or update the current configuration if it has already been created.

@amitjoy
Copy link
Owner

amitjoy commented Nov 26, 2022

After thinking about it, I strongly believe, I should add a respective section after expnding the entry of the configuration in Configurations tab for all the component references that use this PID.

@stbischof
Copy link
Author

Ah I wasn't able to add a config and could not see the any item in the configs view. but good to know

@amitjoy
Copy link
Owner

amitjoy commented Nov 28, 2022

@stbischof Probably the metatype bundle is not wired to OSGi.fx agent bundle as the metatype package is optionally imported to ensure that without metatype, it should also work.

@stbischof
Copy link
Author

now i can see it. not change the setup since yesterday. meta ans scr had been thew re. but thx now i can see that most was there

@amitjoy amitjoy changed the title add Configurations wit MetaType and Component References Support add Configurations with MetaType and Component References Support Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants