Author: cbrisson
Date: Thu Apr 26 17:18:18 2012
New Revision: 1330979
URL: http://svn.apache.org/viewvc?rev=1330979&view=rev
Log:
documentation updates for 2.x
Modified:
velocity/engine/trunk/src/site/xdoc/developer-guide.xml
velocity/engine/trunk/src/site/xdoc/user-guide.xml
velocity/engine/trunk/src/site/xdoc/vtl-reference-guide.xml
Modified: velocity/engine/trunk/src/site/xdoc/developer-guide.xml
URL:
http://svn.apache.org/viewvc/velocity/engine/trunk/src/site/xdoc/developer-guide.xml?rev=1330979&r1=1330978&r2=1330979&view=diff
==============================================================================
--- velocity/engine/trunk/src/site/xdoc/developer-guide.xml (original)
+++ velocity/engine/trunk/src/site/xdoc/developer-guide.xml Thu Apr 26 17:18:18
2012
@@ -1957,6 +1957,8 @@ allows you to create more interesting ru
rather than just returning the first non-null value.
</p>
+<p>Some alternate Uberspectors are provided. You would for instance use
<code>runtime.introspector.uberspect =
org.apache.velocity.util.introspection.SecureUberspector</code> to avoid
template authors to instanciate new classes or to use reflection, or use
<code>runtime.introspector.uberspect =
org.apache.velocity.util.introspection.UberspectImpl,
org.apache.velocity.util.introspection.UberspectPublicFields</code> to expose
Java public fields in your templates.</p>
+
</section>
<section name="Configuring Logging" href="Configuring_Logging">
Modified: velocity/engine/trunk/src/site/xdoc/user-guide.xml
URL:
http://svn.apache.org/viewvc/velocity/engine/trunk/src/site/xdoc/user-guide.xml?rev=1330979&r1=1330978&r2=1330979&view=diff
==============================================================================
--- velocity/engine/trunk/src/site/xdoc/user-guide.xml (original)
+++ velocity/engine/trunk/src/site/xdoc/user-guide.xml Thu Apr 26 17:18:18 2012
@@ -1242,9 +1242,13 @@ $blargh
<p>
The variable <em>$foo</em> is evaluated to determine whether it is
- true, which will happen under one of two circumstances: (i)
- <em>$foo</em> is a boolean (true/false) which has a true value, or
- (ii) the value is not null. Remember that the Velocity context only
+ true, which will happen under one of three circumstances:
+ <ul>
+ <li><em>$foo</em> is a boolean (true/false) which has a true value</li>
+ <li><em>$foo</em> is a string or a collection which is not null
<strong>and</strong> not empty</li>
+ <li><em>$foo</em> is an object (other than a string or a collection)
which is not null</li>
+ </ul>
+ Remember that the Velocity context only
contains Objects, so when we say 'boolean', it will be represented
as a Boolean (the class). This is true even for methods that return
<code>boolean</code> - the introspection infrastructure will return
Modified: velocity/engine/trunk/src/site/xdoc/vtl-reference-guide.xml
URL:
http://svn.apache.org/viewvc/velocity/engine/trunk/src/site/xdoc/vtl-reference-guide.xml?rev=1330979&r1=1330978&r2=1330979&view=diff
==============================================================================
--- velocity/engine/trunk/src/site/xdoc/vtl-reference-guide.xml (original)
+++ velocity/engine/trunk/src/site/xdoc/vtl-reference-guide.xml Thu Apr 26
17:18:18 2012
@@ -122,6 +122,8 @@
and Methods is that you can specify a parameter list to a Method.
</p>
+ <p>Each method argument can be any valid VTL expression.</p>
+
</section>
<section name="Directives" href="Directives">
@@ -499,7 +501,7 @@ directive.foreach.maxloops = -1
</p>
<p>
- <strong>#</strong> [ <strong>{</strong> ] <strong>macro</strong> [
<strong>}</strong> ] <strong>(</strong> vmname $arg1 [ $arg2 $arg3 ... $argn ]
+ <strong>#</strong> [ <strong>{</strong> ] <strong>macro</strong> [
<strong>}</strong> ] <strong>(</strong> vmname $arg1 [ = def1 ] [ $arg2 [ =
def2 ] $arg3 [ = def3 ] ... $argn [ = defn ] ]
<strong>)</strong> [ VM VTL code... ] <strong>#</strong> [
<strong>{</strong> ] <strong>end</strong> [ <strong>}</strong> ]
</p>
@@ -508,7 +510,8 @@ directive.foreach.maxloops = -1
(<em>#vmname</em>)</li>
<li><em>$arg1 $arg2 [ ... ]</em> - Arguments to the VM. There can be
any number of arguments, but the number used at invocation must
- match the number specified in the definition.</li>
+ match the number specified in the definition, unless there is a default
value provided for missing parameters.</li>
+ <li><em>def1 def2 ...</em> - Optional default values provided for macro
arguments. If a default value is provided for an argument, a default value must
also be provided to all subsequent arguments.</li>
<li><em>[ VM VTL code... ]</em> - Any valid VTL code, anything you
can put into a template, can be put into a VM.</li>
</ul>