Hi,

I would like to use a custom capability defined in my repository.xml and a
filter to match only the bundles matching these capabilities.

I joined the extract of my repository.xml corresponding to the bundle
description, the entry is generated with the maven-bundle-plugin and a
custom obr.xml to add my custom property.

And here is the code portion I use to get the resource corresponding to my
bundle.

   final String filter = "(sensortype=thermometer)";

Resolver resolver = repositoryAdmin.resolver();

Resource[] resources = repositoryAdmin.discoverResources(filter);


Unfortunately this doesn't work, and I'm not if it comes from the way I use
my custom capability and the filter or if there is another problem
elsewhere.


Could anyone tell me if the way of doing this is right, or point me to doc
explaining how to do it ?


Thanks in advance.


Pierre-Yves Aillet
<resource id='org.cnam.osgi.android.thermometer-view/0.0.1' symbolicname='org.cnam.osgi.android.thermometer-view' presentationname='Unnamed - org.cnam.osgi.android:thermometer-view:bundle:0.0.1' uri='http://blaz.is-a-geek.org/repository/org/cnam/osgi/android/thermometer-view/0.0.1/thermometer-view-0.0.1.jar' version='0.0.1'> 
    <size>10224</size> 
    <capability name='bundle'> 
      <p n='symbolicname' v='org.cnam.osgi.android.thermometer-view'/> 
      <p n='presentationname' v='Unnamed - org.cnam.osgi.android:thermometer-view:bundle:0.0.1'/> 
      <p n='version' t='version' v='0.0.1'/> 
      <p n='manifestversion' v='2'/> 
    </capability> 
    <capability name='package'> 
      <p n='package' v='org.cnam.osgi.android.thermometer'/> 
      <p n='version' t='version' v='0.0.0'/> 
      <p n='uses:' v='android.util,org.cnam.osgi.sensor,android.widget,android.content,org.cnam.osgi.android.viewfactory'/> 
    </capability> 
    <capability name='sensor'> 
      <p n='sensortype' v='thermometer'/> 
    </capability> 
    <require name='package' filter='(&amp;(package=android.content))' extend='false' multiple='false' optional='false'>Import package android.content</require> 
    <require name='package' filter='(&amp;(package=android.util))' extend='false' multiple='false' optional='false'>Import package android.util</require> 
    <require name='package' filter='(&amp;(package=android.widget))' extend='false' multiple='false' optional='false'>Import package android.widget</require> 
    <require name='package' filter='(&amp;(package=org.cnam.osgi.android.viewfactory))' extend='false' multiple='false' optional='false'>Import package org.cnam.osgi.android.viewfactory</require> 
    <require name='package' filter='(&amp;(package=org.cnam.osgi.sensor))' extend='false' multiple='false' optional='false'>Import package org.cnam.osgi.sensor</require> 
  </resource>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to