org.carrot2.source.etools
Class EToolsDocumentSource

java.lang.Object
  extended by org.carrot2.core.ProcessingComponentBase
      extended by org.carrot2.source.SearchEngineBase
          extended by org.carrot2.source.SimpleSearchEngine
              extended by org.carrot2.source.xml.RemoteXmlSimpleSearchEngineBase
                  extended by org.carrot2.source.etools.EToolsDocumentSource
All Implemented Interfaces:
IDocumentSource, IProcessingComponent

public class EToolsDocumentSource
extends RemoteXmlSimpleSearchEngineBase

A Carrot2 input component for the eTools service (http://www.etools.ch). For commercial licensing of the eTools feed, please e-mail: contact@comcepta.com.


Nested Class Summary
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.
 
Field Summary
 EToolsDocumentSource.Country country
          Determines the country of origin for the returned search results.
 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
 int timeout
          Maximum time in milliseconds to wait for all data sources to return results.
 
Fields inherited from class org.carrot2.source.SearchEngineBase
compressed, documents, query, results, resultsTotal, start, statistics
 
Constructor Summary
EToolsDocumentSource()
           
 
Method Summary
protected  void afterFetch(SearchEngineResponse response)
          Called after a single search engine response has been fetched.
protected  String buildServiceUrl()
          Builds the URL from which XML stream will be fetched.
protected  IResource getXsltResource()
          Returns the XSLT stylesheet that transforms the custom XML into Carrot2 compliant XML.
 
Methods inherited from class org.carrot2.source.xml.RemoteXmlSimpleSearchEngineBase
beforeProcessing, fetchSearchResponse, getPassword, getUser, getXsltParameters, init
 
Methods inherited from class org.carrot2.source.SimpleSearchEngine
process
 
Methods inherited from class org.carrot2.source.SearchEngineBase
clean, urlEncode
 
Methods inherited from class org.carrot2.core.ProcessingComponentBase
afterProcessing, dispose, getContext, getSharedExecutor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.carrot2.core.IProcessingComponent
afterProcessing, dispose
 

Field Detail

serviceUrlBase

public String serviceUrlBase
Base URL for the eTools service

Attribute label:
Service URL
Attribute level:
Advanced
Attribute group:
Service

country

public EToolsDocumentSource.Country country
Determines the country of origin for the returned search results.

Attribute label:
Country
Attribute level:
Medium
Attribute group:
Results filtering

language

public EToolsDocumentSource.Language language
Determines the language of the returned search results.

Attribute label:
Language
Attribute level:
Medium
Attribute group:
Results filtering

timeout

public int timeout
Maximum time in milliseconds to wait for all data sources to return results.

Attribute label:
Timeout
Attribute level:
Advanced
Attribute group:
Service

dataSources

public EToolsDocumentSource.DataSources dataSources
Determines which data sources to search.

Attribute label:
Data sources
Attribute level:
Advanced
Attribute group:
Service

safeSearch

public boolean safeSearch
If enabled, excludes offensive content from the results.

Attribute label:
Safe search
Attribute level:
Basic
Attribute group:
Results filtering

partnerId

public String partnerId
eTools partner identifier. If you have commercial arrangements with eTools, specify your partner id here.

Attribute label:
Partner
Attribute level:
Advanced
Attribute group:
Service
Constructor Detail

EToolsDocumentSource

public EToolsDocumentSource()
Method Detail

getXsltResource

protected IResource getXsltResource()
Description copied from class: RemoteXmlSimpleSearchEngineBase
Returns the XSLT stylesheet that transforms the custom XML into Carrot2 compliant XML. This method will be called once during component initialization. Initialization time attributes will have been bound before the call to this method.

Specified by:
getXsltResource in class RemoteXmlSimpleSearchEngineBase

buildServiceUrl

protected String buildServiceUrl()
Description copied from class: RemoteXmlSimpleSearchEngineBase
Builds the URL from which XML stream will be fetched. This method will be called once per request processing cycle. Processing-time attributes will have been bound before this method the call to this method.

Specified by:
buildServiceUrl in class RemoteXmlSimpleSearchEngineBase

afterFetch

protected void afterFetch(SearchEngineResponse response)
Description copied from class: SearchEngineBase
Called after a single search engine response has been fetched. The concrete implementation may want to override this empty implementation to e.g., clean or otherwise postprocess the returned results.

Overrides:
afterFetch in class SearchEngineBase


Copyright (c) Dawid Weiss, Stanislaw Osinski