geirm       02/01/10 11:33:35

  Modified:    xdocs    user-guide.xml vtl-reference-guide.xml
               docs     user-guide.html vtl-reference-guide.html
  Log:
  Added info on logical NOT
  
  Revision  Changes    Path
  1.59      +126 -92   jakarta-velocity/xdocs/user-guide.xml
  
  Index: user-guide.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/xdocs/user-guide.xml,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- user-guide.xml    9 Jan 2002 03:24:31 -0000       1.58
  +++ user-guide.xml    10 Jan 2002 19:33:34 -0000      1.59
  @@ -319,11 +319,11 @@
    </p>
   
   <source><![CDATA[
  -This is text that is outside the multi-line comment. 
  +This is text that is outside the multi-line comment.
   Online visitors can see it.
   
   #*
  - Thus begins a multi-line comment. Online visitors won't 
  + Thus begins a multi-line comment. Online visitors won't
    see this text because the Velocity Templating Engine will
    ignore it.
   *#
  @@ -339,9 +339,9 @@
   <source><![CDATA[
   This text is visible. ## This text is not.
   This text is visible.
  -This text is visible. #* This text, as part of a multi-line comment, 
  -is not visible. This text is not visible; it is also part of the 
  -multi-line comment. This text still not visible. *# This text is outside 
  +This text is visible. #* This text, as part of a multi-line comment,
  +is not visible. This text is not visible; it is also part of the
  +multi-line comment. This text still not visible. *# This text is outside
   the comment, so it is visible.
   ## This text is not visible.
   ]]></source>
  @@ -388,9 +388,9 @@
       character followed by a VTL <em>Identifier</em>. A VTL Identifier
       must start with an alphabetic character (a .. z or A .. Z). The rest
       of the characters are limited to the following types of characters:
  - </p> 
  + </p>
   
  - <p> 
  + <p>
      <ul>
        <li>alphabetic (a .. z, A .. Z)</li>
        <li>numeric (0 .. 9)</li>
  @@ -694,7 +694,7 @@
   ]]></source>
   
     <p>
  -     renders as 
  +     renders as
     </p>
   
   <source><![CDATA[
  @@ -706,7 +706,7 @@
   
     <p>
        Notice Velocity handles references that are defined differently
  -     from those that have not been defined. Here is a set directive that 
  +     from those that have not been defined. Here is a set directive that
        gives <em>$foo</em> the value <em>gibbous</em>.
     </p>
   
  @@ -765,15 +765,15 @@
       </p>
   
       <p>
  -    Velocity, which is modelled on the Bean specifications defined by 
  +    Velocity, which is modelled on the Bean specifications defined by
       Sun Microsystems, is case sensitive; however, its developers have
  -    strove to catch and correct user errors wherever possible. 
  +    strove to catch and correct user errors wherever possible.
       When the method <em>getFoo()</em> is referred to in a template
       by <code>$bar.foo</code>, Velocity will first try <code>$getfoo</code>.
       If this fails, it will then try <code>$getFoo</code>.
       Similarly, when a template refers to <code>$bar.Foo</code>, Velocity
       will try <em>$getFoo()</em> first and then try <em>getfoo()</em>.
  -    </p> 
  +    </p>
   
       <p>
       Note: <em>References to instance variables in a template are not
  @@ -1057,8 +1057,8 @@
       </p>
   
       <p>
  -    Please note that currently, Velocity's numeric comparisons are contrained 
  -    to Integers - anything else will evaluate to <em>false</em>.  The only 
exception 
  +    Please note that currently, Velocity's numeric comparisons are contrained
  +    to Integers - anything else will evaluate to <em>false</em>.  The only 
exception
       to this is equality '==', where Velocity requires that the objects on each
       side of the '==' is of the <em>same</em> class.
       </p>
  @@ -1084,24 +1084,32 @@
   ]]></source>
   
       <p>
  -      Velocity has logical AND and OR operators as well.  Below is an example of an 

  -      if statement using logical AND.
  +      Velocity has logical AND, OR and NOT operators as well.
  +      For further information, please see the
  +      <a href="vtl-reference-guide.html">VTL Reference Guide</a>
  +      Below are examples demonstrating the use of the
  +      logical AND, OR and NOT operators.
       </p>
   
  -<source><![CDATA[
  +<source><![CDATA[
  +
  +## logical AND
  +
   #if( $foo && $bar )
  -   <strong>Velocity Rocks!</strong>
  -#end
  +   <strong> This AND that</strong>
  +#end
  +
   ]]></source>
   
       <p>
  -      The if statement will only evaluate to true if both <em>$foo</em>
  +      The <em>#if()</em> directive will only evaluate to true
  +      if both <em>$foo</em>
         and <em>$bar</em> are true. If <em>$foo</em> is false, the
         expression will evaluate to false; <em>$bar</em> will not be
         evaluated. If <em>$foo</em> is true, the Velocity Templating
         Engine will then check the value of <em>$bar</em>; if
         <em>$bar</em> is true, then the entire expression is true and
  -      <strong>Velocity Rocks!</strong> becomes the output. If
  +      <strong>This AND that</strong> becomes the output. If
         <em>$bar</em> is false, then there will be no output as the entire
         expression is false.
       </p>
  @@ -1112,24 +1120,50 @@
         expression to be considered true. Consider the following example.
       </p>
   
  -<source><![CDATA[
  +<source><![CDATA[
  +
  +## logical OR
  +
   #if( $foo || $bar )
  -    <strong>Velocity Rocks Again!</strong>
  +    <strong>This OR That</strong>
   #end
   ]]></source>
   
       <p>
         If <em>$foo</em> is true, the Velocity Templating Engine has no
         need to look at <em>$bar</em>; whether <em>$bar</em> is true or
  -      false, the expression will be true, and <strong>Velocity Rocks
  -      Again!</strong> will be output. If <em>$foo</em> is false,
  +      false, the expression will be true, and <strong>This OR That</strong>
  +      will be output. If <em>$foo</em> is false,
         however, <em>$bar</em> must be checked. In this case, if
         <em>$bar</em> is also false, the expression evaluates to false and
         there is no output. On the other hand, if <em>$bar</em> is true,
         then the entire expression is true, and the output is
  -      <strong>Velocity Rocks Again!</strong>
  +      <strong>This OR That</strong>
       </p>
  -
  +
  +    <p>
  +    With logical NOT operators, there is only one argument :
  +    </p>
  +
  +<source><![CDATA[
  +
  +##logical NOT
  +
  +#if( !$foo )
  +  <strong>NOT that</strong>
  +#end
  +
  +]]></source>
  +
  +    <p>
  +    Here, the if <em>$foo</em> is true, then <em>!$foo</em> evaluates to
  +    false, and there is no output.  If <em>$foo</em> is false, then
  +    <em>!$foo</em> evaluates to true and <strong>NOT that</strong> will be
  +    output.  Be careful not to confuse this with the <em>quiet reference $!foo</em>
  +    which is something altogether different.
  +    </p>
  +
  +
    </section>
   
   <section name="Loops">
  @@ -1463,40 +1497,40 @@
     <strong>Velocimacro Arguments</strong>
   
     <p>
  -   Velocimacros can take as arguments any of the following 
  +   Velocimacros can take as arguments any of the following
      VTL elements :
     </p>
   
     <ul>
  -    <li> 
  +    <li>
         Reference : anything that starts with '$'
       </li>
  -    <li> 
  +    <li>
         String literal : something like "$foo" or 'hello'
       </li>
  -    <li> 
  +    <li>
         Number literal : 1, 2 etc
       </li>
  -    <li> 
  +    <li>
         IntegerRange : [ 1..2] or [$foo .. $bar]
       </li>
  -    <li> 
  +    <li>
         ObjectArray : [ "a", "b", "c"]
       </li>
  -    <li> 
  +    <li>
          boolean value true
       </li>
  -    <li> 
  +    <li>
          boolean value false
       </li>
     </ul>
   
      <p>
  -     When passing references as arguments to Velocimacros, 
  -     please note that references are passed 'by name'.  
  +     When passing references as arguments to Velocimacros,
  +     please note that references are passed 'by name'.
        This means that their value is 'generated' at each
        use inside the Velocimacro.  This feature allows you
  -     to pass references with method calls and have the 
  +     to pass references with method calls and have the
        method called at each use.  For example, when calling
        the following Velocimacro as shown
      </p>
  @@ -1515,18 +1549,18 @@
       </p>
   
       <p>
  -       At first glance, this feature appears surprising, but 
  +       At first glance, this feature appears surprising, but
          when you take into consideration the original motivation
          behind Velocimacros -- to eliminate cut'n'paste duplication
          of commonly used VTL -- it makes sense.  It allows you to
          do things like pass stateful objects, such as an object
  -       that generates colors in a repeating sequence for 
  +       that generates colors in a repeating sequence for
          coloring table rows, into the Velocimacro.
       </p>
  -   
  +
       <p>
  -       If you need to circumvent this feature, you can always 
  -       just get the value from the method as a new reference 
  +       If you need to circumvent this feature, you can always
  +       just get the value from the method as a new reference
          and pass that :
       </p>
   
  @@ -1537,7 +1571,7 @@
   
   
       <strong>Velocimacro Properties</strong>
  -    
  +
       <p>
       Several lines in the <code>velocity.properties</code> file allow for
       flexible implementation of Velocimacros.  Node that these are also
  @@ -1545,7 +1579,7 @@
       </p>
   
       <p>
  -    <code>velocimacro.library</code> - A comma-separated list of all 
  +    <code>velocimacro.library</code> - A comma-separated list of all
       Velocimacro template libraries. By default, Velocity looks for
       a single library: <em>VM_global_library.vm</em>. The configured template path
       is used to find the Velocimacro libraries.
  @@ -1563,7 +1597,7 @@
       <code>velocimacro.permissions.allow.inline.to.replace.global</code> -
        With possible values of true or false,
       this property allows the user to specify if a  Velocimacro defined
  -    inline in a template can replace a globally defined template, one 
  +    inline in a template can replace a globally defined template, one
       that was loaded on startup via the <code>velocimacro.library</code>
       property. The default, <code>false</code>, prevents
       Velocimacros defined inline in a template from replacing those
  @@ -1573,7 +1607,7 @@
      <p>
       <code>velocimacro.permissions.allow.inline.local.scope</code> - This
       property, with possible values of true or false, defaulting to false,
  -    controls if Velocimacros defined inline are 'visible' only to the 
  +    controls if Velocimacros defined inline are 'visible' only to the
       defining template.  In other words, with this property set to true,
       a template can define inline VMs that are usable only by the defining
       template.  You can use this for fancy VM tricks - if a global VM calls
  @@ -1596,7 +1630,7 @@
        controls Velocimacro library autoloading. The default value
       is <code>false</code>.  When set to <code>true</code>
       the source Velocimacro library for an invoked Velocimacro will be checked
  -    for changes, and reloaded if necessary.  This allows you to change and 
  +    for changes, and reloaded if necessary.  This allows you to change and
       test Velocimacro libraries without having to restart your application or
       servlet container, just like you can with regular templates.
       This mode only works when caching is <i>off</i>
  @@ -1607,16 +1641,16 @@
       <strong>Velocimacro Trivia</strong>
   
       <p>
  -    Currently, Velocimacros must be defined before they are first 
  -    used in a template.  This means that your #macro() declarations 
  +    Currently, Velocimacros must be defined before they are first
  +    used in a template.  This means that your #macro() declarations
       should come before using the Velocimacros.
       </p>
   
       <p>
  -    This is important to remember if you try to #parse() 
  +    This is important to remember if you try to #parse()
       a template containing inline #macro() directives.  Because
       the #parse() happens at runtime, and the parser decides if
  -    a VM-looking element in the template is a VM at parsetime, 
  +    a VM-looking element in the template is a VM at parsetime,
       #parse()-ing a set of VM declarations won't work as expected.
       To get around this, simply use the <code>velocimacro.library</code>
       facility to have Velocity load your VMs at startup.
  @@ -1653,12 +1687,12 @@
   ]]></source>
   
     <p>
  -  If <em>$jazz</em> is true, the output is 
  +  If <em>$jazz</em> is true, the output is
     </p>
   <source><![CDATA[
   Vyacheslav Ganelin
   ]]></source>
  -   
  +
     <p>
     If <em>$jazz</em> is false, there is no output. Escaping script elements
     alters the output. Consider the following case:
  @@ -1671,18 +1705,18 @@
   ]]></source>
   
     <p>
  -  Whether <em>$jazz</em> is true or false, the output will be 
  +  Whether <em>$jazz</em> is true or false, the output will be
     </p>
  -  
  +
    <source><![CDATA[
  - #if($ jazz ) 
  -     Vyacheslav Ganelin 
  + #if($ jazz )
  +     Vyacheslav Ganelin
    #end
    ]]></source>
  - 
  +
     <p>
     In fact, because all script elements
  -  are escaped, <em>$jazz</em> is never evaluated for it's boolean value. 
  +  are escaped, <em>$jazz</em> is never evaluated for it's boolean value.
     Suppose
     backslashes precede script elements that are legitimately escaped:
     </p>
  @@ -1694,11 +1728,11 @@
   ]]></source>
   
     <p>
  -  In this case, if <em>$jazz</em> is true, the output is 
  +  In this case, if <em>$jazz</em> is true, the output is
     </p>
  -  
  +
   <source><![CDATA[
  -\ Vyacheslav Ganelin 
  +\ Vyacheslav Ganelin
   \
   ]]></source>
   
  @@ -1709,12 +1743,12 @@
     block follows the first '\', rendered
     from the '\\' preceeding the <code>#if()</code>.
      The last \ is on a different
  -  line than the text beacsue there is a newline after 'Ganelin', so 
  -  the final \\, preceeding the <code>#end</code> is part of the 
  +  line than the text beacsue there is a newline after 'Ganelin', so
  +  the final \\, preceeding the <code>#end</code> is part of the
     body of the block.
     </p>
  -  
  -  <p> 
  +
  +  <p>
     If <em>$jazz</em> is false, there is no output. Note that
     things start to break if script elements are not properly escaped.
     </p>
  @@ -2007,7 +2041,7 @@
   </p>
   
   <p>
  -No.  A directive isn't a valid argument to a directive, and for most practical 
  +No.  A directive isn't a valid argument to a directive, and for most practical
   purposes, a VM is a directive.
   </p>
   
  @@ -2031,9 +2065,9 @@
   ]]></source>
   
   <p>
  -Please note that in the latter exmaple the arg 
  -is evaluated <i>inside</i> the VM, not at the 
  -calling level.  In other words, the argument to 
  +Please note that in the latter exmaple the arg
  +is evaluated <i>inside</i> the VM, not at the
  +calling level.  In other words, the argument to
   the VM is passed in in its entirety and evaluated within the VM
   it was passed into. This allows you to do things like :
   </p>
  @@ -2082,7 +2116,7 @@
   ]]></source>
   
   <p>
  -And have rowColor() called repeatedly, rather than just once.  To avoid that, 
  +And have rowColor() called repeatedly, rather than just once.  To avoid that,
   invoke the method outside of the VM, and pass the value into the VM.
   </p>
   
  @@ -2095,16 +2129,16 @@
   <strong>Can I register Velocimacros via #parse() ? </strong>
   
       <p>
  -    Currently, Velocimacros must be defined before they are first 
  -    used in a template.  This means that your #macro() declarations 
  +    Currently, Velocimacros must be defined before they are first
  +    used in a template.  This means that your #macro() declarations
       should come before using the Velocimacros.
       </p>
   
       <p>
  -    This is important to remember if you try to #parse() 
  +    This is important to remember if you try to #parse()
       a template containing inline #macro() directives.  Because
       the #parse() happens at runtime, and the parser decides if
  -    a VM-looking element in the template is a VM at parsetime, 
  +    a VM-looking element in the template is a VM at parsetime,
       #parse()-ing a set of VM declarations won't work as expected.
       To get around this, simply use the <code>velocimacro.library</code>
       facility to have Velocity load your VMs at startup.
  @@ -2114,10 +2148,10 @@
   <strong>What is Velocimacro Autoreloading?</strong>
   
     <p>
  -   There is a property, meant to be used in <i>development</i>, 
  +   There is a property, meant to be used in <i>development</i>,
      not production :
     </p>
  -  
  +
     <p>
     <code>velocimacro.library.autoreload</code>
     </p>
  @@ -2125,16 +2159,16 @@
      <p>
      which defaults to false.  When set to true <em>along with</em>
      </p>
  -   
  +
      <p>
      <code>&lt;type&gt;.resource.loader.cache = false</code>
      </p>
  -    
  +
       <p>
       (where &lt;type&gt; is the name of the resource loader that you
       are using, such as 'file') then the Velocity engine will automatically
  -    reload changes to your Velocimacro library files when you make them, 
  -    so you do not have to dump the servlet engine (or application) or do 
  +    reload changes to your Velocimacro library files when you make them,
  +    so you do not have to dump the servlet engine (or application) or do
       other tricks to have your Velocimacros reloaded.
       </p>
   
  @@ -2163,13 +2197,13 @@
      </p>
   
      <p>
  -    To do concatenation of references in VTL, you 
  -    just have to 'put them together'.  The context of 
  -    where you want to put them together does matter, so 
  +    To do concatenation of references in VTL, you
  +    just have to 'put them together'.  The context of
  +    where you want to put them together does matter, so
       we will illustrate with some examples.
      </p>
   
  -   <p> 
  +   <p>
       In the regular 'schmoo' of a template (when you are mixing
       it in with regular content) :
      </p>
  @@ -2198,8 +2232,8 @@
       ]]></source>
   
       <p>
  -     Which will result in the same output.  As a final example, when 
  -     you want to mix in 'static' strings with your references, you may 
  +     Which will result in the same output.  As a final example, when
  +     you want to mix in 'static' strings with your references, you may
        need to use 'formal references' :
       </p>
   
  @@ -2225,10 +2259,10 @@
   <section name="Feedback">
   
     <p>
  -    If you encounter any mistakes in this manual or have 
  -    other feedback related to the Velocity User Guide, please 
  -    email the 
  -    <a href="mailto:[EMAIL PROTECTED]";>Velocity user list</a>. 
  +    If you encounter any mistakes in this manual or have
  +    other feedback related to the Velocity User Guide, please
  +    email the
  +    <a href="mailto:[EMAIL PROTECTED]";>Velocity user list</a>.
       Thanks!
     </p>
   
  
  
  
  1.32      +2 -1      jakarta-velocity/xdocs/vtl-reference-guide.xml
  
  Index: vtl-reference-guide.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/xdocs/vtl-reference-guide.xml,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- vtl-reference-guide.xml   13 Dec 2001 18:42:57 -0000      1.31
  +++ vtl-reference-guide.xml   10 Jan 2002 19:33:34 -0000      1.32
  @@ -193,7 +193,8 @@
          <li>Less Than or Equal To: #if( $foo &lt;= 42 )</li>
          <li>Equals Number: #if( $foo == 42 )</li>
          <li>Equals String: #if( $foo == "bar" )</li>
  -    </ul>    
  +       <li>Boolean NOT: #if( !$foo )</li>
  +    </ul>
     </subsection>
   
     <subsection name="#foreach - Loops through a list of objects">
  
  
  
  1.65      +124 -76   jakarta-velocity/docs/user-guide.html
  
  Index: user-guide.html
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/docs/user-guide.html,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- user-guide.html   9 Jan 2002 03:24:31 -0000       1.64
  +++ user-guide.html   10 Jan 2002 19:33:34 -0000      1.65
  @@ -556,11 +556,11 @@
       <tr>
         <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" 
height="1" vspace="0" hspace="0" border="0"/></td>
         <td bgcolor="#ffffff"><pre>
  -This is text that is outside the multi-line comment. 
  +This is text that is outside the multi-line comment.
   Online visitors can see it.
   
   #*
  - Thus begins a multi-line comment. Online visitors won't 
  + Thus begins a multi-line comment. Online visitors won't
    see this text because the Velocity Templating Engine will
    ignore it.
   *#
  @@ -592,9 +592,9 @@
         <td bgcolor="#ffffff"><pre>
   This text is visible. ## This text is not.
   This text is visible.
  -This text is visible. #* This text, as part of a multi-line comment, 
  -is not visible. This text is not visible; it is also part of the 
  -multi-line comment. This text still not visible. *# This text is outside 
  +This text is visible. #* This text, as part of a multi-line comment,
  +is not visible. This text is not visible; it is also part of the
  +multi-line comment. This text still not visible. *# This text is outside
   the comment, so it is visible.
   ## This text is not visible.
   </pre></td>
  @@ -673,7 +673,7 @@
       must start with an alphabetic character (a .. z or A .. Z). The rest
       of the characters are limited to the following types of characters:
    </p>
  -                                                <p> 
  +                                                <p>
      <ul>
        <li>alphabetic (a .. z, A .. Z)</li>
        <li>numeric (0 .. 9)</li>
  @@ -1230,7 +1230,7 @@
       </table>
       </div>
                                                   <p>
  -     renders as 
  +     renders as
     </p>
                                                       <div align="left">
       <table cellspacing="4" cellpadding="0" border="0">
  @@ -1258,7 +1258,7 @@
       </div>
                                                   <p>
        Notice Velocity handles references that are defined differently
  -     from those that have not been defined. Here is a set directive that 
  +     from those that have not been defined. Here is a set directive that
        gives <em>$foo</em> the value <em>gibbous</em>.
     </p>
                                                       <div align="left">
  @@ -1354,9 +1354,9 @@
       references almost anywhere in your template.
       </p>
                                                   <p>
  -    Velocity, which is modelled on the Bean specifications defined by 
  +    Velocity, which is modelled on the Bean specifications defined by
       Sun Microsystems, is case sensitive; however, its developers have
  -    strove to catch and correct user errors wherever possible. 
  +    strove to catch and correct user errors wherever possible.
       When the method <em>getFoo()</em> is referred to in a template
       by <code>$bar.foo</code>, Velocity will first try <code>$getfoo</code>.
       If this fails, it will then try <code>$getFoo</code>.
  @@ -1855,8 +1855,8 @@
       true, so the output is <strong>Go South</strong>.
       </p>
                                                   <p>
  -    Please note that currently, Velocity's numeric comparisons are contrained 
  -    to Integers - anything else will evaluate to <em>false</em>.  The only 
exception 
  +    Please note that currently, Velocity's numeric comparisons are contrained
  +    to Integers - anything else will evaluate to <em>false</em>.  The only exception
       to this is equality '==', where Velocity requires that the objects on each
       side of the '==' is of the <em>same</em> class.
       </p>
  @@ -1896,8 +1896,11 @@
       </table>
       </div>
                                                   <p>
  -      Velocity has logical AND and OR operators as well.  Below is an example of an 
  -      if statement using logical AND.
  +      Velocity has logical AND, OR and NOT operators as well.
  +      For further information, please see the
  +      <a href="vtl-reference-guide.html">VTL Reference Guide</a>
  +      Below are examples demonstrating the use of the
  +      logical AND, OR and NOT operators.
       </p>
                                                       <div align="left">
       <table cellspacing="4" cellpadding="0" border="0">
  @@ -1909,9 +1912,13 @@
       <tr>
         <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" 
height="1" vspace="0" hspace="0" border="0"/></td>
         <td bgcolor="#ffffff"><pre>
  +
  +## logical AND
  +
   #if( $foo &amp;&amp; $bar )
  -   &lt;strong&gt;Velocity Rocks!&lt;/strong&gt;
  +   &lt;strong&gt; This AND that&lt;/strong&gt;
   #end
  +
   </pre></td>
         <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" 
height="1" vspace="0" hspace="0" border="0"/></td>
       </tr>
  @@ -1923,13 +1930,14 @@
       </table>
       </div>
                                                   <p>
  -      The if statement will only evaluate to true if both <em>$foo</em>
  +      The <em>#if()</em> directive will only evaluate to true
  +      if both <em>$foo</em>
         and <em>$bar</em> are true. If <em>$foo</em> is false, the
         expression will evaluate to false; <em>$bar</em> will not be
         evaluated. If <em>$foo</em> is true, the Velocity Templating
         Engine will then check the value of <em>$bar</em>; if
         <em>$bar</em> is true, then the entire expression is true and
  -      <strong>Velocity Rocks!</strong> becomes the output. If
  +      <strong>This AND that</strong> becomes the output. If
         <em>$bar</em> is false, then there will be no output as the entire
         expression is false.
       </p>
  @@ -1948,8 +1956,11 @@
       <tr>
         <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" 
height="1" vspace="0" hspace="0" border="0"/></td>
         <td bgcolor="#ffffff"><pre>
  +
  +## logical OR
  +
   #if( $foo || $bar )
  -    &lt;strong&gt;Velocity Rocks Again!&lt;/strong&gt;
  +    &lt;strong&gt;This OR That&lt;/strong&gt;
   #end
   </pre></td>
         <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" 
height="1" vspace="0" hspace="0" border="0"/></td>
  @@ -1964,13 +1975,50 @@
                                                   <p>
         If <em>$foo</em> is true, the Velocity Templating Engine has no
         need to look at <em>$bar</em>; whether <em>$bar</em> is true or
  -      false, the expression will be true, and <strong>Velocity Rocks
  -      Again!</strong> will be output. If <em>$foo</em> is false,
  +      false, the expression will be true, and <strong>This OR That</strong>
  +      will be output. If <em>$foo</em> is false,
         however, <em>$bar</em> must be checked. In this case, if
         <em>$bar</em> is also false, the expression evaluates to false and
         there is no output. On the other hand, if <em>$bar</em> is true,
         then the entire expression is true, and the output is
  -      <strong>Velocity Rocks Again!</strong>
  +      <strong>This OR That</strong>
  +    </p>
  +                                                <p>
  +    With logical NOT operators, there is only one argument :
  +    </p>
  +                                                    <div align="left">
  +    <table cellspacing="4" cellpadding="0" border="0">
  +    <tr>
  +      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" 
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  +      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" 
height="1" vspace="0" hspace="0" border="0"/></td>
  +      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" 
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  +    </tr>
  +    <tr>
  +      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" 
height="1" vspace="0" hspace="0" border="0"/></td>
  +      <td bgcolor="#ffffff"><pre>
  +
  +##logical NOT
  +
  +#if( !$foo )
  +  &lt;strong&gt;NOT that&lt;/strong&gt;
  +#end
  +
  +</pre></td>
  +      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" 
height="1" vspace="0" hspace="0" border="0"/></td>
  +    </tr>
  +    <tr>
  +      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" 
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  +      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" 
height="1" vspace="0" hspace="0" border="0"/></td>
  +      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" 
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  +    </tr>
  +    </table>
  +    </div>
  +                                                <p>
  +    Here, the if <em>$foo</em> is true, then <em>!$foo</em> evaluates to
  +    false, and there is no output.  If <em>$foo</em> is false, then
  +    <em>!$foo</em> evaluates to true and <strong>NOT that</strong> will be
  +    output.  Be careful not to confuse this with the <em>quiet reference $!foo</em>
  +    which is something altogether different.
       </p>
                               </blockquote>
           </p>
  @@ -2629,38 +2677,38 @@
       </div>
                                                   <strong>Velocimacro 
Arguments</strong>
                                                   <p>
  -   Velocimacros can take as arguments any of the following 
  +   Velocimacros can take as arguments any of the following
      VTL elements :
     </p>
                                                   <ul>
  -    <li> 
  +    <li>
         Reference : anything that starts with '$'
       </li>
  -    <li> 
  +    <li>
         String literal : something like "$foo" or 'hello'
       </li>
  -    <li> 
  +    <li>
         Number literal : 1, 2 etc
       </li>
  -    <li> 
  +    <li>
         IntegerRange : [ 1..2] or [$foo .. $bar]
       </li>
  -    <li> 
  +    <li>
         ObjectArray : [ "a", "b", "c"]
       </li>
  -    <li> 
  +    <li>
          boolean value true
       </li>
  -    <li> 
  +    <li>
          boolean value false
       </li>
     </ul>
                                                   <p>
  -     When passing references as arguments to Velocimacros, 
  -     please note that references are passed 'by name'.  
  +     When passing references as arguments to Velocimacros,
  +     please note that references are passed 'by name'.
        This means that their value is 'generated' at each
        use inside the Velocimacro.  This feature allows you
  -     to pass references with method calls and have the 
  +     to pass references with method calls and have the
        method called at each use.  For example, when calling
        the following Velocimacro as shown
      </p>
  @@ -2694,17 +2742,17 @@
          being called 3 times.
       </p>
                                                   <p>
  -       At first glance, this feature appears surprising, but 
  +       At first glance, this feature appears surprising, but
          when you take into consideration the original motivation
          behind Velocimacros -- to eliminate cut'n'paste duplication
          of commonly used VTL -- it makes sense.  It allows you to
          do things like pass stateful objects, such as an object
  -       that generates colors in a repeating sequence for 
  +       that generates colors in a repeating sequence for
          coloring table rows, into the Velocimacro.
       </p>
                                                   <p>
  -       If you need to circumvent this feature, you can always 
  -       just get the value from the method as a new reference 
  +       If you need to circumvent this feature, you can always
  +       just get the value from the method as a new reference
          and pass that :
       </p>
                                                       <div align="left">
  @@ -2736,7 +2784,7 @@
       documented in the <a href="developer-guide.html">Developer Guide</a>.
       </p>
                                                   <p>
  -    <code>velocimacro.library</code> - A comma-separated list of all 
  +    <code>velocimacro.library</code> - A comma-separated list of all
       Velocimacro template libraries. By default, Velocity looks for
       a single library: <em>VM_global_library.vm</em>. The configured template path
       is used to find the Velocimacro libraries.
  @@ -2752,7 +2800,7 @@
       <code>velocimacro.permissions.allow.inline.to.replace.global</code> -
        With possible values of true or false,
       this property allows the user to specify if a  Velocimacro defined
  -    inline in a template can replace a globally defined template, one 
  +    inline in a template can replace a globally defined template, one
       that was loaded on startup via the <code>velocimacro.library</code>
       property. The default, <code>false</code>, prevents
       Velocimacros defined inline in a template from replacing those
  @@ -2761,7 +2809,7 @@
                                                   <p>
       <code>velocimacro.permissions.allow.inline.local.scope</code> - This
       property, with possible values of true or false, defaulting to false,
  -    controls if Velocimacros defined inline are 'visible' only to the 
  +    controls if Velocimacros defined inline are 'visible' only to the
       defining template.  In other words, with this property set to true,
       a template can define inline VMs that are usable only by the defining
       template.  You can use this for fancy VM tricks - if a global VM calls
  @@ -2782,7 +2830,7 @@
        controls Velocimacro library autoloading. The default value
       is <code>false</code>.  When set to <code>true</code>
       the source Velocimacro library for an invoked Velocimacro will be checked
  -    for changes, and reloaded if necessary.  This allows you to change and 
  +    for changes, and reloaded if necessary.  This allows you to change and
       test Velocimacro libraries without having to restart your application or
       servlet container, just like you can with regular templates.
       This mode only works when caching is <i>off</i>
  @@ -2791,15 +2839,15 @@
       </p>
                                                   <strong>Velocimacro Trivia</strong>
                                                   <p>
  -    Currently, Velocimacros must be defined before they are first 
  -    used in a template.  This means that your #macro() declarations 
  +    Currently, Velocimacros must be defined before they are first
  +    used in a template.  This means that your #macro() declarations
       should come before using the Velocimacros.
       </p>
                                                   <p>
  -    This is important to remember if you try to #parse() 
  +    This is important to remember if you try to #parse()
       a template containing inline #macro() directives.  Because
       the #parse() happens at runtime, and the parser decides if
  -    a VM-looking element in the template is a VM at parsetime, 
  +    a VM-looking element in the template is a VM at parsetime,
       #parse()-ing a set of VM declarations won't work as expected.
       To get around this, simply use the <code>velocimacro.library</code>
       facility to have Velocity load your VMs at startup.
  @@ -2878,7 +2926,7 @@
       </table>
       </div>
                                                   <p>
  -  If <em>$jazz</em> is true, the output is 
  +  If <em>$jazz</em> is true, the output is
     </p>
                                                       <div align="left">
       <table cellspacing="4" cellpadding="0" border="0">
  @@ -2929,7 +2977,7 @@
       </table>
       </div>
                                                   <p>
  -  Whether <em>$jazz</em> is true or false, the output will be 
  +  Whether <em>$jazz</em> is true or false, the output will be
     </p>
                                                       <div align="left">
       <table cellspacing="4" cellpadding="0" border="0">
  @@ -2941,8 +2989,8 @@
       <tr>
         <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" 
height="1" vspace="0" hspace="0" border="0"/></td>
         <td bgcolor="#ffffff"><pre>
  - #if($ jazz ) 
  -     Vyacheslav Ganelin 
  + #if($ jazz )
  +     Vyacheslav Ganelin
    #end
    </pre></td>
         <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" 
height="1" vspace="0" hspace="0" border="0"/></td>
  @@ -2956,7 +3004,7 @@
       </div>
                                                   <p>
     In fact, because all script elements
  -  are escaped, <em>$jazz</em> is never evaluated for it's boolean value. 
  +  are escaped, <em>$jazz</em> is never evaluated for it's boolean value.
     Suppose
     backslashes precede script elements that are legitimately escaped:
     </p>
  @@ -2984,7 +3032,7 @@
       </table>
       </div>
                                                   <p>
  -  In this case, if <em>$jazz</em> is true, the output is 
  +  In this case, if <em>$jazz</em> is true, the output is
     </p>
                                                       <div align="left">
       <table cellspacing="4" cellpadding="0" border="0">
  @@ -2996,7 +3044,7 @@
       <tr>
         <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" 
height="1" vspace="0" hspace="0" border="0"/></td>
         <td bgcolor="#ffffff"><pre>
  -\ Vyacheslav Ganelin 
  +\ Vyacheslav Ganelin
   \
   </pre></td>
         <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" 
height="1" vspace="0" hspace="0" border="0"/></td>
  @@ -3015,11 +3063,11 @@
     block follows the first '\', rendered
     from the '\\' preceeding the <code>#if()</code>.
      The last \ is on a different
  -  line than the text beacsue there is a newline after 'Ganelin', so 
  -  the final \\, preceeding the <code>#end</code> is part of the 
  +  line than the text beacsue there is a newline after 'Ganelin', so
  +  the final \\, preceeding the <code>#end</code> is part of the
     body of the block.
     </p>
  -                                                <p> 
  +                                                <p>
     If <em>$jazz</em> is false, there is no output. Note that
     things start to break if script elements are not properly escaped.
     </p>
  @@ -3622,7 +3670,7 @@
   Example : <code>#center( #bold("hello") )</code>
   </p>
                                                   <p>
  -No.  A directive isn't a valid argument to a directive, and for most practical 
  +No.  A directive isn't a valid argument to a directive, and for most practical
   purposes, a VM is a directive.
   </p>
                                                   <p>
  @@ -3677,9 +3725,9 @@
       </table>
       </div>
                                                   <p>
  -Please note that in the latter exmaple the arg 
  -is evaluated <i>inside</i> the VM, not at the 
  -calling level.  In other words, the argument to 
  +Please note that in the latter exmaple the arg
  +is evaluated <i>inside</i> the VM, not at the
  +calling level.  In other words, the argument to
   the VM is passed in in its entirety and evaluated within the VM
   it was passed into. This allows you to do things like :
   </p>
  @@ -3775,7 +3823,7 @@
       </table>
       </div>
                                                   <p>
  -And have rowColor() called repeatedly, rather than just once.  To avoid that, 
  +And have rowColor() called repeatedly, rather than just once.  To avoid that,
   invoke the method outside of the VM, and pass the value into the VM.
   </p>
                                                       <div align="left">
  @@ -3802,22 +3850,22 @@
       </div>
                                                   <strong>Can I register Velocimacros 
via #parse() ? </strong>
                                                   <p>
  -    Currently, Velocimacros must be defined before they are first 
  -    used in a template.  This means that your #macro() declarations 
  +    Currently, Velocimacros must be defined before they are first
  +    used in a template.  This means that your #macro() declarations
       should come before using the Velocimacros.
       </p>
                                                   <p>
  -    This is important to remember if you try to #parse() 
  +    This is important to remember if you try to #parse()
       a template containing inline #macro() directives.  Because
       the #parse() happens at runtime, and the parser decides if
  -    a VM-looking element in the template is a VM at parsetime, 
  +    a VM-looking element in the template is a VM at parsetime,
       #parse()-ing a set of VM declarations won't work as expected.
       To get around this, simply use the <code>velocimacro.library</code>
       facility to have Velocity load your VMs at startup.
       </p>
                                                   <strong>What is Velocimacro 
Autoreloading?</strong>
                                                   <p>
  -   There is a property, meant to be used in <i>development</i>, 
  +   There is a property, meant to be used in <i>development</i>,
      not production :
     </p>
                                                   <p>
  @@ -3832,8 +3880,8 @@
                                                   <p>
       (where &lt;type&gt; is the name of the resource loader that you
       are using, such as 'file') then the Velocity engine will automatically
  -    reload changes to your Velocimacro library files when you make them, 
  -    so you do not have to dump the servlet engine (or application) or do 
  +    reload changes to your Velocimacro library files when you make them,
  +    so you do not have to dump the servlet engine (or application) or do
       other tricks to have your Velocimacros reloaded.
       </p>
                                                   <p>
  @@ -3883,12 +3931,12 @@
       analogue to the '+' operator in Java?</i>.
      </p>
                                                   <p>
  -    To do concatenation of references in VTL, you 
  -    just have to 'put them together'.  The context of 
  -    where you want to put them together does matter, so 
  +    To do concatenation of references in VTL, you
  +    just have to 'put them together'.  The context of
  +    where you want to put them together does matter, so
       we will illustrate with some examples.
      </p>
  -                                                <p> 
  +                                                <p>
       In the regular 'schmoo' of a template (when you are mixing
       it in with regular content) :
      </p>
  @@ -3949,8 +3997,8 @@
       </table>
       </div>
                                                   <p>
  -     Which will result in the same output.  As a final example, when 
  -     you want to mix in 'static' strings with your references, you may 
  +     Which will result in the same output.  As a final example, when
  +     you want to mix in 'static' strings with your references, you may
        need to use 'formal references' :
       </p>
                                                       <div align="left">
  @@ -4003,10 +4051,10 @@
         <tr><td>
           <blockquote>
                                       <p>
  -    If you encounter any mistakes in this manual or have 
  -    other feedback related to the Velocity User Guide, please 
  -    email the 
  -    <a href="mailto:[EMAIL PROTECTED]";>Velocity user list</a>. 
  +    If you encounter any mistakes in this manual or have
  +    other feedback related to the Velocity User Guide, please
  +    email the
  +    <a href="mailto:[EMAIL PROTECTED]";>Velocity user list</a>.
       Thanks!
     </p>
                               </blockquote>
  
  
  
  1.47      +2 -1      jakarta-velocity/docs/vtl-reference-guide.html
  
  Index: vtl-reference-guide.html
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/docs/vtl-reference-guide.html,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- vtl-reference-guide.html  4 Jan 2002 04:12:54 -0000       1.46
  +++ vtl-reference-guide.html  10 Jan 2002 19:33:34 -0000      1.47
  @@ -353,6 +353,7 @@
          <li>Less Than or Equal To: #if( $foo &lt;= 42 )</li>
          <li>Equals Number: #if( $foo == 42 )</li>
          <li>Equals String: #if( $foo == "bar" )</li>
  +       <li>Boolean NOT: #if( !$foo )</li>
       </ul>
                               </blockquote>
         </td></tr>
  @@ -672,7 +673,7 @@
                   </td></tr>
                   <tr><td colspan="2">
                       <div align="center"><font color="#525D76" size="-1"><em>
  -                    Copyright &#169; 1999-2001, Apache Software Foundation
  +                    Copyright &#169; 1999-2002, Apache Software Foundation
                       </em></font></div>
                   </td></tr>
               </table>
  
  
  

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

Reply via email to