velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Cox <b...@virtualschool.edu>
Subject Re: Can I write a macro that can call itself?
Date Sat, 14 Jul 2001 00:07:18 GMT
At 3:21 PM -0700 7/13/01, Jon Stevens wrote:
>  > Yes, but not extensive. In a shop that was committed to an inhouse
>  > template language and not inclined to change.
>
>So, you question the use and implementation of Velocity even though you
>haven't used it yourself? Hmmmmm...

Offering a technique for improving something is not the same as 
questioning its use and implementation. The website describes the 
advantages of taking a compile-time approach without criticizing any 
particular alternative. The only exception I can think of is allowing 
NullPointerExceptions by not doing semantic checks on values read 
from properties file, which was aimed at every jakarta project I've 
ever used, not just Velocity.

>  > Why shouldn't exceptions report the problem exactly? It costs nothing
>>  to be explicit: e.g. "Couldn't find filename.xt in any of [ dir1,
>>  dir2, dir3 ]". As it now stands, its like a C compiler complaining
>>  "undefined variable" with no variable name or line number to go by.
>
>I'm pretty sure that the log file reports which directories where loaded by
>the file resource loader. If the file isn't found in that directory then it
>is pretty clear where the problem is.
>
>>  The filename was was obvious by inspection. What wasn't was the path
>>  being searched.
>
>Eh?
>
>Fri Jul 13 12:16:03 PDT 2001   [info] FileResourceLoader : initialization
>starting.
>Fri Jul 13 12:16:03 PDT 2001   [info] FileResourceLoader : adding path
>'/Users/jon/checkout/scarab/target/webapps/scarab/WEB-INF/src/torque/templat
>es'

I found the log file I was referring to. You must be using a different version.

Mon Jul 09 12:46:53 EDT 2001 AvalonLogSystem initialized using 
logfile /jwaa/velocity.log
Mon Jul 09 12:46:53 EDT 2001   [info]   [info] Default Properties 
File: org/apache/velocity/runtime/defaults/velocity.properties
Mon Jul 09 12:46:53 EDT 2001   [info] Resource Loader Instantiated: 
org.apache.velocity.runtime.resource.loader.FileResourceLoader
Mon Jul 09 12:46:53 EDT 2001   [info] FileResourceLoader : 
initialization starting.
Mon Jul 09 12:46:53 EDT 2001   [info] FileResourceLoader : adding path '.'
Mon Jul 09 12:46:53 EDT 2001   [info] FileResourceLoader : 
initialization complete.
Mon Jul 09 12:46:53 EDT 2001   [info] Loaded Pluggable Directive: 
org.apache.velocity.runtime.directive.Literal
Mon Jul 09 12:46:53 EDT 2001   [info] Loaded Pluggable Directive: 
org.apache.velocity.runtime.directive.Macro
Mon Jul 09 12:46:53 EDT 2001   [info] Loaded Pluggable Directive: 
org.apache.velocity.runtime.directive.Parse
Mon Jul 09 12:46:53 EDT 2001   [info] Loaded Pluggable Directive: 
org.apache.velocity.runtime.directive.Include
Mon Jul 09 12:46:53 EDT 2001   [info] Loaded Pluggable Directive: 
org.apache.velocity.runtime.directive.Foreach
Mon Jul 09 12:46:53 EDT 2001   [info] Created: 20 parsers.
Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : initialization starting.
Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : adding VMs from 
VM library template : VM_global_library.vm
Mon Jul 09 12:46:53 EDT 2001  [error] ResourceManager : unable to 
find resource 'VM_global_library.vm' in any resource loader.
Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : error using  VM 
library template VM_global_library.vm : 
org.apache.velocity.exception.ResourceNotFoundException: Unable to 
find resource 'VM_global_library.vm'
Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : allowInline = 
true : VMs can be defined inline in templates
Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : 
allowInlineToOverride = false : VMs defined inline may NOT replace 
previous VM definitions
Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : allowInlineLocal 
= false : VMs defined inline will be  global in scope if allowed.
Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : messages on  : VM 
system will output logging messages
Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : initialization complete.
Mon Jul 09 12:46:53 EDT 2001   [info] Velocity successfully started.

I still assert that "Couldn't find Template.tmp in [ pathname1, 
pathname2 ] would have
been far more useful than ".". And what the heck is 
VM_global_library.vm, and why can't
it be found? It was wondering about that one that made me try adding 
"class" to the loader list.

>"using Jakarta"????????????????????????

I meant Velocity.

>  >, users have to download, understand, and install
>>  apache, a connector (JServ, mod_jk, etc), and tomcat, each with its
>>  own configuration file peculariaties, each of which is tested only
>>  for syntactic validity, with any semantic invalidity exposed so that
>>  NullPointerExceptions turn up at runtime.
>
>The problem is that it is very difficult to guess every single different
>configuration and use of our software as well as catch that usage perfectly.
>We try our best, but sometimes it isn't always easy.
>
>Needless to say, I'm not really sure what the point of what you are trying
>to say is. Are you saying that we should make things easier for our users?
>Are you saying that we intentionally make things difficult? If so, then let
>me point you at this document:

Jon, try taking what I've been saying at face value instead of trying 
to make everything a confrontation. I've made a number of very 
concrete technical proposals: Abstract classes over properties files, 
static over dynamic binding, the need for both semantic and syntactic 
checks on all external data (especially properties files), avoiding 
Strings/nulls in favor of application-specific Field types and many 
others. I've absolutely no interest in playing games or picking 
fights.

>     <http://jakarta.apache.org/site/understandingopensource.html>

Yeah. Pitch in and help a group that slaps down other ideas this readily?

>All the information you needed was in the log file. See above.

Yeah. Everything in that ".". Mea culpa.

>  > Condescending lecture deleted. I've uploaded everything I have to say
>>  to http://virtualschool.edu/jwaa. You won't be hearing from me again.
>>  In closing, I'll only add my disappointment in how closed this
>>  community is to constructive feedback, consideration of alternative
>>  technical approaches (static vs dynamic binding), and even offers to
>>  help (previous paragraph).
>
>Your response was not constructive feedback. It was a silly rant.

Sure Jon. Over and out.
-- 
For industrial age goods there were checks and credit cards.
For everything else there is mybank.dom at http://virtualschool.edu/mybank
Brad Cox, PhD; bcox@virtualschool.edu 703 361 4751


Mime
View raw message