You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by BramCoding <va...@gmail.com> on 2019/05/11 09:09:24 UTC
How to convert my XML-repository to a list of Resources?
Hi,
I am trying something within the OSGi framework using Apache Felix to
convert my XML-repository to a Java list of Resource objects.
The format of my XML-file is following:
http://www.osgi.org/xmlns/repository/v1.0.0
For full illustration, this is how a part of my repository looks (lay-out is
not the best so I made it as clear as I could):
<repository xmlns="http://www.osgi.org/xmlns/repository/v1.0.0"
increment="885" name="testname">
<resource>
<capability namespace="osgi.identity">
<attribute name="type" value="osgi.bundle"/>
<attribute name="version" type="Version" value="0.12.1"/>
<attribute name="osgi.identity" value="org.demo.test"/>
</capability>
<requirement namespace="osgi.wiring.package">
<directive name="filter"
value="(&(osgi.wiring.package=org.demo2.test)(&(version>=3.6.0)(!(version>=4.0.0))))"/>
</requirement>
</resource>
/*Now, what do I want to do?*/
I am making a method in my testprogram, and that method has to go to the URL
of this repository and then convert this XML to a list of Resources (the
Resources described in the XML ofcourse).
I was going to implement this fully myself, but in my opinion this is a
common thing to do within the OSGi framework so I'm wondering if this work
has already been done for me and I can reuse it.
*Question 1:* Where do I start with this. I found something called the
RepositoryAdmin, but this is an interface and not an implementation. I
thought Apache Felix was an implementation of the OSGi specification?
*Question 2:* I read something about OBD (OSGi Bundle Repository): am I
following this correct? Or what kind of specification am I following for the
Repository?
(http://felix.apache.org/documentation/subprojects/apache-felix-osgi-bundle-repository.html)
If there is more information needed, please post it here so I can give
everything that is needed.
Thanks in advance!
--
Sent from: http://apache-felix.18485.x6.nabble.com/Apache-Felix-Users-f4833200.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: How to convert my XML-repository to a list of Resources?
Posted by BramCoding <va...@gmail.com>.
I just found a solution by using bnd. I imported the
aQute.bnd.osgi.repository.XMLResourceParser and used that to parse my
XML-file to a List<Resource>.
--
Sent from: http://apache-felix.18485.x6.nabble.com/Apache-Felix-Users-f4833200.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org