org.jasig.portlet.search.mvc
Class GsaSearchController

java.lang.Object
  extended by org.jasig.portlet.search.mvc.GsaSearchController

@Controller
@RequestMapping(value="/gsaSearch")
public class GsaSearchController
extends java.lang.Object

GsaSearchController performs searches against a Google Search Appliance.

Version:
$Revision: 47825 $
Author:
Jen Bourey

Field Summary
 java.lang.String googleBaseUrl
           
 java.util.Map<java.lang.String,java.lang.String> googleParameters
           
 java.lang.String googleSearchServlet
           
 java.lang.String googleStylesheetName
           
 
Constructor Summary
GsaSearchController()
           
 
Method Summary
protected  void addParameter(java.lang.StringBuffer url, java.lang.String paramName, java.lang.String paramValue, boolean firstParam)
           
protected  java.lang.String buildGoogleSearchUrl(java.lang.String query, java.lang.String site, java.lang.String num)
           
 org.springframework.web.servlet.ModelAndView searchGsa(javax.servlet.http.HttpServletRequest request)
           
 void setGoogleBaseUrl(java.lang.String googleBaseUrl)
          Set the base URL for Google searches.
 void setGoogleParameters(java.util.Map<java.lang.String,java.lang.String> googleParameters)
          Set a map of parameter names and values for google searches.
 void setGoogleStylesheetName(java.lang.String googleStylesheetName)
          Set the name of the google stylesheet to use in the "more results" link.
 void setView(org.springframework.web.servlet.View view)
          Set the View for the GSA search controller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

googleSearchServlet

public java.lang.String googleSearchServlet

googleBaseUrl

public java.lang.String googleBaseUrl

googleStylesheetName

public java.lang.String googleStylesheetName

googleParameters

public java.util.Map<java.lang.String,java.lang.String> googleParameters
Constructor Detail

GsaSearchController

public GsaSearchController()
Method Detail

searchGsa

@RequestMapping(method=GET)
public org.springframework.web.servlet.ModelAndView searchGsa(javax.servlet.http.HttpServletRequest request)
                                                       throws org.apache.commons.httpclient.HttpException,
                                                              java.io.IOException
Throws:
org.apache.commons.httpclient.HttpException
java.io.IOException

buildGoogleSearchUrl

protected java.lang.String buildGoogleSearchUrl(java.lang.String query,
                                                java.lang.String site,
                                                java.lang.String num)
                                         throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException

addParameter

protected void addParameter(java.lang.StringBuffer url,
                            java.lang.String paramName,
                            java.lang.String paramValue,
                            boolean firstParam)
                     throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException

setView

public void setView(org.springframework.web.servlet.View view)
Set the View for the GSA search controller.

Parameters:
view -

setGoogleBaseUrl

public void setGoogleBaseUrl(java.lang.String googleBaseUrl)
Set the base URL for Google searches. This URL should include the protocol and server. Example: http://google.school.edu

Parameters:
googleBaseUrl -

setGoogleStylesheetName

public void setGoogleStylesheetName(java.lang.String googleStylesheetName)
Set the name of the google stylesheet to use in the "more results" link.

Parameters:
googleStylesheetName -

setGoogleParameters

public void setGoogleParameters(java.util.Map<java.lang.String,java.lang.String> googleParameters)
Set a map of parameter names and values for google searches. These parameters may include instructions regarding encoding, client, etc.

Parameters:
googleParameters -


Copyright © 2010 Jasig. All Rights Reserved.