To make a OSGI factory configuration, provided factory = true using R6 annotations and was able to create factory configs, but when uploaded the configs via xmls using a unique identifier, that identifier is not picked in the display name.
For example config.xml's name is "com.x.y.z.someserviceimpl-<identifier>" while displaying in the felix console it shows some randomly generated number "com.x.y.z.someserviceimpl.09433545561-447d-98b3-1a514342323". As we have multiple xmls, it's tedious to open each config to change a property in runtime. Is there a specific property which we can give, so that config picks the specific name?
Similar to factory configurations PIDs like "org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl" and "org.apache.sling.commons.log.LogManager.factory.config"
Solved! Go to Solution.
Views
Replies
Total Likes
Please try below solution for your requirement.
Config property: define this "webconsole_configurationFactory_nameHint" in config class & this configuration property which defines a name template which is used to build the configuration factory item name when displayed in the Configuration Manager. It allows referencing other service property names as placeholders by enclosing in brackets.
if you already have some unique name in existing property list then you can reuse that instead of defining new one like name() property in below screenshot & add that property as default "some text : {uniquePropertyName}"
Run modes : define unique id/name for each config in run modes
System Console Configuration Manager : it will show unique name as defined in run modes for each config
Hi @asha998919,
While having configs as part of code package, make sure to create a node of type sling:OsgiConfig in the name of PID-<<uniqueIdentifier>>
not as an XML file.
Screenshots for reference:
From project specific config folder:
From /apps/system/config :
From Felix console:
Views
Replies
Total Likes
Views
Replies
Total Likes
Can you try to add it manually from CRXDE (Perhaps in your local instance if the issue is reproducible there, create OSGI config node under config folder of your project) and observe the behavior in Felix console?
Views
Replies
Total Likes
Please try below solution for your requirement.
Config property: define this "webconsole_configurationFactory_nameHint" in config class & this configuration property which defines a name template which is used to build the configuration factory item name when displayed in the Configuration Manager. It allows referencing other service property names as placeholders by enclosing in brackets.
if you already have some unique name in existing property list then you can reuse that instead of defining new one like name() property in below screenshot & add that property as default "some text : {uniquePropertyName}"
Run modes : define unique id/name for each config in run modes
System Console Configuration Manager : it will show unique name as defined in run modes for each config
Views
Replies
Total Likes
You’re welcome ...
Views
Replies
Total Likes
Views
Likes
Replies