Changeset 6123 for SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/app/Aggregator.java
- Timestamp:
- 04/01/15 13:04:47 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/app/Aggregator.java
r6093 r6123 34 34 import java.util.concurrent.ScheduledExecutorService; 35 35 import java.util.concurrent.atomic.AtomicReference; 36 import org.eclipse.jetty.server.session.SessionHandler; 36 37 import org.slf4j.LoggerFactory; 37 38 … … 48 49 * If invoked with 'x-aggregation-context' and 'query' parameter, the aggregator 49 50 * will pre-select provided resources and fill in the query field. This 50 * mechanism is currently used by VLO. Example: POST 51 * http://weblicht.sfs.uni-tuebingen.de/Aggregator HTTP/1.1 operation = 52 * searchRetrieve & version = 1.2 & query = bellen & x-aggregation-context = 51 * mechanism is currently used by VLO. 52 * 53 * Example: POST 54 * http://weblicht.sfs.uni-tuebingen.de/Aggregator HTTP/1.1 55 * query = bellen & x-aggregation-context = 53 56 * {"http://fedora.clarin-d.uni-saarland.de/sru/":["hdl:11858/00-246C-0000-0008-5F2A-0"]} 54 57 * 55 * 56 * Additionally, if run with the a URL query string parameter 'mode', the 57 * special behavior of the aggregator is triggered: 58 * 59 * /?mode=testing corresponds to the mode where the CQL endpoints are taken not 60 * from Clarin center repository, but from a hard-coded endpoints list; this 61 * functionality is useful for testing the development instances of endpoints, 62 * before they are moved to production. Was done to meet the request from MPI. 63 * 64 * /?mode=search corresponds to the mode where the aggregator page is requested 65 * with the already known query and (optionally) resources to search in, and if 66 * the immediate search is desired. In this case the aggregator search results 67 * page is displayed and search results of the provided query start to fill it 68 * in immediately (i.e. users don't need to click 'search' in the aggregator 69 * page). Was done to meet the request from CLARIN ERIC (Martin Wynne contacted 70 * us). 71 * 72 * /?mode=live corresponds to the mode where the information about corpora are 73 * taken not from the scan cache (crawled in advance), but loaded live, starting 74 * from the request to center registry and then performing scan operation 75 * requests on each CQL endpoint listed there. It takes time to get the 76 * corresponding responses from the endpoints, therefore the Aggregator page 77 * loads very slow in this mode. But this mode is useful for testing of the 78 * newly added or changed corpora without waiting for the next crawl. 79 * 80 * 81 * Adds Application initialization and clean up: only one SRU threaded client is 82 * used in the application, it has to be shut down when the application stops. 83 * One Languages object instance is used within the application. 58 * If the Aggregator web page has the URL query string parameter 'mode' 59 * set to the string 'search', and the 'query' parameter is set, 60 * then the aggregator search results for this query are immediately displayed 61 * (i.e. users don't need to click 'search' in the aggregator page). 62 * This feature has been requested initially by Martin Wynne from CLARIN ERIC 84 63 * 85 64 * @author Yana Panchenko 86 65 * @author edima 87 66 * 88 * TODO: add the modes described above (except live)67 * TODO: improve help page text 89 68 * 90 69 * TODO: update comments everywhere … … 103 82 * 104 83 * TODO: tri-state for parent collections; search + message implications 105 *106 * TODO: improve help page text107 84 * 108 85 */ … … 161 138 } 162 139 163 environment.getApplicationContext().setErrorHandler(new ErrorPageHandler()); 140 environment.getApplicationContext().setSessionHandler(new SessionHandler()); 141 environment.getApplicationContext().setErrorHandler(new ErrorHandler()); 164 142 environment.jersey().setUrlPattern("/rest/*"); 165 143 environment.jersey().register(new RestService());
Note: See TracChangeset
for help on using the changeset viewer.