Esri Geoportal Server
1.0

com.esri.gpt.catalog.search
Class SearchConfig

java.lang.Object
  extended by com.esri.gpt.framework.context.Configuration
      extended by com.esri.gpt.catalog.search.SearchConfig

public class SearchConfig
extends Configuration

The Class SearchConfig. Holds the searchConfiguration. Do not instantiate this class to get the configuration. The configuration should be accessed through the ApplicationContext or through the convinience method getConfiguredInstance.

See Also:
ApplicationContext

Field Summary
static String DEFAULT_CSW_PROFILE
          The Constant DEFAULT CSW PROFILE.
static int DEFAULT_DISTR_TIMEOUT
          The Constant DEFAULT_DISTR_TIMEOUT.
static int DEFAULT_MAX_SAVED_SEARCHES
          The dConstant DEFAULT MAXIMUM SAVED SEARCHES *.
static int DEFAULT_MAXIMUM_SEARCHSITES
          The Constant DEFAULT_MAXIMUM_SEARCHSITES.
static int DEFAULT_RESULTS_PER_PAGE
          The default number of results per page *.
static int DEFAULT_TIMEOUT
          The Constant DEFAULT_TIMEOUT.
 
Constructor Summary
SearchConfig()
          Instantiates a new search configuration.
 
Method Summary
 boolean getAllowExternalSearch()
          Checks if is allow external search.
static SearchConfig getConfiguredInstance()
          Convinience method.
 String getCswProfile()
          Gets the CSW profile.
 Envelope getDefaultEnvelope()
          Gets the default envelope.
 String getDefaultViewerUrl()
          Gets the default viewer url.
 int getDistributedSearchMaxSelectedSites()
          Gets the distributed search max selected sites.
 int getDistributedSearchTimeoutMillisecs()
          Gets the distributed search timeout millisecs.
 XsltTemplate getGptToCswXsltTemplate()
          Gets the gpt to csw xslt template.
 SearchGptXslProfiles getGptXslProfiles()
          Gets the gpt xsl profiles.
 String getJsfSuffix()
          Gets the jsf suffix.
 ArrayList<MapViewerConfigs> getMapViewerInstances()
          Gets the map viewer instances.
 String getMapViewerUrl()
          Gets the map viewer url.
 URL getMapviewerUrl2()
          Gets the mapviewer as java.net.URL object.
 int getMaxSavedSearches()
          Gets the max saved searches.
 String getMvsPassword()
          Gets the mvs password.
 String getMvsUsername()
          Gets the mvs username.
 int getResultsPerPage()
          Gets the results per page.
 String getResultsReviewsShown()
          Gets the results reviews shown.
 LinkedHashMap<String,Map<String,String>> getSearchFactoryRepos()
          Gets the search factory.
 URI getSearchUri()
          Gets the Search URI.
 int getTimeOut()
          Gets the time out.
 void setAllowExternalSearch(boolean allowExternalSearch)
          Sets the allow external search.
 void setCswProfile(String cswProfile)
          Sets the CSW profile.
 void setDefaultEnvelope(Envelope defaultEnvelope)
          Sets the default envelope.
 void setDistributedSearchMaxSelectedSites(String distributedSearchMaxSelectedSites)
          Sets the distributed search max selected sites.
 void setDistributedSearchTimeoutMillisecs(String distributedSearchTimeoutMillisecs)
          Sets the distributed search timeout millisecs.
 void setGptToCswXsltPath(String path)
          Sets the gpt to csw xslt.
 void setJsfSuffix(String jsfSuffix)
          Sets the jsf suffix.
 void setMapViewerInstances(ArrayList<MapViewerConfigs> mapViewerInstances)
          Sets the map viewer instances.
 void setMapViewerUrl(String mapViewerUrl)
          Sets the map viewer url.
 void setMaxSavedSearches(String maxSavedSearches)
          Sets the max saved searches.
 void setMvsPassword(String mvsPassword)
          Sets the mvs password.
 void setMvsUsername(String mvsUsername)
          Sets the mvs username.
 void setResultsPerPage(String resultsPerPage)
          Sets the results per page.
 void setResultsReviewsShown(String resultsReviewsShown)
          Sets the results reviews shown.
 void setSearchFactoryRepos(LinkedHashMap<String,Map<String,String>> searchFactory)
          Sets the search factory.
 void setSearchUri(String searchUri)
          Sets the search URI.
 void setTimeOut(String timeOut)
          Sets the time out.
 String toString()
          To string.
 void validate()
          Validate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_RESULTS_PER_PAGE

public static final int DEFAULT_RESULTS_PER_PAGE
The default number of results per page *.

See Also:
Constant Field Values

DEFAULT_TIMEOUT

public static final int DEFAULT_TIMEOUT
The Constant DEFAULT_TIMEOUT.

See Also:
Constant Field Values

DEFAULT_DISTR_TIMEOUT

public static final int DEFAULT_DISTR_TIMEOUT
The Constant DEFAULT_DISTR_TIMEOUT.

See Also:
Constant Field Values

DEFAULT_MAXIMUM_SEARCHSITES

public static final int DEFAULT_MAXIMUM_SEARCHSITES
The Constant DEFAULT_MAXIMUM_SEARCHSITES.

See Also:
Constant Field Values

DEFAULT_CSW_PROFILE

public static final String DEFAULT_CSW_PROFILE
The Constant DEFAULT CSW PROFILE.

See Also:
Constant Field Values

DEFAULT_MAX_SAVED_SEARCHES

public static final int DEFAULT_MAX_SAVED_SEARCHES
The dConstant DEFAULT MAXIMUM SAVED SEARCHES *.

See Also:
Constant Field Values
Constructor Detail

SearchConfig

public SearchConfig()
Instantiates a new search configuration.

Method Detail

getAllowExternalSearch

public boolean getAllowExternalSearch()
Checks if is allow external search.

Returns:
true, if is allow external search

setAllowExternalSearch

public void setAllowExternalSearch(boolean allowExternalSearch)
Sets the allow external search.

Parameters:
allowExternalSearch - the new allow external search

getTimeOut

public int getTimeOut()
Gets the time out.

Returns:
the time out

setTimeOut

public void setTimeOut(String timeOut)
Sets the time out.

Parameters:
timeOut - the new time out

getDefaultEnvelope

public Envelope getDefaultEnvelope()
Gets the default envelope.

Returns:
the default envelope (never null)

setDefaultEnvelope

public void setDefaultEnvelope(Envelope defaultEnvelope)
Sets the default envelope.

Parameters:
defaultEnvelope - the new default envelope

getJsfSuffix

public String getJsfSuffix()
Gets the jsf suffix.

Returns:
the jsf suffix (trimmed, never null, default = ".page")

setJsfSuffix

public void setJsfSuffix(String jsfSuffix)
Sets the jsf suffix.

Parameters:
jsfSuffix - the new jsf suffix

getMapViewerUrl

public String getMapViewerUrl()
Gets the map viewer url.

Returns:
the map viewer url (trimmed never null)

setMapViewerUrl

public void setMapViewerUrl(String mapViewerUrl)
Sets the map viewer url.

Parameters:
mapViewerUrl - the new map viewer url

getGptToCswXsltTemplate

public XsltTemplate getGptToCswXsltTemplate()
                                     throws SearchException
Gets the gpt to csw xslt template.

Returns:
the gpt to csw xslt template
Throws:
SearchException - the search exception
Searchception - xlst template not initialized by configuration

getResultsPerPage

public int getResultsPerPage()
Gets the results per page.

Returns:
the results per page

setResultsPerPage

public void setResultsPerPage(String resultsPerPage)
Sets the results per page.

Parameters:
resultsPerPage - the results per page

getGptXslProfiles

public SearchGptXslProfiles getGptXslProfiles()
                                       throws SearchException
Gets the gpt xsl profiles.

Returns:
the gpt xsl profiles
Throws:
SearchException - TODO: Make this threadsafe TM

getSearchUri

public URI getSearchUri()
                 throws SearchException
Gets the Search URI.

Returns:
the Search uri (never null)
Throws:
SearchException - if uri configured has a problem

setSearchUri

public void setSearchUri(String searchUri)
Sets the search URI.

Parameters:
searchUri - the new search URI (nulls allowed)

getCswProfile

public String getCswProfile()
Gets the CSW profile. If not configured, the default profile returned is CSW.OGCCORE.ESRI

Returns:
the CSW profile (trimmed, never null )

setCswProfile

public void setCswProfile(String cswProfile)
Sets the CSW profile.

Parameters:
cswProfile - the new CSW profile

setGptToCswXsltPath

public void setGptToCswXsltPath(String path)
Sets the gpt to csw xslt.

Parameters:
path - the new gpt to csw xslt file path
Throws:
ConfigurationException - If resource cannot be initialized

getDistributedSearchTimeoutMillisecs

public int getDistributedSearchTimeoutMillisecs()
Gets the distributed search timeout millisecs.

Returns:
the distributed search timeout millisecs

setDistributedSearchTimeoutMillisecs

public void setDistributedSearchTimeoutMillisecs(String distributedSearchTimeoutMillisecs)
Sets the distributed search timeout millisecs.

Parameters:
distributedSearchTimeoutMillisecs - the new distributed search timeout millisecs

getDistributedSearchMaxSelectedSites

public int getDistributedSearchMaxSelectedSites()
Gets the distributed search max selected sites.

Returns:
the distributed search max selected sites

setDistributedSearchMaxSelectedSites

public void setDistributedSearchMaxSelectedSites(String distributedSearchMaxSelectedSites)
Sets the distributed search max selected sites.

Parameters:
distributedSearchMaxSelectedSites - the new distributed search max selected sites

setMapViewerInstances

public void setMapViewerInstances(ArrayList<MapViewerConfigs> mapViewerInstances)
Sets the map viewer instances.

Parameters:
mapViewerInstances - the new map viewer instances

getMaxSavedSearches

public int getMaxSavedSearches()
Gets the max saved searches.

Returns:
the max saved searches

setMaxSavedSearches

public void setMaxSavedSearches(String maxSavedSearches)
Sets the max saved searches.

Parameters:
maxSavedSearches - the new max saved searches

getMvsUsername

public String getMvsUsername()
Gets the mvs username.

Returns:
the mvs username (trimmed, never null)

setMvsUsername

public void setMvsUsername(String mvsUsername)
Sets the mvs username.

Parameters:
mvsUsername - the new mvs username

getMvsPassword

public String getMvsPassword()
Gets the mvs password.

Returns:
the mvs password (trimmed, never null)

setMvsPassword

public void setMvsPassword(String mvsPassword)
Sets the mvs password.

Parameters:
mvsPassword - the new mvs password

getSearchFactoryRepos

public LinkedHashMap<String,Map<String,String>> getSearchFactoryRepos()
Gets the search factory.

Returns:
the search factory (never null)

setSearchFactoryRepos

public void setSearchFactoryRepos(LinkedHashMap<String,Map<String,String>> searchFactory)
Sets the search factory.

Parameters:
searchFactory - the new search factory

getMapViewerInstances

public ArrayList<MapViewerConfigs> getMapViewerInstances()
Gets the map viewer instances.

Returns:
the map viewer instances (possibly null)

getResultsReviewsShown

public String getResultsReviewsShown()
Gets the results reviews shown.

Returns:
the results reviews shown (always either "none", "only-reviewed" or "all")

setResultsReviewsShown

public void setResultsReviewsShown(String resultsReviewsShown)
Sets the results reviews shown.

Parameters:
resultsReviewsShown - the new results reviews shown

getConfiguredInstance

public static SearchConfig getConfiguredInstance()
Convinience method. Gets the configured instance.

Returns:
the configured instance (never null)
Throws:
ConfigurationException - if SearchConfig is null in ApplicationContext

toString

public String toString()
To string.

Overrides:
toString in class Object
Returns:
String representing object
See Also:
Object.toString()

validate

public void validate()
Validate. Triggers gets which print errors

Throws:
ConfigurationException - if configuration parameters are wrong

getMapviewerUrl2

public URL getMapviewerUrl2()
                     throws SearchException
Gets the mapviewer as java.net.URL object.

Returns:
the mapviewer url (never null)
Throws:
SearchException - If mapvewer url was found to be errant

getDefaultViewerUrl

public String getDefaultViewerUrl()
Gets the default viewer url.

Returns:
the default viewer url (never null, trimmed)

Esri Geoportal Server
1.0

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