You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Felix Meschberger <fm...@adobe.com> on 2011/12/17 14:44:19 UTC

Web Console generic capabilities

Hi all

The Web Console bundle provides JQuery libraries for use by plugin bundles. It has once been discussed, whether the provisioning of these libraries should be exposed in the Export-Package header. At that time we -- correctly IMHO -- dismissed this idea.

As of OSGi Core 4.3 we now have a generic capabilities and requirements model, which allows us to model these dependencies.

So I suggest, the Web Console defines a namespace for such libraries, etc. provided and exposes them as generic capabilities. Plugins could then require.

  Provide-Capability =
     felix.webconsole; name=JQuery; version:Version=1.3.2;
             path=webconsole/res/lib/jquery-1.3.2.js,
     felix.webconsole; name=JQuery-UI; version:Version=1.8.1;
             path=webconsole/res/lib/jquery-ui-1.8.1.js

A plugin could then require JQuery 1.3 or higher:

  Require-Capability =
     felix.webconsole; filter:="(&(name=JQuery)(version>=1.3))

When running in a 4.3 (or later) compliant framework these capabilities and requirements will be enforced. While in an earlier framework the headers are just ignored.

WDYT ?

As for the namespace: Would felix.webconsole be ok ? Or should that be org.apache.felix.webconsole ? Would it make sense to register that with the OSGi alliance ?

Regards
Felix

Re: Web Console generic capabilities

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 12/17/11 08:44 , Felix Meschberger wrote:
> Hi all
>
> The Web Console bundle provides JQuery libraries for use by plugin bundles. It has once been discussed, whether the provisioning of these libraries should be exposed in the Export-Package header. At that time we -- correctly IMHO -- dismissed this idea.
>
> As of OSGi Core 4.3 we now have a generic capabilities and requirements model, which allows us to model these dependencies.
>
> So I suggest, the Web Console defines a namespace for such libraries, etc. provided and exposes them as generic capabilities. Plugins could then require.
>
>    Provide-Capability =
>       felix.webconsole; name=JQuery; version:Version=1.3.2;
>               path=webconsole/res/lib/jquery-1.3.2.js,
>       felix.webconsole; name=JQuery-UI; version:Version=1.8.1;
>               path=webconsole/res/lib/jquery-ui-1.8.1.js
>
> A plugin could then require JQuery 1.3 or higher:
>
>    Require-Capability =
>       felix.webconsole; filter:="(&(name=JQuery)(version>=1.3))
>
> When running in a 4.3 (or later) compliant framework these capabilities and requirements will be enforced. While in an earlier framework the headers are just ignored.
>
> WDYT ?
>
> As for the namespace: Would felix.webconsole be ok ? Or should that be org.apache.felix.webconsole ? Would it make sense to register that with the OSGi alliance ?

Just depends on whether you want to worry about collisions or not. I 
think the recommended approach is reverse domain name, but it is likely 
unique enough. Your call.

Would something like felix.webconsole.javascript be more forward 
thinking? Maybe in the future you'll export other libraries in other 
languages? Just a thought.

-> richard

>
> Regards
> Felix