|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.app.util.OpenSearch
public class OpenSearch
Utility Class with static methods for producing OpenSearch-compliant search results, and the OpenSearch description document.
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.
| Constructor Summary | |
|---|---|
OpenSearch()
|
|
| Method Summary | |
|---|---|
static String |
getContentType(String format)
Returns a mime-type associated with passed format |
static String |
getDescription(String scope)
Returns OpenSearch Servic Document as a string |
static Document |
getDescriptionDoc(String scope)
Returns the OpenSearch service document appropriate for given scope |
static List<String> |
getFormats()
Returns list of supported formats |
static Document |
getResultsDoc(String format,
String query,
int totalResults,
int start,
int pageSize,
DSpaceObject scope,
DSpaceObject[] results,
Map<String,String> labels)
Returns a formatted set of search results as a document |
static String |
getResultsString(String format,
String query,
int totalResults,
int start,
int pageSize,
DSpaceObject scope,
DSpaceObject[] results,
Map<String,String> labels)
Returns a formatted set of search results as a string |
static DSpaceObject |
resolveScope(Context context,
String scope)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OpenSearch()
| Method Detail |
|---|
public static List<String> getFormats()
public static String getContentType(String format)
format - the results document format (rss, atom, html)
public static Document getDescriptionDoc(String scope)
throws IOException
scope - - null for entire repository, or handle or community or collection
IOExceptionpublic static String getDescription(String scope)
scope - - null for entire repository, or handle or community or collection
public static String getResultsString(String format,
String query,
int totalResults,
int start,
int pageSize,
DSpaceObject scope,
DSpaceObject[] results,
Map<String,String> labels)
throws IOException
format - 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 specific
IOException
public static Document getResultsDoc(String format,
String query,
int totalResults,
int start,
int pageSize,
DSpaceObject scope,
DSpaceObject[] results,
Map<String,String> labels)
throws IOException
format - 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 specific
IOException
public static DSpaceObject resolveScope(Context context,
String scope)
throws SQLException
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||