|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.droplet.EmptyFormHandler atg.droplet.GenericFormHandler atg.search.formhandlers.BaseSearchFormHandler
public abstract class BaseSearchFormHandler
This class provides the generic functionality for executing queries against the search server and retrieving results. Subclasses implement request-specific functionality.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
Fields inherited from class atg.droplet.GenericFormHandler |
---|
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
BaseSearchFormHandler()
|
Method Summary | |
---|---|
protected SearchResponse |
afterSearch(SearchRequest pRequest,
SearchResponse pResults,
atg.search.client.SearchSession pSession)
This method is called just after a search has been executed and is intended to allow subclasses an opportunity to update the search session or modify the search results object. |
protected SearchRequest |
beforeSearch(SearchRequest pRequest,
atg.search.client.SearchSession pSession)
This method is called just before a search is executed and is intended to allow subclasses an opportunity to make last minute changes to the request object or to update the search context. |
atg.search.client.SearchSession |
createSearchSession(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Create the SearchSession by first calling createSessionConfig() to obtain a configuration, then by calling ESSearchService.createSession() |
protected boolean |
doRedirect(DynamoHttpServletRequest pRequest,
java.lang.String pUrl)
Performs an actual redirection to another page for the given URL. |
java.lang.String |
getClearFormURL()
Get the optional URL to redirect to when handleClearQuery() is invoked |
java.util.Collection |
getEnvironmentTargets()
|
java.lang.String |
getErrorURL()
Get the optional url to redirect to when an error is encountered in handleSearch() |
java.util.Collection |
getLogicalPartitionNames()
|
java.lang.String |
getRedirect()
|
java.util.List<java.lang.String> |
getRedirects()
|
java.lang.String |
getRequestFile()
|
ResultsFetchingProxy |
getResultsFetcher()
Get the results fetcher. |
atg.repository.search.testing.SearchAssetTools |
getSearchAssetTools()
|
SearchClient |
getSearchClient()
Get the SearchClient, the interface to the search service |
SearchContext |
getSearchContext()
Get the session scoped search context |
boolean |
getSearchException()
|
java.util.Vector |
getSearchExceptions()
|
SearchRedirectProcessor[] |
getSearchRedirectProcessors()
|
SearchRequest |
getSearchRequest()
|
SearchRequestProcessor[] |
getSearchRequestProcessors()
|
SearchResponse |
getSearchResponse()
|
SearchResponseProcessor[] |
getSearchResponseProcessors()
|
atg.search.client.SearchSession |
getSearchSession(java.lang.String pRequestChainToken)
Return the search session from the search context or null if one does not yet exist. |
java.lang.String |
getSuccessURL()
Get the optional url to redirect to on a successful search. |
RepositoryItem |
getUserProfile()
Get the user profile repository item or null. |
boolean |
handleClearForm(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Handle clear form |
boolean |
handleConnect(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Connects to the specified search instance. |
protected boolean |
handleErrorCondition(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse,
java.lang.Exception pException)
|
boolean |
handleLoad(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Loads an existing request from an xml file. |
boolean |
handleLoadAndSearch(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Loads an existing request from an xml file and submits the request. |
boolean |
handleSearch(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Handle new search request. |
boolean |
isForceDeployedOnlyAssets()
If set to true then the form handler will ensure that the version of assets used by the processors is the last deployed version. |
boolean |
isLoggingVerboseResponseXML()
When true, the search response at all stages of the post-search request processing stages will be logged. |
boolean |
isPageRequest()
|
boolean |
isRedirectEnabled()
If set to true then the form handler will check the search results for a redirect URL and if found redirect to it. |
boolean |
isShowDetailedResults()
|
boolean |
isShowXml()
|
protected SearchResponse |
search(SearchRequest pSearchRequest,
atg.search.client.SearchSession pSession)
Override this to control how search is executed. |
void |
setClearFormURL(java.lang.String pClearFormURL)
Set the optional URL to go to when handleClearQuery() is invoked. |
void |
setErrorURL(java.lang.String pErrorURL)
Set the optional url to redirect to when an error is encountered in handleSearch() |
void |
setForceDeployedOnlyAssets(boolean pForceDeployedOnlyAssets)
If set to true then the form handler will ensure that the version of assets used by the processors is the last deployed version. |
void |
setLoggingVerboseResponseXML(boolean pLogging)
When true, the search response at all stages of the post-search request processing stages will be logged. |
void |
setPageRequest(boolean pPageRequest)
|
void |
setRedirectEnabled(boolean pRedirectEnabled)
If set to true then the form handler will check the search results for a redirect URL and if found redirect to it. |
void |
setRequestFile(java.lang.String requestFile)
|
void |
setResultsFetcher(ResultsFetchingProxy pResultsFetcher)
Set a results fetching proxy. |
void |
setSearchAssetTools(atg.repository.search.testing.SearchAssetTools pSearchAssetTools)
|
void |
setSearchContext(SearchContext pSearchContext)
Set the session scoped search context object |
void |
setSearchExceptions(java.util.Vector pSearchExceptions)
|
void |
setSearchRedirectProcessors(SearchRedirectProcessor[] pSearchRedirectProcessors)
|
void |
setSearchRequest(SearchRequest pRequest)
|
void |
setSearchRequestProcessors(SearchRequestProcessor[] pSearchRequestProcessors)
|
void |
setSearchResponse(SearchResponse pResponse)
|
void |
setSearchResponseProcessors(SearchResponseProcessor[] pSearchResponseProcessors)
|
void |
setShowDetailedResults(boolean pShowDetailedResults)
Only used for excluding detailed results from rendered HTML. |
void |
setShowXml(boolean pShowXml)
Used for excluding original request and response XML from rendered HTML. |
void |
setSuccessURL(java.lang.String pSuccessURL)
Set the optional url to redirect to on a successful search (a search which throws no exceptions) |
void |
setUserProfile(RepositoryItem pUserProfile)
Set the user user profile for the user executing the search |
protected abstract SearchRequest |
stringToRequest(java.lang.String pString)
Converts XML into a request object. |
Methods inherited from class atg.droplet.EmptyFormHandler |
---|
afterGet, beforeGet |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public BaseSearchFormHandler()
Method Detail |
---|
public boolean isLoggingVerboseResponseXML()
public void setLoggingVerboseResponseXML(boolean pLogging)
pLogging
- true to log response processing verboselypublic boolean isShowXml()
public void setShowXml(boolean pShowXml)
pShowXml
- true to enable XML displaypublic boolean isShowDetailedResults()
public void setShowDetailedResults(boolean pShowDetailedResults)
pShowDetailedResults
- true to enable detailed displaypublic void setPageRequest(boolean pPageRequest)
public boolean isPageRequest()
public void setSearchRequestProcessors(SearchRequestProcessor[] pSearchRequestProcessors)
public SearchRequestProcessor[] getSearchRequestProcessors()
public void setSearchResponseProcessors(SearchResponseProcessor[] pSearchResponseProcessors)
public SearchResponseProcessor[] getSearchResponseProcessors()
public void setSearchRedirectProcessors(SearchRedirectProcessor[] pSearchRedirectProcessors)
public SearchRedirectProcessor[] getSearchRedirectProcessors()
public atg.repository.search.testing.SearchAssetTools getSearchAssetTools()
public void setSearchAssetTools(atg.repository.search.testing.SearchAssetTools pSearchAssetTools)
public boolean isForceDeployedOnlyAssets()
public void setForceDeployedOnlyAssets(boolean pForceDeployedOnlyAssets)
pForceDeployedOnlyAssets
- boolean true to force the asset version to the last deployed version.public boolean isRedirectEnabled()
public void setRedirectEnabled(boolean pRedirectEnabled)
public java.lang.String getRedirect()
public java.util.List<java.lang.String> getRedirects()
public void setResultsFetcher(ResultsFetchingProxy pResultsFetcher)
pResultsFetcher
- the results fetcher proxyatg.search.query.formhandlers.ResultsFetchingProxy
,
atg.search.query.formhandlers.CollectionFilterFetchingProxy
public ResultsFetchingProxy getResultsFetcher()
atg.search.query.formhandlers.ResultsFetchingProxy
,
atg.search.query.formhandlers.CollectionFilterFetchingProxy
public SearchRequest getSearchRequest()
public java.util.Collection getEnvironmentTargets()
SearchEnvironmentTarget
spublic java.util.Collection getLogicalPartitionNames()
public void setClearFormURL(java.lang.String pClearFormURL)
pClearFormURL
- the url or nullpublic java.lang.String getClearFormURL()
public void setErrorURL(java.lang.String pErrorURL)
pErrorURL
- the url or nullpublic java.lang.String getErrorURL()
public void setSuccessURL(java.lang.String pSuccessURL)
pSuccessURL
- the success url or nulpublic java.lang.String getSuccessURL()
public void setSearchContext(SearchContext pSearchContext)
pSearchContext
- the search contextpublic SearchContext getSearchContext()
public atg.search.client.SearchSession getSearchSession(java.lang.String pRequestChainToken)
pRequestChainToken
-
public atg.search.client.SearchSession createSearchSession(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
pRequest
- the Dynamo http requestpResponse
- the Dynamo http response
public SearchClient getSearchClient() throws atg.search.client.SearchClientException
atg.search.client.SearchClientException
- if unable to retrieve the SearchClientpublic void setUserProfile(RepositoryItem pUserProfile)
pUserProfile
- the user profile repository item or nullpublic RepositoryItem getUserProfile()
public void setSearchResponse(SearchResponse pResponse)
pResponse
- the search responsepublic SearchResponse getSearchResponse()
public java.lang.String getRequestFile()
public void setRequestFile(java.lang.String requestFile)
requestFile
- path to xml request fileprotected abstract SearchRequest stringToRequest(java.lang.String pString)
pString
- XML request string
public boolean handleLoad(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws java.io.IOException, javax.servlet.ServletException
pRequest
- the dynamo requestpResponse
- the dynamo response
javax.servlet.ServletException
java.io.IOException
public boolean handleLoadAndSearch(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws java.io.IOException, javax.servlet.ServletException
pRequest
- the dynamo requestpResponse
- the dynamo response
javax.servlet.ServletException
java.io.IOException
public boolean handleConnect(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws java.io.IOException, javax.servlet.ServletException
pRequest
- pResponse
-
java.io.IOException
javax.servlet.ServletException
public boolean handleSearch(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws java.io.IOException, javax.servlet.ServletException
pRequest
- the dynamo requestpResponse
- the dynamo response
javax.servlet.ServletException
java.io.IOException
public boolean handleClearForm(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- the dynamo requestpResponse
- the dynamo response
javax.servlet.ServletException
java.io.IOException
setClearFormURL(String)
protected boolean doRedirect(DynamoHttpServletRequest pRequest, java.lang.String pUrl) throws java.io.IOException
pRequest
- The current DynamoHttpServletRequestpUrl
- The String URL to redirect to
java.io.IOException
protected SearchResponse search(SearchRequest pSearchRequest, atg.search.client.SearchSession pSession) throws atg.search.client.SearchClientException
pSearchRequest
- the requestpSession
- the session
atg.search.client.SearchClientException
- if something failsprotected boolean handleErrorCondition(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, java.lang.Exception pException) throws java.io.IOException, javax.servlet.ServletException
java.io.IOException
javax.servlet.ServletException
public boolean getSearchException()
public java.util.Vector getSearchExceptions()
public void setSearchExceptions(java.util.Vector pSearchExceptions)
public void setSearchRequest(SearchRequest pRequest)
protected SearchRequest beforeSearch(SearchRequest pRequest, atg.search.client.SearchSession pSession)
pRequest
- the client query requestpSession
- the search session
protected SearchResponse afterSearch(SearchRequest pRequest, SearchResponse pResults, atg.search.client.SearchSession pSession)
pRequest
- the client query requestpResults
- the search resultspSession
- the search session
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |