You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Gareth <ga...@gmail.com> on 2013/01/08 01:46:26 UTC

Gogo vs. Karaf Commands

Hello,

I am curious - What is the difference between a Gogo command and a Karaf
command?

I ask because I wrote for myself a couple of gogo commands. If I run vanilla
OSGi (e.g. equinox) with gogo they run fine. The commands also show up if I
run gogo "help".

If I run these same gogo commands in karaf, they also appear to work.
However, the commands don't show up in Karaf help and I cannot take
advantage of other advanced karaf console features like autocomplete with
these commands.

Any reason why this would not work? Is there perhaps just an additional
service property I can add which will allow me to take advantage of the
additional Karaf console support? Having looked at a few Karaf console
command examples, I see they all extend the Karaf class OsgiCommandSupport,
which I prefer not to do as I would like to avoid having to explicitly
depend on Karaf classes.

thanks in advance,
Gareth




--
View this message in context: http://karaf.922171.n3.nabble.com/Gogo-vs-Karaf-Commands-tp4027219.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Gogo vs. Karaf Commands

Posted by Göktürk Gezer <go...@gmail.com>.
Hi,

I uploaded the patch to
KARAF-2121<https://issues.apache.org/jira/browse/KARAF-2121> for
you to try.


Best,
Gokturk



On Thu, Jan 17, 2013 at 8:38 AM, Göktürk Gezer <go...@gmail.com>wrote:

> Hi Gareth, Michael
>
> As I expressed I have a quick fix which is dirty ATM. I'll clean it up and
> upload a patch in JIRA.
>
> To give you further details of what I have:
>
> It can list gogo commands along with other karaf commands in "help" with
> their descriptions those provided with @Descriptor annotation. Prints "No
> description" if not provided. It also prints some limited information in
> "help <command>" -> command description + command's argument types with
> their description if provided with @Descriptor.
>
> On Thu, Jan 17, 2013 at 6:38 AM, Gareth <ga...@gmail.com>wrote:
>
>> Hi Mike,
>>
>> I wasn't suggesting actually forking and maintaining Karaf. I was just
>> suggesting using GitHub as a collaboration platform to complete the
>> implementation. It is much easier to work with than svn diffs :).
>>
>> Anyway, I have added the JIRA:
>>
>> https://issues.apache.org/jira/browse/KARAF-2121
>>
>> thanks,
>> Gareth
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/Gogo-vs-Karaf-Commands-tp4027219p4027358.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
>

Re: Gogo vs. Karaf Commands

Posted by Göktürk Gezer <go...@gmail.com>.
Hi Gareth, Michael

As I expressed I have a quick fix which is dirty ATM. I'll clean it up and
upload a patch in JIRA.

To give you further details of what I have:

It can list gogo commands along with other karaf commands in "help" with
their descriptions those provided with @Descriptor annotation. Prints "No
description" if not provided. It also prints some limited information in
"help <command>" -> command description + command's argument types with
their description if provided with @Descriptor.

On Thu, Jan 17, 2013 at 6:38 AM, Gareth <ga...@gmail.com> wrote:

> Hi Mike,
>
> I wasn't suggesting actually forking and maintaining Karaf. I was just
> suggesting using GitHub as a collaboration platform to complete the
> implementation. It is much easier to work with than svn diffs :).
>
> Anyway, I have added the JIRA:
>
> https://issues.apache.org/jira/browse/KARAF-2121
>
> thanks,
> Gareth
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Gogo-vs-Karaf-Commands-tp4027219p4027358.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

Re: Gogo vs. Karaf Commands

Posted by Gareth <ga...@gmail.com>.
Hi Mike,

I wasn't suggesting actually forking and maintaining Karaf. I was just
suggesting using GitHub as a collaboration platform to complete the
implementation. It is much easier to work with than svn diffs :).

Anyway, I have added the JIRA:

https://issues.apache.org/jira/browse/KARAF-2121

thanks,
Gareth



--
View this message in context: http://karaf.922171.n3.nabble.com/Gogo-vs-Karaf-Commands-tp4027219p4027358.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Gogo vs. Karaf Commands

Posted by mikevan <mv...@comcast.net>.
This kind of a change is one that I feel should be rolled into a future 
release of Karaf. Unless anyone has an objection, I suggest a Jira 
ticket (for a new feature) be created, and that a patch be submitted to 
that Jira ticket with Gokturk's code.  IMHO, this approach is preferable 
to a fork of Karaf.

Thoughts?

On 1/15/2013 9:11 PM, Gareth [via Karaf] wrote:
> Hi Gokturk,
>
> I am interested in seeing this happen as well.
>
> Perhaps you can share what you did so far on github? Just make a fork 
> of apache karaf then push your changes to your fork?
>
> thanks,
> Gareth
>
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the 
> discussion below:
> http://karaf.922171.n3.nabble.com/Gogo-vs-Karaf-Commands-tp4027219p4027303.html 
>
> To start a new topic under Karaf - User, email 
> ml-node+s922171n930749h71@n3.nabble.com
> To unsubscribe from Karaf - User, click here 
> <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=930749&code=bXZhbmdlZXJ0cnV5QGNvbWNhc3QubmV0fDkzMDc0OXwtNjA0ODc4OTY2>.
> NAML 
> <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
>





-----
Mike Van  (All links open in new tabs)
Committer - Kalumet 

Atraxia Technologies 

Mike Van's Open Source Technologies Blog 
--
View this message in context: http://karaf.922171.n3.nabble.com/Gogo-vs-Karaf-Commands-tp4027219p4027306.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Gogo vs. Karaf Commands

Posted by Gareth <ga...@gmail.com>.
Hi Gokturk,

I am interested in seeing this happen as well.

Perhaps you can share what you did so far on github? Just make a fork of
apache karaf then push your changes to your fork?

thanks,
Gareth





--
View this message in context: http://karaf.922171.n3.nabble.com/Gogo-vs-Karaf-Commands-tp4027219p4027303.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Gogo vs. Karaf Commands

Posted by Göktürk Gezer <go...@gmail.com>.
Hi,

I did a quick look at the code. It seems karaf is wrapping gogo annotations
into its own ones and making them run as if they are karaf commands.
However the commands with only published service
properties(osgi.command.scope,osgi.command.function) are tracked for
execution into CommandProcessor, but left out in CommandListHelpProvider.
With a quick fix I've been able to make them appear on command list,
without description though!

To display usage for commands, more need to be done of course. The first
way that could come to my mind is: We could add description and argument
informations into CommandProxy(wrapper around plain osgi commands) by
analyzing command's object against @Description annotations, then use this
information in SingleCommandHelpProvider.

I would like to have some advice from karaf devs before working on a patch,
since I also need to make some of my command implementations to be appear
on help.


Best,
Gokturk

On Tue, Jan 8, 2013 at 9:26 AM, Guillaume Nodet <gn...@gmail.com> wrote:

> That's because completion and the help system is specific to karaf
> commands, as they are when you use the gogo commands (for help at least).
> This is kinda historical as the karaf commands did exist before gogo
> commands annotations.  I suppose the karaf help system could be able
> recognize plain gogo commands and display help correctly though.  You could
> raise a JIRA issue for that, I think it's doable, though I don't think we
> provide the annotations in the basic karaf distribution.
>
>
> On Tue, Jan 8, 2013 at 1:46 AM, Gareth <ga...@gmail.com> wrote:
>
>> Hello,
>>
>> I am curious - What is the difference between a Gogo command and a Karaf
>> command?
>>
>> I ask because I wrote for myself a couple of gogo commands. If I run
>> vanilla
>> OSGi (e.g. equinox) with gogo they run fine. The commands also show up if
>> I
>> run gogo "help".
>>
>> If I run these same gogo commands in karaf, they also appear to work.
>> However, the commands don't show up in Karaf help and I cannot take
>> advantage of other advanced karaf console features like autocomplete with
>> these commands.
>>
>> Any reason why this would not work? Is there perhaps just an additional
>> service property I can add which will allow me to take advantage of the
>> additional Karaf console support? Having looked at a few Karaf console
>> command examples, I see they all extend the Karaf class
>> OsgiCommandSupport,
>> which I prefer not to do as I would like to avoid having to explicitly
>> depend on Karaf classes.
>>
>> thanks in advance,
>> Gareth
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/Gogo-vs-Karaf-Commands-tp4027219.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
>
>
> --
> ------------------------
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> FuseSource, Integration everywhere
> http://fusesource.com
>

Re: Gogo vs. Karaf Commands

Posted by Guillaume Nodet <gn...@gmail.com>.
That's because completion and the help system is specific to karaf
commands, as they are when you use the gogo commands (for help at least).
This is kinda historical as the karaf commands did exist before gogo
commands annotations.  I suppose the karaf help system could be able
recognize plain gogo commands and display help correctly though.  You could
raise a JIRA issue for that, I think it's doable, though I don't think we
provide the annotations in the basic karaf distribution.


On Tue, Jan 8, 2013 at 1:46 AM, Gareth <ga...@gmail.com> wrote:

> Hello,
>
> I am curious - What is the difference between a Gogo command and a Karaf
> command?
>
> I ask because I wrote for myself a couple of gogo commands. If I run
> vanilla
> OSGi (e.g. equinox) with gogo they run fine. The commands also show up if I
> run gogo "help".
>
> If I run these same gogo commands in karaf, they also appear to work.
> However, the commands don't show up in Karaf help and I cannot take
> advantage of other advanced karaf console features like autocomplete with
> these commands.
>
> Any reason why this would not work? Is there perhaps just an additional
> service property I can add which will allow me to take advantage of the
> additional Karaf console support? Having looked at a few Karaf console
> command examples, I see they all extend the Karaf class OsgiCommandSupport,
> which I prefer not to do as I would like to avoid having to explicitly
> depend on Karaf classes.
>
> thanks in advance,
> Gareth
>
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Gogo-vs-Karaf-Commands-tp4027219.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
FuseSource, Integration everywhere
http://fusesource.com