org.sakaiproject.tool.OSIDRepository
Class SearchSource

java.lang.Object
  extended byorg.sakaiproject.tool.OSIDRepository.SearchSource

public class SearchSource
extends Object


Method Summary
static boolean alternateFormsEnabled()
          Are alternate forms available?
static String getDefaultSourceName()
          Get the default search source
 String getName()
          Return the search source name
static String getNextFormName(String currentSourceName)
          Get the "next form" name
 QueryBase getQueryHandler()
          Return a new QueryBase object for the specified search source.
 ResultPageBase getResultPageHandler()
          Return a new ResultPageBase object for the specified search source.
static Iterator getSearchListIterator()
          Return an Iterator to the source list
 SearchResultBase getSearchResultHandler()
          Return a new SearchResultBase object for the specified search source.
static SearchSource getSourceByName(String name)
          Lookup a search source by name
 boolean isAlternateForm()
          Does this source require an alternate form?
 boolean isEnabled()
          Is this source available?
static boolean isSourceListPopulated()
          Has source list has been populated?
static void populate()
          Create a populated SearchSource list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getName

public String getName()
Return the search source name

Returns:
The name of this source (eg Academic Search, ERIC)

isEnabled

public boolean isEnabled()
Is this source available?

Returns:
true (if available)

getQueryHandler

public QueryBase getQueryHandler()
                          throws ClassNotFoundException,
                                 InstantiationException,
                                 IllegalAccessException
Return a new QueryBase object for the specified search source. Class loading is defered until request time.

Returns:
A QueryBase object for this source
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException

getSearchResultHandler

public SearchResultBase getSearchResultHandler()
                                        throws ClassNotFoundException,
                                               InstantiationException,
                                               IllegalAccessException
Return a new SearchResultBase object for the specified search source. Class loading is defered until request time.

Returns:
A SearchResultBase object for this source
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException

getResultPageHandler

public ResultPageBase getResultPageHandler()
                                    throws ClassNotFoundException,
                                           InstantiationException,
                                           IllegalAccessException
Return a new ResultPageBase object for the specified search source. Class loading is defered until request time.

Returns:
A ResultPageBase object for this source
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException

getSourceByName

public static SearchSource getSourceByName(String name)
Lookup a search source by name

Parameters:
name - Source name
Returns:
SearchSource object

getDefaultSourceName

public static String getDefaultSourceName()
Get the default search source

Returns:
The search source name

getSearchListIterator

public static Iterator getSearchListIterator()
Return an Iterator to the source list

Returns:
Source list Iterator

alternateFormsEnabled

public static boolean alternateFormsEnabled()
Are alternate forms available?

Returns:
true if so

isAlternateForm

public boolean isAlternateForm()
Does this source require an alternate form?

Returns:
true if so

getNextFormName

public static String getNextFormName(String currentSourceName)
Get the "next form" name

Parameters:
currentSourceName - Name of the active search source
Returns:
Form name for the "next form" link

populate

public static void populate()
                     throws SearchException
Create a populated SearchSource list. We actually construct two lists, one for sources which use the standard form, and another for any sources that require an alternate form. These lists are eventaully combined to create one list with the alternate form sources at the end.

Throws:
SearchException

isSourceListPopulated

public static boolean isSourceListPopulated()
Has source list has been populated?

Returns:
true if so