org.sakaiproject.tool.search
Interface QueryInterface

All Known Implementing Classes:
QueryBase

public interface QueryInterface


Field Summary
static String CS_DEFAULT
          Default character set
static String CS_ISO
          ISO 8859
static String CS_UTF8
          UTF 8 encoding
 
Method Summary
 String getImageCount()
          Fetch the desired image count
 String getParameter(String name)
          Get a named parameter
 String getRequestParameter(String name)
          Fetch a request parameter by name
 Map getRequestParameterMap()
          Fetch the entire request parameter Map
 String getResponseString()
          Get query results
 String getSearchString()
          Fetch the requested search text
 String getUrl()
          Get the URL for this query
 void initialize(SessionContext session)
          Common initialization
 void parseRequest(Map parameterMap)
          Parse and save request parameters
 void setDefaultCharacterSet(String characterSet)
          Request a character set
 void setImageCount(String count)
          Specify desired number of images
 void setParameter(String name, String value)
          Set a named parameter related to this search.
 void setSearchString(String searchString)
          Specify search text
 void setUrl(String url)
          Set the URL for this query
 int submit()
          Submit a search request to the server
 

Field Detail

CS_DEFAULT

public static final String CS_DEFAULT
Default character set

See Also:
Constant Field Values

CS_ISO

public static final String CS_ISO
ISO 8859

See Also:
Constant Field Values

CS_UTF8

public static final String CS_UTF8
UTF 8 encoding

See Also:
Constant Field Values
Method Detail

parseRequest

public void parseRequest(Map parameterMap)
Parse and save request parameters

Parameters:
parameterMap - A map of request details (name=value pairs)

getRequestParameter

public String getRequestParameter(String name)
Fetch a request parameter by name

Parameters:
name - Parameter name
Returns:
Parameter value

getRequestParameterMap

public Map getRequestParameterMap()
Fetch the entire request parameter Map

Returns:
Parameter Map

setDefaultCharacterSet

public void setDefaultCharacterSet(String characterSet)
Request a character set

Parameters:
characterSet - Desired character set (UTF-8, ISO-8859-1, etc)

setUrl

public void setUrl(String url)
Set the URL for this query

Parameters:
url - The requested URL

getUrl

public String getUrl()
Get the URL for this query

Returns:
The requested URL

setSearchString

public void setSearchString(String searchString)
Specify search text

Parameters:
searchString - Text to search for

getSearchString

public String getSearchString()
Fetch the requested search text

Returns:
The search text

setImageCount

public void setImageCount(String count)
Specify desired number of images

Parameters:
count - Count of images requested from the search engine

getImageCount

public String getImageCount()
Fetch the desired image count

Returns:
The desired number of images

setParameter

public void setParameter(String name,
                         String value)
Set a named parameter related to this search. Sent to the search server, this is usually a modifier for the search (return ## matches, etc)

Parameters:
name - Parameter name
value - Parameter value

getParameter

public String getParameter(String name)
Get a named parameter

Returns:
Parameter value

getResponseString

public String getResponseString()
Get query results

Returns:
The results page (as a String)

initialize

public void initialize(SessionContext session)
Common initialization

Parameters:
session - Session context for this query

submit

public int submit()
Submit a search request to the server

Returns:
Server status (ala HTTP, 200 is success)