|
Carrot2 v3.5.2
API Documentation |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.carrot2.core.ProcessingComponentBase
org.carrot2.source.SearchEngineBase
org.carrot2.source.SimpleSearchEngine
org.carrot2.source.xml.RemoteXmlSimpleSearchEngineBase
public abstract class RemoteXmlSimpleSearchEngineBase
A base class for implementing data sources based on XML/XSLT. The XSLT stylesheet will be loaded once during component initialization and cached for all further requests.
| Field Summary |
|---|
| Fields inherited from class org.carrot2.source.SearchEngineBase |
|---|
compressed, documents, query, results, resultsTotal, start, statistics |
| Constructor Summary | |
|---|---|
RemoteXmlSimpleSearchEngineBase()
|
|
| Method Summary | |
|---|---|
void |
beforeProcessing()
Invoked after the attributes marked with Processing and Input
annotations have been bound, but before a call to IProcessingComponent.process(). |
protected abstract 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 String |
getPassword()
Returns the password to use for HTTP Basic Authentication. |
protected String |
getUser()
Returns the user name to use for HTTP Basic Authentication. |
protected Map<String,String> |
getXsltParameters()
Returns parameters to be passed to the XSLT transformer. |
protected abstract IResource |
getXsltResource()
Returns the XSLT stylesheet that transforms the custom XML into Carrot2 compliant XML. |
void |
init(IControllerContext context)
Invoked after component's attributes marked with Init and Input
annotations have been bound, but before calls to any other methods of this
component. |
| Methods inherited from class org.carrot2.source.SimpleSearchEngine |
|---|
process |
| Methods inherited from class org.carrot2.source.SearchEngineBase |
|---|
afterFetch, 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 |
| Constructor Detail |
|---|
public RemoteXmlSimpleSearchEngineBase()
| Method Detail |
|---|
public void init(IControllerContext context)
IProcessingComponentInit and Input
annotations have been bound, but before calls to any other methods of this
component. After a call to this method completes without an exception, attributes
marked with Init Output will be collected. In this method,
components should perform initializations based on the initialization-time
attributes. This method is called once in the life time of a processing
component instance.
init in interface IProcessingComponentinit in class ProcessingComponentBasecontext - An instance of IControllerContext of the controller to which this
component instance will be bound.
public void beforeProcessing()
throws ProcessingException
IProcessingComponentProcessing 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 IProcessingComponentbeforeProcessing in class ProcessingComponentBaseProcessingException - 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 SearchEngineResponse fetchSearchResponse()
throws Exception
SimpleSearchEngine
fetchSearchResponse in class SimpleSearchEngineException - in case of problems with the underlying search engineprotected abstract IResource getXsltResource()
protected Map<String,String> getXsltParameters()
null.
protected abstract String buildServiceUrl()
protected String getUser()
protected String getPassword()
|
Please refer to project documentation at
http://project.carrot2.org |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||