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:25:51 UTC

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

jvanzyl     01/08/05 14:25:51

  Modified:    src/java/org/apache/turbine/modules ContextAdapter.java
                        Module.java
  Log:
  - the pull service has been changed to talk turbine and not
    fulcrum so now we don't need to adapter things two ways and
    this package in the Module.java class is where all the interaction
    between turbine and fulcrum takes place when it comes to template
    processing.
  
  Revision  Changes    Path
  1.5       +25 -6     jakarta-turbine/src/java/org/apache/turbine/modules/ContextAdapter.java
  
  Index: ContextAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/modules/ContextAdapter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ContextAdapter.java	2001/08/05 16:12:17	1.4
  +++ ContextAdapter.java	2001/08/05 21:25:51	1.5
  @@ -2,24 +2,43 @@
   
   import org.apache.fulcrum.template.TemplateContext;
   
  +/**
  + *
  + */
   public class ContextAdapter
  -     implements org.apache.turbine.TemplateContext
  +    implements TemplateContext
   {
  -    TemplateContext context;
  +    private org.apache.turbine.TemplateContext context;
   
  -    public ContextAdapter(TemplateContext context)
  +    public ContextAdapter(org.apache.turbine.TemplateContext context)
       {
           this.context = context;
       }
   
  -    public Object put(String key, Object value)
  +    public void put(String key, Object value)
       {
  -        context.put(key,value);
  -        return value;
  +        context.put(key, value);
  +        //return null;
       }
       
       public Object get(String key)
       {
           return context.get(key);
  +    }
  +    
  +    public Object remove(Object key)
  +    {
  +        return null;
  +        //return context.remove(key);
  +    }
  +    
  +    public Object[] getKeys()
  +    {
  +        return null;
  +    }
  +    
  +    public boolean containsKey(Object key)
  +    {
  +        return false;
       }
   }
  
  
  
  1.10      +5 -5      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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Module.java	2001/08/05 21:01:29	1.9
  +++ Module.java	2001/08/05 21:25:51	1.10
  @@ -68,7 +68,7 @@
    * future use is yet to be determined.
    *
    * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
  - * @version $Id: Module.java,v 1.9 2001/08/05 21:01:29 jvanzyl Exp $
  + * @version $Id: Module.java,v 1.10 2001/08/05 21:25:51 jvanzyl Exp $
    */
   public class Module
   {
  @@ -115,7 +115,7 @@
   
       public static TemplateContext getTemplateContext()
       {
  -        return new ContextAdapter(TurbinePull.getGlobalContext());
  +        return TurbinePull.getGlobalContext();
       }
       
       public static TemplateContext getTemplateContext(RunData data)
  @@ -134,7 +134,7 @@
               // 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);
  +            TurbinePull.populateContext(context, data);
               
               data.setTemp(Turbine.CONTEXT, context);
           }
  @@ -144,7 +144,7 @@
       public static String handleRequest(TemplateContext context, String template)
           throws ServiceException
       {
  -        return TurbineTemplate.handleRequest(new ContextAdapter2(context), template);
  +        return TurbineTemplate.handleRequest(new ContextAdapter(context), template);
       }
   
       public static boolean templateExists(String template)
  @@ -160,7 +160,7 @@
        */
       public static void requestFinished(TemplateContext context)
       {
  -        TurbinePull.releaseTools(new ContextAdapter2(context));
  +        TurbinePull.releaseTools(context);
       }
   
       /**
  
  
  

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