You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by jv...@apache.org on 2001/08/05 23:00:52 UTC

cvs commit: jakarta-turbine/src/java/org/apache/turbine/modules Module.java

jvanzyl     01/08/05 14:00:52

  Modified:    src/java/org/apache/turbine/modules Module.java
  Log:
  - the pull model is not really optional when using the templating
    system anymore because that's how we feed in our standard tools.
    i think i can get the pull service to work for jsp as well.
  
  Revision  Changes    Path
  1.8       +12 -19    jakarta-turbine/src/java/org/apache/turbine/modules/Module.java
  
  Index: Module.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/modules/Module.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Module.java	2001/08/05 16:12:17	1.7
  +++ Module.java	2001/08/05 21:00:52	1.8
  @@ -68,12 +68,10 @@
    * future use is yet to be determined.
    *
    * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
  - * @version $Id: Module.java,v 1.7 2001/08/05 16:12:17 jvanzyl Exp $
  + * @version $Id: Module.java,v 1.8 2001/08/05 21:00:52 jvanzyl Exp $
    */
   public class Module
   {
  -    private static boolean pullModelActive = true;
  -
       /**
        * A subclass must override this method to build itself.
        * Subclasses override this method to store the layout in RunData
  @@ -117,14 +115,7 @@
   
       public static TemplateContext getTemplateContext()
       {
  -        if (pullModelActive)
  -        {
  -            return new ContextAdapter(TurbinePull.getGlobalContext());
  -        }
  -        else
  -        {
  -            return new ContextAdapter(TurbineTemplate.getTemplateContext());
  -        }
  +        return new ContextAdapter(TurbinePull.getGlobalContext());
       }
       
       public static TemplateContext getTemplateContext(RunData data)
  @@ -139,14 +130,11 @@
               context = getTemplateContext();
               context.put ( "data", data );
   
  -            if (pullModelActive)
  -            {
  -                // Populate the toolbox with request scope, session scope
  -                // and persistent scope tools (global tools are already in
  -                // the toolBoxContent which has been wrapped to construct
  -                // this request-specific context).
  -                TurbinePull.populateContext(new ContextAdapter2(context), data);
  -            }
  +            // Populate the toolbox with request scope, session scope
  +            // and persistent scope tools (global tools are already in
  +            // the toolBoxContent which has been wrapped to construct
  +            // this request-specific context).
  +            TurbinePull.populateContext(new ContextAdapter2(context), data);
               
               data.setTemp(Turbine.CONTEXT, context);
           }
  @@ -158,6 +146,11 @@
       {
           return TurbineTemplate.handleRequest(new ContextAdapter2(context), template);
       }
  +
  +    public static boolean templateExists(String template)
  +    {
  +        return TurbineTemplate.templateExists(template);
  +    }        
   
       /**
        * Performs post-request actions (releases context
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org