Esri Geoportal Server
1.0

com.esri.gpt.catalog.search
Class SearchEngineRest

java.lang.Object
  extended by com.esri.gpt.catalog.search.ASearchEngine
      extended by com.esri.gpt.catalog.search.SearchEngineRest
All Implemented Interfaces:
IRequest<SearchRequestDefinition>

public class SearchEngineRest
extends ASearchEngine

The class SearchEngineCSW. Accesses a CSW repository to send searTch and parse back results. works closely with the csw client jar.


Field Summary
static String DELIMETER_KV
          The Constant DELIMETER_VALUES between key value
static String DELIMETER_KVP
          The Constant DELIMETER key value pair
 
Constructor Summary
SearchEngineRest(RequestContext context)
          Instantiates a new search engine rest.
 
Method Summary
 Map<String,Object> createInstances(StringSet rids)
          Creates instances of this search engines from the rids
 void doSearch()
          Do search.
 URI getConnectionUri()
          Get the connection uri
 String getEndPointMetadataUrl()
          Gets the end point metadata url.
 String getEndPointSearchUrl()
          Gets the end point url.
 String getKeyAbstract()
          Gets the abstract associated with the key
 SearchResultRecord getMetadataAsSearchResultRecord(String uuid)
          Gets the metadata as object.
 String getMetadataAsText(String uuid)
          Gets the metadata as text.
 String getMetadataUrl(String uuid)
          Gets the metadata url for record.
 String getProfileId()
          Gets the profile id.
 String getRecordByIdKvpurl()
          Gets the record by id kvpurl.
 String getSearchQuery()
          Gets the search query.
 SearchGptXslProfiles getXslProfiles()
          Gets the xsl profiles.
 void parseResponse(String xml)
          Parses the response.
 Map<String,String> readDefaultParamValues()
          Gets the default param values as map.
protected  boolean readIsExternalSearch()
          Read is external search.
 Map<String,String> readReplaceParamValues()
          Read replace param values as map.
 SearchXslProfile readXslProfile()
          Read xsl profile.
 void setDefaultParamValues(String defaultParamValues)
          Sets the default param values.
 void setEndPointMetadataUrl(String endPointMetadataUrl)
          Sets the end point metadata url.
 void setEndPointSearchUrl(String endPointUrl)
          Sets the end point url.
 void setProfileId(String profileId)
          Sets the profile id.
 void setRecordByIdKvpurl(String recordByIdKvpurl)
          Sets the record by id kvpurl.
 void setReplaceUrlValues(String replaceUrlValues)
          Sets the replace url values.
 void setXslProfiles(SearchGptXslProfiles xslProfiles)
          Sets the xsl profiles.
 
Methods inherited from class com.esri.gpt.catalog.search.ASearchEngine
checkPagination, getConnectionTimeoutMs, getCredentials, getFactoryAttributes, getHitsOnly, getKey, getMessageBroker, getRequestContext, getRequestDefinition, getResourceLinkBuilder, getResponseTimeoutMs, getSearchTimeInMillis, getTimeInSeconds, init, readInputCharacters, setConnectionTimeoutMs, setConnectionUri, setCredentials, setFactoryAttributes, setHitsOnly, setKey, setMessageBroker, setRequestContext, setRequestDefinition, setResourceLinkBuilder, setResponseTimeout, setSearchTimeInMillis
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELIMETER_KVP

public static final String DELIMETER_KVP
The Constant DELIMETER key value pair

See Also:
Constant Field Values

DELIMETER_KV

public static final String DELIMETER_KV
The Constant DELIMETER_VALUES between key value

See Also:
Constant Field Values
Constructor Detail

SearchEngineRest

public SearchEngineRest(RequestContext context)
Instantiates a new search engine rest.

Parameters:
context - the context
Method Detail

setDefaultParamValues

public void setDefaultParamValues(String defaultParamValues)
Sets the default param values.

Parameters:
defaultParamValues - the new default param values

getEndPointSearchUrl

public String getEndPointSearchUrl()
Gets the end point url.

Returns:
the end point url (trimmed, never null)

setEndPointSearchUrl

public void setEndPointSearchUrl(String endPointUrl)
Sets the end point url.

Parameters:
endPointUrl - the new end point url

getProfileId

public String getProfileId()
Gets the profile id.

Returns:
the profile id (trimmed, never null)

setProfileId

public void setProfileId(String profileId)
Sets the profile id.

Parameters:
profileId - the new profile id

getRecordByIdKvpurl

public String getRecordByIdKvpurl()
                           throws SearchException
Gets the record by id kvpurl.

Returns:
the record by id kvpurl (trimmed, never null)
Throws:
SearchException

setRecordByIdKvpurl

public void setRecordByIdKvpurl(String recordByIdKvpurl)
Sets the record by id kvpurl.

Parameters:
recordByIdKvpurl - the new record by id kvpurl

setReplaceUrlValues

public void setReplaceUrlValues(String replaceUrlValues)
Sets the replace url values.

Parameters:
replaceUrlValues - the new replace url values

getXslProfiles

public SearchGptXslProfiles getXslProfiles()
                                    throws SearchException
Gets the xsl profiles.

Returns:
the xsl profiles
Throws:
SearchException - the search exception

setXslProfiles

public void setXslProfiles(SearchGptXslProfiles xslProfiles)
Sets the xsl profiles.

Parameters:
xslProfiles - the new xsl profiles

getEndPointMetadataUrl

public String getEndPointMetadataUrl()
Gets the end point metadata url.

Returns:
the end point metadata url (trimmed, never null)

setEndPointMetadataUrl

public void setEndPointMetadataUrl(String endPointMetadataUrl)
Sets the end point metadata url.

Parameters:
endPointMetadataUrl - the new end point metadata url

getMetadataUrl

public String getMetadataUrl(String uuid)
                      throws SearchException
Gets the metadata url for record.

Overrides:
getMetadataUrl in class ASearchEngine
Parameters:
uuid - the uuid
Returns:
the metadata url
Throws:
SearchException - the search exception

getConnectionUri

public URI getConnectionUri()
                     throws SearchException
Get the connection uri

Overrides:
getConnectionUri in class ASearchEngine
Returns:
uri representing the search
Throws:
SearchException - if uri from criteria is invalid

doSearch

public void doSearch()
              throws SearchException
Description copied from class: ASearchEngine
Do search. Should update the requestDefinition.searchResult and requestDefinition.searchResult.pageCursor

Specified by:
doSearch in class ASearchEngine
Throws:
SearchException - Exceptions from performing a search

parseResponse

public void parseResponse(String xml)
                   throws SearchException
Parses the response.

Parameters:
xml - the xml
Throws:
SearchException

getMetadataAsSearchResultRecord

public SearchResultRecord getMetadataAsSearchResultRecord(String uuid)
                                                   throws SearchException
Gets the metadata as object.

Specified by:
getMetadataAsSearchResultRecord in class ASearchEngine
Parameters:
uuid - the uuid
Returns:
the metadata as object
Throws:
SearchException - the search exception
See Also:
ASearchEngine.getMetadataAsSearchResultRecord(java.lang.String)

getMetadataAsText

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

Specified by:
getMetadataAsText in class ASearchEngine
Parameters:
uuid - the uuid
Returns:
the metadata as text
Throws:
SearchException - the search exception
See Also:
ASearchEngine.getMetadataAsText(java.lang.String)

readDefaultParamValues

public Map<String,String> readDefaultParamValues()
Gets the default param values as map.

Returns:
the default param values (never null)

readReplaceParamValues

public Map<String,String> readReplaceParamValues()
Read replace param values as map.

Returns:
the map

readXslProfile

public SearchXslProfile readXslProfile()
                                throws SearchException
Read xsl profile.

Returns:
the search xsl profile
Throws:
SearchException - the search exception

getSearchQuery

public String getSearchQuery()
                      throws SearchException
Gets the search query.

Specified by:
getSearchQuery in class ASearchEngine
Returns:
the search query
Throws:
SearchException - the search exception

readIsExternalSearch

protected boolean readIsExternalSearch()
Read is external search.

Specified by:
readIsExternalSearch in class ASearchEngine
Returns:
true, if successful
See Also:
ASearchEngine.readIsExternalSearch()

createInstances

public Map<String,Object> createInstances(StringSet rids)
                                   throws SearchException
Creates instances of this search engines from the rids

Overrides:
createInstances in class ASearchEngine
Parameters:
rids -
Returns:
mapping between rids and search engines instances
Throws:
SearchException

getKeyAbstract

public String getKeyAbstract()
                      throws SearchException
Gets the abstract associated with the key

Overrides:
getKeyAbstract in class ASearchEngine
Returns:
the abstract
Throws:
SearchException

Esri Geoportal Server
1.0

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