Esri Geoportal Server
1.0

com.esri.gpt.control.search
Class SearchController

java.lang.Object
  extended by com.esri.gpt.framework.jsf.BaseActionListener
      extended by com.esri.gpt.control.search.SearchController
All Implemented Interfaces:
EventListener, ActionListener, FacesListener
Direct Known Subclasses:
SearchHarvestSitesController

public class SearchController
extends BaseActionListener

The Class SearchController. Controller for search operations. To be used in JSF scope.


Constructor Summary
SearchController()
          Default constructor.
 
Method Summary
protected  void doSearch(int page, boolean doPrefetch)
          Do search.
 HtmlPanelGroup getDetailsPanelGroup()
          Gets the bound HtmlPanelGroup for the details page panel.
 String getDisplayResultsStyle()
          Gets the style attribute for the display results page.
protected  String getEventType(ActionEvent event)
          Gets the event type.
 String getExpandResultCheckboxStyle()
          Gets the style attribute for the expand result check-box.
 String getExpandResultContentStyle()
          Gets the style attribute for the content panel of a result record.
 String getMetadataText(String uuid)
          Gets the metadata text.
 String getMetadataText(String uuid, String catalogUri)
          Gets the metadata text.
 String getResourceUrl()
          Gets resource URL.
protected  String getRestSearchRequestUrl(String format)
          Gets the rest search request url.
 String getRestSearchRequestUrlAtom()
          Gets the rest search request url atom.
 String getRestSearchRequestUrlGeorss()
          Gets the rest search request url georss.
 String getRestSearchRequestUrlHtml()
          Gets the rest search request url html.
 String getRestSearchRequestUrlHtmlFragment()
          Gets the rest search request url html fragment.
 String getRestSearchRequestUrlHtmlResultsJsf()
          Gets the rest search request url html results jsf.
 String getRestSearchRequestUrlJson()
          Gets the rest search request url json.
 String getRestSearchRequestUrlKml()
          Gets the rest search request url kml.
 List<SelectItem> getSavedSearches()
          Gets the collection of saved searches for this user.
 String getSavedSearchesPanelStyle()
          Deprecated. since version 1
 String getSaveSearchStyle()
          Gets the style attribute for the save search control.
 SearchCriteria getSearchCriteria()
          Gets the search criteria.
protected  ASearchEngine getSearchDao()
          Gets the search dao.
 SearchEvents getSearchEvent()
          Gets the search event.
 SearchResult getSearchResult()
          Gets the search result.
 boolean getWasSearched()
          Gets the flag indicating whether or not a search was performed.
 void prepareView()
          Fired at the start of the view phase for the search page.
 String processRequestParams()
          Does process request parameters.
protected  void processSearchActions(ActionEvent event, RequestContext context)
          ActionListener method
 void processSubAction(ActionEvent event, RequestContext context)
          Main actionListener method for this class.
 void setDetailsPanelGroup(HtmlPanelGroup htmlPanelGroup)
          Sets the bound HtmlPanelGroup for the details page panel.
 void setResourceUrl(String resourceUrl)
          Sets resource URL.
 void setSavedSearchesPanelStyle(String style)
          Deprecated. since version 1
 void setSearchCriteria(SearchCriteria searchCriteria)
          Sets the search criteria.
 void setSearchResult(SearchResult searchResult)
          Sets the search result.
 void setWasSearched(boolean wasSearched)
          Sets the flag indicating whether or not a search was performed.
 
Methods inherited from class com.esri.gpt.framework.jsf.BaseActionListener
assertLoggedIn, authorizeAction, extractMessageBroker, extractRequestContext, getContextBroker, getKey, getLogger, getNavigationOutcome, getPrepareView, getSecurityRoles, getSecurityRoleSet, handleException, onExecutionPhaseCompleted, onExecutionPhaseStarted, onPrepareView, onPrepareViewCompleted, onPrepareViewStarted, processAction, setKey, setNavigationOutcome, setPrepareView, setSecurityRoles
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchController

public SearchController()
Default constructor.

Method Detail

getDetailsPanelGroup

public HtmlPanelGroup getDetailsPanelGroup()
Gets the bound HtmlPanelGroup for the details page panel.
This object is used during the Faces component binding process.

Returns:
the bound HtmlPanelGroup

setDetailsPanelGroup

public void setDetailsPanelGroup(HtmlPanelGroup htmlPanelGroup)
Sets the bound HtmlPanelGroup for the details page panel.
This object is used during the Faces component binding process.

Parameters:
htmlPanelGroup - the bound HtmlPanelGroup

getResourceUrl

public String getResourceUrl()
Gets resource URL.

Returns:
resource URL

setResourceUrl

public void setResourceUrl(String resourceUrl)
Sets resource URL.

Parameters:
resourceUrl - resource URL

getDisplayResultsStyle

public String getDisplayResultsStyle()
Gets the style attribute for the display results page.

Returns:
the style

getExpandResultCheckboxStyle

public String getExpandResultCheckboxStyle()
Gets the style attribute for the expand result check-box.

Returns:
the style (display none or empty)

getExpandResultContentStyle

public String getExpandResultContentStyle()
Gets the style attribute for the content panel of a result record.

Returns:
the style (display none or block)

getSavedSearches

public List<SelectItem> getSavedSearches()
Gets the collection of saved searches for this user.

Returns:
the user's saved searches

getSavedSearchesPanelStyle

public String getSavedSearchesPanelStyle()
Deprecated. since version 1

Gets the style attribute for the saved searches panel.

Returns:
the style

setSavedSearchesPanelStyle

public void setSavedSearchesPanelStyle(String style)
Deprecated. since version 1

Sets the style attribute for the saved searches panel.

Parameters:
style - the style

getSaveSearchStyle

public String getSaveSearchStyle()
Gets the style attribute for the save search control.

Returns:
the style

getSearchCriteria

public SearchCriteria getSearchCriteria()
Gets the search criteria.

Returns:
the search criteria (never null)

setSearchCriteria

public void setSearchCriteria(SearchCriteria searchCriteria)
Sets the search criteria.

Parameters:
searchCriteria - the new search criteria

getSearchEvent

public SearchEvents getSearchEvent()
Gets the search event.

Returns:
the search event (never null)

getSearchResult

public SearchResult getSearchResult()
Gets the search result.

Returns:
the search result (never null)

setSearchResult

public void setSearchResult(SearchResult searchResult)
Sets the search result.

Parameters:
searchResult - the new search result

getWasSearched

public boolean getWasSearched()
Gets the flag indicating whether or not a search was performed.

Returns:
true if a search was performed.

setWasSearched

public void setWasSearched(boolean wasSearched)
Sets the flag indicating whether or not a search was performed.

Parameters:
wasSearched - true if a search was performed

prepareView

public void prepareView()
Fired at the start of the view phase for the search page.


processSubAction

public void processSubAction(ActionEvent event,
                             RequestContext context)
                      throws AbortProcessingException,
                             Exception
Main actionListener method for this class. Called by superClass

Overrides:
processSubAction in class BaseActionListener
Parameters:
event - The event information
context - Request Context Information
Throws:
AbortProcessingException - Exception on error
Exception - Exception on error

processRequestParams

public String processRequestParams()
Does process request parameters. It is used to process 'uuid' parameter to fetch metadata details.

Returns:
empty string

processSearchActions

protected void processSearchActions(ActionEvent event,
                                    RequestContext context)
                             throws AbortProcessingException,
                                    Exception
ActionListener method

Parameters:
event - The event information
context - Request Context Information
Throws:
AbortProcessingException - Exception on error
Exception - Exception on error

getEventType

protected String getEventType(ActionEvent event)
Gets the event type.

Parameters:
event - the event
Returns:
the event type

doSearch

protected void doSearch(int page,
                        boolean doPrefetch)
                 throws SearchException
Do search.

Parameters:
page - the page number (if page <= 0, last page in session will be used)
doPrefetch - the do prefetch
Throws:
SearchException - the search exception

getMetadataText

public String getMetadataText(String uuid)
                       throws SearchException
Gets the metadata text.

Parameters:
uuid - the uuid
Returns:
the metadata text
Throws:
SearchException - rethrows getMetadataText(uuid, null)

getMetadataText

public String getMetadataText(String uuid,
                              String catalogUri)
                       throws SearchException
Gets the metadata text.

Parameters:
uuid - the uuid
catalogUri - the catalog uri
Returns:
the metadata text
Throws:
SearchException - the search exception

getSearchDao

protected ASearchEngine getSearchDao()
                              throws SearchException
Gets the search dao.

Returns:
the search dao
Throws:
SearchException - the search exception

getRestSearchRequestUrlAtom

public String getRestSearchRequestUrlAtom()
Gets the rest search request url atom.

Returns:
the rest search request url atom

getRestSearchRequestUrlGeorss

public String getRestSearchRequestUrlGeorss()
Gets the rest search request url georss.

Returns:
the rest search request url georss

getRestSearchRequestUrlJson

public String getRestSearchRequestUrlJson()
Gets the rest search request url json.

Returns:
the rest search request url json

getRestSearchRequestUrlHtml

public String getRestSearchRequestUrlHtml()
Gets the rest search request url html.

Returns:
the rest search request url html

getRestSearchRequestUrlHtmlFragment

public String getRestSearchRequestUrlHtmlFragment()
Gets the rest search request url html fragment.

Returns:
the rest search request url html fragment

getRestSearchRequestUrlHtmlResultsJsf

public String getRestSearchRequestUrlHtmlResultsJsf()
Gets the rest search request url html results jsf.

Returns:
the rest search request url html results jsf

getRestSearchRequestUrlKml

public String getRestSearchRequestUrlKml()
Gets the rest search request url kml.

Returns:
the rest search request url kml

getRestSearchRequestUrl

protected String getRestSearchRequestUrl(String format)
Gets the rest search request url.

Parameters:
format - the format
Returns:
the rest search request url

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.