Changeset 6153 for SRUAggregator


Ignore:
Timestamp:
04/22/15 07:47:57 (9 years ago)
Author:
emanuel.dima@uni-tuebingen.de
Message:
  1. beta-39: updated java comments, better build script
Location:
SRUAggregator/trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • SRUAggregator/trunk/build.sh

    r6065 r6153  
    66JSDIR=$ASSETDIR/js
    77
    8 if [ ! -e bower_components ]
     8RUN_BOWER=
     9BUILD_JSX=1
     10BUILD_JAR=
     11BUILD_GO=
     12RUN_JAR=
     13RUN_JAR_PRODUCTION=
     14
     15while [[ $# > 0 ]]
     16do
     17key="$1"
     18# echo $# " :" $key
     19case $key in
     20    --bower)
     21    RUN_BOWER=1
     22    ;;
     23    --jsx)
     24    BUILD_JSX=1
     25    ;;
     26    --jar)
     27    BUILD_JAR=1
     28    ;;
     29    --run)
     30    RUN_JAR=1
     31    ;;
     32    --run-production)
     33    RUN_JAR_PRODUCTION=1
     34    ;;
     35    *)
     36    echo "Unknown option:" $1
     37    exit 1
     38    ;;
     39esac
     40shift
     41done
     42
     43if [ $RUN_BOWER ]
    944then
    1045        mkdir -p $LIBDIR
     
    2762fi
    2863
    29 for f in $JSDIR/*.jsx; do
    30         cp -v $f $JSDIR/`basename $f .jsx`.js;
    31 done
    32 node_modules/react-tools/bin/jsx --no-cache-dir $JSDIR $JSDIR
     64if [ $BUILD_JSX ]
     65then
     66        echo; echo "---- jsx"
     67        for f in $JSDIR/*.jsx; do
     68                cp -v $f $JSDIR/`basename $f .jsx`.js;
     69        done
     70        node_modules/react-tools/bin/jsx --no-cache-dir $JSDIR $JSDIR
     71fi
    3372
    34 if [ "$1" == "--jar" ]
     73if [ $BUILD_JAR ]
    3574then
     75        echo; echo "---- mvn clean package"
    3676        mvn -q clean package
    3777fi
    3878
    39 # Run in production:
    40 #java -jar target/Aggregator2-2.0.0.jar server aggregator.yml
     79if [ $RUN_JAR ]
     80then
     81        echo; echo "---- run devel"
     82        JAR=`find target -iname 'Aggregator2-*.jar'`
     83        echo java -cp src/main/resources:$JAR eu.clarin.sru.fcs.aggregator.app.Aggregator server aggregator_development.yml
     84        java -cp src/main/resources:$JAR eu.clarin.sru.fcs.aggregator.app.Aggregator server aggregator_development.yml
     85fi
    4186
    42 # Run for development:
    43 # java -cp src/main/resources:target/Aggregator2-2.0.0.jar eu.clarin.sru.fcs.aggregator.app.Aggregator server aggregator_development.yml
     87if [ $RUN_JAR_PRODUCTION ]
     88then
     89        echo; echo "---- run production"
     90        JAR=`find target -iname 'Aggregator2-*.jar'`
     91        echo java -jar $JAR server aggregator.yml
     92        java -jar $JAR server aggregator.yml
     93fi
  • SRUAggregator/trunk/pom.xml

    r6145 r6153  
    88        <groupId>eu.clarin.sru.fcs</groupId>
    99        <artifactId>aggregator</artifactId>
    10         <version>2.0.0-beta-36</version>
     10        <version>2.0.0-beta-39</version>
    1111        <name>FCS Aggregator</name>
    1212
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/app/Aggregator.java

    r6145 r6153  
    6868 * @author edima
    6969 *
    70  * TODO: update comments everywhere
    71  *
    7270 * TODO: add some basic docs
    7371 *
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/app/ErrorHandler.java

    r6131 r6153  
    1111
    1212/**
     13 * @author edima
    1314 *
    14  * @author edima
     15 * The Aggregator is a single web page application, and most of the URLs are
     16 * routed and handled by the javascript client, not in the server.
     17 * Therefore, whenever a 404 pops up in the server, it probably means that the
     18 * URL should be handled by javascript, and to do that we must return the normal
     19 * index.html HTML code.
     20 *
     21 * Sometimes the server gets POST calls from external apps (VLO, for example).
     22 * We must keep the special parameters which are sent to the Aggregator and
     23 * pass them to the js client, and, again, serve the normal index.html file.
    1524 */
    1625public class ErrorHandler extends org.eclipse.jetty.server.handler.ErrorHandler {
    1726
    18         private static final org.slf4j.Logger log = LoggerFactory.getLogger(Aggregator.class);
     27        private static final org.slf4j.Logger log = LoggerFactory.getLogger(ErrorHandler.class);
    1928
    2029        public static final String PARAM_QUERY = "query";
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/client/GenericClient.java

    r6132 r6153  
    1212 *
    1313 * @author edima
     14 *
     15 * This is a SRUThreadedClient wrapper that only allows a limited number of
     16 * requests per endpoint, no matter what SRU operation the requests make.
     17 * This class is an internal utility class, used by the ThrottledClient class.
    1418 */
    1519class GenericClient {
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/client/ThrottledClient.java

    r6132 r6153  
    1414/**
    1515 * @author edima
     16 *
     17 * This is a SRUThreadedClient wrapper that only allows a limited number of
     18 * requests per endpoint, depending on the requests type. To determine the
     19 * number of requests for each endpoint the user must provide a callback.
    1620 */
    1721public class ThrottledClient {
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/rest/DataTransfer.java

    r6043 r6153  
    1414 * @author Yana Panchenko
    1515 * @author edima
     16 *
     17 * A utility class that allows moving data from the Aggregator server to some
     18 * public location (currently the drop-off service).
    1619 */
    1720public class DataTransfer {
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/rest/RestService.java

    r6131 r6153  
    4343 *
    4444 * @author edima
     45 * The REST API of the Aggregator (actually, it's a HTTP API, not very restful).
     46 *
    4547 */
    4648@Produces(MediaType.APPLICATION_JSON)
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/scan/Corpora.java

    r5957 r6153  
    1111/**
    1212 * Implementation of the cached scan data (endpoints descriptions) that stores
    13  * the cache in memory in maps.
     13 * the cache in memory in maps. Must be thread safe, updates in the maps are
     14 * asynchronous.
    1415 *
    1516 * @author yanapanchenko
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/scan/Corpus.java

    r6065 r6153  
    1212/**
    1313 * Represents information about corpus resource, such as corpus handle (id),
    14  * institution, title, description, language(s), etc. Does not store the
     14 * institution, title, description, language(s), etc. Also store the
    1515 * information about corpus sub-corpora.
    1616 *
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/scan/Diagnostic.java

    r6092 r6153  
    33import com.fasterxml.jackson.annotation.JsonProperty;
    44
    5 /*
     5/**
    66 * @author edima
    77 */
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/scan/EndpointUrlFilterAllow.java

    r5893 r6153  
    66
    77/**
    8  * Allow takes precedence over deny; default is to include
    9  * everything.
    10  * Filters for the cache of scan data (endpoint/resources
    11  * descriptions) based on
    12  * endpoint url.
     8 * Allow takes precedence over deny; default is to include everything.
     9 * Filters for the cache of scan data (endpoint/resources descriptions)
     10 * based on endpoint url.
    1311 *
    1412 * @author yanapanchenko
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/scan/EndpointUrlFilterDeny.java

    r5893 r6153  
    66
    77/**
    8  * Allow takes precedence over deny; default is to include
    9  * everything.
    10  * Filters for the cache of scan data (endpoint/resources
    11  * descriptions) based on
    12  * endpoint url.
     8 * Allow takes precedence over deny; default is to include everything.
     9 * Filters for the cache of scan data (endpoint/resources descriptions)
     10 * based on endpoint url.
    1311 *
    1412 * @author yanapanchenko
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/scan/JsonException.java

    r5971 r6153  
    66 *
    77 * @author edima
     8 *
     9 * A Json representation of an exception in the scan/search process, to be sent
     10 * to the JS client
    811 */
    912public class JsonException {
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/scan/ScanCrawlTask.java

    r6093 r6153  
    1414 * @author yanapanchenko
    1515 * @author edima
     16 *
     17 * This task is run by an executor every now and then to scan for new endpoints
    1618 */
    1719public class ScanCrawlTask implements Runnable {
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/scan/Statistics.java

    r6131 r6153  
    1212 *
    1313 * @author edima
     14 *
     15 * Stores statistics information about scans or searches. The info is then sent
     16 * to the JS client and displayed in the /Aggregator/stats page.
    1417 */
    1518public class Statistics {
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/search/Result.java

    r6097 r6153  
    2525
    2626/**
    27  * Represents the results of a SRU search-retrieve operation request. It
    28  * contains the endpoint/corpus (if specified in the request) to which a request
    29  * was sent, and the corresponding SRU search-retrieve response.
     27 * The results of a SRU search-retrieve operation for a particular corpus.
     28 * Its content is json-serialized and sent to the JS client for display.
    3029 *
    3130 * @author Yana Panchenko
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/search/Search.java

    r6131 r6153  
    2020
    2121/**
    22  * Class representing a search operation
     22 * A search operation done on a list of corpora.
    2323 *
    2424 * @author Yana Panchenko
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/util/CounterLatch.java

    r5771 r6153  
    44
    55/**
     6 * @author edima
    67 *
    7  * @author edima
     8 * Similar to a java CountDownLatch, but can also count up.
     9 *
    810 */
    911public class CounterLatch {
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/util/LanguagesISO693.java

    r6081 r6153  
    1414
    1515/**
    16  * Represents collection of languages.
     16 * Utility class to convert between various language codes.
    1717 *
    1818 * @author Yana Panchenko
     
    2828        public static class Language {
    2929
    30                 // code is ISO-639-3 (3 letters) while code_2 is ISO-639-1 (2 letters)
     30                // code is ISO-639-3 (3 letters) while code_1 is ISO-639-1 (2 letters)
    3131                private String code_3, code_1, name;
    3232
  • SRUAggregator/trunk/src/main/resources/assets/js/main.js

    r6145 r6153  
    33"use strict";
    44
    5 var VERSION = window.MyAggregator.VERSION = "VERSION 2.0.0-beta-36";
     5var VERSION = window.MyAggregator.VERSION = "VERSION 2.0.0-beta-38";
    66
    77var URLROOT = window.MyAggregator.URLROOT =
     
    141141                                React.createElement("ul", {id: "CLARIN_header_right", className: "nav navbar-nav navbar-right"},
    142142                                        React.createElement("li", null,
    143                                                 React.createElement("div", {id: "clarinservices", style: {padding:10}})
     143                                                React.createElement("div", {id: "clarinservices", style: {padding:5}})
    144144                                        ),
    145145                                        this.renderLogin()
  • SRUAggregator/trunk/src/main/resources/assets/js/main.jsx

    r6145 r6153  
    33"use strict";
    44
    5 var VERSION = window.MyAggregator.VERSION = "VERSION 2.0.0-beta-36";
     5var VERSION = window.MyAggregator.VERSION = "VERSION 2.0.0-beta-39";
    66
    77var URLROOT = window.MyAggregator.URLROOT =
  • SRUAggregator/trunk/src/main/resources/assets/js/search.js

    r6145 r6153  
    153153Corpora.prototype.setAggregationContext = function(endpoints2handles) {
    154154        var selectSubTree = function(select, corpus) {
    155                 corpus.selected = false;
     155                corpus.selected = select;
    156156                this.recurseCorpora(corpus.subCorpora, function(c) { c.selected = corpus.selected; });
    157157        };
     
    253253                                                query: this.state.query || json.query || '',
    254254                                        });
     255
     256                                        // // for testing aggregation context
     257                                        // json['x-aggregation-context'] = {
     258                                        //      'EKUT': ["http://hdl.handle.net/11858/00-1778-0000-0001-DDAF-D"]
     259                                        // };
    255260
    256261                                        if (json['x-aggregation-context']) {
  • SRUAggregator/trunk/src/main/resources/assets/js/search.jsx

    r6145 r6153  
    153153Corpora.prototype.setAggregationContext = function(endpoints2handles) {
    154154        var selectSubTree = function(select, corpus) {
    155                 corpus.selected = false;
     155                corpus.selected = select;
    156156                this.recurseCorpora(corpus.subCorpora, function(c) { c.selected = corpus.selected; });
    157157        };
     
    253253                                                query: this.state.query || json.query || '',
    254254                                        });
     255
     256                                        // // for testing aggregation context
     257                                        // json['x-aggregation-context'] = {
     258                                        //      'EKUT': ["http://hdl.handle.net/11858/00-1778-0000-0001-DDAF-D"]
     259                                        // };
    255260
    256261                                        if (json['x-aggregation-context']) {
Note: See TracChangeset for help on using the changeset viewer.