velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@locus.apache.org
Subject cvs commit: jakarta-velocity/src/java/org/apache/velocity/runtime/directive VelocimacroProxy.java
Date Sun, 10 Dec 2000 04:54:51 GMT
geirm       00/12/09 20:54:51

  Modified:    src/java/org/apache/velocity/runtime/directive
                        VelocimacroProxy.java
  Log:
  Added support for template-local inline VMs.  Needed to send a real context down the AST
via init() to set the template name.
  
  Revision  Changes    Path
  1.13      +6 -7      jakarta-velocity/src/java/org/apache/velocity/runtime/directive/VelocimacroProxy.java
  
  Index: VelocimacroProxy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/directive/VelocimacroProxy.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- VelocimacroProxy.java	2000/12/05 05:07:39	1.12
  +++ VelocimacroProxy.java	2000/12/10 04:54:50	1.13
  @@ -58,7 +58,7 @@
    *   a proxy Directive-derived object to fit with the current directive system
    *
    * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
  - * @version $Id: VelocimacroProxy.java,v 1.12 2000/12/05 05:07:39 geirm Exp $ 
  + * @version $Id: VelocimacroProxy.java,v 1.13 2000/12/10 04:54:50 geirm Exp $ 
    */
   
   package org.apache.velocity.runtime.directive;
  @@ -183,16 +183,15 @@
                    *  to allow recursive VMs, we want to init them at render time, not init
time
                    *  or else you wander down the VM calls forever.
                    *
  -                 *  need a context clone() here so we don't modify the real context, as
we do the
  -                 *  actions on stuff for introspection purposes (ex  #set $a = $a - 1...)
  -                 *
  -                 *  I am not happy about this and performance, but to get jon going again
with anakia, 
  -                 * this will do for now
  +                 *  need a context here to carry the template name down through the init
                    */
   
                   if (!bInit_)
                   {
  -                    nodeTree_.init( null,null);
  +                    Context c = new Context();
  +                    c.setCurrentTemplateName( context.getCurrentTemplateName() );
  +                        
  +                    nodeTree_.init( c ,null);
                       bInit_ = true;
                   }
   
  
  
  

Mime
View raw message