|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.shale.usecases.rolodex.RolodexDao
public class RolodexDao
Data Access Object for the roledex use case.
Field Summary | |
---|---|
static char[][] |
TAB_INDEX
Tab indexes for the rolodex. |
Constructor Summary | |
---|---|
RolodexDao()
The constructor loads some default data. |
Method Summary | |
---|---|
void |
deleteContact(Contact entity)
Removes the contact from the mock data store. |
Contact |
findContact(String name)
Returns the latest copy of the Contact by primary key. |
List |
findContactsForTab(int index)
Retuns a subset of contacts within the index of a a tab
defined by TAB_INDEX from the mock data store. |
int |
findTabForContact(Contact contact)
This function will find the tabIndex that the Contact
will be located on. |
javax.faces.model.SelectItem[] |
getCountries()
Returns an array of countries used to populate a select list. |
javax.faces.model.SelectItem[] |
getStates()
Returns an array of states used to populate a select list. |
List |
getTabs()
Returns a list of SelectItem that will be used to build
the links. |
void |
loadStates()
Loads the State codes and contacts from an XML data source. |
int |
saveContact(Contact entity)
Saves a Contact to the mock data store. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char[][] TAB_INDEX
Tab indexes for the rolodex. Each sub array represents the starting and ending character index.
Constructor Detail |
---|
public RolodexDao()
The constructor loads some default data.
Method Detail |
---|
public List getTabs()
Returns a list of SelectItem
that will be used to build
the links.
public int saveContact(Contact entity)
Saves a Contact
to the mock data store.
public int findTabForContact(Contact contact)
This function will find the tabIndex that the Contact
will be located on. It will default to the first page.
public List findContactsForTab(int index)
Retuns a subset of contacts within the index
of a a tab
defined by TAB_INDEX
from the mock data store. If this was
a RDBMS data store, the contacts returned might be a "ghost" object
meaning that maybe only the name
attribute would be
populated.
public void deleteContact(Contact entity)
Removes the contact from the mock data store.
public void loadStates()
Loads the State
codes and contacts from an XML data source. The
stateDataStore
set will hold the states where the
countryDataStore
set will hold the countries. The target type of
these collections will be SelectItem. The contacts are held in the
entityDataStore
set.
public javax.faces.model.SelectItem[] getStates()
Returns an array of states used to populate a select list. The target type is an array of SelectItem.
public javax.faces.model.SelectItem[] getCountries()
Returns an array of countries used to populate a select list. The target type is an array of SelectItem.
public Contact findContact(String name)
Returns the latest copy of the Contact
by primary key.
name
- contact name that uniquely identifies a Contact.
Contact
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |