public class ListSessionSetHelper extends ListHelper
If the user selected items need to be more persistant than simply the session, use
ListRhnSetHelper instead.
ListRhnSetHelperDATA_SET, LIST| Constructor and Description |
|---|
ListSessionSetHelper(Listable inp,
javax.servlet.http.HttpServletRequest req)
Creates a new
ListSessionSetHelper that will attempt to generate
its own unique name for the set. |
ListSessionSetHelper(Listable inp,
javax.servlet.http.HttpServletRequest req,
java.util.Map params)
Creates a new
ListSessionSetHelper that will attempt to generate
its own unique name for the set combined with the values of the request parameters. |
ListSessionSetHelper(Listable inp,
javax.servlet.http.HttpServletRequest req,
java.util.Map params,
java.lang.String declPrefix)
Creates a new
ListSessionSetHelper that will use the given prefix
as the uniqueness indicator for tracking the set data. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
add(java.util.Set c)
Add elements to a set.
|
protected void |
clear()
clear the set
|
void |
destroy()
Obliterates the set from Session or Database
|
void |
execute()
Setup the appropriate data bindings.
|
protected void |
execute(java.util.List dataSet)
Perform the execute step of the helpers
basicall handles the selectall updateset etc..
|
java.util.Collection |
getAddedKeys()
Returns a list of items that were added
to the initial set
|
java.lang.String |
getDecl()
gets the declaration associated to this set
|
protected java.util.Set |
getPreSelected() |
java.util.Collection |
getRemovedKeys()
Returns a list of items that were removed
from the initial set (basically list of unselected items)
|
protected java.util.Map |
getSelections()
returns the selections map.
|
java.util.Set<java.lang.String> |
getSet()
Returns the set that was used to store user selected items.
|
void |
ignoreEmptySelection()
Asks the helper to ignore reporting
errors if no checkbox was selected
and the dispatch action was pressed.
|
boolean |
isDispatched() |
protected boolean |
isParentAnElement() |
boolean |
isPreSelectAll() |
boolean |
isWillClearSet() |
static java.lang.String |
makeSelectionsName(java.lang.String listName)
Returns the name of the selections key.
|
void |
preSelect(java.util.Set set) |
void |
resync(javax.servlet.http.HttpServletRequest request)
resync the selected objects in case you have added anything to set after
it was executed
|
void |
setPreSelectAll(boolean preSelectAllIn) |
void |
setWillClearSet(boolean willClearSetIn)
If set to true the associated set will be cleared when setting up the page
For something like SystemSetManager we don't want this, so set this to false.
|
protected int |
size()
return the size of the set
|
protected void |
syncSelections(java.util.List dataSet)
sync the selections of rhn or session set to dataset.
|
protected void |
update()
Update the set getting data
from List, basically perform
the RhnListSetHelper.updateSet
|
getContext, getDataSet, getDataSetName, getListable, getListName, getParamMap, getParentUrl, getUniqueName, setDataSetName, setListName, setParamMap, setParentUrlpublic ListSessionSetHelper(Listable inp, javax.servlet.http.HttpServletRequest req, java.util.Map params, java.lang.String declPrefix)
ListSessionSetHelper that will use the given prefix
as the uniqueness indicator for tracking the set data.
It is important that if the value chosen for the prefix is unique across all actions to prevent a conflict in storing user selected values.
inp - listablereq - the servlet requestparams - the parameter map for this requestdeclPrefix - the declaration prefix needed to make this set declaration uniquepublic ListSessionSetHelper(Listable inp, javax.servlet.http.HttpServletRequest req, java.util.Map params)
ListSessionSetHelper that will attempt to generate
its own unique name for the set combined with the values of the request parameters.
Using a combination of a standard prefix (determined by the Listable
parameter value) and parameters helps to scope this instance for a dynamic page.
For instance, if the page is scoped to a particular channel, having the channel ID
in this parameter map will allow the user to work with in the same section of two
different channels without the selections in each list interfering with each other.
inp - listablereq - the servlet requestparams - the parameter map for this requestpublic ListSessionSetHelper(Listable inp, javax.servlet.http.HttpServletRequest req)
ListSessionSetHelper that will attempt to generate
its own unique name for the set. This call is suitable when there are no request
parameters of interest for the page.inp - listablereq - the servlet requestpublic void destroy()
public java.lang.String getDecl()
public java.util.Collection getAddedKeys()
public java.util.Collection getRemovedKeys()
public java.util.Set<java.lang.String> getSet()
nullprotected java.util.Map getSelections()
protected int size()
protected void syncSelections(java.util.List dataSet)
dataSet - the result set.protected void update()
protected void add(java.util.Set c)
c - set to add.protected void clear()
protected void execute(java.util.List dataSet)
dataSet - the input data setpublic void ignoreEmptySelection()
public boolean isDispatched()
protected boolean isParentAnElement()
public void execute()
execute in class ListHelperpublic void resync(javax.servlet.http.HttpServletRequest request)
request - the requestpublic static java.lang.String makeSelectionsName(java.lang.String listName)
listName - the name of the list
i.e. the value specifided in <rl:list name=>protected java.util.Set getPreSelected()
public void preSelect(java.util.Set set)
set - the initial set of items to prepopulatepublic boolean isWillClearSet()
public void setWillClearSet(boolean willClearSetIn)
willClearSetIn - the willClearSet to setpublic boolean isPreSelectAll()
public void setPreSelectAll(boolean preSelectAllIn)
preSelectAllIn - The preSelectAll to set.