org.apache.turbine.services.intake
Class IntakeTool

java.lang.Object
  |
  +--org.apache.turbine.services.intake.IntakeTool
All Implemented Interfaces:
ApplicationTool, Recyclable

public class IntakeTool
extends java.lang.Object
implements ApplicationTool, Recyclable

A Pull tool to make intake objects available to a template

Version:
$Id: IntakeTool.java,v 1.5 2002/07/11 16:53:28 mpoeschl Exp $
Author:
John D. McNally

Inner Class Summary
 class IntakeTool.PullHelper
          Inner class to present a nice interface to the template designer
 
Field Summary
static java.lang.String DEFAULT_KEY
           
 
Constructor Summary
IntakeTool()
           
 
Method Summary
 java.lang.String declareGroup(Group group)
          A convenience method to write out the hidden form fields that notify intake of the group.
 void declareGroup(Group group, java.lang.StringBuffer sb)
          xhtml valid hidden input field(s) that notifies intake of the group's presence.
 java.lang.String declareGroups()
          A convenience method to write out the hidden form fields that notify intake of the relevant groups.
 void dispose()
          Disposes the object after use.
 java.lang.Object get(java.lang.String groupName)
           
 Group get(java.lang.String groupName, java.lang.String key)
           
 Group get(java.lang.String groupName, java.lang.String key, boolean create)
           
 void init(java.lang.Object runData)
          Prepares intake for a single request
 boolean isAllValid()
           
 boolean isDisposed()
          Checks whether the recyclable has been disposed.
 void newForm()
           
 void recycle()
          Recycles the object for a new client.
 void refresh()
          Implementation of ApplicationTool interface is not needed for this tool as it is request scoped
 void remove(Group group)
          Removes group.
 void removeAll()
          Removes all groups.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_KEY

public static final java.lang.String DEFAULT_KEY
Constructor Detail

IntakeTool

public IntakeTool()
Method Detail

init

public void init(java.lang.Object runData)
Prepares intake for a single request
Specified by:
init in interface ApplicationTool
Following copied from interface: org.apache.turbine.services.pull.ApplicationTool
Parameters:
data - initialization data

declareGroups

public java.lang.String declareGroups()
A convenience method to write out the hidden form fields that notify intake of the relevant groups. It should be used only in templates with 1 form. In multiform templates, the groups that are relevant for each form need to be declared using $intake.newForm() and $intake.declareGroup($group) for the relevant groups in the form.

declareGroup

public java.lang.String declareGroup(Group group)
A convenience method to write out the hidden form fields that notify intake of the group.

declareGroup

public void declareGroup(Group group,
                         java.lang.StringBuffer sb)
xhtml valid hidden input field(s) that notifies intake of the group's presence.

newForm

public void newForm()

refresh

public void refresh()
Implementation of ApplicationTool interface is not needed for this tool as it is request scoped
Specified by:
refresh in interface ApplicationTool

get

public java.lang.Object get(java.lang.String groupName)
                     throws java.lang.Exception

isAllValid

public boolean isAllValid()

get

public Group get(java.lang.String groupName,
                 java.lang.String key)
          throws java.lang.Exception

get

public Group get(java.lang.String groupName,
                 java.lang.String key,
                 boolean create)
          throws java.lang.Exception

remove

public void remove(Group group)
Removes group. Primary use is to remove a group that has been processed by an action and is no longer appropriate in the view (screen).

removeAll

public void removeAll()
Removes all groups. Primary use is to remove groups that have been processed by an action and are no longer appropriate in the view (screen).

recycle

public void recycle()
Recycles the object for a new client. Recycle methods with parameters must be added to implementing object and they will be automatically called by pool implementations when the object is taken from the pool for a new client. The parameters must correspond to the parameters of the constructors of the object. For new objects, constructors can call their corresponding recycle methods whenever applicable. The recycle methods must call their super.
Specified by:
recycle in interface Recyclable

dispose

public void dispose()
Disposes the object after use. The method is called when the object is returned to its pool. The dispose method must call its super.
Specified by:
dispose in interface Recyclable

isDisposed

public boolean isDisposed()
Checks whether the recyclable has been disposed.
Specified by:
isDisposed in interface Recyclable
Returns:
true, if the recyclable is disposed.


Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.