|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectblackboard.persist.user.UserSearch
public class UserSearch
Class to encapsulate user searches as viewed from the control and admin panels. The factory methods getNameSearch(), getEnrollmentSearch(), getLoginDateSearch(), and getRoleSearch() return properly initialized searches. Examples:
UserSearch us = UserSearch.getNameSearch( UserSearch.SearchKey.UserName, SearchOperator.Contains, "dmin" ); UserSearch us = UserSearch.getLoginDateSearch( SearchOperator.IsNull, null );The class is constructed to assemble the SQL statements in a modular fashion; most of the parameters can be arbitrarily added. This means however, that the resulting statement may not be the most efficient. This is a conscious tradeoff for maintainability. However, these are queries against modest data sets and for user interactions that are infrequent.
| Nested Class Summary | |
|---|---|
static class |
UserSearch.SearchKey
Valid keys for search operations |
static class |
UserSearch.SortKey
Enumeration of possible "sort" keys. |
| Constructor Summary | |
|---|---|
UserSearch()
|
|
| Method Summary | |
|---|---|
static UserSearch |
getEnrollmentSearch(int count,
SearchOperator op,
boolean course)
Returns a search object that finds users based on the number of enrollments. |
static UserSearch |
getLoginDateSearch(SearchOperator op,
java.util.Calendar value)
Creates a search object that compares the login date. |
static UserSearch |
getNameSearch(UserSearch.SearchKey key,
SearchOperator op,
java.lang.String value)
Generates a search object that finds users based on the specified name key. |
SelectQuery |
getQuery()
Returns a query for use by the loader. |
static UserSearch |
getRoleSearch(java.util.List<java.lang.String> list)
Creates a search object based on a list of role identifiers (the string id, not the Id object) This search is used from the admin panel, and thus adds a filter for entitlement 'system.user.VIEW'. |
int |
getRowCount()
|
boolean |
getUsePaging()
Returns whether this search will return "paged" results. |
boolean |
isCheckSysRoleEntitlement()
|
boolean |
isOnlyShowEnabled()
|
void |
setAscending(boolean value)
Sets flag determining whether sort order is ascending. |
void |
setCheckSysRoleEntitlement(boolean checkSysRoleEntitlement)
|
void |
setCurrentPage(int value)
|
void |
setOnlyShowEnabled(boolean onlyShowEnabled)
|
void |
setPageSize(int value)
|
void |
setUsePaging(boolean usePaging)
Sets whether to "page" this search |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UserSearch()
| Method Detail |
|---|
public static UserSearch getNameSearch(UserSearch.SearchKey key,
SearchOperator op,
java.lang.String value)
key - Key to search on. Must be one of FamilyName, GivenName, or
UserNameop - Operator to usevalue - Value to search. Should be provided "as-is", appropriate search
syntax will be added as required.
public static UserSearch getEnrollmentSearch(int count,
SearchOperator op,
boolean course)
count - Count comparisonop - One of Equals, GreaterThan, or LessThan; default is equalscourse - Flag to check course enrollments if true; org enrollments if false
public static UserSearch getLoginDateSearch(SearchOperator op,
java.util.Calendar value)
op - Operator to apply, valid values are GreaterThan, Equals, LessThan, and IsNull
(to find users who have never logged in)value - Date value to search. Ignored if op = IsNull
public static UserSearch getRoleSearch(java.util.List<java.lang.String> list)
list - List of roles to check
java.lang.IllegalArgumentException - throw if list is null or emptypublic boolean isCheckSysRoleEntitlement()
public void setCheckSysRoleEntitlement(boolean checkSysRoleEntitlement)
sysRoleEntitlement - The _checkSysRoleEntitlement to set.public boolean isOnlyShowEnabled()
public void setOnlyShowEnabled(boolean onlyShowEnabled)
onlyShowEnabled - The value to set.public void setAscending(boolean value)
value - True if sort should be ascendingpublic void setPageSize(int value)
public void setCurrentPage(int value)
public int getRowCount()
public boolean getUsePaging()
public void setUsePaging(boolean usePaging)
usePaging - Whether to page the search.public SelectQuery getQuery()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||