|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.abdera.ext.opensearch.server.impl.AbstractOpenSearchUrlAdapter<T>
T
- The generic object type representing a search result.public abstract class AbstractOpenSearchUrlAdapter<T>
Abstract OpenSearchUrlAdapter
providing explicit methods to implement
and/or override for executing the actual search and creating the Atom feed containing search results.
Constructor Summary | |
---|---|
AbstractOpenSearchUrlAdapter()
|
Method Summary | |
---|---|
protected abstract List<T> |
doSearch(RequestContext request,
Map<String,String> parameters)
Do the actual search, returning a list of search results as generic objects. |
protected abstract void |
fillEntry(Entry entry,
T entity)
Fill the given empty Atom entry from the given search result object. This method is called once for every search result returned by the {#doSearch(RequestContext, Map |
protected abstract Person |
getOpenSearchFeedAuthor(RequestContext request)
Get the author of the feed containing this search results. |
protected abstract String |
getOpenSearchFeedId(RequestContext request)
Get the identifier of the feed containing this search results. |
protected int |
getOpenSearchFeedItemsPerPage(RequestContext request,
Map<String,String> parameters,
List<T> searchResults)
Get the number of items (entries) contained into this page (feed). By default, it's equal to the number of search results: override to provide a different behavior. This element can be explicitly omitted from the feed by returning a negative value. |
protected int |
getOpenSearchFeedStartIndex(RequestContext request,
Map<String,String> parameters,
List<T> searchResults)
Get the index number of the first result contained into this feed. By default, this element is omitted: override to provide a different behavior. This element can be explicitly omitted from the feed by returning a negative value. |
protected abstract String |
getOpenSearchFeedTitle(RequestContext request)
Get the title of the feed containing this search results. |
protected int |
getOpenSearchFeedTotalResults(RequestContext request,
Map<String,String> parameters,
List<T> searchResults)
Get the total number of results of this search. By default, it's equal to the number of search results: override to provide a different behavior. This element can be explicitly omitted from the feed by returning a negative value. |
protected abstract Date |
getOpenSearchFeedUpdatedDate(RequestContext request)
Get the update date of the feed containing this search results. |
protected void |
postProcess(Feed feed,
RequestContext request,
Map<String,String> parameters,
List<T> searchResults)
Post process this feed in order to make custom modifications. By default, this method does nothing: override to provide a different behavior. |
ResponseContext |
search(RequestContext request,
Map<String,String> parameters)
Make the actual search operation based on passed parameters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractOpenSearchUrlAdapter()
Method Detail |
---|
public ResponseContext search(RequestContext request, Map<String,String> parameters)
OpenSearchUrlAdapter
search
in interface OpenSearchUrlAdapter
request
- The RequestContext
object.parameters
- Search parameters extracted from the request: they are the same parameters reported into the
Open Search URL template.protected abstract String getOpenSearchFeedId(RequestContext request)
protected abstract String getOpenSearchFeedTitle(RequestContext request)
protected abstract Person getOpenSearchFeedAuthor(RequestContext request)
protected abstract Date getOpenSearchFeedUpdatedDate(RequestContext request)
protected abstract List<T> doSearch(RequestContext request, Map<String,String> parameters)
protected abstract void fillEntry(Entry entry, T entity)
protected int getOpenSearchFeedTotalResults(RequestContext request, Map<String,String> parameters, List<T> searchResults)
protected int getOpenSearchFeedItemsPerPage(RequestContext request, Map<String,String> parameters, List<T> searchResults)
protected int getOpenSearchFeedStartIndex(RequestContext request, Map<String,String> parameters, List<T> searchResults)
protected void postProcess(Feed feed, RequestContext request, Map<String,String> parameters, List<T> searchResults)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |