public class IntakeTool extends Object implements ApplicationTool, org.apache.fulcrum.pool.Recyclable
Modifier and Type | Class and Description |
---|---|
class |
IntakeTool.PullHelper
Inner class to present a nice interface to the template designer
|
Modifier and Type | Field and Description |
---|---|
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 org.apache.fulcrum.intake.IntakeService |
intakeService
The Intake service.
|
protected static org.apache.logging.log4j.Logger |
log
Used for logging
|
protected org.apache.fulcrum.parser.ValueParser |
pp
ValueParser instance
|
Constructor and Description |
---|
IntakeTool()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addGroupsToParameters(org.apache.fulcrum.parser.ValueParser vp)
Add all registered group ids to the value parser
|
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,
StringBuilder 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<String,org.apache.fulcrum.intake.model.Group> |
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()
Declare that a new form starts
|
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.
|
protected static final org.apache.logging.log4j.Logger log
public static final String DEFAULT_KEY
public static final String INTAKE_GRP
protected HashMap<String,org.apache.fulcrum.intake.model.Group> groups
protected org.apache.fulcrum.parser.ValueParser pp
protected org.apache.fulcrum.intake.IntakeService intakeService
public IntakeTool()
public void init(Object runData)
init
in interface ApplicationTool
runData
- initialization datapublic void addGroupsToParameters(org.apache.fulcrum.parser.ValueParser vp)
vp
- the value parserpublic String declareGroups()
public String declareGroup(org.apache.fulcrum.intake.model.Group group)
group
- the group to declarepublic void declareGroup(org.apache.fulcrum.intake.model.Group group, StringBuilder sb)
group
- the group to declaresb
- a String Builder where the hidden field HTML will be appendedpublic void newForm()
public void refresh()
refresh
in interface ApplicationTool
public IntakeTool.PullHelper get(String groupName)
groupName
- the name of the groupIntakeTool.PullHelper
wrapper around the grouppublic IntakeTool.PullHelper get(String groupName, boolean throwExceptions) throws org.apache.fulcrum.intake.IntakeException
groupName
- the name of the groupthrowExceptions
- if false, exceptions will be suppressed.IntakeTool.PullHelper
wrapper around the grouporg.apache.fulcrum.intake.IntakeException
- could not retrieve grouppublic boolean isAllValid()
public org.apache.fulcrum.intake.model.Group get(String groupName, String key) throws org.apache.fulcrum.intake.IntakeException
groupName
- the name of the groupkey
- the key for the groupGroup
org.apache.fulcrum.intake.IntakeException
- if the group could not be retrievedpublic org.apache.fulcrum.intake.model.Group get(String groupName, String key, boolean create) throws org.apache.fulcrum.intake.IntakeException
groupName
- the name of the groupkey
- the key for the groupcreate
- true if a new group should be createdGroup
org.apache.fulcrum.intake.IntakeException
- if the group could not be retrievedpublic void remove(org.apache.fulcrum.intake.model.Group group)
group
- the group instance to removepublic void removeAll()
public Map<String,org.apache.fulcrum.intake.model.Group> getGroups()
public void recycle()
recycle
in interface org.apache.fulcrum.pool.Recyclable
public void dispose()
dispose
in interface org.apache.fulcrum.pool.Recyclable
public boolean isDisposed()
isDisposed
in interface org.apache.fulcrum.pool.Recyclable
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.