You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by sam lee <sk...@gmail.com> on 2010/12/01 13:03:05 UTC

what is symbolicName?

Using Web Console, I could get information about a bundle through HTTP GET
/system/console/bundles/<bundle-id>.json
The returned json includes a property called "symbolicName" which seems to
be constructed using maven groupId and artifactId.
symbolicName is also displayed in parenthesis when you visit
/system/console/bundles   For example, Apache Sling API
(org.apache.sling.api).

How is symbolicName constructed? Is it overlapping groupId and artifactId?
groupId=org.apache.sling
artifactId=apache.sling.api
==> org.apache.sling.api    (apache.sling is overlapped)

I am writing a script that given a (groupId, artifactId) pair, search for
such bundle in felix and download it.  (felix stores Bundle Location too).
But to search bundles in felix, I need to generate symbolicName from the
pair.

Thanks.
Sam

Re: what is symbolicName?

Posted by Guillaume Nodet <gn...@gmail.com>.
There's no way to have the symbolic name from groupid / artifactId,
because each project can do that differently.
However if you're interested in the location, you could use the OPS4j
mvn url handler (we heavily use it in Karaf) so that the bundle url
becomes:
    mvn:groupId/artifactId/version
and you then have direct access to it.

On Wed, Dec 1, 2010 at 07:03, sam lee <sk...@gmail.com> wrote:
> Using Web Console, I could get information about a bundle through HTTP GET
> /system/console/bundles/<bundle-id>.json
> The returned json includes a property called "symbolicName" which seems to
> be constructed using maven groupId and artifactId.
> symbolicName is also displayed in parenthesis when you visit
> /system/console/bundles   For example, Apache Sling API
> (org.apache.sling.api).
>
> How is symbolicName constructed? Is it overlapping groupId and artifactId?
> groupId=org.apache.sling
> artifactId=apache.sling.api
> ==> org.apache.sling.api    (apache.sling is overlapped)
>
> I am writing a script that given a (groupId, artifactId) pair, search for
> such bundle in felix and download it.  (felix stores Bundle Location too).
> But to search bundles in felix, I need to generate symbolicName from the
> pair.
>
> Thanks.
> Sam
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: what is symbolicName?

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Am Mittwoch, den 01.12.2010, 07:03 -0500 schrieb sam lee: 
> Using Web Console, I could get information about a bundle through HTTP GET
> /system/console/bundles/<bundle-id>.json
> The returned json includes a property called "symbolicName" which seems to
> be constructed using maven groupId and artifactId.
> symbolicName is also displayed in parenthesis when you visit
> /system/console/bundles   For example, Apache Sling API
> (org.apache.sling.api).
> 
> How is symbolicName constructed?

Inside the OSGi framework the Bundle's symbolic name being the value of
the "symbolicName" JSON property is taken calling the
Bundle.getSymbolicName() method and comes from the Bundle-SymbolicName
manifest header.

> Is it overlapping groupId and artifactId?
> groupId=org.apache.sling
> artifactId=apache.sling.api
> ==> org.apache.sling.api    (apache.sling is overlapped)

As Guillaum said there is no fixed, enforced overlap of the bundle's
symbolic name and the Maven groupId and artifactId. As a convention we
use the artifactId her and in Apache as the bundle symbolic name, where
the artifactId in fact includes the Maven groupId.

> 
> I am writing a script that given a (groupId, artifactId) pair, search for
> such bundle in felix and download it.  (felix stores Bundle Location too).
> But to search bundles in felix, I need to generate symbolicName from the
> pair.

What are you using such a script for ? I am sure, such a script will be
rather brittle and not work over time because you are not using official
API.

Regards
Felix


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org