DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7459>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7459

Creating a more lightweight Velocity Framework

[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://cvs.apache.org/viewcv
                   |                            |s/jakarta-
                   |                            |velocity/src/java/org/apache
                   |                            |/velocity/runtime/defaults/d
                   |                            |irective.properties?rev=1&co
                   |                            |ntent-type=text/vnd.viewcvs-
                   |                            |markup
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME



------- Additional Comments From [EMAIL PROTECTED]  2002-03-26 02:03 -------
Hey Matt.  Directives are already overridable (if perhaps not directly
pluggable, as this is not something I would want to encourage), there just
doesn't seem to be much in the way of documentation on it (as the number of
directives supported is already very minimal).  Here's the content of
jakarta-velocity/src/java/org/apache/velocity/runtime/defaults/directive.properties:

directive.1=org.apache.velocity.runtime.directive.Foreach
directive.2=org.apache.velocity.runtime.directive.Include
directive.3=org.apache.velocity.runtime.directive.Parse
directive.4=org.apache.velocity.runtime.directive.Macro
directive.5=org.apache.velocity.runtime.directive.Literal

The constant o.a.v.runtime.RuntimeConstants.DEFAULT_RUNTIME_DIRECTIVES names
that file, and is used in the RuntimeInstance.initializeDirectives() method,
which is in turn called by the init() method of the same class.

Geir or Jason may be able to suggest a better way, but sub-classing
RuntimeInstance and overriding init() with code that either supplies your own
directives or removes existing default directives would accomplish what you want
to do.  IMO, this is fine as is -- removes the standard directives and you no
longer have Velocity.

BTW, no one recommends implementing _business_ logic in the templates.  The
standard directives are there for minimal display logic, which is generally tied
to a template anyways.

If you stray down this path and want to contribute some HOWTO documentation,
you'd save us from having to answer this question at a later date.

- Thanks, Dan

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

Reply via email to