You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Ba...@troika.ru on 2011/01/19 10:42:48 UTC

karaf shell each example

Greetings!

Could you please help me write the karaf script which shows all feature 
names (only).
I tried the following:
  each (features:list) { echo ($it name) }
based on the example from mail list (it works!):
  each (bundles) { echo ($it symbolicname) }

But I got the error:
Error executing command: Argument values is required

Please, advice.

Regards,
Boris
_______________________________________________________

The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia. 
If you need assistance please contact our Contact Center  (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp  


Re: karaf shell each example

Posted by Gert Vanthienen <ge...@gmail.com>.
L.S.,

There's some very basic information on the shell available on
http://karaf.apache.org/manual/latest-2.2.x/developers-guide/shell-syntax.html,
but it would definitely make sense to elaborate that page and add the
information about the exposed variables as well.  FWIW, I raised
https://issues.apache.org/jira/browse/KARAF-960 to track the improvement
request.

Regards,

Gert Vanthienen
------------------------
FuseSource
Web: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/


On Wed, Oct 19, 2011 at 9:54 PM, Mel <me...@gmail.com> wrote:

> Hello,
>
> Guillaume could you give tips how to learn osgi / Karaf / ServiceMix shell
> scripting?
> From what did you know or from what one should know that iterate object on
> each is exposed in variable $it?
> What are others already exposed variables like $.context?
>
> Thank you in advance,
> Mark
>
> --
> View this message in context:
> http://servicemix.396122.n5.nabble.com/karaf-shell-each-example-tp3347514p4919235.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>

Re: karaf shell each example

Posted by Mel <me...@gmail.com>.
Hello,

Guillaume could you give tips how to learn osgi / Karaf / ServiceMix shell
scripting?
>From what did you know or from what one should know that iterate object on
each is exposed in variable $it?
What are others already exposed variables like $.context?

Thank you in advance,
Mark

--
View this message in context: http://servicemix.396122.n5.nabble.com/karaf-shell-each-example-tp3347514p4919235.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: karaf shell each example

Posted by Guillaume Nodet <gn...@gmail.com>.
The 'bundles' call translates into bundleContext.getBundles() by virtue of
bundleContext being exposed implicitely and bundles being translated into
the getter call.
For features, you need to access the FeaturesService which is exposed in the
OSGi registry.

With karaf trunk, you could write something like :

fs = ($.context getService ($.context getServiceReference
org.apache.karaf.features.FeaturesService))
each ($fs listFeatures) { echo ($it name) }

Removing the $.context should make it work on your version.



On Wed, Jan 19, 2011 at 10:42, <Ba...@troika.ru> wrote:

> Greetings!
>
> Could you please help me write the karaf script which shows all feature
> names (only).
> I tried the following:
>  each (features:list) { echo ($it name) }
> based on the example from mail list (it works!):
>  each (bundles) { echo ($it symbolicname) }
>
> But I got the error:
> Error executing command: Argument values is required
>
> Please, advice.
>
> Regards,
> Boris
> _______________________________________________________
>
> The information contained in this message may be privileged and conf
> idential and protected from disclosure. If you are not the original intended
> recipient, you are hereby notified that any review, retransmission,
> dissemination, or other use of, or taking of any action in reliance upon,
> this information is prohibited. If you have received this communication in
> error, please notify the sender immediately by replying to this message and
> delete it from your computer. Thank you for your cooperation. Troika Dialog,
> Russia.
> If you need assistance please contact our Contact Center  (+7495) 258 0500
> or go to www.troika.ru/eng/Contacts/system.wbp
>
>


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