commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prick...@apache.org
Subject cvs commit: jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/util RunDataUtils.java
Date Wed, 02 Oct 2002 19:24:36 GMT
prickett    2002/10/02 12:24:35

  Modified:    periodicity project.xml
               periodicity/src/java/org/apache/commons/periodicity/turbine/actions
                        EvtDoJrlFBTestAction.java EvtDoJrlTestAction.java
                        EvtDoTestAction.java NoAlarmTestAction.java
                        SaveEventTestAction.java
               periodicity/src/java/org/apache/commons/periodicity/turbine/screens
                        Event_detail.java Evt_do.java Evt_do_jrl.java
                        Evt_do_jrl_fb.java No_alarm.java
               periodicity/src/java/org/apache/commons/periodicity/util
                        RunDataUtils.java
  Log:
  Added dependencies to the following projects:
  xerces-2.0.0
  junit-3.7
  velocity-1.3-dev
  servletapi-2.2
  commons-logging-1.0
  commons-configuration-1.0-dev
  
  Fixed turbine logging to use commons-logging
  
  Changed VelocityContext to TemplateContext
  
  Changed VelocityAction to TemplateAction
  
  Changed VelocityScreen to TemplateScreen
  
  Revision  Changes    Path
  1.2       +24 -0     jakarta-commons-sandbox/periodicity/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/project.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- project.xml	1 Oct 2002 23:34:25 -0000	1.1
  +++ project.xml	2 Oct 2002 19:24:35 -0000	1.2
  @@ -51,6 +51,30 @@
         <id>turbine</id>
         <version>SNAPSHOT</version>
       </dependency>  
  +    <dependency>
  +      <id>xerces</id>
  +      <version>2.0.0</version>
  +    </dependency>  
  +    <dependency>
  +      <id>junit</id>
  +      <version>3.7</version>
  +    </dependency>  
  +    <dependency>
  +      <id>velocity</id>
  +      <version>1.3-dev</version>
  +    </dependency>  
  +    <dependency>
  +      <id>servletapi</id>
  +      <version>2.2</version>
  +    </dependency>  
  +    <dependency>
  +      <id>commons-logging</id>
  +      <version>1.0</version>
  +    </dependency>  
  +    <dependency>
  +      <id>commons-configuration</id>
  +      <version>1.0-dev</version>
  +    </dependency>  
     </dependencies>
   
     <build>
  
  
  
  1.3       +22 -9     jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/actions/EvtDoJrlFBTestAction.java
  
  Index: EvtDoJrlFBTestAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/actions/EvtDoJrlFBTestAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EvtDoJrlFBTestAction.java	28 Mar 2002 09:31:45 -0000	1.2
  +++ EvtDoJrlFBTestAction.java	2 Oct 2002 19:24:35 -0000	1.3
  @@ -55,9 +55,9 @@
   package org.apache.commons.periodicity.turbine.actions;
   
   import javax.servlet.http.HttpServletRequest;
  -import org.apache.turbine.util.RunData;
  -import org.apache.velocity.context.Context;
  -import org.apache.turbine.util.Log;
  +import org.apache.turbine.RunData;
  +import org.apache.turbine.TemplateContext;
  +import org.apache.commons.logging.Log;
   import org.apache.commons.periodicity.util.TestTemplateParams;
   import org.apache.commons.periodicity.util.RunDataUtils;
   import org.apache.commons.periodicity.util.ICalendarException;
  @@ -68,12 +68,16 @@
   
   public class EvtDoJrlFBTestAction extends NoAlarmTestAction 
   {
  -    public void doPerform(RunData data, Context context) throws Exception
  +    public void doPerform(RunData data, TemplateContext context) 
  +           throws Exception
       {
           if(data != null && context != null)
           {
  -            Log.debug(
  -                   "context and data are not null so we will save the event");
  +            if(getLog() != null)
  +            {
  +                getLog().debug(
  +                       "context and data are not null so we will save the event");
  +            }           
               VEvent event = RunDataUtils.getCurrentEvent(data);
               if(event == null)
               {
  @@ -83,15 +87,24 @@
           }
           else if(data == null)
           {
  -            Log.debug("data == null");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("data == null");
  +            }    
           }
           else if(context == null)
           {
  -            Log.debug("context == null");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("context == null");
  +            }    
           }
           else
           {
  -            Log.debug("Some other error has occured cannot save event");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("Some other error has occured cannot save event");
  +            }    
           }    
       }
   
  
  
  
  1.3       +23 -9     jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/actions/EvtDoJrlTestAction.java
  
  Index: EvtDoJrlTestAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/actions/EvtDoJrlTestAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EvtDoJrlTestAction.java	28 Mar 2002 09:31:45 -0000	1.2
  +++ EvtDoJrlTestAction.java	2 Oct 2002 19:24:35 -0000	1.3
  @@ -56,9 +56,9 @@
   
   import java.util.GregorianCalendar;
   import javax.servlet.http.HttpServletRequest;
  -import org.apache.turbine.util.RunData;
  -import org.apache.velocity.context.Context;
  -import org.apache.turbine.util.Log;
  +import org.apache.turbine.RunData;
  +import org.apache.turbine.TemplateContext;
  +import org.apache.commons.logging.Log;
   import org.apache.commons.periodicity.util.TestTemplateParams;
   import org.apache.commons.periodicity.util.RunDataUtils;
   import org.apache.commons.periodicity.util.ICalendarException;
  @@ -72,12 +72,17 @@
   
   public class EvtDoJrlTestAction extends EvtDoJrlFBTestAction 
   {
  -    public void doPerform(RunData data, Context context) throws Exception
  +
  +    public void doPerform(RunData data, TemplateContext context) 
  +           throws Exception
       {
           if(data != null && context != null)
           {
  -            Log.debug(
  -                   "context and data are not null so we will save the event");
  +            if(getLog() != null)
  +            {
  +                getLog().debug(
  +                       "context and data are not null so we will save the event");
  +            }           
               VEvent event = RunDataUtils.getCurrentEvent(data);
               if(event == null)
               {
  @@ -87,15 +92,24 @@
           }
           else if(data == null)
           {
  -            Log.debug("data == null");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("data == null");
  +            }    
           }
           else if(context == null)
           {
  -            Log.debug("context == null");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("context == null");
  +            }    
           }
           else
           {
  -            Log.debug("Some other error has occured cannot save event");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("Some other error has occured cannot save event");
  +            }    
           }    
       }
   
  
  
  
  1.3       +22 -9     jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/actions/EvtDoTestAction.java
  
  Index: EvtDoTestAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/actions/EvtDoTestAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EvtDoTestAction.java	28 Mar 2002 09:31:45 -0000	1.2
  +++ EvtDoTestAction.java	2 Oct 2002 19:24:35 -0000	1.3
  @@ -56,9 +56,9 @@
   
   import java.util.GregorianCalendar;
   import javax.servlet.http.HttpServletRequest;
  -import org.apache.turbine.util.RunData;
  -import org.apache.velocity.context.Context;
  -import org.apache.turbine.util.Log;
  +import org.apache.turbine.RunData;
  +import org.apache.turbine.TemplateContext;
  +import org.apache.commons.logging.Log;
   import org.apache.commons.periodicity.util.TestTemplateParams;
   import org.apache.commons.periodicity.util.RunDataUtils;
   import org.apache.commons.periodicity.util.ICalendarException;
  @@ -69,12 +69,16 @@
   
   public class EvtDoTestAction extends EvtDoJrlTestAction 
   {
  -    public void doPerform(RunData data, Context context) throws Exception
  +    public void doPerform(RunData data, TemplateContext context) 
  +           throws Exception
       {
           if(data != null && context != null)
           {
  -            Log.debug(
  -                   "context and data are not null so we will save the event");
  +            if(getLog() != null)
  +            {
  +                getLog().debug(
  +                       "context and data are not null so we will save the event");
  +            }           
               VEvent event = RunDataUtils.getCurrentEvent(data);
               if(event == null)
               {
  @@ -84,15 +88,24 @@
           }
           else if(data == null)
           {
  -            Log.debug("data == null");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("data == null");
  +            }    
           }
           else if(context == null)
           {
  -            Log.debug("context == null");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("context == null");
  +            }    
           }
           else
           {
  -            Log.debug("Some other error has occured cannot save event");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("Some other error has occured cannot save event");
  +            }    
           }    
       }
   
  
  
  
  1.3       +37 -11    jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/actions/NoAlarmTestAction.java
  
  Index: NoAlarmTestAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/actions/NoAlarmTestAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NoAlarmTestAction.java	28 Mar 2002 09:31:45 -0000	1.2
  +++ NoAlarmTestAction.java	2 Oct 2002 19:24:35 -0000	1.3
  @@ -56,24 +56,32 @@
   
   import java.util.GregorianCalendar;
   import javax.servlet.http.HttpServletRequest;
  -import org.apache.turbine.util.RunData;
  -import org.apache.velocity.context.Context;
  -import org.apache.turbine.modules.actions.VelocityAction;
  -import org.apache.turbine.util.Log;
  +import org.apache.turbine.RunData;
  +import org.apache.turbine.TemplateContext;
  +import org.apache.turbine.modules.actions.TemplateAction;
  +import org.apache.commons.logging.LogFactory;
  +import org.apache.commons.logging.Log;
   import org.apache.commons.periodicity.util.TestTemplateParams;
   import org.apache.commons.periodicity.util.RunDataUtils;
   import org.apache.commons.periodicity.util.ICalendarException;
   import org.apache.commons.periodicity.ical.vobjects.VEvent;
   import org.apache.commons.periodicity.ical.properties.Dtstart;
   
  -public class NoAlarmTestAction extends VelocityAction 
  +public class NoAlarmTestAction extends TemplateAction 
   {
  -    public void doPerform(RunData data, Context context) throws Exception
  +
  +    private static Log log = LogFactory.getLog(NoAlarmTestAction.class);
  +
  +    public void doPerform(RunData data, TemplateContext context) 
  +           throws Exception
       {
           if(data != null && context != null)
           {
  -            Log.debug(
  -                   "context and data are not null so we will save the event");
  +            if(log != null)
  +            {
  +                log.debug(
  +                       "context and data are not null so we will save the event");
  +            }           
               VEvent event = RunDataUtils.getCurrentEvent(data);
               if(event == null)
               {
  @@ -83,15 +91,24 @@
           }
           else if(data == null)
           {
  -            Log.debug("data == null");
  +            if(log != null)
  +            {
  +                log.debug("data == null");
  +            }    
           }
           else if(context == null)
           {
  -            Log.debug("context == null");
  +            if(log != null)
  +            {
  +                log.debug("context == null");
  +            }    
           }
           else
           {
  -            Log.debug("Some other error has occured cannot save event");
  +            if(log != null)
  +            {
  +                log.debug("Some other error has occured cannot save event");
  +            }    
           }    
       }
   
  @@ -158,5 +175,14 @@
               }
           }    
       }
  +
  +    protected static Log getLog()
  +    {
  +        if(log == null)
  +        {
  +            log = LogFactory.getLog(NoAlarmTestAction.class);
  +        }
  +        return log;
  +    }    
   }
   
  
  
  
  1.4       +23 -9     jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/actions/SaveEventTestAction.java
  
  Index: SaveEventTestAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/actions/SaveEventTestAction.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SaveEventTestAction.java	9 Apr 2002 09:59:30 -0000	1.3
  +++ SaveEventTestAction.java	2 Oct 2002 19:24:35 -0000	1.4
  @@ -56,9 +56,9 @@
   
   import java.util.GregorianCalendar;
   import javax.servlet.http.HttpServletRequest;
  -import org.apache.turbine.util.RunData;
  -import org.apache.velocity.context.Context;
  -import org.apache.turbine.util.Log;
  +import org.apache.turbine.RunData;
  +import org.apache.turbine.TemplateContext;
  +import org.apache.commons.logging.Log;
   import org.apache.commons.periodicity.util.TestTemplateParams;
   import org.apache.commons.periodicity.util.RunDataUtils;
   import org.apache.commons.periodicity.util.ICalendarException;
  @@ -68,12 +68,17 @@
   
   public class SaveEventTestAction extends EvtDoTestAction 
   {
  -    public void doPerform(RunData data, Context context) throws Exception
  +
  +    public void doPerform(RunData data, TemplateContext context) 
  +           throws Exception
       {
           if(data != null && context != null)
           {
  -            Log.debug(
  -                   "context and data are not null so we will save the event");
  +            if(getLog() != null)
  +            {
  +                getLog().debug(
  +                       "context and data are not null so we will save the event");
  +            }           
               VEvent event = RunDataUtils.getCurrentEvent(data);
               if(event == null)
               {
  @@ -84,15 +89,24 @@
           }
           else if(data == null)
           {
  -            Log.debug("data == null");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("data == null");
  +            }    
           }
           else if(context == null)
           {
  -            Log.debug("context == null");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("context == null");
  +            }    
           }
           else
           {
  -            Log.debug("Some other error has occured cannot save event");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("Some other error has occured cannot save event");
  +            }    
           }    
       }
   
  
  
  
  1.4       +24 -12    jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/screens/Event_detail.java
  
  Index: Event_detail.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/screens/Event_detail.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Event_detail.java	27 Mar 2002 05:13:58 -0000	1.3
  +++ Event_detail.java	2 Oct 2002 19:24:35 -0000	1.4
  @@ -54,39 +54,51 @@
   
   package org.apache.commons.periodicity.turbine.screens;
   
  -import org.apache.turbine.util.RunData;
  -import org.apache.velocity.context.Context;
  -import org.apache.velocity.VelocityContext;
  -import org.apache.turbine.modules.screens.VelocityScreen;
  -import org.apache.turbine.util.Log;
  +import org.apache.turbine.RunData;
  +import org.apache.turbine.TemplateContext;
  +import org.apache.commons.logging.Log;
   import org.apache.commons.periodicity.util.TestTemplateLabels;
   import org.apache.commons.periodicity.util.TestTemplateParams;
   
   public class Event_detail extends Evt_do 
   {
  -    public void doBuildTemplate(RunData data, Context context) throws Exception
  +
  +    public void doBuildTemplate(RunData data, TemplateContext context) 
  +           throws Exception
       {
           if(data != null)
           {
  -            Log.debug("data != null");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("data != null");
  +            }    
               if(context != null)
               {
  -                Log.debug("context != null");
  +                if(getLog() != null)
  +                {
  +                    getLog().debug("context != null");
  +                }    
                   addLabelsToContext(data, context);
                   addParametersToContext(data, context);
               }    
               else
               {
  -                Log.debug("context == null");
  +                if(getLog() != null)
  +                {
  +                    getLog().debug("context == null");
  +                }    
               }    
           }
           else
           {
  -            Log.debug("data == null");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("data == null");
  +            }    
           }    
       }
   
  -    protected void addLabelsToContext(RunData data, Context context)
  +    protected void addLabelsToContext(RunData data, TemplateContext context)
       {
           super.addLabelsToContext(data, context);
           if(context != null && data != null)
  @@ -98,7 +110,7 @@
           }
       }
   
  -    protected void addParametersToContext(RunData data, Context context)
  +    protected void addParametersToContext(RunData data, TemplateContext context)
       {
           super.addParametersToContext(data, context);
           if(context != null && data != null)
  
  
  
  1.3       +24 -12    jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/screens/Evt_do.java
  
  Index: Evt_do.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/screens/Evt_do.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Evt_do.java	27 Mar 2002 05:13:58 -0000	1.2
  +++ Evt_do.java	2 Oct 2002 19:24:35 -0000	1.3
  @@ -54,39 +54,51 @@
   
   package org.apache.commons.periodicity.turbine.screens;
   
  -import org.apache.turbine.util.RunData;
  -import org.apache.velocity.context.Context;
  -import org.apache.velocity.VelocityContext;
  -import org.apache.turbine.modules.screens.VelocityScreen;
  -import org.apache.turbine.util.Log;
  +import org.apache.turbine.RunData;
  +import org.apache.turbine.TemplateContext;
  +import org.apache.commons.logging.Log;
   import org.apache.commons.periodicity.util.TestTemplateLabels;
   import org.apache.commons.periodicity.util.TestTemplateParams;
   
   public class Evt_do extends Evt_do_jrl
   {
  -    public void doBuildTemplate(RunData data, Context context) throws Exception
  +
  +    public void doBuildTemplate(RunData data, TemplateContext context) 
  +           throws Exception
       {
           if(data != null)
           {
  -            Log.debug("data != null");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("data != null");
  +            }    
               if(context != null)
               {
  -                Log.debug("context != null");
  +                if(getLog() != null)
  +                {
  +                    getLog().debug("context != null");
  +                }    
                   addLabelsToContext(data, context);
                   addParametersToContext(data, context);
               }    
               else
               {
  -                Log.debug("context == null");
  +                if(getLog() != null)
  +                {
  +                    getLog().debug("context == null");
  +                }    
               }    
           }
           else
           {
  -            Log.debug("data == null");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("data == null");
  +            }    
           }    
       }
   
  -    protected void addLabelsToContext(RunData data, Context context)
  +    protected void addLabelsToContext(RunData data, TemplateContext context)
       {
           super.addLabelsToContext(data, context);
           if(data != null && context != null)
  @@ -106,7 +118,7 @@
           }
       }    
   
  -    protected void addParametersToContext(RunData data, Context context)
  +    protected void addParametersToContext(RunData data, TemplateContext context)
       {
           super.addParametersToContext(data, context);
           if(context != null && data != null)
  
  
  
  1.4       +24 -12    jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/screens/Evt_do_jrl.java
  
  Index: Evt_do_jrl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/screens/Evt_do_jrl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Evt_do_jrl.java	27 Mar 2002 06:08:05 -0000	1.3
  +++ Evt_do_jrl.java	2 Oct 2002 19:24:35 -0000	1.4
  @@ -54,39 +54,51 @@
   
   package org.apache.commons.periodicity.turbine.screens;
   
  -import org.apache.turbine.util.RunData;
  -import org.apache.velocity.context.Context;
  -import org.apache.velocity.VelocityContext;
  -import org.apache.turbine.modules.screens.VelocityScreen;
  -import org.apache.turbine.util.Log;
  +import org.apache.turbine.RunData;
  +import org.apache.turbine.TemplateContext;
  +import org.apache.commons.logging.Log;
   import org.apache.commons.periodicity.util.TestTemplateLabels;
   import org.apache.commons.periodicity.util.TestTemplateParams;
   
   public class Evt_do_jrl extends Evt_do_jrl_fb 
   {
  -    public void doBuildTemplate(RunData data, Context context) throws Exception
  +
  +    public void doBuildTemplate(RunData data, TemplateContext context) 
  +           throws Exception
       {
           if(data != null)
           {
  -            Log.debug("data != null");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("data != null");
  +            }    
               if(context != null)
               {
  -                Log.debug("context != null");
  +                if(getLog() != null)
  +                {
  +                    getLog().debug("context != null");
  +                }    
                   addLabelsToContext(data, context);
                   addParametersToContext(data, context);
               }    
               else
               {
  -                Log.debug("context == null");
  +                if(getLog() != null)
  +                {
  +                    getLog().debug("context == null");
  +                }    
               }    
           }
           else
           {
  -            Log.debug("data == null");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("data == null");
  +            }    
           }    
       }
   
  -    protected void addLabelsToContext(RunData data, Context context)
  +    protected void addLabelsToContext(RunData data, TemplateContext context)
       {
           super.addLabelsToContext(data, context);
           if(data != null && context != null)
  @@ -120,7 +132,7 @@
           }
       }
   
  -    protected void addParametersToContext(RunData data, Context context)
  +    protected void addParametersToContext(RunData data, TemplateContext context)
       {
           super.addParametersToContext(data, context);
           if(data != null && context != null)
  
  
  
  1.3       +23 -12    jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/screens/Evt_do_jrl_fb.java
  
  Index: Evt_do_jrl_fb.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/screens/Evt_do_jrl_fb.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Evt_do_jrl_fb.java	27 Mar 2002 05:13:58 -0000	1.2
  +++ Evt_do_jrl_fb.java	2 Oct 2002 19:24:35 -0000	1.3
  @@ -54,39 +54,50 @@
   
   package org.apache.commons.periodicity.turbine.screens;
   
  -import org.apache.turbine.util.RunData;
  -import org.apache.velocity.context.Context;
  -import org.apache.velocity.VelocityContext;
  -import org.apache.turbine.modules.screens.VelocityScreen;
  -import org.apache.turbine.util.Log;
  +import org.apache.turbine.RunData;
  +import org.apache.turbine.TemplateContext;
  +import org.apache.commons.logging.Log;
   import org.apache.commons.periodicity.util.TestTemplateLabels;
   import org.apache.commons.periodicity.util.TestTemplateParams;
   
   public class Evt_do_jrl_fb extends No_alarm 
   {
  -    public void doBuildTemplate(RunData data, Context context) throws Exception
  +    public void doBuildTemplate(RunData data, TemplateContext context) 
  +           throws Exception
       {
           if(data != null)
           {
  -            Log.debug("data != null");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("data != null");
  +            }    
               if(context != null)
               {
  -                Log.debug("context != null");
  +                if(getLog() != null)
  +                {
  +                    getLog().debug("context != null");
  +                }    
                   addLabelsToContext(data, context);
                   addParametersToContext(data, context);
               }    
               else
               {
  -                Log.debug("context == null");
  +                if(getLog() != null)
  +                {
  +                    getLog().debug("context == null");
  +                }    
               }    
           }
           else
           {
  -            Log.debug("data == null");
  +            if(getLog() != null)
  +            {
  +                getLog().debug("data == null");
  +            }    
           }    
       }
   
  -    protected void addLabelsToContext(RunData data, Context context)
  +    protected void addLabelsToContext(RunData data, TemplateContext context)
       {
           super.addLabelsToContext(data, context);
           if(data != null && context != null)
  @@ -108,7 +119,7 @@
           }
       }    
   
  -    protected void addParametersToContext(RunData data, Context context)
  +    protected void addParametersToContext(RunData data, TemplateContext context)
       {
           super.addParametersToContext(data, context);
           if(data != null && context != null)
  
  
  
  1.3       +39 -13    jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/screens/No_alarm.java
  
  Index: No_alarm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/turbine/screens/No_alarm.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- No_alarm.java	27 Mar 2002 05:13:58 -0000	1.2
  +++ No_alarm.java	2 Oct 2002 19:24:35 -0000	1.3
  @@ -54,38 +54,55 @@
   
   package org.apache.commons.periodicity.turbine.screens;
   
  -import org.apache.turbine.util.RunData;
  -import org.apache.velocity.context.Context;
  -import org.apache.velocity.VelocityContext;
  -import org.apache.turbine.modules.screens.VelocityScreen;
  -import org.apache.turbine.util.Log;
  +import org.apache.turbine.RunData;
  +import org.apache.turbine.TemplateContext;
  +import org.apache.turbine.modules.screens.TemplateScreen;
  +import org.apache.commons.logging.LogFactory;
  +import org.apache.commons.logging.Log;
   import org.apache.commons.periodicity.util.TestTemplateLabels;
   import org.apache.commons.periodicity.util.TestTemplateParams;
   
  -public class No_alarm extends VelocityScreen 
  +public class No_alarm extends TemplateScreen 
   {
  -    public void doBuildTemplate(RunData data, Context context) throws Exception
  +
  +    private static Log log = LogFactory.getLog(
  +           No_alarm.class);
  +
  +    public void doBuildTemplate(RunData data, TemplateContext context) 
  +           throws Exception
       {
           if(data != null)
           {
  -            Log.debug("data != null");
  +            if(log != null)
  +            {
  +                log.debug("data != null");
  +            }    
               if(context != null)
               {
  -                Log.debug("context != null");
  +                if(log != null)
  +                {
  +                    log.debug("context != null");
  +                }    
                   addLabelsToContext(data, context);
               }    
               else
               {
  -                Log.debug("context == null");
  +                if(log != null)
  +                {
  +                    log.debug("context == null");
  +                }    
               }    
           }
           else
           {
  -            Log.debug("data == null");
  +            if(log != null)
  +            {
  +                log.debug("data == null");
  +            }    
           }    
       }
   
  -    protected void addLabelsToContext(RunData data, Context context)
  +    protected void addLabelsToContext(RunData data, TemplateContext context)
       {
           if(data != null && context != null)
           {
  @@ -98,7 +115,7 @@
           }
       }
   
  -    protected void addParametersToContext(RunData data, Context context)
  +    protected void addParametersToContext(RunData data, TemplateContext context)
       {
           if(data != null && context != null)
           {
  @@ -115,6 +132,15 @@
               context.put(TestTemplateParams.DTSTART_TZID_PARAM_KEY,
                      TestTemplateParams.DTSTART_TZID_PARAM);
           }
  +    }    
  +
  +    protected static Log getLog()
  +    {
  +        if(log == null)
  +        {
  +            log = LogFactory.getLog(No_alarm.class);
  +        }
  +        return log;
       }    
   }
   
  
  
  
  1.2       +1 -1      jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/util/RunDataUtils.java
  
  Index: RunDataUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/util/RunDataUtils.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RunDataUtils.java	28 Mar 2002 08:49:14 -0000	1.1
  +++ RunDataUtils.java	2 Oct 2002 19:24:35 -0000	1.2
  @@ -55,7 +55,7 @@
    */
   
   import javax.servlet.http.HttpSession;
  -import org.apache.turbine.util.RunData;
  +import org.apache.turbine.RunData;
   import org.apache.commons.periodicity.ical.vobjects.VEvent;
   
   public class RunDataUtils 
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message