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/06/14 16:45:52 UTC

cvs commit: jakarta-turbine/src/java/org/apache/turbine/services/webmacro TurbineWebMacroService.java

jvanzyl     01/06/14 07:45:52

  Modified:    src/java/org/apache/turbine/services/webmacro
                        TurbineWebMacroService.java
  Log:
  - updating service as per notes.
  
  Revision  Changes    Path
  1.38      +12 -14    jakarta-turbine/src/java/org/apache/turbine/services/webmacro/TurbineWebMacroService.java
  
  Index: TurbineWebMacroService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/webmacro/TurbineWebMacroService.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- TurbineWebMacroService.java	2001/05/05 14:03:46	1.37
  +++ TurbineWebMacroService.java	2001/06/14 14:45:52	1.38
  @@ -59,20 +59,17 @@
   import javax.servlet.ServletConfig;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
  -import org.apache.turbine.services.BaseInitable;
   import org.apache.turbine.services.BaseService;
   import org.apache.turbine.services.InitializationException;
   import org.apache.turbine.services.servlet.TurbineServlet;
   import org.apache.turbine.services.template.BaseTemplateEngineService;
   import org.apache.turbine.services.template.TurbineTemplate;
   import org.apache.turbine.util.ContentURI;
  -import org.apache.turbine.util.Log;
   import org.apache.turbine.util.RunData;
   import org.apache.turbine.util.TurbineException;
   import org.apache.turbine.util.template.TemplateLink;
   import org.apache.turbine.util.template.TemplatePageAttributes;
   import org.apache.turbine.util.webmacro.WebMacroFormatter;
  -import org.apache.velocity.runtime.configuration.Configuration;
   import org.webmacro.Broker;
   import org.webmacro.Context;
   import org.webmacro.FastWriter;
  @@ -113,9 +110,10 @@
    * @author <a href="mailto:krzewski@e-point.pl">Rafal Krzewski</a>
    * @author <a href="mailto:dlr@collab.net">Daniel Rall</a>
    * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
  - * @version $Id: TurbineWebMacroService.java,v 1.37 2001/05/05 14:03:46 jvanzyl Exp $
  + * @version $Id: TurbineWebMacroService.java,v 1.38 2001/06/14 14:45:52 jvanzyl Exp $
    */
  -public class TurbineWebMacroService extends BaseTemplateEngineService
  +public class TurbineWebMacroService 
  +    extends BaseTemplateEngineService
       implements WebMacroService
   {
       /**
  @@ -163,7 +161,7 @@
        *
        * @exception InitializationException Caused by any initialization error.
        */
  -    public void init(ServletConfig unused) throws InitializationException
  +    public void init() throws InitializationException
       {
           try
           {
  @@ -320,8 +318,6 @@
       private void initWebMacro() 
           throws InitException, InitializationException
       {
  -        Configuration config = getConfiguration();
  -
           /*
            * We retrieve the template paths here and translate
            * them so that we have a functional templateExists(name)
  @@ -337,11 +333,11 @@
            * the services, even if they are converted. Just
            * trying to explain what's going on.
            */
  -        templatePaths = config.getStringArray("templates");
  +        templatePaths = getConfiguration().getStringArray("templates");
           templatePaths = TurbineTemplate.translateTemplatePaths(templatePaths);
           
  -        WMTemplateProvider = config.getString("templates.provider", null);
  -        WMProperties = config.getString("properties");
  +        WMTemplateProvider = getConfiguration().getString("templates.provider", null);
  +        WMProperties = getConfiguration().getString("properties");
           
           if (WMProperties != null)
           {
  @@ -349,7 +345,7 @@
                * If possible, transform paths to be webapp 
                * root relative.
                */
  -            WMProperties = TurbineServlet.getRealPath(WMProperties);
  +            WMProperties = getRealPath(WMProperties);
               wm = new WM(WMProperties);
           }
           else
  @@ -374,14 +370,16 @@
                   /*
                    * Instantiate Turbine's TemplateProvider.
                    */
  -                Log.debug("Loading TurbineTemplateProvider");
  +                getCategory().debug("Loading TurbineTemplateProvider");
                   Class c = Class.forName(WMTemplateProvider);
                   ResourceProvider provider = (ResourceProvider)c.newInstance();
   
                   /*
                    * Register the provider with the broker.
                    */
  -                Log.debug("Registering TurbineTemplateProvider with WebMacro");
  +                getCategory().debug(
  +                    "Registering TurbineTemplateProvider with WebMacro");
  +                
                   resourceBroker.join(provider);
                   // TODO: Find WM template provider instance and remove it.
                   // ResourceProvider wmProvier = null;
  
  
  

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