Esri Geoportal Server
1.0

com.esri.gpt.catalog.search
Class SearchCriteria

java.lang.Object
  extended by com.esri.gpt.framework.request.Criteria
      extended by com.esri.gpt.framework.request.QueryCriteria
          extended by com.esri.gpt.catalog.search.SearchCriteria
All Implemented Interfaces:
Serializable

public class SearchCriteria
extends QueryCriteria

The class SearchCriteria. Class for composition of search criteria.

See Also:
Serialized Form

Nested Class Summary
static class SearchCriteria.OptionSaveLocation
          Where to save the search criteria to.
 
Constructor Summary
SearchCriteria()
          Instantiates a new search criteria.
SearchCriteria(Document searchCriteriaDom)
          Instantiates a new search criteria with values of searchCriteriaDom.
SearchCriteria(SearchCriteria criteria)
          Instantiates a new search criteria with the values of the criteria param.
 
Method Summary
 boolean equals(Object obj)
          Tests equality of object.
 SearchCriteria getClone()
          Gets the clone.
 boolean getExpandResultContent()
          Gets the flag indicating whether or not result records should be expanded by default.
 SearchFiltersList getMiscelleniousFilters()
          Gets the filters that do not have attributes in the search criteria.
protected  Set<ISearchFilter> getNewSearchFilters()
          Gets the new search filters.
 String getSavedSearchName()
          Gets the saved search name.
 ISearchFilterContentTypes getSearchFilterContentTypes()
          Gets the search filter content types.
 ISearchFilterKeyword getSearchFilterKeyword()
          Gets the search filter keyword.
 ISearchFilterPagination getSearchFilterPageCursor()
          Gets the page cursor filter.
 ISearchFilterSort getSearchFilterSort()
          Gets the search filter sort.
 ISearchFilterSpatialObj getSearchFilterSpatial()
          Gets the search filter spatial.
 ISearchFilterTemporal getSearchFilterTemporal()
          Gets the search filter temporal.
 ISearchFilterThemes getSearchFilterThemes()
          Gets the search filter themes.
 ISearchFilterURI getSearchFilterUri()
          Gets the search uri Filter.
 URI getSearchUri()
          Gets the search uri.
 void loadSearchCriteria(Document criteriaDom)
          Load search criteria.
 void reset()
          Resets all search filters.
 void resetFilters()
          Reset this.
 void setExpandResultContent(boolean expand)
          Sets the flag indicating whether or not result records should be expanded by default.
 void setMiscelleniousFilters(SearchFiltersList filterObjectList)
          Sets the filter object list.
 void setSavedSearchName(String savedSearchName)
          Sets the saved search name.
 void setSearchFilterContentTypes(ISearchFilterContentTypes searchFilterContentTypes)
          Sets the search filter content types.
 void setSearchFilterKeyword(ISearchFilterKeyword searchFilterKeyword)
          Sets the search filter keyword.
 void setSearchFilterPageCursor(ISearchFilterPagination pageCursorFilter)
          Sets the page cursor filter.
 void setSearchFilterSort(ISearchFilterSort searchFilterSort)
          Sets the search filter sort.
 void setSearchFilterSpatial(ISearchFilterSpatialObj searchFilterSpatial)
          Sets the search filter spatial.
 void setSearchFilterTemporal(ISearchFilterTemporal searchFilterTemporal)
          Sets the search filter temporal.
 void setSearchFilterThemes(ISearchFilterThemes searchFilterThemes)
          Sets the search filter themes.
 void setSearchFilterUri(ISearchFilterURI searchURIFilter)
          Sets the search uri.
 Document toDom()
          The DOM representation of Search Criteria.
 Document toDom(String extraInfo)
          Transform this criteria to its DOM representation.
 Document toDom(String extraInfo, SimpleDateFormat dateFormat)
          To dom.
 String toDom2()
          Convinience method to get DOM as a String.
 String toString()
          String representation of object.
 void validate()
          Validate input.
 void writeRestParameters(Map<String,String> map)
          Write rest parameters.
 
Methods inherited from class com.esri.gpt.framework.request.QueryCriteria
getSortOption, setSortOption
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SearchCriteria

public SearchCriteria()
Instantiates a new search criteria. If class is extended, be sure to use super


SearchCriteria

public SearchCriteria(Document searchCriteriaDom)
               throws SearchException
Instantiates a new search criteria with values of searchCriteriaDom.

Parameters:
searchCriteriaDom - the search criteria dom (never null assumed)
Throws:
SearchException - the search exception

SearchCriteria

public SearchCriteria(SearchCriteria criteria)
               throws SearchException
Instantiates a new search criteria with the values of the criteria param.

Parameters:
criteria - the criteria (assumed never null)
Throws:
SearchException - the search exception
Method Detail

getExpandResultContent

public boolean getExpandResultContent()
Gets the flag indicating whether or not result records should be expanded by default.

Returns:
true if results records should be expanded

setExpandResultContent

public void setExpandResultContent(boolean expand)
Sets the flag indicating whether or not result records should be expanded by default.

Parameters:
expand - true if results records should be expanded

getSavedSearchName

public String getSavedSearchName()
Gets the saved search name.

Returns:
the saved search name (never null)

setSavedSearchName

public void setSavedSearchName(String savedSearchName)
Sets the saved search name.

Parameters:
savedSearchName - the new saved search name

getMiscelleniousFilters

public final SearchFiltersList getMiscelleniousFilters()
Gets the filters that do not have attributes in the search criteria.

Returns:
the filter object list (never null )

setMiscelleniousFilters

public final void setMiscelleniousFilters(SearchFiltersList filterObjectList)
Sets the filter object list.

Parameters:
filterObjectList - the new filter object list

getSearchFilterUri

public ISearchFilterURI getSearchFilterUri()
Gets the search uri Filter.

Returns:
the search uri filter (never null)

setSearchFilterUri

public void setSearchFilterUri(ISearchFilterURI searchURIFilter)
Sets the search uri.

Parameters:
searchURIFilter - the new search uri filter

getSearchFilterPageCursor

public ISearchFilterPagination getSearchFilterPageCursor()
Gets the page cursor filter.

Returns:
the page cursor filter (possibly null)

setSearchFilterPageCursor

public void setSearchFilterPageCursor(ISearchFilterPagination pageCursorFilter)
Sets the page cursor filter. CAUTION: If using faces context DO NOT SET THIS METHOD.

Parameters:
pageCursorFilter - the new page cursor filter

getSearchFilterSpatial

public ISearchFilterSpatialObj getSearchFilterSpatial()
Gets the search filter spatial.

Returns:
the search filter spatial (possibly null)

setSearchFilterSpatial

public void setSearchFilterSpatial(ISearchFilterSpatialObj searchFilterSpatial)
Sets the search filter spatial. CAUTION: If using faces context DO NOT SET THIS METHOD.

Parameters:
searchFilterSpatial - the new search filter spatial

getSearchFilterThemes

public ISearchFilterThemes getSearchFilterThemes()
Gets the search filter themes.

Returns:
the search filter themes (never null)

setSearchFilterThemes

public void setSearchFilterThemes(ISearchFilterThemes searchFilterThemes)
Sets the search filter themes. CAUTION: If using faces context DO NOT SET THIS METHOD.

Parameters:
searchFilterThemes - the new search filter themes

getSearchFilterKeyword

public ISearchFilterKeyword getSearchFilterKeyword()
Gets the search filter keyword.

Returns:
the search filter keyword (never null)

setSearchFilterKeyword

public void setSearchFilterKeyword(ISearchFilterKeyword searchFilterKeyword)
Sets the search filter keyword. CAUTION: If using faces context DO NOT SET THIS METHOD.

Parameters:
searchFilterKeyword - the new search filter keyword

getSearchFilterContentTypes

public ISearchFilterContentTypes getSearchFilterContentTypes()
Gets the search filter content types.

Returns:
the search filter content types (never null)

setSearchFilterContentTypes

public void setSearchFilterContentTypes(ISearchFilterContentTypes searchFilterContentTypes)
Sets the search filter content types. CAUTION: If using faces context DO NOT SET THIS METHOD.

Parameters:
searchFilterContentTypes - the new search filter content types

getSearchFilterSort

public ISearchFilterSort getSearchFilterSort()
Gets the search filter sort.

Returns:
the search filter sort (never null)

setSearchFilterSort

public void setSearchFilterSort(ISearchFilterSort searchFilterSort)
Sets the search filter sort. CAUTION: If using faces context DO NOT SET THIS METHOD.

Parameters:
searchFilterSort - the new search filter sort

getSearchFilterTemporal

public ISearchFilterTemporal getSearchFilterTemporal()
Gets the search filter temporal.

Returns:
the search filter temporal (never null)

setSearchFilterTemporal

public void setSearchFilterTemporal(ISearchFilterTemporal searchFilterTemporal)
Sets the search filter temporal. CAUTION: If using faces context DO NOT SET THIS METHOD.

Parameters:
searchFilterTemporal - the new search filter temporal

resetFilters

public final void resetFilters()
Reset this. Resets all search filters & this. to remove search filters w

See Also:
QueryCriteria.reset()

reset

public final void reset()
Resets all search filters.

Overrides:
reset in class QueryCriteria

validate

public final void validate()
                    throws SearchException
Validate input.

Throws:
SearchException - thrown when validation has errors

toDom

public final Document toDom()
                     throws SearchException
The DOM representation of Search Criteria. ... ... ... ... ... ...

Returns:
the Dom representing the criteria (possibly null)
Throws:
SearchException - Especially if DOM document could not be initialized

toDom

public final Document toDom(String extraInfo,
                            SimpleDateFormat dateFormat)
                     throws SearchException
To dom.

Parameters:
extraInfo - the extra info
dateFormat - the date format
Returns:
the document
Throws:
SearchException - the search exception

toDom

public final Document toDom(String extraInfo)
                     throws SearchException
Transform this criteria to its DOM representation.

Parameters:
extraInfo - Any extra info to be put included in this DOM (can be null)
Returns:
the document (possibly null)
Throws:
SearchException - Especially if DOM document could not be initialized

toDom2

public String toDom2()
              throws SearchException
Convinience method to get DOM as a String.

Returns:
the DOM string representation (never null)
Throws:
SearchException - the search exception

getNewSearchFilters

protected Set<ISearchFilter> getNewSearchFilters()
Gets the new search filters. Should be overridden by customized SearchCriteria child. The child should return a set containing all the new filters implemented

Returns:
the new search filters (possibly null)

loadSearchCriteria

public void loadSearchCriteria(Document criteriaDom)
                        throws SearchException
Load search criteria.

Parameters:
criteriaDom - the criteria XML DOM object (Exception on null)
Throws:
SearchException - exception on error

getSearchUri

public URI getSearchUri()
                 throws SearchException
Gets the search uri. If no ISearchCriteria object was found in filter list then the gpt.xml search url will be used

Returns:
the search uri (never null if configured properly)
Throws:
SearchException - the search exception

toString

public String toString()
String representation of object.

Overrides:
toString in class Object
Returns:
String representation of object

equals

public boolean equals(Object obj)
Tests equality of object. Relies on the method toDom()

Overrides:
equals in class Object
Parameters:
obj - the obj
Returns:
true if equals, otherwise false

getClone

public SearchCriteria getClone()
                        throws SearchException
Gets the clone.

Returns:
the clone of this
Throws:
SearchException - the search exception

writeRestParameters

public void writeRestParameters(Map<String,String> map)
Write rest parameters.

Parameters:
map - parameters map

Esri Geoportal Server
1.0

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