There is not a way for a Designate element to alter the OCD to which it refers. So it would be up to any UI to detect that multiple Designates refer to the same OCD and generate a UI which can disambiguate them. So Felix Web Console should be updated.
--

BJ Hargrave
Senior Technical Staff Member, IBM // office: +1 386 848 1781
OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788
hargr...@us.ibm.com
 
 
----- Original message -----
From: Konrad Windszus via osgi-dev <osgi-dev@mail.osgi.org>
Sent by: osgi-dev-boun...@mail.osgi.org
To: OSGi Developer Mail List <osgi-dev@mail.osgi.org>
Cc:
Subject: [osgi-dev] Overwriting OCD name per Designate
Date: Mon, Jan 28, 2019 9:04 AM
 
 
We have a use case where we want to reuse the same metatype OCD for multiple different designates.
 
The according metatype xml  (generated by bnd from Annotations, ) looks like this
 
<?xml version="1.0" encoding="UTF-8"?>
<metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.2.0" localization="OSGI-INF/l10n/com.adobe.acs.commons.httpcache.config.impl.KeyValueConfig">
  <OCD id="com.adobe.acs.commons.httpcache.config.impl.KeyValueConfig" name="ACS AEM Commons - HTTP Cache - Key / Value extension" description="Defined key / values that will be allowed for this extension.">
    <AD id="allowedKeys" type="String" cardinality="2147483647" name="Allowed keys" description="ValueMap keys that will used to generate a cache key." default=""/>
    <AD id="allowedValues" type="String" cardinality="2147483647" name="AllowedValues" description="If set, narrows down specified keys to specified values only." default=""/>
    <AD id="emptyAllowed" type="Boolean" name="Empty is allowed" description="Allows no value match to be a cache entry." default="false"/>
    <AD id="configName" type="String" name="Config Name" default=""/>
  </OCD>
  <Designate factoryPid="com.adobe.acs.commons.httpcache.config.impl.RequestCookieHttpCacheConfigExtension">
    <Object ocdref="com.adobe.acs.commons.httpcache.config.impl.KeyValueConfig"/>
  </Designate>
  <Designate factoryPid="com.adobe.acs.commons.httpcache.config.impl.RequestHeaderHttpCacheConfigExtension">
    <Object ocdref="com.adobe.acs.commons.httpcache.config.impl.KeyValueConfig"/>
  </Designate>
  <Designate factoryPid="com.adobe.acs.commons.httpcache.config.impl.RequestParameterHttpCacheConfigExtension">
    <Object ocdref="com.adobe.acs.commons.httpcache.config.impl.KeyValueConfig"/>
  </Designate>
  <Designate factoryPid="com.adobe.acs.commons.httpcache.config.impl.ValueMapValueHttpCacheConfigExtension">
    <Object ocdref="com.adobe.acs.commons.httpcache.config.impl.KeyValueConfig"/>
  </Designate>
</metatype:MetaData>
 
 
Within the Apache Felix Web Console. those appear 4 times with the same name "ACS AEM Commons - HTTP Cache - Key / Value extension" (only), although each refers to a different OSGi service. Is it possible to easily overwrite the OCD name per Designate somehow or would you rather say this is a bug/limitation of the Felix Web Console which just exposes the OCD name but not the factory PID in the UI?
 
Thanks,
Konrad
 
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev
 

_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to