Ignore:
Timestamp:
04/01/15 13:04:47 (9 years ago)
Author:
emanuel.dima@uni-tuebingen.de
Message:
  1. beta-31: support for query&mode params, and for x-aggregation-context on POST
File:
1 edited

Legend:

Unmodified
Added
Removed
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/app/Aggregator.java

    r6093 r6123  
    3434import java.util.concurrent.ScheduledExecutorService;
    3535import java.util.concurrent.atomic.AtomicReference;
     36import org.eclipse.jetty.server.session.SessionHandler;
    3637import org.slf4j.LoggerFactory;
    3738
     
    4849 * If invoked with 'x-aggregation-context' and 'query' parameter, the aggregator
    4950 * 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 =
    5356 * {"http://fedora.clarin-d.uni-saarland.de/sru/":["hdl:11858/00-246C-0000-0008-5F2A-0"]}
    5457 *
    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
    8463 *
    8564 * @author Yana Panchenko
    8665 * @author edima
    8766 *
    88  * TODO: add the modes described above (except live)
     67 * TODO: improve help page text
    8968 *
    9069 * TODO: update comments everywhere
     
    10382 *
    10483 * TODO: tri-state for parent collections; search + message implications
    105  *
    106  * TODO: improve help page text
    10784 *
    10885 */
     
    161138                }
    162139
    163                 environment.getApplicationContext().setErrorHandler(new ErrorPageHandler());
     140                environment.getApplicationContext().setSessionHandler(new SessionHandler());
     141                environment.getApplicationContext().setErrorHandler(new ErrorHandler());
    164142                environment.jersey().setUrlPattern("/rest/*");
    165143                environment.jersey().register(new RestService());
Note: See TracChangeset for help on using the changeset viewer.