blackboard.persist.course
Class CourseSearch

java.lang.Object
  extended by blackboard.persist.course.CourseSearch

public class CourseSearch
extends java.lang.Object

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, "admin" );
 
 UserSearch us = UserSearch.getLoginDateSearch( SearchOperator.IsNull, null );
 


Nested Class Summary
static class CourseSearch.SearchKey
          Valid keys for search operations
static class CourseSearch.SortKey
          Enumeration of possible "sort" keys.
 
Constructor Summary
CourseSearch()
          Constructor
 
Method Summary
static CourseSearch getDateCreatedSearch(SearchOperator op, java.util.Date value, Course.ServiceLevel serviceLevel)
          Creates a search object that compares the creation date.
static CourseSearch getInfoSearch(CourseSearch.SearchKey key, SearchOperator op, java.lang.String value, Course.ServiceLevel serviceLevel)
          Generates a search object that finds courses based on the specified name key.
static CourseSearch getInstructorSearch(SearchOperator op, java.lang.String value, Course.ServiceLevel serviceLevel)
          Generates a search object that finds courses based on whether one of the instructors has a name matching the specified value.
 SelectQuery getQuery()
          Returns a query for use by the loader.
 int getRowCount()
          getRowCount
 boolean getUsePaging()
          Returns whether this search will return "paged" results.
static CourseSearch getViewCatalogSearch(CourseSearch.SearchKey key, SearchOperator op, java.lang.String value, SearchOperator dateOp, java.util.Date createdDate, Id categoryId, Course.ServiceLevel serviceLevel)
          Returns a course search object appropriate for use when rendering a course list with the course catalog as viewed by user (i.e., non-admin panel) Since this is not used from the admin panel, the entitlement clause is not added.
static CourseSearch getViewCoursesSearch(CourseSearch.SearchKey key, SearchOperator op, java.lang.String value, SearchOperator dateOp, java.util.Date createdDate, Course.ServiceLevel serviceLevel)
          Creates a search object that
static CourseSearch getViewCoursesSearch(CourseSearch.SearchKey key, SearchOperator op, java.lang.String value, SearchOperator dateOp, java.util.Date createdDate, Course.ServiceLevel serviceLevel, boolean bFilterRowStatus)
          Creates a search object that
static CourseSearch getViewCoursesSearch(CourseSearch.SearchKey key, SearchOperator op, java.lang.String value, SearchOperator dateOp, java.util.Date createdDate, Course.ServiceLevel serviceLevel, boolean bFilterRowStatus, boolean bCheckDomainEntitlement)
           
static CourseSearch getViewCoursesSearch(CourseSearch.SearchKey key, SearchOperator op, java.lang.String value, SearchOperator dateOp, java.util.Date createdDate, Course.ServiceLevel serviceLevel, boolean bFilterRowStatus, boolean bCheckDomainEntitlement, boolean displayIntegrated)
          Creates a search object that
 void setAscending(boolean value)
          Sets flag determining whether sort order is ascending.
 void setCurrentPage(int value)
          setCurrentPage
 void setPageSize(int value)
          setPageSize
 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

CourseSearch

public CourseSearch()
Constructor

Method Detail

getInfoSearch

public static CourseSearch getInfoSearch(CourseSearch.SearchKey key,
                                         SearchOperator op,
                                         java.lang.String value,
                                         Course.ServiceLevel serviceLevel)
Generates a search object that finds courses based on the specified name key. This search also restricts based on whether the user has the proper entitlement system.course.VIEW or system.org.VIEW.

Parameters:
key - Key to search on. Must be one of FamilyName, GivenName, or UserName
op - Operator to use
value - Value to search. Should be provided "as-is", appropriate search syntax will be added as required.
serviceLevel - Discriminator for searching courses vs organizations
Returns:
Initialized course search object

getInstructorSearch

public static CourseSearch getInstructorSearch(SearchOperator op,
                                               java.lang.String value,
                                               Course.ServiceLevel serviceLevel)
Generates a search object that finds courses based on whether one of the instructors has a name matching the specified value. This search is used from the admin panel and thus also restricts based on whether the user has the proper entitlement system.course.VIEW or system.org.VIEW.

Parameters:
op - Operator for the value comparison
value - Value to compare; it will be converted to an appropriate SQL predicate based on op.
serviceLevel - Discriminator for searching courses vs organizations
Returns:
CourseSearch object with appropriate parameters added

getDateCreatedSearch

public static CourseSearch getDateCreatedSearch(SearchOperator op,
                                                java.util.Date value,
                                                Course.ServiceLevel serviceLevel)
Creates a search object that compares the creation date. This search is used from the admin panel and thus also restricts based on whether the user has the proper entitlement system.course.VIEW or system.org.VIEW.

Parameters:
op - Operator to apply
value - Date value to search
serviceLevel - Discriminator for searching courses vs organizations
Returns:
CourseSearch object with date and entitlement parameters set

getViewCoursesSearch

public static CourseSearch getViewCoursesSearch(CourseSearch.SearchKey key,
                                                SearchOperator op,
                                                java.lang.String value,
                                                SearchOperator dateOp,
                                                java.util.Date createdDate,
                                                Course.ServiceLevel serviceLevel)
Creates a search object that


getViewCoursesSearch

public static CourseSearch getViewCoursesSearch(CourseSearch.SearchKey key,
                                                SearchOperator op,
                                                java.lang.String value,
                                                SearchOperator dateOp,
                                                java.util.Date createdDate,
                                                Course.ServiceLevel serviceLevel,
                                                boolean bFilterRowStatus)
Creates a search object that


getViewCoursesSearch

public static CourseSearch getViewCoursesSearch(CourseSearch.SearchKey key,
                                                SearchOperator op,
                                                java.lang.String value,
                                                SearchOperator dateOp,
                                                java.util.Date createdDate,
                                                Course.ServiceLevel serviceLevel,
                                                boolean bFilterRowStatus,
                                                boolean bCheckDomainEntitlement)

getViewCoursesSearch

public static CourseSearch getViewCoursesSearch(CourseSearch.SearchKey key,
                                                SearchOperator op,
                                                java.lang.String value,
                                                SearchOperator dateOp,
                                                java.util.Date createdDate,
                                                Course.ServiceLevel serviceLevel,
                                                boolean bFilterRowStatus,
                                                boolean bCheckDomainEntitlement,
                                                boolean displayIntegrated)
Creates a search object that


getViewCatalogSearch

public static CourseSearch getViewCatalogSearch(CourseSearch.SearchKey key,
                                                SearchOperator op,
                                                java.lang.String value,
                                                SearchOperator dateOp,
                                                java.util.Date createdDate,
                                                Id categoryId,
                                                Course.ServiceLevel serviceLevel)
Returns a course search object appropriate for use when rendering a course list with the course catalog as viewed by user (i.e., non-admin panel) Since this is not used from the admin panel, the entitlement clause is not added.

Parameters:
key - the course search key to filter results using
op - the operator to use for the course search key criteria
value - the value to use for the course search key criteria
dateOp - the operator to use for the date search criteria
createdDate - the value to use for the date search criteria
categoryId - the category within the catalog to which the search should be restricted. Provide null if the entire catalog should be searched
serviceLevel - the service level which describes the type of course to search for (course versus organization)
Returns:
a CourseSearch object which can used with the appropriate database loader to load the desired course list.

setAscending

public void setAscending(boolean value)
Sets flag determining whether sort order is ascending.

Parameters:
value - True if sort should be ascending

setPageSize

public void setPageSize(int value)
setPageSize


setCurrentPage

public void setCurrentPage(int value)
setCurrentPage


getRowCount

public int getRowCount()
getRowCount


getUsePaging

public boolean getUsePaging()
Returns whether this search will return "paged" results.

Returns:
true if the search is "paged".

setUsePaging

public void setUsePaging(boolean usePaging)
Sets whether to "page" this search

Parameters:
usePaging - Whether to page the search.

getQuery

public SelectQuery getQuery()
Returns a query for use by the loader.

Returns:
Select query


Copyright © 2003 Blackboard, Inc. All Rights Reserved.