[ 
https://issues.apache.org/jira/browse/VELTOOLS-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12570015#action_12570015
 ] 

Nathan Bubna commented on VELTOOLS-97:
--------------------------------------

Naysaying doesn't bother me.  I always trust ideas that survive the firing line 
better than those which get no response from anyone or only vague, positive 
responses.  Now some answers from me....

There is no plan for this tool and even less code.  I'm just collecting ideas 
as they occur to me.  So any requests for specific answers will get, at best, 
very tentative ones.  For your one specific question above, my answer is:  
yeah, i was going to have get(String) return a tag object, but i'm not married 
to the idea.

My interest in this tool--which is currently higher than any of the other 
vaporware tools (GoogleChart, Tiles2, Xml)--stems more from a dislike of typing 
tags than anything, but DRY applies here too.  I've lately taken to using 
Velocity to quickly generate static files (xml, html, java, whatever), leaning 
heavily on GenericTools to simplify that.  When generating xml and html, i 
frequently find myself imagining shortcuts.  My current love affair with jQuery 
is only exacerbating that itch.  It would greatly speed things for me to do 
something crazy like $markup.get('ul/li', $myPairs) instead of

<ul>
#foreach( $entry in $myList )
    <li>$entry</li>
#end
</ul>

There's a lot of very nice shortcut syntaxes people have invented for 
navigating markup, some of which i can see turning around to generate it pretty 
easily.

As for bloat concerns, the only bloat i'm really concerned about is 
unmaintained code.  Our little library's growth is not likely to ever outpace 
hardware developers improvements in memory and performance.   Code that is 
unmaintained (and documentation and examples are part of maintenance) is much 
more likely to be a drag on the project than anything else.   Also, 
lack-of-maintenance is probably the least subjective measure of bloat available 
to us.  

That said, since community is key to maintenance, i'm generally open to 
including code like Matthias' table code (VELTOOLS-102) since he's shown long 
interest in developing that code base and it might help draw him to greater 
involvement in the community.  I don't envision myself ever needing to use that 
personally in my work, but i still won't consider it bloat so long as somebody 
is supporting the code.

This is part of "the Apache way": the actual code is secondary to the community 
involved with it (both user and dev, though dev is obviously the most 
important).

> MarkupTool
> ----------
>
>                 Key: VELTOOLS-97
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-97
>             Project: Velocity Tools
>          Issue Type: New Feature
>          Components: GenericTools
>    Affects Versions: 2.x
>            Reporter: Nathan Bubna
>            Priority: Minor
>             Fix For: 2.x
>
>
> As i grow continually more fond of tools and less fond of macros (though 
> things are finally starting to look up for macros in 1.6 and the possibility 
> of Raghu implementing blockmacros), i find myself starting to wish for tools 
> that aid with markup (mostly html or xml).  The idea has occurred to me that 
> i might find a general MarkupTool for manipulating markup in flexible, 
> repeatable ways.   The API i have in mind might be used something like this:
> #set( $foo = $markup.foo.attr('bar', 0) )
> $foo
> #if( $foo.bar == 0 )
> $foo.body($text.danger).attr({'black' : 'white', 'zebras' : $crossing})
> #end
> which would output
> <foo bar="0"/>
> <foo bar="0" black="white" zebras="crossing">Danger!</foo>
> It's also not hard to imagine ways to allow default attributes/values for 
> various tags in the configuration for the tool, like 
> <tool class="org.apache.velocity.tools.generic.MarkupTool" 
> img="border:0,class:thumb"/>
> So that doing just
> $markup.img.attr('src',$imglink)
> would produce something like
> <img border="0" class="thumb" src="http://foo.com/bar.jpg"/>
> Granted, i don't have that many situations where this would be useful, but 
> there have been a few.  Also, i wonder if it might serve as a base class for 
> a JSPTaglibTool (see  
> http://velocity.markmail.org/search/?q=jsp+tag#query:jsp%20tag%20from%3A%22Nathan%20Bubna%22+page:2+mid:ebotko7hanut3uhx+state:results
>  for more on this)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to