public abstract class BaseSearchFormHandler extends GenericFormHandler
| Modifier and Type | Field and Description | 
|---|---|
static java.lang.String | 
CLASS_VERSION  | 
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDSSERVICE_INFO_KEYDEFAULT_LOG_TRACE_STATUSDEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS| Constructor and Description | 
|---|
BaseSearchFormHandler()  | 
| Modifier and Type | Method and Description | 
|---|---|
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. 
 | 
protected boolean | 
doRedirect(DynamoHttpServletRequest pRequest,
          java.lang.String pUrl,
          boolean pBypassUrlValidation)
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. 
 | 
java.util.Map | 
getSuccessURLDynamicParams()
An optional map of dynamic parameter data used to include search
 information in parameters in the success URL. 
 | 
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 | 
setSuccessURLDynamicParams(java.util.Map pParams)
An optional map of dynamic parameter data used to include search
 information in parameters in the success URL. 
 | 
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. 
 | 
addFormException, addUncheckedFormException, afterSet, beforeSet, checkFormRedirect, createFormSubmissionMessage, getCancelURL, getCheckForValidSession, getFormError, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, getUncheckedFormExceptions, handleCancel, handleFormException, handleUncheckedFormException, hasUncheckedFormExceptions, isDeferForwardsAndRedirects, isRestorableForm, isUseForwards, isValidSession, redirectOrForward, resetFormExceptions, setCancelURL, setCheckForValidSession, setDeferForwardsAndRedirects, setFormName, setMessagePort, setMessageSource, setMessageType, setRestorableForm, setSendMessages, setUseForwardsafterGet, beforeGetaddLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService, toStringvlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarningpublic java.util.Map getSuccessURLDynamicParams()
public void setSuccessURLDynamicParams(java.util.Map pParams)
pParams - the success URL dynamic parameter mappublic 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.CollectionFilterFetchingProxypublic ResultsFetchingProxy getResultsFetcher()
atg.search.query.formhandlers.ResultsFetchingProxy, 
atg.search.query.formhandlers.CollectionFilterFetchingProxypublic SearchRequest getSearchRequest()
public java.util.Collection getEnvironmentTargets()
SearchEnvironmentTargetspublic 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 responsepublic 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 stringpublic boolean handleLoad(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws java.io.IOException, javax.servlet.ServletException
pRequest - the dynamo requestpResponse - the dynamo responsejavax.servlet.ServletExceptionjava.io.IOExceptionpublic boolean handleLoadAndSearch(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws java.io.IOException, javax.servlet.ServletException
pRequest - the dynamo requestpResponse - the dynamo responsejavax.servlet.ServletExceptionjava.io.IOExceptionpublic boolean handleConnect(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws java.io.IOException, javax.servlet.ServletException
pRequest - pResponse - java.io.IOExceptionjavax.servlet.ServletExceptionpublic boolean handleSearch(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws java.io.IOException, javax.servlet.ServletException
pRequest - the dynamo requestpResponse - the dynamo responsejavax.servlet.ServletExceptionjava.io.IOExceptionpublic boolean handleClearForm(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest - the dynamo requestpResponse - the dynamo responsejavax.servlet.ServletExceptionjava.io.IOExceptionsetClearFormURL(String)protected boolean doRedirect(DynamoHttpServletRequest pRequest, java.lang.String pUrl) throws java.io.IOException
pRequest - The current DynamoHttpServletRequestpUrl - The String URL to redirect tojava.io.IOExceptionprotected boolean doRedirect(DynamoHttpServletRequest pRequest, java.lang.String pUrl, boolean pBypassUrlValidation) throws java.io.IOException
pRequest - The current DynamoHttpServletRequestpUrl - The String URL to redirect topBypassUrlValidation - Can we bypass URL validation?java.io.IOExceptionprotected SearchResponse search(SearchRequest pSearchRequest, atg.search.client.SearchSession pSession) throws atg.search.client.SearchClientException
pSearchRequest - the requestpSession - the sessionatg.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.IOExceptionjavax.servlet.ServletExceptionpublic 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 sessionprotected SearchResponse afterSearch(SearchRequest pRequest, SearchResponse pResults, atg.search.client.SearchSession pSession)
pRequest - the client query requestpResults - the search resultspSession - the search session