public interface OpenSearchService
OpenSearch is a specification for describing and advertising search-engines and their result formats. Commonly, RSS and Atom formats are used, which the current implementation supports, as is HTML (used directly in browsers). NB: this is baseline OpenSearch, no extensions currently supported.
The value of the "scope" parameter should either be absent (which means no scope restriction), or the handle of a community or collection.
| Modifier and Type | Method and Description |
|---|---|
String |
getContentType(String format)
Returns a mime-type associated with passed format
|
String |
getDescription(String scope)
Returns OpenSearch Servic Document as a string
|
Document |
getDescriptionDoc(String scope)
Returns the OpenSearch service document appropriate for given scope
|
List<String> |
getFormats()
Returns list of supported formats
|
Document |
getResultsDoc(Context context,
String format,
String query,
int totalResults,
int start,
int pageSize,
DSpaceObject scope,
List<DSpaceObject> results,
Map<String,String> labels)
Returns a formatted set of search results as a document
|
String |
getResultsString(Context context,
String format,
String query,
int totalResults,
int start,
int pageSize,
DSpaceObject scope,
List<DSpaceObject> results,
Map<String,String> labels)
Returns a formatted set of search results as a string
|
DSpaceObject |
resolveScope(Context context,
String scope) |
List<String> getFormats()
String getContentType(String format)
format - the results document format (rss, atom, html)Document getDescriptionDoc(String scope) throws IOException
scope - - null for entire repository, or handle or community or collectionIOException - if IO errorString getDescription(String scope)
scope - - null for entire repository, or handle or community or collectionString getResultsString(Context context, String format, String query, int totalResults, int start, int pageSize, DSpaceObject scope, List<DSpaceObject> results, Map<String,String> labels) throws IOException
context - DSpace Contextformat - results format - html, rss or atomquery - - the search querytotalResults - - the hit countstart - - start result indexpageSize - - page sizescope - - search scope, null or community/collection handleresults - the retreived DSpace objects satisfying searchlabels - labels to apply - format specificIOException - if IO errorDocument getResultsDoc(Context context, String format, String query, int totalResults, int start, int pageSize, DSpaceObject scope, List<DSpaceObject> results, Map<String,String> labels) throws IOException
context - DSpace Contextformat - results format - html, rss or atomquery - - the search querytotalResults - - the hit countstart - - start result indexpageSize - - page sizescope - - search scope, null or community/collection handleresults - the retreived DSpace objects satisfying searchlabels - labels to apply - format specificIOException - if IO errorDSpaceObject resolveScope(Context context, String scope) throws SQLException
SQLExceptionCopyright © 2017 DuraSpace. All rights reserved.