You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by jo...@apache.org on 2001/03/22 04:18:58 UTC

cvs commit: jakarta-turbine/src/java/org/apache/turbine/services/pull TurbinePull.java TurbinePullService.java

jon         01/03/21 19:18:57

  Modified:    src/java/org/apache/turbine/services/pull TurbinePull.java
                        TurbinePullService.java
  Log:
  fixed some javadoc
  added getTool method to TurbinePull.
  
  Revision  Changes    Path
  1.7       +22 -1     jakarta-turbine/src/java/org/apache/turbine/services/pull/TurbinePull.java
  
  Index: TurbinePull.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/pull/TurbinePull.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TurbinePull.java	2001/03/06 06:12:36	1.6
  +++ TurbinePull.java	2001/03/22 03:18:56	1.7
  @@ -67,7 +67,7 @@
    * the settings in TurbineResources.
    *
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
  - * @version $Id: TurbinePull.java,v 1.6 2001/03/06 06:12:36 chrise Exp $
  + * @version $Id: TurbinePull.java,v 1.7 2001/03/22 03:18:56 jon Exp $
    */
   public abstract class TurbinePull
   {
  @@ -185,5 +185,26 @@
       public static void releaseTools(Context context)
       {
           getService().releaseTools(context);
  +    }
  +    
  +    /**
  +     * Helper method that allows you to easily get a tool 
  +     * from a Context. Essentially, it just does the cast 
  +     * to an Application tool for you.
  +     *
  +     * @param context a Velocity Context to get tools from
  +     * @param name the name of the tool to get
  +     */
  +    public ApplicationTool getTool(Context context, 
  +                                          String name)
  +    {
  +        try
  +        {
  +            return (ApplicationTool) context.get(name);
  +        }
  +        catch (Exception e)
  +        {
  +        }
  +        return null;
       }
   }
  
  
  
  1.15      +6 -6      jakarta-turbine/src/java/org/apache/turbine/services/pull/TurbinePullService.java
  
  Index: TurbinePullService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/pull/TurbinePullService.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- TurbinePullService.java	2001/03/22 02:25:45	1.14
  +++ TurbinePullService.java	2001/03/22 03:18:57	1.15
  @@ -136,7 +136,7 @@
    *
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    * @author <a href="mailto:sean@informage.net">Sean Legassick</a>
  - * @version $Id: TurbinePullService.java,v 1.14 2001/03/22 02:25:45 jon Exp $
  + * @version $Id: TurbinePullService.java,v 1.15 2001/03/22 03:18:57 jon Exp $
    */
   public class TurbinePullService extends TurbineBaseService 
       implements PullService
  @@ -306,14 +306,14 @@
            * request scope, session scope and persistent scope tools).
            * They are specified respectively in the TR.props like this:
            *
  -         * tool.global.ui.1 = org.apache.turbine.util.pull.UIManager
  -         * tool.global.mm.2 = org.apache.turbine.util.pull.MessageManager
  +         * tool.global.ui = org.apache.turbine.util.pull.UIManager
  +         * tool.global.mm = org.apache.turbine.util.pull.MessageManager
            *
  -         * tool.request.link.1 = org.apache.turbine.util.template.TemplateLink;
  +         * tool.request.link = org.apache.turbine.util.template.TemplateLink;
            *
  -         * tool.session.basket.1 = org.sample.util.ShoppingBasket;
  +         * tool.session.basket = org.sample.util.ShoppingBasket;
            *
  -         * tool.persistent.ui.1 = org.apache.turbine.services.pull.util.PersistentUIManager
  +         * tool.persistent.ui = org.apache.turbine.services.pull.util.PersistentUIManager
            */
   
           globalTools     = getTools(GLOBAL_TOOL);
  
  
  

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