You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by Reuben Garrett <re...@gmail.com> on 2012/04/05 17:14:06 UTC

table printer for Karaf commands

i'm working on patching Camel's Karaf commands to print more nicely
(columns aligned regardless of a field's length) [1].  unfortunately, my
first attempt's implementation was a little too heavy, and would benefit
from code reuse.

i recently observed a JIRA [2] which suggests that Karaf may have builtin
support for printing tables to the console.  i'm searching the source for
examples, but haven't found anything yet.  does karaf have a builtin table
printer, or if not, can you recommend a 3rd-party library for this
purpose?  i'm not sure if this is relevant or feasible, but to me this
would seem like a nice OSGi service for the container to provide.


[1]: https://issues.apache.org/jira/browse/CAMEL-4931
[2]: https://issues.apache.org/jira/browse/KARAF-1281

~ Reuben

Re: table printer for Karaf commands

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

as now we have Karaf 2.3.x branch, I would prefer to merge the table 
printer on this branch.
It's not in the opposite of a "util jar" providing this, we just have to 
create a module in Karaf (small refactoring).

Regards
JB

On 04/06/2012 08:04 PM, Christian Schneider wrote:
> We can do three things:
>
> 1. copy the table printer over to camel till 3.0 is out and generally in
> use
> 2. backport table printer to 2.2.x in karaf console jar
> 3. Create an independent jar in karaf for the table printer that camel
> can depend on
>
> All options have some good points and I am open to all of them. 3. might
> be the cleanest option.
>
> Christian
>
> Am 06.04.2012 16:31, schrieb Reuben Garrett:
>> in light of feedback from Karaf committers [1], would it be okay to copy
>> Christian Schneider's table printer [2] into the Camel Karaf commands
>> project (org.apache.camel.karaf.commands.internal) as a private utility
>> class, at least until it's available in a Karaf release?
>>
>> i strongly agree with Claus about striving for neutral modularity, and at
>> the same time Christian explained that this table printer is already
>> small
>> and self-contained. is it an agreeable compromise to temporarily borrow
>> the implementation?
>>
>> [1]:
>> http://karaf.922171.n3.nabble.com/table-printer-for-Karaf-commands-tt3887535.html
>>
>> [2]:
>> http://svn.apache.org/viewvc/karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/table/
>>
>>
>> ~ Reuben
>>
>> On Thu, Apr 5, 2012 at 12:32, Claus Ibsen<cl...@gmail.com> wrote:
>>
>>> Well I am talking about an end user library which has utility methods so
>>> people can use that in their Karaf commands / plugins.
>>>
>>> The irony is that Karaf is all about modularity. So would it not be
>>> possible to offer a neutral Karaf library that people can use on both
>>> 2.x
>>> and 3.0.
>>>
>>> I assume the table and other util methods is mostly about string
>>> manipulation and to make commands output nicely in Karaf. And thus
>>> its not
>>> deeply tied to te Karaf container runtime version. So it ought to run on
>>> both 2.x and 3.x.
>>>
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: table printer for Karaf commands

Posted by Reuben Garrett <re...@gmail.com>.
3 sounds good to me too - could benefit other projects besides just Karaf
and Camel :]

~ Reuben

On Fri, Apr 6, 2012 at 13:04, Christian Schneider
<ch...@die-schneider.net>wrote:

> We can do three things:
>
> 1. copy the table printer over to camel till 3.0 is out and generally in
> use
> 2. backport table printer to 2.2.x in karaf console jar
> 3. Create an independent jar in karaf for the table printer that camel can
> depend on
>
> All options have some good points and I am open to all of them. 3. might
> be the cleanest option.
>

Re: table printer for Karaf commands

Posted by Christian Schneider <ch...@die-schneider.net>.
We can do three things:

1. copy the table printer over to camel till 3.0 is out and generally in use
2. backport table printer to 2.2.x in karaf console jar
3. Create an independent jar in karaf for the table printer that camel 
can depend on

All options have some good points and I am open to all of them. 3. might 
be the cleanest option.

Christian

Am 06.04.2012 16:31, schrieb Reuben Garrett:
> in light of feedback from Karaf committers [1], would it be okay to copy
> Christian Schneider's table printer [2] into the Camel Karaf commands
> project (org.apache.camel.karaf.commands.internal) as a private utility
> class, at least until it's available in a Karaf release?
>
> i strongly agree with Claus about striving for neutral modularity, and at
> the same time Christian explained that this table printer is already small
> and self-contained.  is it an agreeable compromise to temporarily borrow
> the implementation?
>
> [1]:
> http://karaf.922171.n3.nabble.com/table-printer-for-Karaf-commands-tt3887535.html
> [2]:
> http://svn.apache.org/viewvc/karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/table/
>
> ~ Reuben
>
> On Thu, Apr 5, 2012 at 12:32, Claus Ibsen<cl...@gmail.com>  wrote:
>
>> Well I am talking about an end user library which has utility methods so
>> people can use that in their Karaf commands / plugins.
>>
>> The irony is that Karaf is all about modularity. So would it not be
>> possible to offer a neutral Karaf library that people can use on both 2.x
>> and 3.0.
>>
>> I assume the table and other util methods is mostly about string
>> manipulation and to make commands output nicely in Karaf. And thus its not
>> deeply tied to te Karaf container runtime version. So it ought to run on
>> both 2.x and 3.x.
>>


-- 

Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: table printer for Karaf commands

Posted by Reuben Garrett <re...@gmail.com>.
in light of feedback from Karaf committers [1], would it be okay to copy
Christian Schneider's table printer [2] into the Camel Karaf commands
project (org.apache.camel.karaf.commands.internal) as a private utility
class, at least until it's available in a Karaf release?

i strongly agree with Claus about striving for neutral modularity, and at
the same time Christian explained that this table printer is already small
and self-contained.  is it an agreeable compromise to temporarily borrow
the implementation?

[1]:
http://karaf.922171.n3.nabble.com/table-printer-for-Karaf-commands-tt3887535.html
[2]:
http://svn.apache.org/viewvc/karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/table/

~ Reuben

On Thu, Apr 5, 2012 at 12:32, Claus Ibsen <cl...@gmail.com> wrote:

> Well I am talking about an end user library which has utility methods so
> people can use that in their Karaf commands / plugins.
>
> The irony is that Karaf is all about modularity. So would it not be
> possible to offer a neutral Karaf library that people can use on both 2.x
> and 3.0.
>
> I assume the table and other util methods is mostly about string
> manipulation and to make commands output nicely in Karaf. And thus its not
> deeply tied to te Karaf container runtime version. So it ought to run on
> both 2.x and 3.x.
>

Re: table printer for Karaf commands

Posted by Christian Schneider <ch...@die-schneider.net>.
Why do you want to create a service for the table printer. You can 
create it with "new". As service typically makes only sense when the 
initialization is complicated or you want to hide the implementation. 
Both is not the
case for the tables.

So on trunk you can just use it and we can also backport to 2.2.x if 
necessary.

Christian

Am 05.04.2012 20:21, schrieb Reuben Garrett:
> thanks, everyone, for your feedback!
>
> it seems that to partially solve my immediate problem for the Camel 
> Karaf commands, i should just assume a certain console width (e.g. 80 
> chars) and (statically) optimize the columns based on the width of 
> expected content - e.g. "status" columns will be shorter due to 
> limited enumerated values, and "name" columns will consume the 
> remaining width due to arbitrary user-dependent values.
>
> then, for the long-term general solution (benefiting other projects 
> than just Camel), we could pursue publishing as a service the new 
> table printer that Christian has been working on.  i'm not sure if 
> this is immediately within my abilities, but it's an endeavor i would 
> certainly follow.
>
> would it be agreeable to open a Karaf JIRA requesting this kind of 
> modularization for the table printer somewhere down the line?
>
> ~ Reuben


-- 

Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: table printer for Karaf commands

Posted by Christian Schneider <ch...@die-schneider.net>.
I overlooked one aspect you mentioned. Usage for other projects. Here 
the main concern is that you have to depend on the shell.console 
project. This is the case for commands anyway. If this is an issue we 
might create a separate bundle for the table functionality.

Christian

Am 05.04.2012 20:21, schrieb Reuben Garrett:
> thanks, everyone, for your feedback!
>
> it seems that to partially solve my immediate problem for the Camel 
> Karaf commands, i should just assume a certain console width (e.g. 80 
> chars) and (statically) optimize the columns based on the width of 
> expected content - e.g. "status" columns will be shorter due to 
> limited enumerated values, and "name" columns will consume the 
> remaining width due to arbitrary user-dependent values.
>
> then, for the long-term general solution (benefiting other projects 
> than just Camel), we could pursue publishing as a service the new 
> table printer that Christian has been working on.  i'm not sure if 
> this is immediately within my abilities, but it's an endeavor i would 
> certainly follow.
>
> would it be agreeable to open a Karaf JIRA requesting this kind of 
> modularization for the table printer somewhere down the line?
>
> ~ Reuben


-- 

Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: table printer for Karaf commands

Posted by Reuben Garrett <re...@gmail.com>.
thanks, everyone, for your feedback!

it seems that to partially solve my immediate problem for the Camel Karaf
commands, i should just assume a certain console width (e.g. 80 chars) and
(statically) optimize the columns based on the width of expected content -
e.g. "status" columns will be shorter due to limited enumerated values, and
"name" columns will consume the remaining width due to arbitrary
user-dependent values.

then, for the long-term general solution (benefiting other projects than
just Camel), we could pursue publishing as a service the new table printer
that Christian has been working on.  i'm not sure if this is immediately
within my abilities, but it's an endeavor i would certainly follow.

would it be agreeable to open a Karaf JIRA requesting this kind of
modularization for the table printer somewhere down the line?

~ Reuben

Re: table printer for Karaf commands

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
It makes sense, and I'm not against at all from a technical perspective 
(see my e-mail replied to Ioannis).

Regards
JB

On 04/05/2012 07:32 PM, Claus Ibsen wrote:
> Well I am talking about an end user library which has utility methods
> so people can use that in their Karaf commands / plugins.
>
> The irony is that Karaf is all about modularity. So would it not be
> possible to offer a neutral Karaf library that people can use on both
> 2.x and 3.0.
>
> I assume the table and other util methods is mostly about string
> manipulation and to make commands output nicely in Karaf. And thus its
> not deeply tied to te Karaf container runtime version. So it ought to
> run on both 2.x and 3.x.
>
>
> On Thu, Apr 5, 2012 at 7:17 PM, Jean-Baptiste Onofré<jb...@nanthrax.net>  wrote:
>> Hi Claus,
>>
>>  From a feature perspective, of course it's cool ;)
>>
>> But more we merge new feature on Karaf 2.2.x, more we postpone Karaf 3.0.0,
>> as users won't update to Karaf 3.0.0.
>>
>>  From a technical perspective, I'm fully agree with you, table rendering is
>> interesting (whatever the Karaf version is).
>>  From a "promotional" perspective, I think it's not a good idea.
>>
>> Regards
>> JB
>>
>>
>> On 04/05/2012 07:14 PM, Claus Ibsen wrote:
>>>
>>> On Thu, Apr 5, 2012 at 5:27 PM, Jean-Baptiste Onofré<jb...@nanthrax.net>
>>>   wrote:
>>>>
>>>> Hi Reuben,
>>>>
>>>> We have an implementation of the console table available.
>>>>
>>>> You can take a look:
>>>>
>>>> ./shell/console/src/main/java/org/apache/karaf/shell/console/table
>>>>
>>>> but it's only available on trunk for now (so in the next Karaf 3.0.0).
>>>>
>>>> I don't think it's a good idea to merge on Karaf 2.2.x, as we decided to
>>>> focus on 3.0.0.
>>>>
>>>
>>> Why is that not a good idea?
>>> People will use Karaf 2.x for a long time, and the commands is a very
>>> cool part of Karaf.
>>> And having a nice layout of the outputs of the command is great.
>>>
>>> And it also encourages end users to contribute custom commands and
>>> whatnot, if its easy to do that with Karaf. Java is not really good at
>>> String manipulation out of the box. So many people have to create
>>> their own libraries and whatnot.
>>>
>>> Maybe provide the table as part of end user plugin API for developing
>>> Karaf commands.
>>> As well with other util methods people may need for writing Karaf
>>> commands.
>>>
>>>
>>>> Regards
>>>> JB
>>>>
>>>>
>>>> On 04/05/2012 05:14 PM, Reuben Garrett wrote:
>>>>>
>>>>>
>>>>> i'm working on patching Camel's Karaf commands to print more nicely
>>>>> (columns aligned regardless of a field's length) [1].  unfortunately, my
>>>>> first attempt's implementation was a little too heavy, and would benefit
>>>>> from code reuse.
>>>>>
>>>>> i recently observed a JIRA [2] which suggests that Karaf may have
>>>>> builtin
>>>>> support for printing tables to the console.  i'm searching the source
>>>>> for
>>>>> examples, but haven't found anything yet.  does karaf have a builtin
>>>>> table
>>>>> printer, or if not, can you recommend a 3rd-party library for this
>>>>> purpose?  i'm not sure if this is relevant or feasible, but to me this
>>>>> would seem like a nice OSGi service for the container to provide.
>>>>>
>>>>>
>>>>> [1]: https://issues.apache.org/jira/browse/CAMEL-4931
>>>>> [2]: https://issues.apache.org/jira/browse/KARAF-1281
>>>>>
>>>>> ~ Reuben
>>>>>
>>>>
>>>> --
>>>> Jean-Baptiste Onofré
>>>> jbonofre@apache.org
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>
>>>
>>>
>>>
>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: table printer for Karaf commands

Posted by Reuben Garrett <re...@gmail.com>.
you're right, Christian - the table implementation is simple enough that a
full-blown service might be excessive for my immediate needs.  moreover,
importing packages is already a kind of service consumption.  for better or
worse, i might have gotten carried away with my enthusiasm for OSGi.

all the same, i wonder if Karaf's growing popularity could create new
opportunities for third-party collaboration with the container.  i'm still
new around here, so take that with a grain of salt and forgive my
imagination ^_^;

btw, your table printer looks great - especially where it provides a DSL!
can't wait to use it.

~ Reuben

On Thu, Apr 5, 2012 at 14:26, Christian Schneider
<ch...@die-schneider.net>wrote:

> Why do you want to create a service for the table printer. You can create
> it with "new". As service typically makes only sense when the
> initialization is complicated or you want to hide the implementation. Both
> is not the case for the tables.
>

On Thu, Apr 5, 2012 at 14:28, Christian Schneider <ch...@die-schneider.net>
wrote:

> I overlooked one aspect you mentioned. Usage for other projects. Here the
> main concern is that you have to depend on the shell.console project.  This
> is the case for commands anyway. If this is an issue we might create a
> separate bundle for the table functionality.


On Thu, Apr 5, 2012 at 14:30, Christian Schneider
<ch...@die-schneider.net>wrote:

> I think it would make sense to user the karaf.util project for that.
> Currently we just inline it into projects but we could also make it a
> bundle.  We could move the table functionality and other general tools
> there.
>

Re: table printer for Karaf commands

Posted by Christian Schneider <ch...@die-schneider.net>.
I think it would make sense to user the karaf.util project for that. 
Currently we just inline it into projects but we could also make it a 
bundle.
We could move the table functionality and other general tools there.

Christian

Am 05.04.2012 19:32, schrieb Claus Ibsen:
> Well I am talking about an end user library which has utility methods
> so people can use that in their Karaf commands / plugins.
>
> The irony is that Karaf is all about modularity. So would it not be
> possible to offer a neutral Karaf library that people can use on both
> 2.x and 3.0.
>
> I assume the table and other util methods is mostly about string
> manipulation and to make commands output nicely in Karaf. And thus its
> not deeply tied to te Karaf container runtime version. So it ought to
> run on both 2.x and 3.x.
>
>
> On Thu, Apr 5, 2012 at 7:17 PM, Jean-Baptiste Onofré<jb...@nanthrax.net>  wrote:
>> Hi Claus,
>>
>>  From a feature perspective, of course it's cool ;)
>>
>> But more we merge new feature on Karaf 2.2.x, more we postpone Karaf 3.0.0,
>> as users won't update to Karaf 3.0.0.
>>
>>  From a technical perspective, I'm fully agree with you, table rendering is
>> interesting (whatever the Karaf version is).
>>  From a "promotional" perspective, I think it's not a good idea.
>>
>> Regards
>> JB
>>
>>
>> On 04/05/2012 07:14 PM, Claus Ibsen wrote:
>>> On Thu, Apr 5, 2012 at 5:27 PM, Jean-Baptiste Onofré<jb...@nanthrax.net>
>>>   wrote:
>>>> Hi Reuben,
>>>>
>>>> We have an implementation of the console table available.
>>>>
>>>> You can take a look:
>>>>
>>>> ./shell/console/src/main/java/org/apache/karaf/shell/console/table
>>>>
>>>> but it's only available on trunk for now (so in the next Karaf 3.0.0).
>>>>
>>>> I don't think it's a good idea to merge on Karaf 2.2.x, as we decided to
>>>> focus on 3.0.0.
>>>>
>>> Why is that not a good idea?
>>> People will use Karaf 2.x for a long time, and the commands is a very
>>> cool part of Karaf.
>>> And having a nice layout of the outputs of the command is great.
>>>
>>> And it also encourages end users to contribute custom commands and
>>> whatnot, if its easy to do that with Karaf. Java is not really good at
>>> String manipulation out of the box. So many people have to create
>>> their own libraries and whatnot.
>>>
>>> Maybe provide the table as part of end user plugin API for developing
>>> Karaf commands.
>>> As well with other util methods people may need for writing Karaf
>>> commands.
>>>
>>>
>>>> Regards
>>>> JB
>>>>
>>>>
>>>> On 04/05/2012 05:14 PM, Reuben Garrett wrote:
>>>>>
>>>>> i'm working on patching Camel's Karaf commands to print more nicely
>>>>> (columns aligned regardless of a field's length) [1].  unfortunately, my
>>>>> first attempt's implementation was a little too heavy, and would benefit
>>>>> from code reuse.
>>>>>
>>>>> i recently observed a JIRA [2] which suggests that Karaf may have
>>>>> builtin
>>>>> support for printing tables to the console.  i'm searching the source
>>>>> for
>>>>> examples, but haven't found anything yet.  does karaf have a builtin
>>>>> table
>>>>> printer, or if not, can you recommend a 3rd-party library for this
>>>>> purpose?  i'm not sure if this is relevant or feasible, but to me this
>>>>> would seem like a nice OSGi service for the container to provide.
>>>>>
>>>>>
>>>>> [1]: https://issues.apache.org/jira/browse/CAMEL-4931
>>>>> [2]: https://issues.apache.org/jira/browse/KARAF-1281
>>>>>
>>>>> ~ Reuben
>>>>>
>>>> --
>>>> Jean-Baptiste Onofré
>>>> jbonofre@apache.org
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>
>>>
>>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>
>


-- 

Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: table printer for Karaf commands

Posted by Claus Ibsen <cl...@gmail.com>.
Well I am talking about an end user library which has utility methods
so people can use that in their Karaf commands / plugins.

The irony is that Karaf is all about modularity. So would it not be
possible to offer a neutral Karaf library that people can use on both
2.x and 3.0.

I assume the table and other util methods is mostly about string
manipulation and to make commands output nicely in Karaf. And thus its
not deeply tied to te Karaf container runtime version. So it ought to
run on both 2.x and 3.x.


On Thu, Apr 5, 2012 at 7:17 PM, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> Hi Claus,
>
> From a feature perspective, of course it's cool ;)
>
> But more we merge new feature on Karaf 2.2.x, more we postpone Karaf 3.0.0,
> as users won't update to Karaf 3.0.0.
>
> From a technical perspective, I'm fully agree with you, table rendering is
> interesting (whatever the Karaf version is).
> From a "promotional" perspective, I think it's not a good idea.
>
> Regards
> JB
>
>
> On 04/05/2012 07:14 PM, Claus Ibsen wrote:
>>
>> On Thu, Apr 5, 2012 at 5:27 PM, Jean-Baptiste Onofré<jb...@nanthrax.net>
>>  wrote:
>>>
>>> Hi Reuben,
>>>
>>> We have an implementation of the console table available.
>>>
>>> You can take a look:
>>>
>>> ./shell/console/src/main/java/org/apache/karaf/shell/console/table
>>>
>>> but it's only available on trunk for now (so in the next Karaf 3.0.0).
>>>
>>> I don't think it's a good idea to merge on Karaf 2.2.x, as we decided to
>>> focus on 3.0.0.
>>>
>>
>> Why is that not a good idea?
>> People will use Karaf 2.x for a long time, and the commands is a very
>> cool part of Karaf.
>> And having a nice layout of the outputs of the command is great.
>>
>> And it also encourages end users to contribute custom commands and
>> whatnot, if its easy to do that with Karaf. Java is not really good at
>> String manipulation out of the box. So many people have to create
>> their own libraries and whatnot.
>>
>> Maybe provide the table as part of end user plugin API for developing
>> Karaf commands.
>> As well with other util methods people may need for writing Karaf
>> commands.
>>
>>
>>> Regards
>>> JB
>>>
>>>
>>> On 04/05/2012 05:14 PM, Reuben Garrett wrote:
>>>>
>>>>
>>>> i'm working on patching Camel's Karaf commands to print more nicely
>>>> (columns aligned regardless of a field's length) [1].  unfortunately, my
>>>> first attempt's implementation was a little too heavy, and would benefit
>>>> from code reuse.
>>>>
>>>> i recently observed a JIRA [2] which suggests that Karaf may have
>>>> builtin
>>>> support for printing tables to the console.  i'm searching the source
>>>> for
>>>> examples, but haven't found anything yet.  does karaf have a builtin
>>>> table
>>>> printer, or if not, can you recommend a 3rd-party library for this
>>>> purpose?  i'm not sure if this is relevant or feasible, but to me this
>>>> would seem like a nice OSGi service for the container to provide.
>>>>
>>>>
>>>> [1]: https://issues.apache.org/jira/browse/CAMEL-4931
>>>> [2]: https://issues.apache.org/jira/browse/KARAF-1281
>>>>
>>>> ~ Reuben
>>>>
>>>
>>> --
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>
>>
>>
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: table printer for Karaf commands

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
For 2.3.x, I'm fully agree and it's the purpose.

Really, don't get me wrong, I have no problem to merge that in Karaf 
2.2.x. It's just that it could be a good message for the users in order 
to say: "hey guys, look what it's cool in Karaf 3.0.0" ;)

Regards
JB

On 04/05/2012 07:31 PM, Ioannis Canellos wrote:
> True, but releasing 3.0.0 should not block us from delivering functionality
> to 2.2.x or even 2.3.x.

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: table printer for Karaf commands

Posted by Ioannis Canellos <io...@gmail.com>.
True, but releasing 3.0.0 should not block us from delivering functionality
to 2.2.x or even 2.3.x.
-- 
*Ioannis Canellos*
*
FuseSource <http://fusesource.com>

**
Blog: http://iocanel.blogspot.com
**
Twitter: iocanel
*

Re: table printer for Karaf commands

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Claus,

 From a feature perspective, of course it's cool ;)

But more we merge new feature on Karaf 2.2.x, more we postpone Karaf 
3.0.0, as users won't update to Karaf 3.0.0.

 From a technical perspective, I'm fully agree with you, table rendering 
is interesting (whatever the Karaf version is).
 From a "promotional" perspective, I think it's not a good idea.

Regards
JB

On 04/05/2012 07:14 PM, Claus Ibsen wrote:
> On Thu, Apr 5, 2012 at 5:27 PM, Jean-Baptiste Onofré<jb...@nanthrax.net>  wrote:
>> Hi Reuben,
>>
>> We have an implementation of the console table available.
>>
>> You can take a look:
>>
>> ./shell/console/src/main/java/org/apache/karaf/shell/console/table
>>
>> but it's only available on trunk for now (so in the next Karaf 3.0.0).
>>
>> I don't think it's a good idea to merge on Karaf 2.2.x, as we decided to
>> focus on 3.0.0.
>>
>
> Why is that not a good idea?
> People will use Karaf 2.x for a long time, and the commands is a very
> cool part of Karaf.
> And having a nice layout of the outputs of the command is great.
>
> And it also encourages end users to contribute custom commands and
> whatnot, if its easy to do that with Karaf. Java is not really good at
> String manipulation out of the box. So many people have to create
> their own libraries and whatnot.
>
> Maybe provide the table as part of end user plugin API for developing
> Karaf commands.
> As well with other util methods people may need for writing Karaf commands.
>
>
>> Regards
>> JB
>>
>>
>> On 04/05/2012 05:14 PM, Reuben Garrett wrote:
>>>
>>> i'm working on patching Camel's Karaf commands to print more nicely
>>> (columns aligned regardless of a field's length) [1].  unfortunately, my
>>> first attempt's implementation was a little too heavy, and would benefit
>>> from code reuse.
>>>
>>> i recently observed a JIRA [2] which suggests that Karaf may have builtin
>>> support for printing tables to the console.  i'm searching the source for
>>> examples, but haven't found anything yet.  does karaf have a builtin table
>>> printer, or if not, can you recommend a 3rd-party library for this
>>> purpose?  i'm not sure if this is relevant or feasible, but to me this
>>> would seem like a nice OSGi service for the container to provide.
>>>
>>>
>>> [1]: https://issues.apache.org/jira/browse/CAMEL-4931
>>> [2]: https://issues.apache.org/jira/browse/KARAF-1281
>>>
>>> ~ Reuben
>>>
>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: table printer for Karaf commands

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Apr 5, 2012 at 5:27 PM, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> Hi Reuben,
>
> We have an implementation of the console table available.
>
> You can take a look:
>
> ./shell/console/src/main/java/org/apache/karaf/shell/console/table
>
> but it's only available on trunk for now (so in the next Karaf 3.0.0).
>
> I don't think it's a good idea to merge on Karaf 2.2.x, as we decided to
> focus on 3.0.0.
>

Why is that not a good idea?
People will use Karaf 2.x for a long time, and the commands is a very
cool part of Karaf.
And having a nice layout of the outputs of the command is great.

And it also encourages end users to contribute custom commands and
whatnot, if its easy to do that with Karaf. Java is not really good at
String manipulation out of the box. So many people have to create
their own libraries and whatnot.

Maybe provide the table as part of end user plugin API for developing
Karaf commands.
As well with other util methods people may need for writing Karaf commands.


> Regards
> JB
>
>
> On 04/05/2012 05:14 PM, Reuben Garrett wrote:
>>
>> i'm working on patching Camel's Karaf commands to print more nicely
>> (columns aligned regardless of a field's length) [1].  unfortunately, my
>> first attempt's implementation was a little too heavy, and would benefit
>> from code reuse.
>>
>> i recently observed a JIRA [2] which suggests that Karaf may have builtin
>> support for printing tables to the console.  i'm searching the source for
>> examples, but haven't found anything yet.  does karaf have a builtin table
>> printer, or if not, can you recommend a 3rd-party library for this
>> purpose?  i'm not sure if this is relevant or feasible, but to me this
>> would seem like a nice OSGi service for the container to provide.
>>
>>
>> [1]: https://issues.apache.org/jira/browse/CAMEL-4931
>> [2]: https://issues.apache.org/jira/browse/KARAF-1281
>>
>> ~ Reuben
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: table printer for Karaf commands

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Reuben,

We have an implementation of the console table available.

You can take a look:

./shell/console/src/main/java/org/apache/karaf/shell/console/table

but it's only available on trunk for now (so in the next Karaf 3.0.0).

I don't think it's a good idea to merge on Karaf 2.2.x, as we decided to 
focus on 3.0.0.

Regards
JB

On 04/05/2012 05:14 PM, Reuben Garrett wrote:
> i'm working on patching Camel's Karaf commands to print more nicely
> (columns aligned regardless of a field's length) [1].  unfortunately, my
> first attempt's implementation was a little too heavy, and would benefit
> from code reuse.
>
> i recently observed a JIRA [2] which suggests that Karaf may have builtin
> support for printing tables to the console.  i'm searching the source for
> examples, but haven't found anything yet.  does karaf have a builtin table
> printer, or if not, can you recommend a 3rd-party library for this
> purpose?  i'm not sure if this is relevant or feasible, but to me this
> would seem like a nice OSGi service for the container to provide.
>
>
> [1]: https://issues.apache.org/jira/browse/CAMEL-4931
> [2]: https://issues.apache.org/jira/browse/KARAF-1281
>
> ~ Reuben
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: table printer for Karaf commands

Posted by Christian Schneider <ch...@die-schneider.net>.
If you like you can use the table impl JB mentioned to make some of the 
3.0.0 tables prettier.

For reference you can look at the package/command module where the new 
table is already used.

Christian

Am 05.04.2012 17:14, schrieb Reuben Garrett:
> i'm working on patching Camel's Karaf commands to print more nicely
> (columns aligned regardless of a field's length) [1].  unfortunately, my
> first attempt's implementation was a little too heavy, and would benefit
> from code reuse.
>
> i recently observed a JIRA [2] which suggests that Karaf may have builtin
> support for printing tables to the console.  i'm searching the source for
> examples, but haven't found anything yet.  does karaf have a builtin table
> printer, or if not, can you recommend a 3rd-party library for this
> purpose?  i'm not sure if this is relevant or feasible, but to me this
> would seem like a nice OSGi service for the container to provide.
>
>
> [1]: https://issues.apache.org/jira/browse/CAMEL-4931
> [2]: https://issues.apache.org/jira/browse/KARAF-1281
>
> ~ Reuben
>


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com