org.sakaiproject.search.tool
Class SearchBeanImpl

java.lang.Object
  extended by org.sakaiproject.search.tool.SearchBeanImpl
All Implemented Interfaces:
SearchBean

public class SearchBeanImpl
extends Object
implements SearchBean

Implementation of the search bean backing bean

Author:
ieb

Nested Class Summary
static class SearchBeanImpl.Scope
           
protected  class SearchBeanImpl.TermHolder
           
 
Field Summary
static String SEARCH_ALL_SITES
           
static String SEARCH_SITE_IDS
           
 
Constructor Summary
SearchBeanImpl(javax.servlet.http.HttpServletRequest request, SearchService searchService, org.sakaiproject.site.api.SiteService siteService, org.sakaiproject.tool.api.ToolManager toolManager, org.sakaiproject.user.api.UserDirectoryService userDirectoryService, org.sakaiproject.authz.api.SecurityService securityService, org.sakaiproject.component.api.ServerConfigurationService serverConfigurationService)
          Creates a searchBean
SearchBeanImpl(javax.servlet.http.HttpServletRequest request, String sortName, String filterName, SearchService searchService, org.sakaiproject.site.api.SiteService siteService, org.sakaiproject.tool.api.ToolManager toolManager, org.sakaiproject.user.api.UserDirectoryService userDirectoryService, org.sakaiproject.authz.api.SecurityService securityService, org.sakaiproject.component.api.ServerConfigurationService serverConfigurationService)
           
SearchBeanImpl(String siteId, SearchService ss, String search, org.sakaiproject.tool.api.ToolManager tm, org.sakaiproject.authz.api.SecurityService securityService, org.sakaiproject.component.api.ServerConfigurationService serverConfigurationService)
           
 
Method Summary
protected  Properties extractPropertiesFromTool()
           
protected  String[] extractSiteIdsFromProperties(Properties props)
           
 boolean foundNoResults()
           
protected  String[] getAllUsersSites()
          Get all the sites a user has access to.
 String getBaseUrl()
          get the base URL
 int getCensoredResultCount()
           
 String getDateNow()
          get the date now in RFS-822 format
 String getErrorMessage()
          get the error message
 int getNlistPages()
           
 int getNresults()
          The Total number of results
 String getOpenSearchUrl()
          Get the OpensearchURL
 List<SearchPage> getPages()
          get a pager objects
 int getPagesize()
           
 String getPortalBaseUrl()
           
 int getRequestPage()
           
 String getRequestUrl()
          get the request URL
 List<SearchOutputItem> getResults()
          get the results for the current pages
 String getRssURL()
          get the RSS URL
 String getSearch()
          Gets the current search request
 String getSearchFound()
          get the found string
 String getSearchFoundCensored()
           
protected  List<String> getSearchSites(String[] toolPropertySiteIds)
           
 String getSearchTitle()
          Title for the search page
 String getSherlockIconUrl()
           
 String getSherlockUpdateUrl()
           
 String getSiteTitle()
          Get the site title
 String getSuggestion()
           
 String getSuggestionUrl()
           
 String getSystemName()
          get the name of the system
 List<SearchTerm> getTerms()
          get the terms on the current page
 String getTerms(String format)
          Deprecated.  
 String getTimeTaken()
          The time taken to perform the search only, not including rendering
protected  String[] getToolPropertySiteIds()
           
 String getToolUrl()
          Gets the base url for the tool
 boolean hasAdmin()
          true if the user has admin rights
 boolean hasError()
          does the page have an error
 boolean hasResults()
          Returns true if a search has been performed and there are some results
 boolean hasSuggestion()
           
 boolean isEnabled()
          returns true if search isEnabled
 boolean isScope(String scope)
           
 SearchList search()
          Perform the search
 void setNlistPages(int nlistPages)
           
 void setPagesize(int pagesize)
           
 void setRequestPage(int requestPage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEARCH_SITE_IDS

public static final String SEARCH_SITE_IDS
See Also:
Constant Field Values

SEARCH_ALL_SITES

public static final String SEARCH_ALL_SITES
See Also:
Constant Field Values
Constructor Detail

SearchBeanImpl

public SearchBeanImpl(String siteId,
                      SearchService ss,
                      String search,
                      org.sakaiproject.tool.api.ToolManager tm,
                      org.sakaiproject.authz.api.SecurityService securityService,
                      org.sakaiproject.component.api.ServerConfigurationService serverConfigurationService)

SearchBeanImpl

public SearchBeanImpl(javax.servlet.http.HttpServletRequest request,
                      SearchService searchService,
                      org.sakaiproject.site.api.SiteService siteService,
                      org.sakaiproject.tool.api.ToolManager toolManager,
                      org.sakaiproject.user.api.UserDirectoryService userDirectoryService,
                      org.sakaiproject.authz.api.SecurityService securityService,
                      org.sakaiproject.component.api.ServerConfigurationService serverConfigurationService)
               throws org.sakaiproject.exception.IdUnusedException
Creates a searchBean

Parameters:
request - The HTTP request
searchService - The search service to use
siteService - the site service
portalService - the portal service
Throws:
org.sakaiproject.exception.IdUnusedException - if there is no current worksite

SearchBeanImpl

public SearchBeanImpl(javax.servlet.http.HttpServletRequest request,
                      String sortName,
                      String filterName,
                      SearchService searchService,
                      org.sakaiproject.site.api.SiteService siteService,
                      org.sakaiproject.tool.api.ToolManager toolManager,
                      org.sakaiproject.user.api.UserDirectoryService userDirectoryService,
                      org.sakaiproject.authz.api.SecurityService securityService,
                      org.sakaiproject.component.api.ServerConfigurationService serverConfigurationService)
               throws org.sakaiproject.exception.IdUnusedException
Throws:
org.sakaiproject.exception.IdUnusedException
See Also:
#SearchBeanImpl(HttpServletRequest, SearchService, SiteService, ToolManager)
Method Detail

getTerms

public String getTerms(String format)
Deprecated. 

Description copied from interface: SearchBean
Get a formatted list of terms

Specified by:
getTerms in interface SearchBean
Parameters:
format - format is {0} is the term {1} is the frequency
Returns:

isEnabled

public boolean isEnabled()
Description copied from interface: SearchBean
returns true if search isEnabled

Specified by:
isEnabled in interface SearchBean
Returns:

isScope

public boolean isScope(String scope)
Specified by:
isScope in interface SearchBean

getSearch

public String getSearch()
Gets the current search request

Specified by:
getSearch in interface SearchBean
Returns:
current search request

getTimeTaken

public String getTimeTaken()
The time taken to perform the search only, not including rendering

Returns:

getSearchSites

protected List<String> getSearchSites(String[] toolPropertySiteIds)

getToolPropertySiteIds

protected String[] getToolPropertySiteIds()

getAllUsersSites

protected String[] getAllUsersSites()
Get all the sites a user has access to.

Returns:
An array of site IDs.

extractSiteIdsFromProperties

protected String[] extractSiteIdsFromProperties(Properties props)

extractPropertiesFromTool

protected Properties extractPropertiesFromTool()

search

public SearchList search()
Perform the search

Returns:
a list of page names that match the search criteria

getNlistPages

public int getNlistPages()
Returns:
Returns the nlistPages.

setNlistPages

public void setNlistPages(int nlistPages)
Parameters:
nlistPages - The nlistPages to set.

getPagesize

public int getPagesize()
Returns:
Returns the pagesize.

setPagesize

public void setPagesize(int pagesize)
Parameters:
pagesize - The pagesize to set.

getRequestPage

public int getRequestPage()
Returns:
Returns the requestPage.

setRequestPage

public void setRequestPage(int requestPage)
Parameters:
requestPage - The requestPage to set.

getNresults

public int getNresults()
The Total number of results

Specified by:
getNresults in interface SearchBean
Returns:

getSearchTitle

public String getSearchTitle()
Title for the search page

Specified by:
getSearchTitle in interface SearchBean
Returns:

hasAdmin

public boolean hasAdmin()
true if the user has admin rights

Specified by:
hasAdmin in interface SearchBean
Returns:

getToolUrl

public String getToolUrl()
Gets the base url for the tool

Specified by:
getToolUrl in interface SearchBean
Returns:

hasResults

public boolean hasResults()
Description copied from interface: SearchBean
Returns true if a search has been performed and there are some results

Specified by:
hasResults in interface SearchBean
Returns:

foundNoResults

public boolean foundNoResults()
Specified by:
foundNoResults in interface SearchBean
Returns:

getOpenSearchUrl

public String getOpenSearchUrl()
Description copied from interface: SearchBean
Get the OpensearchURL

Specified by:
getOpenSearchUrl in interface SearchBean
Returns:

getSherlockIconUrl

public String getSherlockIconUrl()
Specified by:
getSherlockIconUrl in interface SearchBean
Returns:

getSherlockUpdateUrl

public String getSherlockUpdateUrl()
Specified by:
getSherlockUpdateUrl in interface SearchBean
Returns:

getBaseUrl

public String getBaseUrl()
Description copied from interface: SearchBean
get the base URL

Specified by:
getBaseUrl in interface SearchBean
Returns:

getPortalBaseUrl

public String getPortalBaseUrl()
Specified by:
getPortalBaseUrl in interface SearchBean
Returns:

getSiteTitle

public String getSiteTitle()
Description copied from interface: SearchBean
Get the site title

Specified by:
getSiteTitle in interface SearchBean
Returns:

getSystemName

public String getSystemName()
Description copied from interface: SearchBean
get the name of the system

Specified by:
getSystemName in interface SearchBean
Returns:

getPages

public List<SearchPage> getPages()
Description copied from interface: SearchBean
get a pager objects

Specified by:
getPages in interface SearchBean
Returns:

getResults

public List<SearchOutputItem> getResults()
Description copied from interface: SearchBean
get the results for the current pages

Specified by:
getResults in interface SearchBean
Returns:

getSearchFound

public String getSearchFound()
Description copied from interface: SearchBean
get the found string

Specified by:
getSearchFound in interface SearchBean
Returns:

getSearchFoundCensored

public String getSearchFoundCensored()

getTerms

public List<SearchTerm> getTerms()
Description copied from interface: SearchBean
get the terms on the current page

Specified by:
getTerms in interface SearchBean
Returns:

hasError

public boolean hasError()
Description copied from interface: SearchBean
does the page have an error

Specified by:
hasError in interface SearchBean
Returns:

getErrorMessage

public String getErrorMessage()
Description copied from interface: SearchBean
get the error message

Specified by:
getErrorMessage in interface SearchBean
Returns:

getRssURL

public String getRssURL()
Description copied from interface: SearchBean
get the RSS URL

Specified by:
getRssURL in interface SearchBean
Returns:

getDateNow

public String getDateNow()
Description copied from interface: SearchBean
get the date now in RFS-822 format

Specified by:
getDateNow in interface SearchBean
Returns:

getRequestUrl

public String getRequestUrl()
Description copied from interface: SearchBean
get the request URL

Specified by:
getRequestUrl in interface SearchBean
Returns:

getCensoredResultCount

public int getCensoredResultCount()

getSuggestion

public String getSuggestion()
Specified by:
getSuggestion in interface SearchBean

hasSuggestion

public boolean hasSuggestion()
Specified by:
hasSuggestion in interface SearchBean

getSuggestionUrl

public String getSuggestionUrl()
Specified by:
getSuggestionUrl in interface SearchBean


Copyright © 2003-2012 Sakai Project. All Rights Reserved.