@Bindable(prefix="EToolsDocumentSource") public class EToolsDocumentSource extends RemoteXmlSimpleSearchEngineBase
contact@comcepta.com
.Modifier and Type | Class and Description |
---|---|
static class |
EToolsDocumentSource.Country
Enumeration for countries supported by
EToolsDocumentSource , see
country . |
static class |
EToolsDocumentSource.DataSources
Enumeration for the data sources modes supported by
EToolsDocumentSource ,
see dataSources . |
static class |
EToolsDocumentSource.Language
Enumeration for languages supported by
EToolsDocumentSource , see
language . |
Modifier and Type | Field and Description |
---|---|
EToolsDocumentSource.Country |
country
Determines the country of origin for the returned search results.
|
String |
customerId
eTools customer identifier.
|
EToolsDocumentSource.DataSources |
dataSources
Determines which data sources to search.
|
EToolsDocumentSource.Language |
language
Determines the language of the returned search results.
|
String |
partnerId
eTools partner identifier.
|
boolean |
safeSearch
If enabled, excludes offensive content from the results.
|
String |
serviceUrlBase
Base URL for the eTools service
|
String |
site
Site URL or comma-separated list of site site URLs to which the returned results
should be restricted.
|
int |
timeout
Maximum time in milliseconds to wait for all data sources to return results.
|
redirectStrategy, xmlDocumentSourceHelper
compressed, documents, POSTPROCESSING, query, results, resultsTotal, SERVICE, start, statistics
Constructor and Description |
---|
EToolsDocumentSource() |
Modifier and Type | Method and Description |
---|---|
protected void |
afterFetch(SearchEngineResponse response)
Called after a single search engine response has been fetched.
|
void |
beforeProcessing()
Invoked after the attributes marked with
Processing and Input
annotations have been bound, but before a call to IProcessingComponent.process() . |
protected String |
buildServiceUrl()
Builds the URL from which XML stream will be fetched.
|
protected SearchEngineResponse |
fetchSearchResponse()
Requests and returns results from the underlying search engine.
|
protected IResource |
getXsltResource()
Returns the XSLT stylesheet that transforms the custom XML into Carrot2 compliant
XML.
|
afterFetch, getPassword, getUser, getXsltParameters, init, loadProcessingResult
process
clean, urlEncode
afterProcessing, dispose, getContext, getSharedExecutor
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
afterProcessing, dispose
@Input @Processing @Internal @Attribute @Label(value="Service URL") @Level(value=ADVANCED) @Group(value="Service") public String serviceUrlBase
@Input @Processing @Attribute @Label(value="Country") @Level(value=MEDIUM) @Group(value="Filtering") public EToolsDocumentSource.Country country
@Input @Processing @Attribute @Label(value="Language") @Level(value=MEDIUM) @Group(value="Filtering") public EToolsDocumentSource.Language language
@Input @Processing @Attribute @IntRange(min=0) @Label(value="Timeout") @Level(value=ADVANCED) @Group(value="Service") public int timeout
@Input @Processing @Attribute @Label(value="Data sources") @Level(value=ADVANCED) @Group(value="Service") public EToolsDocumentSource.DataSources dataSources
@Input @Processing @Attribute @Label(value="Safe search") @Level(value=BASIC) @Group(value="Filtering") public boolean safeSearch
@Input @Processing @Attribute @Label(value="Site restriction") @Level(value=ADVANCED) @Group(value="Filtering") public String site
@Input @Processing @Attribute @Internal @Label(value="Partner ID") @Level(value=ADVANCED) @Group(value="Service") public String partnerId
@Input @Processing @Attribute @Label(value="Customer ID") @Level(value=MEDIUM) @Group(value="Service") public String customerId
contact@comcepta.com
to obtain your customer identifier.protected IResource getXsltResource()
RemoteXmlSimpleSearchEngineBase
getXsltResource
in class RemoteXmlSimpleSearchEngineBase
protected String buildServiceUrl()
RemoteXmlSimpleSearchEngineBase
buildServiceUrl
in class RemoteXmlSimpleSearchEngineBase
protected SearchEngineResponse fetchSearchResponse() throws Exception
SimpleSearchEngine
fetchSearchResponse
in class RemoteXmlSimpleSearchEngineBase
Exception
- in case of problems with the underlying search enginepublic void beforeProcessing() throws ProcessingException
IProcessingComponent
Processing
and Input
annotations have been bound, but before a call to IProcessingComponent.process()
. In this
method, the processing component should perform any initializations based on the
runtime attributes. This method is called once per request.beforeProcessing
in interface IProcessingComponent
beforeProcessing
in class RemoteXmlSimpleSearchEngineBase
ProcessingException
- when processing cannot start, e.g. because some
attributes were not bound. If thrown, the IProcessingComponent.process()
method
will not be called. Instead, IProcessingComponent.afterProcessing()
will be called
immediately to allow clean-up actions, and the component will be ready
to accept further requests or to be disposed of. Finally, the exception
will be rethrown from the controller method that caused the component
to perform processing.protected void afterFetch(SearchEngineResponse response)
SearchEngineBase
afterFetch
in class SearchEngineBase