DSpace/DSpace — pull request #80 by nesovi (2012-09-06 17:46:25+00:00)
Title: [DS-1244] XMLUI's OpenSearch implementation refactored to work with Discovery

As it was commented in https://jira.duraspace.org/browse/DS-1244, the current OpenSearch implementation was working only with PostgreSQL's indexes, regardless having Discovery enabled for searches.
After a code evaluation, we noticed a very high coupling level between the OpenSearch implementation and the standard (PostgreSQL based) search implementation.
We make some refactoring in order to separate concerns and generalize the common behaviour.

This "open-search-discover" branch includes:
1) a new class hierarchy for OpenSearchGenerator componentes:
a) new class org.dspace.app.xmlui.opensearch.AbstractOpenSearchGenerator, wich has main instance variables, and a default implementation for methods setup(), getValidity() and getKey(). The setup() method makes the default parsing for all common parameters, ensuring default values or exceptions rising.
b) new class org.dspace.app.xmlui.opensearch.StandardOpenSearchGenerator, subclass of AbstractOpenSearchGenerator, implementing the generate() method and coupled with the "standard" search services (PostgreSQL based).
c) new class org.dspace.app.xmlui.opensearch.DiscoveryOpenSearchGenerator, subclass of AbstractOpenSearchGenerator, implementing the generate() method in order to use discovery search services.
d) new class org.dspace.app.xmlui.opensearch.DescriptionOpenSearchGenerator, wich generates the description.xml document, based on configuration properties.
e) modified helper class org.dspace.app.util.OpenSearch, in order to avoid dependencies with the "standard" search services (it used to reference the class org.dspace.search.QueryResults)

Also, the main sitemap.xmap has been modified in order to reference the new generators, and to include the new match pattern for discovery based requests.
Considering the backward compatibility need, the standard open-search requests and the description.xml request remains as they were before this patch:
- /open-search/description.xml[?scope={...}]- for description file
- /open-search/?query={...} - request to search using the PostgreSQL indexes

This patch adds a match for:
- /open-search/discover?query={...} request to search using the discovery services

Of course, to change the output of the description.xml file, users should edit the following confg properties:
- websvc.opensearch.uicontext = discover ===> used to be "simple-search"
- websvc.opensearch.svccontext = open-search/discover ===> used to be "open-search/"

Any comment will be very welcome