pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.core.site.search
Class SearchSite

java.lang.Object
  extended by org.torweg.pulse.bundle.Controller
      extended by org.torweg.pulse.component.core.site.search.SearchSite

public class SearchSite
extends Controller

a simple controller to use the site-wide full-text search.

It also provides a Result to initialise the advance search, i.e. restricting a search to certain SitemapSectionTags.

It records successful searches (as SearchSuggestion) and fruitless searches (as SearchFailure). The SearchSuggestions can be used for an auto-completion search with the SearchSiteSuggestions controller.

The SearchSiteJoblet can be configured to remove stale suggestions and failures.

The actual search query is expected to be the first value of the Parameter search. A limitation to SitemapNodes belonging to specific SitemapSectionTags can be provided in the Parameter sectionTag with the SitemapSectionTag.id as the value.

Version:
$Revision: 1832 $
Author:
Thomas Weber
See Also:
SearchSiteConfiguration, SearchSuggestion, SearchFailure, SearchSiteSuggestions, SearchSiteJoblet, SitemapSectionTag

Nested Class Summary
 
Nested classes/interfaces inherited from class org.torweg.pulse.bundle.Controller
Controller.AlwaysRun
 
Constructor Summary
SearchSite()
           
 
Method Summary
 AdvancedSearchResult initAdvancedSearch(Bundle bundle, ServiceRequest request)
          initialises the advanced search view.
 SearchSiteResult searchSite(Bundle bundle, ServiceRequest request)
          delegates the search request to the corresponding worker methods.
protected  void searchSitemap(Bundle bundle, ServiceRequest request, SearchSiteResult result, java.lang.String search, org.hibernate.search.FullTextSession session)
          performs a search on the complete sitemap.
 
Methods inherited from class org.torweg.pulse.bundle.Controller
getAlwaysRun, isAlwaysRun, setAlwaysRun
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchSite

public SearchSite()
Method Detail

searchSite

@Action(value="searchSite", generate=true, stripSitemapID=false)
@Permission(value="searchSite")
public SearchSiteResult searchSite(Bundle bundle, ServiceRequest request)
delegates the search request to the corresponding worker methods.

Parameters:
request - the ServiceRequest as a basic context for the Controller
bundle - the bundle object
Returns:
a Result reprensenting the Sitemap, its root SitemapNode and the children of the root SitemapNode, if present.

initAdvancedSearch

@Action(value="initAdvancedSearch", generate=true, stripSitemapID=false)
@Permission(value="initAdvancedSearch")
public AdvancedSearchResult initAdvancedSearch(Bundle bundle, ServiceRequest request)
initialises the advanced search view.

Parameters:
bundle - the bundle
request - the current request
Returns:
the AdvancedSearchResult with all available tags

searchSitemap

protected void searchSitemap(Bundle bundle, ServiceRequest request, SearchSiteResult result,
                             java.lang.String search,
                             org.hibernate.search.FullTextSession session)
                      throws org.apache.lucene.queryParser.ParseException
performs a search on the complete sitemap.

Parameters:
bundle - the current bundle for configuration access
request - the request
search - the search string
session - the full text session
result - the search result
Throws:
org.apache.lucene.queryParser.ParseException - on errors parsing the search string