Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.turbine.services.intake
Class IntakeTool

    java.lang.Object
      org.apache.turbine.services.intake.IntakeTool

All Implemented Interfaces:
  org.apache.fulcrum.pool.Recyclable, ApplicationTool

    public class IntakeTool

extends Object
implements ApplicationTool, org.apache.fulcrum.pool.Recyclable

The main class through which Intake is accessed. Provides easy access to the Fulcrum Intake component.

Version:
  $Id: IntakeTool.java 1078552 2011-03-06 19:58:46Z tv $
Author:
  John D. McNally, Henning P. Schmiedehausen, Quinton McCombs, Eric Pugh

Nested Class Summary
`class` | `IntakeTool.PullHelper` Inner class to present a nice interface to the template designer

Field Summary
`static String` | `DEFAULT_KEY` Constant for default key
`protected HashMap<String,org.apache.fulcrum.intake.model.Group>` | `groups` Groups from intake.xml
`static String` | `INTAKE_GRP` Constant for the hidden fieldname
`protected static org.apache.commons.logging.Log` | `log` Used for logging
`protected org.apache.fulcrum.parser.ValueParser` | `pp` ValueParser instance

Constructor Summary
`IntakeTool()` Constructor

Method Summary
`void` | `addGroupsToParameters(org.apache.fulcrum.parser.ValueParser vp)`
`String` | `declareGroup(org.apache.fulcrum.intake.model.Group group)` A convenience method to write out the hidden form fields that notify intake of the group.
`void` | `declareGroup(org.apache.fulcrum.intake.model.Group group, StringBuffer sb)` xhtml valid hidden input field(s) that notifies intake of the group's presence.
`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.
`IntakeTool.PullHelper` | `get(String groupName)` get a specific group
`IntakeTool.PullHelper` | `get(String groupName, boolean throwExceptions)` Get a specific group
`org.apache.fulcrum.intake.model.Group` | `get(String groupName, String key)` Get a specific group by name and key.
`org.apache.fulcrum.intake.model.Group` | `get(String groupName, String key, boolean create)` Get a specific group by name and key.
`Map` | `getGroups()` Get a Map containing all the groups.
`void` | `init(Object runData)` Prepares intake for a single request
`boolean` | `isAllValid()` Loops through all of the Groups and checks to see if the data within the Group is valid.
`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(org.apache.fulcrum.intake.model.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

### log

    protected static org.apache.commons.logging.Log log

  Used for logging

### DEFAULT_KEY

    public static final String DEFAULT_KEY

  Constant for default key

  See Also:
    Constant Field Values

### INTAKE_GRP

    public static final String INTAKE_GRP

  Constant for the hidden fieldname

  See Also:
    Constant Field Values

### groups

    protected HashMap<String,org.apache.fulcrum.intake.model.Group> groups

  Groups from intake.xml

### pp

    protected org.apache.fulcrum.parser.ValueParser pp

  ValueParser instance

Constructor Detail

### IntakeTool

    public IntakeTool()

  Constructor

Method Detail

### init

    public void init(Object runData)

  Prepares intake for a single request

  Specified by:
    `init` in interface `ApplicationTool`
  Parameters:
    `runData` - initialization data

### addGroupsToParameters

    public void addGroupsToParameters(org.apache.fulcrum.parser.ValueParser vp)

### declareGroups

    public 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 String declareGroup(org.apache.fulcrum.intake.model.Group group)

  A convenience method to write out the hidden form fields that notify intake of the group.

### declareGroup

    public void declareGroup(org.apache.fulcrum.intake.model.Group group,
                             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 IntakeTool.PullHelper get(String groupName)

  get a specific group

### get

    public IntakeTool.PullHelper get(String groupName,
                                     boolean throwExceptions)
                              throws org.apache.fulcrum.intake.IntakeException

  Get a specific group

  Parameters:
    `throwExceptions` - if false, exceptions will be supressed.
  Throws:
    `org.apache.fulcrum.intake.IntakeException` - could not retrieve group

### isAllValid

    public boolean isAllValid()

  Loops through all of the Groups and checks to see if the data within the Group is valid.

### get

    public org.apache.fulcrum.intake.model.Group get(String groupName,
                                                     String key)
                                              throws org.apache.fulcrum.intake.IntakeException

  Get a specific group by name and key.

  Throws:
    `org.apache.fulcrum.intake.IntakeException`

### get

    public org.apache.fulcrum.intake.model.Group get(String groupName,
                                                     String key,
                                                     boolean create)
                                              throws org.apache.fulcrum.intake.IntakeException

  Get a specific group by name and key. Also specify whether or not you want to create a new group.

  Throws:
    `org.apache.fulcrum.intake.IntakeException`

### remove

    public void remove(org.apache.fulcrum.intake.model.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).

### getGroups

    public Map getGroups()

  Get a Map containing all the groups.

  Returns:
    the Group Map

### 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 `org.apache.fulcrum.pool.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 `org.apache.fulcrum.pool.Recyclable`

### isDisposed

    public boolean isDisposed()

  Checks whether the recyclable has been disposed.

  Specified by:
    `isDisposed` in interface `org.apache.fulcrum.pool.Recyclable`
  Returns:
    true, if the recyclable is disposed.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2011 The Apache Software Foundation. All Rights Reserved.