Klasse IntakeTool
java.lang.Object
org.apache.turbine.services.intake.IntakeTool
- Alle implementierten Schnittstellen:
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$
- Autor:
- John D. McNally, Henning P. Schmiedehausen, Quinton McCombs, Eric Pugh
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungclass
Inner class to present a nice interface to the template designer -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final String
Constant for default keyGroups from intake.xmlstatic final String
Constant for the hidden fieldnameprotected org.apache.fulcrum.intake.IntakeService
The Intake service.protected static final org.apache.logging.log4j.Logger
Used for loggingprotected org.apache.fulcrum.parser.ValueParser
ValueParser instance -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
addGroupsToParameters
(org.apache.fulcrum.parser.ValueParser vp) Add all registered group ids to the value parserdeclareGroup
(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, StringBuilder sb) xhtml valid hidden input field(s) that notifies intake of the group's presence.A convenience method to write out the hidden form fields that notify intake of the relevant groups.void
dispose()
Disposes the object after use.get a specific groupGet a specific grouporg.apache.fulcrum.intake.model.Group
Get a specific group by name and key.org.apache.fulcrum.intake.model.Group
Get a specific group by name and key.Get a Map containing all the groups.void
Prepares intake for a single requestboolean
Loops through all of the Groups and checks to see if the data within the Group is valid.boolean
Checks whether the recyclable has been disposed.void
newForm()
Declare that a new form startsvoid
recycle()
Recycles the object for a new client.void
refresh()
Implementation of ApplicationTool interface is not needed for this tool as it is request scopedvoid
remove
(org.apache.fulcrum.intake.model.Group group) Removes group.void
Removes all groups.
-
Felddetails
-
log
Used for logging -
DEFAULT_KEY
Constant for default key- Siehe auch:
-
INTAKE_GRP
Constant for the hidden fieldname- Siehe auch:
-
groups
Groups from intake.xml -
pp
ValueParser instance -
intakeService
The Intake service.
-
-
Konstruktordetails
-
IntakeTool
public IntakeTool()Constructor
-
-
Methodendetails
-
init
Prepares intake for a single request- Angegeben von:
init
in SchnittstelleApplicationTool
- Parameter:
runData
- initialization data
-
addGroupsToParameters
Add all registered group ids to the value parser- Parameter:
vp
- the value parser
-
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.- Gibt zurück:
- the HTML that declares all groups to Intake in hidden input fields
-
declareGroup
A convenience method to write out the hidden form fields that notify intake of the group.- Parameter:
group
- the group to declare- Gibt zurück:
- the HTML that declares the group to Intake in a hidden input field
-
declareGroup
xhtml valid hidden input field(s) that notifies intake of the group's presence.- Parameter:
group
- the group to declaresb
- a String Builder where the hidden field HTML will be appended
-
newForm
Declare that a new form starts -
refresh
Implementation of ApplicationTool interface is not needed for this tool as it is request scoped- Angegeben von:
refresh
in SchnittstelleApplicationTool
-
get
get a specific group- Parameter:
groupName
- the name of the group- Gibt zurück:
- a
IntakeTool.PullHelper
wrapper around the group
-
get
public IntakeTool.PullHelper get(String groupName, boolean throwExceptions) throws org.apache.fulcrum.intake.IntakeException Get a specific group- Parameter:
groupName
- the name of the groupthrowExceptions
- if false, exceptions will be suppressed.- Gibt zurück:
- a
IntakeTool.PullHelper
wrapper around the group - Löst aus:
org.apache.fulcrum.intake.IntakeException
- could not retrieve group
-
isAllValid
Loops through all of the Groups and checks to see if the data within the Group is valid.- Gibt zurück:
- true if all groups are 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.- Parameter:
groupName
- the name of the groupkey
- the key for the group- Gibt zurück:
- the
Group
- Löst aus:
org.apache.fulcrum.intake.IntakeException
- if the group could not be retrieved
-
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.- Parameter:
groupName
- the name of the groupkey
- the key for the groupcreate
- true if a new group should be created- Gibt zurück:
- the
Group
- Löst aus:
org.apache.fulcrum.intake.IntakeException
- if the group could not be retrieved
-
remove
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).- Parameter:
group
- the group instance to remove
-
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
Get a Map containing all the groups.- Gibt zurück:
- the Group Map
-
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.- Angegeben von:
recycle
in Schnittstelleorg.apache.fulcrum.pool.Recyclable
-
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.- Angegeben von:
dispose
in Schnittstelleorg.apache.fulcrum.pool.Recyclable
-
isDisposed
Checks whether the recyclable has been disposed.- Angegeben von:
isDisposed
in Schnittstelleorg.apache.fulcrum.pool.Recyclable
- Gibt zurück:
- true, if the recyclable is disposed.
-