Changeset 5041


Ignore:
Timestamp:
04/24/14 09:59:58 (10 years ago)
Author:
yana.panchenko@uni-tuebingen.de
Message:

code clean-up

  • use context (environment) variables (in web.xml) instead of constants to define e.g. scan crawl interval, location property to store/get the scan data, etc.
  • replace hard-coded data location with the one defined by system property, with fallback 2 default locations: /data and user.home
  • re-enable live mode support
  • add documentation
Location:
SRUAggregator/trunk
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • SRUAggregator/trunk/pom.xml

    r5040 r5041  
    140140            <version>1.9.5</version>
    141141            <scope>test</scope>
    142         </dependency> 
    143        
     142        </dependency>
     143        <dependency>
     144            <groupId>javax.servlet</groupId>
     145            <artifactId>javax.servlet-api</artifactId>
     146            <version>3.1.0</version>
     147        </dependency>
    144148    </dependencies>
    145149   
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/app/Aggregator.java

    r5040 r5041  
    1414import org.zkoss.zul.Textbox;
    1515import eu.clarin.sru.fcs.aggregator.sopt.Corpus;
     16import eu.clarin.sru.fcs.aggregator.sopt.Languages;
    1617import eu.clarin.sru.fcs.aggregator.util.SRUCQL;
     18import javax.naming.InitialContext;
     19import javax.naming.NamingException;
    1720import org.zkoss.zul.A;
    1821import org.zkoss.zul.Div;
     
    6063 * page is displayed and search results of the provided query start to fill
    6164 * it in immediately (i.e. users don't need to click 'search' in the aggregator
    62  * page). Was done to meet the request from CLARIN ERIC ( Martin Wynne
     65 * page). Was done to meet the request from CLARIN ERIC (Martin Wynne
    6366 * contacted us).
     67 *
     68 * /?mode=live
     69 * corresponds to the mode where the information about corpora are taken not
     70 * from the scan cache (crawled in advance), but loaded live, starting from
     71 * the request to center registry and then performing scan operation requests on
     72 * each CQL  endpoint listed there. It takes time to get the corresponding
     73 * responses from the endpoints, therefore the Aggregator page loads very slow
     74 * in this mode. But this mode is useful for testing of the newly added or
     75 * changed corpora without waiting for the next crawl.
    6476 *
     77 *
    6578 * @author Yana Panchenko
    6679 */
     
    96109    private Label helpLabel;
    97110    @Wire
    98     Progressmeter pMeter;
    99     @Wire
    100     Menubar menubar;
    101     @Wire
    102     North controls1;
    103     @Wire
    104     South controls2;
    105     @Wire
    106     A prevButton;
    107     @Wire
    108     A nextButton;
    109     @Wire
    110     Label tooltipPrevText;
    111     @Wire
    112     Label tooltipNextText;
    113    
    114     @Wire
    115     Menuitem weblichtTcf;
     111    private Progressmeter pMeter;
     112    @Wire
     113    private Menubar menubar;
     114    @Wire
     115    private North controls1;
     116    @Wire
     117    private South controls2;
     118    @Wire
     119    private A prevButton;
     120    @Wire
     121    private A nextButton;
     122    @Wire
     123    private Label tooltipPrevText;
     124    @Wire
     125    private Label tooltipNextText;
     126    @Wire
     127    private Menuitem weblichtTcf;
    116128   
    117129    private int[] searchOffset = new int[]{1, 0}; // start and size
     
    119131    private PagesVisibility pagesVisibility;
    120132
    121     private static final String WEBLICHT_URL =
    122             "https://weblicht.sfs.uni-tuebingen.de/WebLicht-4/?input=";
    123    
     133    private String weblichtUrl; // defined in web.xml
    124134    public static final String MODE_PARAM = "mode";
    125135    public static final String MODE_PARAM_VALUE_TEST = "testing";
     
    132142    public void doAfterCompose(Component comp) throws Exception {
    133143        super.doAfterCompose(comp);
     144        processContext();
    134145        processParameters();
    135146        searchOptionsComposer = (SearchOptions) soDiv.getChildren().get(0).getChildren().get(0).getAttribute("$" + SearchOptions.class.getSimpleName());
     
    163174            searchOffset[1] = maxRecords;
    164175            searchResultsComposer.executeSearch(selectedCorpora, searchOffset[0], maxRecords, searchString.getText(), searchLang);
    165             if (searchLang.equals("anylang")) {
     176            if (searchLang.equals(Languages.ANY_LANGUAGE_NAME)) {
    166177                this.weblichtTcf.setVisible(false);
    167178            } else {
     
    230241        String url = searchResultsComposer.useWebLichtOnText();
    231242        if (url != null) {
    232             Executions.getCurrent().sendRedirect(WEBLICHT_URL
     243            Executions.getCurrent().sendRedirect(weblichtUrl
    233244                + url, "_blank");
    234245        }
     
    239250        String url = searchResultsComposer.useWebLichtOnToks();
    240251        if (url != null) {
    241             Executions.getCurrent().sendRedirect(WEBLICHT_URL
     252            Executions.getCurrent().sendRedirect(weblichtUrl
    242253                + url, "_blank");
    243254        }
     
    335346            searchOffset[1] = maxRecords;
    336347            searchResultsComposer.executeSearch(selectedCorpora, searchOffset[0], maxRecords, searchString.getText(), searchLang);
    337             if (searchLang.equals("anylang")) {
     348            if (searchLang.equals(Languages.ANY_LANGUAGE_NAME)) {
    338349                this.weblichtTcf.setVisible(false);
    339350            } else {
     
    365376            searchOffset[1] = maxRecords;
    366377            searchResultsComposer.executeSearch(selectedCorpora, searchOffset[0], maxRecords, searchString.getText(), searchLang);
    367             if (searchLang.equals("anylang")) {
     378            if (searchLang.equals(Languages.ANY_LANGUAGE_NAME)) {
    368379                this.weblichtTcf.setVisible(false);
    369380            } else {
     
    408419    }
    409420
     421    private void processContext() {
     422        InitialContext context;
     423        try {
     424            context = new InitialContext();
     425            weblichtUrl = (String) context.lookup("java:comp/env/weblicht-url");
     426        } catch (NamingException ex) {
     427            LOGGER.log(Level.SEVERE, null, ex);
     428        }
     429    }
     430
    410431}
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/app/PagesVisibility.java

    r3038 r5041  
    66/**
    77 * Class to control which/how page is to be displayed in the main Aggregator window
    8  * (about page, search options page, results page or help page).
     8 * ('about' page, 'search options' page, 'results' page or 'help' page).
    99 *
    1010 * @author Yana Panchenko
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/app/SearchOptions.java

    r5040 r5041  
    6363    @Wire
    6464    private Comboitem anyLanguage;
     65    @Wire
     66    private Combobox maximumRecordsSelect;
     67    @Wire
     68    private Groupbox allCorpora;
     69    @Wire
     70    private Tree tree;
     71    @Wire
     72    private Treecol nameCol;
     73    @Wire
     74    private Treecol instCol;
     75   
    6576    private Languages languages;
    66    
    67     @Wire
    68     private Combobox maximumRecordsSelect;
    69    
    70     @Wire
    71     private Groupbox allCorpora;
    72     @Wire
    73     private Tree tree;
    7477    private Map<String, List<String>> xAggregationContext;
    75    
    7678    private CorpusModelI corporaModel;
    7779    private CorpusRenderer corpusRenderer;
    78    
    79     private boolean liveMode = false;
    80 
    8180    private ScanCache cache;
    82    
    8381    private Aggregator aggregatorController;
    8482   
     
    8886        setUpAggerationContext();
    8987        cache = (ScanCache) Executions.getCurrent().getDesktop().getWebApp().getAttribute(WebAppListener.CORPUS_CACHE);
    90         //if (cache.isEmpty()) {
    91         //    liveMode = true;
    92         //}
    9388        setUpCorpusTree();
    9489        languages = (Languages) Executions.getCurrent().getDesktop().getWebApp().getAttribute(WebAppListener.LANGUAGES);
     
    176171        Treechildren openTreeItems = tree.getTreechildren();
    177172        for (Treeitem openItem : openTreeItems.getItems()) {
    178            
    179173            DefaultTreeNode<Corpus> node = (DefaultTreeNode<Corpus>) openItem.getValue();
    180             //Corpus data = node.getData();
    181             //System.out.println(data);
    182            
    183174            corpusRenderer.updateItem(openItem, false);
    184175        }
     
    214205                        }
    215206                    }
    216                    
    217 //                    // this is a temporary solution,
    218 //                    // the whole concept on how selected externally resources
    219 //                    // are displayed has to be changed, otherwise endpoints with
    220 //                    // hundreds of subresources will break the tree interface
    221 //                    // by loading all their resources...
    222 //                    List<String> handlesCopy = new ArrayList<String>(handles.size());
    223 //                    handlesCopy.addAll(handles);
    224 //                    selectCorpora(openItem, data, handlesCopy);
    225207                }
    226208            }
     
    249231                availableLangs.add(corpus.getLanguages().iterator().next());
    250232            }
    251             //for (String langCode : corpus.getLanguages()) {
    252             //    availableLangs.add(langCode);
    253             //}
    254         }
    255 
    256         //List<String> sortedAvailableLanguages = new ArrayList<String>(availableLangs.size());
    257         //sortedAvailableLanguages.addAll(availableLangs);
    258         //Collections.sort(sortedAvailableLanguages);
     233        }
     234
    259235        List<Language> sortedLangs = new ArrayList<Language>(availableLangs.size());
    260236        for (String langCode : availableLangs) {
     
    307283            this.corporaModel = model;
    308284            this.corpusRenderer = renderer;
    309         } else if (liveMode) {
     285        } else if (isLiveModeOn()) {
    310286            CenterRegistryI registry = new CenterRegistryLive();
    311287            CorpusModelLive model = new CorpusModelLive(registry);
     
    325301            this.corpusRenderer = renderer;
    326302        }
    327         Treecol nameCol = (Treecol) tree.getTreecols().getFellow("nameCol");
     303        //Treecol nameCol = (Treecol) tree.getTreecols().getFellow("nameCol");
    328304        nameCol.setSortAscending(new CorpusByNameComparator());
    329305        nameCol.setSortDescending(new CorpusByNameDComparator());
    330         Treecol instCol = (Treecol) tree.getTreecols().getFellow("instCol");
     306        //Treecol instCol = (Treecol) tree.getTreecols().getFellow("instCol");
    331307        instCol.setSortAscending(new CorpusByInstitutionComparator());
    332308        instCol.setSortDescending(new CorpusByInstitutionDComparator());
     
    335311
    336312
    337     private void selectCorpora(Treeitem openItem, Corpus data, List<String> handles) {
    338         List<String> handlesFound = new ArrayList<String>();
    339         for (String handle : handles) {
    340             if (handle.equals(data.getHandle())) {
    341                 handlesFound.add(handle);
    342             }
    343         }
    344         for (String handle : handlesFound) {
    345             corpusRenderer.updateItem(openItem, true);
    346             handles.remove(handle);
    347         }
    348        
    349         if (!handles.isEmpty()) {
    350             int sizeBefore = handles.size();
    351             openItem.setOpen(true);
    352             Treechildren tchildren = openItem.getTreechildren();
    353             List<Treeitem> tcitems = new ArrayList<Treeitem>();
    354             tcitems.addAll(tchildren.getItems());
    355             for (Treeitem child : tcitems) {
    356                 DefaultTreeNode<Corpus> node = (DefaultTreeNode<Corpus>) child.getValue();
    357                 Corpus cdata = node.getData();
    358                 selectCorpora(child, cdata, handles);
    359                 if (handles.isEmpty()) {
    360                     break;
    361                 }
    362             }
    363             if (sizeBefore == handles.size()) {
    364                 openItem.setOpen(false);
    365             }
    366         }
    367     }
     313//    private void selectCorpora(Treeitem openItem, Corpus data, List<String> handles) {
     314//        List<String> handlesFound = new ArrayList<String>();
     315//        for (String handle : handles) {
     316//            if (handle.equals(data.getHandle())) {
     317//                handlesFound.add(handle);
     318//            }
     319//        }
     320//        for (String handle : handlesFound) {
     321//            corpusRenderer.updateItem(openItem, true);
     322//            handles.remove(handle);
     323//        }
     324//       
     325//        if (!handles.isEmpty()) {
     326//            int sizeBefore = handles.size();
     327//            openItem.setOpen(true);
     328//            Treechildren tchildren = openItem.getTreechildren();
     329//            List<Treeitem> tcitems = new ArrayList<Treeitem>();
     330//            tcitems.addAll(tchildren.getItems());
     331//            for (Treeitem child : tcitems) {
     332//                DefaultTreeNode<Corpus> node = (DefaultTreeNode<Corpus>) child.getValue();
     333//                Corpus cdata = node.getData();
     334//                selectCorpora(child, cdata, handles);
     335//                if (handles.isEmpty()) {
     336//                    break;
     337//                }
     338//            }
     339//            if (sizeBefore == handles.size()) {
     340//                openItem.setOpen(false);
     341//            }
     342//        }
     343//    }
    368344   
    369345   
     
    373349        if (paramValue != null) {
    374350            String mode = paramValue[0].trim();
    375             LOGGER.log(Level.INFO, "Received parameter: {0}[{1}]", new String[]{Aggregator.MODE_PARAM, mode});
    376351            if (mode.equals(Aggregator.MODE_PARAM_VALUE_TEST)) {
    377352                testingOn = true;
     353                LOGGER.log(Level.INFO, "Received parameter: {0}[{1}]", new String[]{Aggregator.MODE_PARAM, mode});
    378354            }
    379355        }
    380356        return testingOn;
     357    }
     358   
     359    private boolean isLiveModeOn() {
     360        boolean liveOn = false;
     361        String[] paramValue = Executions.getCurrent().getParameterMap().get(Aggregator.MODE_PARAM);
     362        if (paramValue != null) {
     363            String mode = paramValue[0].trim();
     364            if (mode.equals(Aggregator.MODE_PARAM_VALUE_LIVE)) {
     365                liveOn = true;
     366                LOGGER.log(Level.INFO, "Received parameter: {0}[{1}]", new String[]{Aggregator.MODE_PARAM, mode});
     367            }
     368        }
     369        return liveOn;
    381370    }
    382371       
     
    386375        if (paramValue != null) {
    387376            String mode = paramValue[0].trim();
    388             LOGGER.log(Level.INFO, "Received parameter: {0}[{1}]", new String[]{Aggregator.MODE_PARAM, mode});
    389377            if (mode.equals(Aggregator.MODE_PARAM_VALUE_SEARCH)) {
    390378                searchOn = true;
     379                LOGGER.log(Level.INFO, "Received parameter: {0}[{1}]", new String[]{Aggregator.MODE_PARAM, mode});
    391380            }
    392381        }
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/app/WebAppListener.java

    r5040 r5041  
    2525import java.util.logging.Level;
    2626import java.util.logging.Logger;
     27import javax.naming.InitialContext;
     28import javax.naming.NamingException;
     29import javax.servlet.ServletContext;
    2730import opennlp.tools.tokenize.TokenizerModel;
    2831import org.joda.time.DateTime;
     
    4043public class WebAppListener implements WebAppInit, WebAppCleanup {
    4144
     45    private static final Logger LOGGER = Logger.getLogger(WebAppListener.class.getName());
    4246    public static final String ACTIVE_SEARCH_CONTROLLERS = "ACTIVE_SEARCH_CONTROLLERS";
    4347    public static final String SHARED_SRU_CLIENT = "SHARED_SRU_CLIENT";
    4448    public static final String LANGUAGES = "LANG";
    4549    public static final String CORPUS_CACHE = "CORPUS_CACHE";
    46     private static final Logger LOGGER = Logger.getLogger(WebAppListener.class.getName());
    47     //private static final int HOURS_BETWEEN_CACHE_UPDATE = 3;
     50    public static final String CORPUS_CRAWLER = "CORPUS_CRAWLER";
     51    public static final int WAITING_TIME_FOR_SRUCLIENT_SHUTDOWN_MS = 10000;
     52    public static final int WAITING_TIME_FOR_POOL_SHUTDOWN_MS = 60000;
    4853    //private Timer cacheTimer;
    4954    public static final String DE_TOK_MODEL = "/tokenizer/de-tuebadz-8.0-token.bin";
    50     private static final String AGGREGATOR_DIR_NAME = "aggregator";
     55    private static final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
     56    private static final String DEFAULT_DATA_LOCATION = "/data";
     57    private String dataLocation; // defined in web.xml with fall-back in the code
     58    private String aggregatorDirName; // defined in web.xml
    5159    private static final String SCAN_DIR_NAME = "scan";
    52     private static final TimeUnit CACHE_UPDATE_INTERVAL_UNIT = TimeUnit.HOURS;
    53     private static final int CACHE_UPDATE_INTERVAL = 6;
    54     private static final int CACHE_MAX_DEPTH = 3;
    55     private static final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
    56     public static final String CORPUS_CRAWLER = "CORPUS_CRAWLER";
     60    private TimeUnit cacheUpdateIntervalUnit; // defined in web.xml
     61    private Integer cacheUpdateInterval; // defined in web.xml
     62    private Integer cacheMaxDepth; // defined in web.xml
    5763
    5864    @Override
    59     public void init(WebApp webapp) throws Exception {
     65    public void init(WebApp webapp) {
    6066
    6167        LOGGER.info("Aggregator is starting.");
    62        
     68        processContext();
     69
    6370        Set<SearchResults> activeControllers = new HashSet<SearchResults>();
    6471        webapp.setAttribute(ACTIVE_SEARCH_CONTROLLERS, activeControllers);
    65        
     72
    6673        SRUThreadedClient sruClient = new SRUThreadedClient();
    6774        sruClient.registerRecordParser(new ClarinFCSRecordParser());
     
    7077        Languages languages = new Languages();
    7178        webapp.setAttribute(LANGUAGES, languages);
    72        
    73         //setUpScanCache(webapp);
    74         setUpScanCacheForReadOnly(webapp);
    75        
     79
     80        setUpScanCache(webapp);
     81        //setUpScanCacheForReadOnly(webapp);
     82
    7683        setUpTokenizers(webapp);
    77        
     84
    7885    }
    7986
     
    9299
    93100    private String getScanDirectory() {
    94         File aggregatorDir = new File(System.getProperty("user.home"), "/." + AGGREGATOR_DIR_NAME);
    95         //File aggregatorDir = new File("/var/www", "/." + AGGREGATOR_DIR_NAME);
    96         //File aggregatorDir = new File("/data/fcsAggregator");
    97        
     101
     102        File aggregatorDir = new File(dataLocation, aggregatorDirName);
    98103        if (!aggregatorDir.exists()) {
    99             if (!aggregatorDir.mkdir()) {
    100                 LOGGER.info("Scan directory does not exist and cannot be created: "
     104            LOGGER.severe("Aggregator directory does not exist and cannot be created: "
     105                        + aggregatorDir.getAbsolutePath());
     106        }
     107        File scanDir = new File(aggregatorDir, SCAN_DIR_NAME);
     108        if (!scanDir.exists()) {
     109            if (!scanDir.mkdir()) {
     110                LOGGER.severe("Scan directory does not exist and cannot be created: "
    101111                        + aggregatorDir.getAbsolutePath());
    102112            }
    103113        }
    104         File scanDir = new File(aggregatorDir, SCAN_DIR_NAME);
    105         if (!scanDir.exists()) {
    106             scanDir.mkdir();
    107         }
    108114        String scanPath = scanDir.getAbsolutePath();
    109         LOGGER.info("Scan location: " + scanPath);
     115        LOGGER.info("Scan data location: " + scanPath);
    110116        return scanPath;
    111117    }
    112    
     118
    113119    /**
    114      * Use this method instead of setUpScanCache() method if it is necessary
    115      * to run the application without scan data crawl, given that the scan
    116      * data was crawled before and was stored as cache under appropriate
    117      * location (useful when testing or when smth is wrong with the endpoint
    118      * scan responses).
    119      *
    120      * @param webapp
     120     * Use this method instead of setUpScanCache() method if it is necessary to
     121     * run the application without scan data crawl, given that the scan data was
     122     * crawled before and was stored as cache under appropriate location (useful
     123     * when testing or when smth is wrong with the endpoint scan responses).
     124     *
     125     * @param webapp
    121126     */
    122127    private void setUpScanCacheForReadOnly(WebApp webapp) {
     
    145150        //filter.urlShouldContainAnyOf("dspin.dwds.de", "lindat.");
    146151        //ScanCrawler scanCrawler = new ScanCrawler(centerRegistry, sruScanClient, filter, CACHE_MAX_DEPTH);
    147         ScanCrawler scanCrawler = new ScanCrawler(centerRegistry, sruScanClient, null, CACHE_MAX_DEPTH);
     152        ScanCrawler scanCrawler = new ScanCrawler(centerRegistry, sruScanClient, null, cacheMaxDepth);
    148153        ScanCache scanCache;
    149154
    150         //synchronized (scanCrawler) {
    151             LOGGER.info("Start cache read");
    152             try {
    153                 scanCache = scanCacheFiled.read();
    154                 LOGGER.info("Finished cache read, number of root corpora: " + scanCache.getRootCorpora().size());
    155             } catch (Exception e) {
    156                 LOGGER.log(Level.SEVERE, "Error while reading the scan cache!", e);
    157                 scanCache = new SimpleInMemScanCache();
    158             }
    159         //}
     155        LOGGER.info("Start cache read");
     156        try {
     157            scanCache = scanCacheFiled.read();
     158            LOGGER.info("Finished cache read, number of root corpora: " + scanCache.getRootCorpora().size());
     159        } catch (Exception e) {
     160            LOGGER.log(Level.SEVERE, "Error while reading the scan cache!", e);
     161            scanCache = new SimpleInMemScanCache();
     162        }
    160163        webapp.setAttribute(CORPUS_CACHE, scanCache);
    161164        webapp.setAttribute(CORPUS_CRAWLER, scanCrawler);
     
    163166        scheduler.scheduleAtFixedRate(
    164167                new ScanCrawlTask(scanCrawler, scanCacheFiled, webapp),
    165                 0, CACHE_UPDATE_INTERVAL, CACHE_UPDATE_INTERVAL_UNIT);
     168                0, cacheUpdateInterval, cacheUpdateIntervalUnit);
    166169
    167170    }
     
    176179            // Wait 10 secs for existing tasks to terminate
    177180            // replace with awaitTermination if ever provided in SRUClient API
    178             Thread.sleep(10000);
     181            Thread.sleep(WAITING_TIME_FOR_SRUCLIENT_SHUTDOWN_MS);
    179182            sruClient.shutdownNow(); // Cancel currently executing tasks
    180183            // Wait 10 secs for tasks to respond to being cancelled
    181184            // replace with awaitTermination if ever provided in SRUClient API
    182             Thread.sleep(10000);
     185            Thread.sleep(WAITING_TIME_FOR_SRUCLIENT_SHUTDOWN_MS);
    183186        } catch (InterruptedException ie) {
    184187            // (Re-)Cancel if current thread also interrupted
     
    193196        try {
    194197            // Wait a while for existing tasks to terminate
    195             if (!pool.awaitTermination(60, TimeUnit.SECONDS)) {
     198            if (!pool.awaitTermination(WAITING_TIME_FOR_POOL_SHUTDOWN_MS,
     199                    TimeUnit.MILLISECONDS)) {
    196200                pool.shutdownNow(); // Cancel currently executing tasks
    197201                // Wait a while for tasks to respond to being cancelled
    198                 if (!pool.awaitTermination(60, TimeUnit.SECONDS)) {
     202                if (!pool.awaitTermination(WAITING_TIME_FOR_POOL_SHUTDOWN_MS,
     203                        TimeUnit.MILLISECONDS)) {
    199204                    LOGGER.info("Pool did not terminate");
    200205                }
     
    220225    }
    221226
     227    private void processContext() {
     228        try {
     229            InitialContext context;
     230            context = new InitialContext();
     231            String dataLocationPropertyName = (String) context.lookup("java:comp/env/data-location-property");
     232            aggregatorDirName = (String) context.lookup("java:comp/env/aggregator-folder");
     233            String updateIntervalUnitString = (String) context.lookup("java:comp/env/update-interval-unit");
     234            cacheUpdateIntervalUnit = TimeUnit.valueOf(updateIntervalUnitString);
     235            cacheUpdateInterval = (Integer) context.lookup("java:comp/env/update-interval");
     236            cacheMaxDepth = (Integer) context.lookup("java:comp/env/scan-max-depth");
     237            // see if data location is set in properties
     238            dataLocation = System.getProperty(dataLocationPropertyName);
     239            if (dataLocation == null || !(new File(dataLocation, aggregatorDirName).exists())) {
     240                dataLocation = DEFAULT_DATA_LOCATION;
     241                if (!(new File(dataLocation, aggregatorDirName).exists())) {
     242                    dataLocation = System.getProperty("user.home");
     243                }
     244                if ((new File(dataLocation, aggregatorDirName).exists())) {
     245                    LOGGER.info(dataLocationPropertyName + " property is not defined, "
     246                            + "setting to default: " + dataLocation);
     247                } else {
     248                    LOGGER.info(dataLocationPropertyName + " property is not defined, "
     249                            + "default location does not extist: " + dataLocation);
     250                    throw new RuntimeException("Data location not found");
     251                }
     252            }
     253        } catch (NamingException ex) {
     254            Logger.getLogger(WebAppListener.class.getName()).log(Level.SEVERE, null, ex);
     255        }
     256    }
    222257}
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/sopt/CenterRegistryLive.java

    r5035 r5041  
    1313import java.util.logging.Level;
    1414import java.util.logging.Logger;
     15import javax.naming.InitialContext;
     16import javax.naming.NamingException;
    1517
    1618/**
     
    2224
    2325    private static final Logger LOGGER = Logger.getLogger(CenterRegistryLive.class.getName());
    24     private static final String CENTER_REGISTRY_URL = "http://130.183.206.32/restxml/";
     26    //private static final String CENTER_REGISTRY_URL = "http://130.183.206.32/restxml/";
     27    private String centerRegistryUrl; //defined in web.xml
    2528    //https://centerregistry-clarin.esc.rzg.mpg.de/restxml/
    2629    private boolean hasInstitutionsLoaded = false;
    2730    private List<Institution> centers = new ArrayList<Institution>();
     31   
     32    public CenterRegistryLive() {
     33        super();
     34        processContext();
     35    }
    2836
    2937    @Override
     
    3947            }
    4048            hasInstitutionsLoaded = true;
    41             URI url = URI.create(CENTER_REGISTRY_URL);
     49            URI url = URI.create(centerRegistryUrl);
    4250            CenterRegistryConnector connector = new CenterRegistryConnector(url, 30000);
    4351             try {
     
    9098        return centers.get(index);
    9199    }
     100   
     101    private void processContext() {
     102        InitialContext context;
     103        try {
     104            context = new InitialContext();
     105            centerRegistryUrl = (String) context.lookup("java:comp/env/center-registry-url");
     106        } catch (NamingException ex) {
     107            LOGGER.log(Level.SEVERE, null, ex);
     108        }
     109    }
    92110
    93111}
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/sopt/Corpus.java

    r5035 r5041  
    66
    77/**
     8 * Represents information about corpus resource, such as corpus handle (id),
     9 * institution, title, description, language(s), etc. Does not store the
     10 * information about corpus sub-corpora.
    811 *
    912 * @author Yana Panchenko
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/sopt/CorpusByInstitutionComparator.java

    r3038 r5041  
    55
    66/**
     7 * Comparator necessary for sorting the corpora according to their
     8 * institution name in ascending order.
    79 *
    810 * @author Yana Panchenko
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/sopt/CorpusByInstitutionDComparator.java

    r3038 r5041  
    55
    66/**
    7  *
     7 * Comparator necessary for sorting the corpora according to their
     8 * institution name in descending order.
     9 *
    810 * @author Yana Panchenko
    911 */
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/sopt/CorpusByNameComparator.java

    r3038 r5041  
    55
    66/**
    7  *
     7 * Comparator necessary for sorting the corpora according to the corpus name
     8 * in ascending order.
     9 *
    810 * @author Yana Panchenko
    911 */
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/sopt/CorpusByNameDComparator.java

    r3038 r5041  
    55
    66/**
    7  *
     7 * Comparator necessary for sorting the corpora according to the corpus name
     8 * in descending order.
     9 *
    810 * @author Yana Panchenko
    911 */
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/sopt/CorpusModelCached.java

    r5035 r5041  
    1515
    1616/**
    17  *
     17 * Represents corpora model where corpora data is taken from cache of the
     18 * pre-crawled scan requests.
     19 *
    1820 * @author Yana Panchenko
    1921 */
     
    161163
    162164    private void initCorpusTree() {
    163         //System.out.println("Initializing tree");
    164         //System.out.println(cache);
    165165        for (Corpus c : cache.getRootCorpora()) {
    166166            // create node from root corpora
    167             DefaultTreeNode<Corpus> rootChildNode = new DefaultTreeNode(c, new ArrayList<DefaultTreeNode<Corpus>>());
    168            
    169             //System.out.println("Adding children to root node " + c.getEndpointUrl() + " " + c.getHandle());
     167            DefaultTreeNode<Corpus> rootChildNode =
     168                    new DefaultTreeNode(c, new ArrayList<DefaultTreeNode<Corpus>>());
    170169            // add children to that node
    171170            addChildren(rootChildNode);
    172            
    173             //System.out.println("Adding root to tree " + c.getEndpointUrl() + " " + c.getHandle());
    174171            // add to the root of the model
    175172            super.getRoot().getChildren().add(rootChildNode);
     
    182179       
    183180        List<Corpus> corpusChildren = cache.getChildren(corpus);
    184         //System.out.println("Getting children of " + corpus.getEndpointUrl() + " " + corpus.getHandle() + "--> " + corpusChildren);
    185181        for (Corpus corpusChild : corpusChildren) {
    186182            DefaultTreeNode<Corpus> child = new DefaultTreeNode(corpusChild, new ArrayList<DefaultTreeNode<Corpus>>());
    187183            parentNode.add(child);
    188             //System.out.println("Adding child " + corpusChild.getEndpointUrl() + " " + corpusChild.getHandle());
    189184            addChildren(child);
    190185        }
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/sopt/CorpusModelI.java

    r3058 r5041  
    77
    88/**
    9  *
     9 * Represents corpora model that has access to Corpus objects and their
     10 * information about corpora.
     11 *
    1012 * @author Yana Panchenko
    1113 */
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/sopt/CorpusModelLive.java

    r5039 r5041  
    11package eu.clarin.sru.fcs.aggregator.sopt;
    22
    3 import eu.clarin.sru.client.SRUClientException;
    4 import eu.clarin.sru.client.SRUScanRequest;
    5 import eu.clarin.sru.client.SRUScanResponse;
    6 import eu.clarin.sru.client.SRUTerm;
    73import eu.clarin.sru.client.SRUThreadedClient;
    84import eu.clarin.sru.fcs.aggregator.app.WebAppListener;
    95import eu.clarin.sru.fcs.aggregator.cache.ScanCrawler;
    10 import static eu.clarin.sru.fcs.aggregator.sopt.Corpus.ROOT_HANDLE;
    11 import eu.clarin.sru.fcs.aggregator.util.SRUCQL;
    126import java.util.ArrayList;
    137import java.util.Arrays;
     
    1711import java.util.Map;
    1812import java.util.Set;
    19 import java.util.concurrent.ExecutionException;
    20 import java.util.concurrent.Future;
    21 import java.util.concurrent.TimeUnit;
    22 import java.util.concurrent.TimeoutException;
    23 import java.util.logging.Level;
    2413import java.util.logging.Logger;
    25 import org.w3c.dom.DocumentFragment;
    26 import org.w3c.dom.Element;
    27 import org.w3c.dom.Node;
    28 import org.w3c.dom.NodeList;
    2914import org.zkoss.zk.ui.Executions;
    3015import org.zkoss.zul.DefaultTreeModel;
     
    3318
    3419/**
    35  *
     20 * Represents corpora model where corpora data is taken from live requests to
     21 * corpus endpoints.
     22 *
    3623 * @author Yana Panchenko
    3724 */
     
    4835    }
    4936
     37    @Override
    5038    public boolean isCorpusSelected(DefaultTreeNode<Corpus> node) {
    5139        if (selectedCorpora.containsKey(node.getData().getEndpointUrl())) {
     
    6856     * parent's children
    6957     */
     58    @Override
    7059    public void remove(DefaultTreeNode<Corpus> parent, int indexFrom, int indexTo) {
    7160        for (int i = indexTo; i >= indexFrom; i--) {
     
    8574     * parent's children
    8675     */
     76    @Override
    8777    public void remove(DefaultTreeNode<Corpus> parent, int index) {
    8878        parent.getChildren().remove(index);
     
    10292     * parent's children
    10393     */
     94    @Override
    10495    public void insert(DefaultTreeNode<Corpus> parent, int indexFrom, int indexTo, DefaultTreeNode<Corpus>[] newNodes) {
    10596        for (int i = indexFrom; i <= indexTo; i++) {
     
    116107     * @param newNodes New nodes which are appended
    117108     */
     109    @Override
    118110    public void add(DefaultTreeNode<Corpus> parent, DefaultTreeNode<Corpus>[] newNodes) {
    119111        parent.getChildren().addAll(Arrays.asList(newNodes));
     
    128120     * @param newNode New node which is appended
    129121     */
     122    @Override
    130123    public void add(DefaultTreeNode<Corpus> parent, DefaultTreeNode<Corpus> newNode) {
    131124        parent.getChildren().add(newNode);
    132125    }
    133126
     127    @Override
    134128    public boolean hasChildren(Treeitem item) {
    135129        return !item.getTreechildren().getChildren().isEmpty();
     
    165159     * @param corpus The corpus that the new appended node should contain
    166160     */
     161    @Override
    167162    public void add(DefaultTreeNode<Corpus> parent, Corpus corpus) {
    168163        DefaultTreeNode<Corpus> childNode = createNodeWithTempChildren(corpus);
     
    170165    }
    171166
     167    @Override
    172168    public void addToSelected(Corpus data) {
    173169        if (!this.selectedCorpora.containsKey(data.getEndpointUrl())) {
     
    178174    }
    179175
     176    @Override
    180177    public void removeFromSelected(Corpus data) {
    181178        if (this.selectedCorpora.containsKey(data.getEndpointUrl())) {
     
    184181    }
    185182
     183    @Override
    186184    public Map<String, Set<Corpus>> getSelectedCorpora() {
    187185        return selectedCorpora;
     
    192190        for (Institution instit : startingPoint.getCQLInstitutions()) {
    193191            for (Endpoint endp : instit.getEndpoints()) {
    194                 //try {
    195                     //TODO: temp for testing, this 3 lines are to be removed:
    196                     //if (//!endp.getUrl().contains("uni-leipzig.de") &&
    197                     //        !endp.getUrl().contains("mpi.")
    198                     //        && !endp.getUrl().contains("ids-mannheim")
    199                     //        && !endp.getUrl().contains("weblicht")) {
    200                     //    continue;
    201                     //}
    202                    
    203192                    List<Corpus> rootCorpora = ScanCrawler.doScan(sruClient, endp.getUrl(), instit, null);
    204193                    for (Corpus c : rootCorpora) {
     
    206195                        super.getRoot().add(rootChild);
    207196                    }
    208 //                    Future<SRUScanResponse> corporaResponse = null;
    209 //                    SRUScanRequest corporaRequest = new SRUScanRequest(endp.getUrl());
    210 //                    StringBuilder scanClause = new StringBuilder(SRUCQL.SCAN_RESOURCE_PARAMETER);
    211 //                    scanClause.append("=");
    212 //                    scanClause.append(ROOT_HANDLE);
    213 //                    corporaRequest.setScanClause(scanClause.toString());
    214 //                    corporaRequest.setExtraRequestData(SRUCQL.SCAN_RESOURCE_INFO_PARAMETER, "true");
    215 //                    corporaResponse = sruClient.scan(corporaRequest);
    216 //                    SRUScanResponse response = corporaResponse.get(200, TimeUnit.SECONDS);
    217 //                    if (response != null && response.hasTerms()) {
    218 //                        for (SRUTerm term : response.getTerms()) {
    219 //                            Corpus c = new Corpus(instit, endp.getUrl());
    220 //                            c.setHandle(term.getValue());
    221 //                            c.setDisplayName(term.getDisplayTerm());
    222 //                            c.setNumberOfRecords(term.getNumberOfRecords());
    223 //                            addExtraInfo(c, term);
    224 //                            DefaultTreeNode<Corpus> rootChild = createNodeWithTempChildren(c);
    225 //                            super.getRoot().add(rootChild);
    226 //                        }
    227 //                    } else {
    228 //                        Corpus endpCorpus = new Corpus(endp.getInstitution(), endp.getUrl());
    229 //                        DefaultTreeNode<Corpus> rootChild = createNodeWithTempChildren(endpCorpus);
    230 //                        super.getRoot().add(rootChild);
    231 //                    }
    232 //                } catch (SRUClientException ex) {
    233 //                    logger.log(Level.SEVERE, "Error accessing corpora {0} at {1} {2} {3}",
    234 //                            new String[]{ROOT_HANDLE, endp.getUrl(), ex.getClass().getName(), ex.getMessage()});
    235 //                } catch (InterruptedException ex) {
    236 //                    logger.log(Level.SEVERE, "Error accessing corpora {0} at {1} {2} {3}",
    237 //                            new String[]{ROOT_HANDLE, endp.getUrl(), ex.getClass().getName(), ex.getMessage()});
    238 //                } catch (ExecutionException ex) {
    239 //                    logger.log(Level.SEVERE, "Error accessing corpora {0} at {1} {2} {3}",
    240 //                            new String[]{ROOT_HANDLE, endp.getUrl(), ex.getClass().getName(), ex.getMessage()});
    241 //                } catch (TimeoutException ex) {
    242 //                    logger.log(Level.SEVERE, "Timeout scanning corpora {0} at {1} {2} {3}",
    243 //                            new String[]{ROOT_HANDLE, endp.getUrl(), ex.getClass().getName(), ex.getMessage()});
    244 //                }
    245197            }
    246198
     
    249201   
    250202    private Iterable<Corpus> getSubcorpora(Corpus corpus) {
    251         //get rid of institution and endpoint? get get this info from corpus
     203       
    252204        return ScanCrawler.doScan(sruClient, corpus.getEndpointUrl(), corpus.getInstitution(), corpus);
    253     }
    254 
    255 //    private Iterable<Corpus> getSubcorpora(Corpus corpus) {
    256 //        logger.info("OBTAINING SUBCORPORA");
    257 //        ArrayList<Corpus> subCorpora = new ArrayList<Corpus>();
    258 //        try {
    259 //           
    260 //           
    261 //            SRUScanRequest corporaRequest = new SRUScanRequest(corpus.getEndpointUrl());
    262 //            StringBuilder scanClause = new StringBuilder(SRUCQL.SCAN_RESOURCE_PARAMETER);
    263 //            scanClause.append("=");
    264 //            String resourceValue = corpus.getHandle();
    265 //            if (corpus.getHandle() == null) {
    266 //                resourceValue = ROOT_HANDLE;
    267 //            }
    268 //            if (Corpus.HANDLE_WITH_SPECIAL_CHARS.matcher(resourceValue).matches()) {
    269 //                resourceValue = "%22" + resourceValue + "%22";
    270 //            }
    271 //            scanClause.append(resourceValue);
    272 //            corporaRequest.setScanClause(scanClause.toString());
    273 //            //!!!TODO request doesn't work for scan with resource handle???
    274 //            //corporaRequest.setExtraRequestData(SRUCQLscan.RESOURCE_INFO_PARAMETER, "true");
    275 //            Future<SRUScanResponse> corporaResponse = sruClient.scan(corporaRequest);
    276 //            logger.info("BEFORE get " + resourceValue);
    277 //            SRUScanResponse response = corporaResponse.get(200, TimeUnit.SECONDS);
    278 //            logger.info("AFTER get " + resourceValue);
    279 //            if (response != null && response.hasTerms()) {
    280 //            for (SRUTerm term : response.getTerms()) {
    281 //                Corpus c = new Corpus(corpus.getInstitution(), corpus.getEndpointUrl());
    282 //                c.setHandle(term.getValue());
    283 //                c.setDisplayName(term.getDisplayTerm());
    284 //                c.setNumberOfRecords(term.getNumberOfRecords());
    285 //                addExtraInfo(c, term);
    286 //                subCorpora.add(c);
    287 //            }
    288 //            logger.info("OBTAINED SUBCORPORA " + subCorpora.size());
    289 //        }
    290 //        } catch (SRUClientException ex) {
    291 //            logger.log(Level.SEVERE, "Error accessing corpora {0} at {1} {2} {3}",
    292 //                    new String[]{corpus.getHandle(), corpus.getEndpointUrl(), ex.getClass().getName(), ex.getMessage()});
    293 //        } catch (InterruptedException ex) {
    294 //            logger.log(Level.SEVERE, "Error accessing corpora {0} at {1} {2} {3}",
    295 //                    new String[]{corpus.getHandle(), corpus.getEndpointUrl(), ex.getClass().getName(), ex.getMessage()});
    296 //        } catch (ExecutionException ex) {
    297 //            logger.log(Level.SEVERE, "Error accessing corpora {0} at {1} {2} {3}",
    298 //                    new String[]{corpus.getHandle(), corpus.getEndpointUrl(), ex.getClass().getName(), ex.getMessage()});
    299 //        } catch (TimeoutException ex) {
    300 //            logger.log(Level.SEVERE, "Timeout scanning corpora {0} at {1} {2} {3}",
    301 //                    new String[]{corpus.getHandle(), corpus.getEndpointUrl(), ex.getClass().getName(), ex.getMessage()});
    302 //        }
    303 //       
    304 //        return subCorpora;
    305 //    }
    306 
    307     private void addExtraInfo(Corpus c, SRUTerm term) {
    308 
    309         DocumentFragment extraInfo = term.getExtraTermData();
    310         String enDescription = null;
    311         if (extraInfo != null) {
    312             NodeList infoNodes = extraInfo.getChildNodes().item(0).getChildNodes();
    313             for (int i = 0; i < infoNodes.getLength(); i++) {
    314                 Node infoNode = infoNodes.item(i);
    315                 if (infoNode.getNodeType() == Node.ELEMENT_NODE && infoNode.getLocalName().equals("LandingPageURI")) {
    316                     c.setLandingPage(infoNode.getTextContent().trim());
    317                 } else if (infoNode.getNodeType() == Node.ELEMENT_NODE && infoNode.getLocalName().equals("Languages")) {
    318                     NodeList languageNodes = infoNode.getChildNodes();
    319                     for (int j = 0; j < languageNodes.getLength(); j++) {
    320                         if (languageNodes.item(j).getNodeType() == Node.ELEMENT_NODE && languageNodes.item(j).getLocalName().equals("Language")) {
    321                             Element languageNode = (Element) languageNodes.item(j);
    322                             String languageText = languageNode.getTextContent().trim();
    323                             if (!languageText.isEmpty()) {
    324                                 c.addLanguage(languageText.trim());
    325                             }
    326                         }
    327 
    328                     }
    329                 } else if (infoNode.getNodeType() == Node.ELEMENT_NODE && infoNode.getLocalName().equals("Description")) {
    330                     Element element = (Element) infoNode;
    331                     c.setDescription(infoNode.getTextContent().trim());
    332                     //String lang = element.getAttributeNS("http://clarin.eu/fcs/1.0/resource-info", "lang");
    333                     //System.out.println("ATTRIBUTE LANG: " + lang);
    334                     if ("en".equals(element.getAttribute("xml:lang"))) {
    335                         enDescription = infoNode.getTextContent().trim();
    336                     }
    337                 }
    338             }
    339             // description in Engish has priority
    340             if (enDescription != null && !enDescription.isEmpty()) {
    341                 c.setDescription(enDescription);
    342             }
    343         }
    344205    }
    345206
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/sopt/CorpusRendererLive.java

    r5039 r5041  
    1414 * renderer.
    1515 *
    16  * TODO: maybe remove the loaded sub-resources from the tree when they are
    17  * closed by the user.
     16 * TODO: remove the loaded sub-resources from the tree when they are
     17 * closed by the user?
    1818 *
    1919 * @author Yana Panchenko
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/sopt/Endpoint.java

    r5035 r5041  
    22
    33/**
    4  * Endpoint. Contains the parent Institution.
     4 * Endpoint. Contains information about CQL endpoint url and the parent
     5 * Institution.
    56 *
    67 * @author Yana Panchenko
     
    5859        return true;
    5960    }
    60 
    61    
    62    
    6361   
    6462}
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/sopt/Institution.java

    r5035 r5041  
    44
    55/**
    6  * Institution. Can have Endpoint children.
     6 * Institution. Contains information about institution name and link (url).
     7 * Can have information about its CQL Endpoints.
    78 *
    89 * @author Yana Panchenko
     
    5859    }
    5960   
     61    @Override
    6062    public String toString() {
    6163        if (name != null && name.length() > 0) {
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/sopt/Language.java

    r5039 r5041  
    22
    33/**
    4  *
     4 * Represents language and contains information about language name and
     5 * language codes according to ISO-639 codes.
     6 *
    57 * @author Yana Panchenko
    68 */
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/sopt/Languages.java

    r5039 r5041  
    1212
    1313/**
    14  *
     14 * Represents collection of languages.
     15 *
    1516 * @author Yana Panchenko
    1617 */
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/sresult/Kwic.java

    r3038 r5041  
    44
    55/**
    6  *
     6 * Represents keyword in context data view and information about its
     7 * PID and reference.
     8 *
    79 * @author Yana Panchenko
    810 */
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/sresult/SearchResultContent.java

    r5039 r5041  
    3131
    3232/**
    33  *
    34  * @author Yana Panchenko <yana.panchenko@uni-tuebingen.de>
     33 * Utility for representing SearchResult data in different formats.
     34 *
     35 * @author Yana Panchenko
    3536 */
    3637public class SearchResultContent {
     
    337338    public String getExportText(List<SearchResult> resultsProcessed) {
    338339        StringBuilder text = new StringBuilder();
    339         //Set<String> resultsLangs = new HashSet<String>();
    340         if (resultsProcessed != null && !resultsProcessed.isEmpty()) {
    341             for (SearchResult result : resultsProcessed) {
    342                 //resultsLangs.addAll(result.getCorpus().getLanguages());
     340        if (resultsProcessed != null && !resultsProcessed.isEmpty()) {
     341            for (SearchResult result : resultsProcessed) {
    343342                for (Kwic kwic : result.getKwics()) {
    344343                    text.append(kwic.getLeft());
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/sresult/SearchResultGroupRenderer.java

    r5039 r5041  
    2828 * the corresponding SearchResult.
    2929 *
    30  * @author Yana Panchenko <yana.panchenko@uni-tuebingen.de>
     30 * @author Yana Panchenko
    3131 */
    3232public class SearchResultGroupRenderer {
     
    114114        Label recordsFound = null;
    115115        final Toolbarbutton infoCell = new Toolbarbutton();
    116        
    117 
    118116       
    119117        if (resultsItem.getCorpus().getLandingPage() != null) {
     
    161159            sb2.append(" from " + resultsItem.getResponse().getNumberOfRecords() + " found");
    162160        }
    163 
    164161        recordsFound = new Label(sb2.toString());
    165162        recordsFound.setStyle("margin-left:10px;margin-right:30px;");
    166            
    167 
    168163        if (hasInfo) {
    169164            Image infoImage = new Image("img/help-about.png");
    170165            infoImage.setStyle("margin-right:10px;");
    171             //infoCell.appendChild(infoImage);
    172166            infoCell.setImage("img/help-about.png");
    173167            infoCell.addEventListener(Events.ON_CLICK, new EventListener() {
     
    181175
    182176        } else {
    183             //Label label = new Label("");
    184             //label.setParent(infoCell);
    185177            infoCell.setLabel("");
    186178        }
    187         //infoCell.setStyle("margin-left:10px;margin-right:10px;");
    188        
    189         //caption.appendChild(name);
    190        
    191179        caption.appendChild(recordsFound);
    192180        if (homeLink != null) {
    193181            caption.appendChild(homeLink);
    194182        }
    195        
    196183        caption.appendChild(infoCell);
    197184       
    198          //align="left" width="300px">
    199                
    200                
    201185        return caption;
    202186    }
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/util/SRUCQL.java

    r5035 r5041  
    22
    33/**
    4  *
    5  * @author Yana Panchenko <yana.panchenko@uni-tuebingen.de>
     4 * Utility for storing constants related to SRU/CQL specification.
     5 *
     6 * @author Yana Panchenko
    67 */
    78public class SRUCQL {
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/util/ZKComp.java

    r5039 r5041  
    1 /*
    2  * To change this template, choose Tools | Templates
    3  * and open the template in the editor.
    4  */
    51package eu.clarin.sru.fcs.aggregator.util;
    62
     
    84
    95/**
    10  *
     6 * Utility for reusable ZK components created for Aggregator.
     7 *
    118 * @author Yana Panchenko <yana.panchenko@uni-tuebingen.de>
    129 */
  • SRUAggregator/trunk/src/main/webapp/WEB-INF/web.xml

    r5034 r5041  
    33    <description>CLARIN-D Federated Content Search Aggregator</description>
    44    <display-name>CLARIN-D Federated Content Search Aggregator</display-name>
     5   
     6    <env-entry>
     7        <env-entry-name>center-registry-url</env-entry-name>
     8        <env-entry-type>java.lang.String</env-entry-type>
     9        <env-entry-value>http://centerregistry-clarin.esc.rzg.mpg.de/restxml/</env-entry-value>
     10    </env-entry>
     11    <env-entry>
     12        <env-entry-name>weblicht-url</env-entry-name>
     13        <env-entry-type>java.lang.String</env-entry-type>
     14        <env-entry-value>https://weblicht.sfs.uni-tuebingen.de/WebLicht-4/?input=</env-entry-value>
     15    </env-entry>
     16    <env-entry>
     17        <env-entry-name>update-interval-unit</env-entry-name>
     18        <env-entry-type>java.lang.String</env-entry-type>
     19        <env-entry-value>HOURS</env-entry-value>
     20    </env-entry>
     21    <env-entry>
     22        <env-entry-name>update-interval</env-entry-name>
     23        <env-entry-type>java.lang.Integer</env-entry-type>
     24        <env-entry-value>6</env-entry-value>
     25    </env-entry>
     26    <env-entry>
     27        <env-entry-name>scan-max-depth</env-entry-name>
     28        <env-entry-type>java.lang.Integer</env-entry-type>
     29        <env-entry-value>3</env-entry-value>
     30    </env-entry>
     31    <!-- Value of this property (data.location) should be specified in CATALINA_OPT
     32         (e.g. inside /etc/init.d/tomcat7*), unless the default is used.
     33         Currently defaults to /data/ or user.home -->
     34    <env-entry>
     35        <env-entry-name>data-location-property</env-entry-name>
     36        <env-entry-type>java.lang.String</env-entry-type>
     37        <env-entry-value>data.location</env-entry-value>
     38    </env-entry>
     39    <!-- Folder for the data specific to the current Aggregator application,
     40         supposed to be inside the data location folder above  -->
     41    <env-entry>
     42        <env-entry-name>aggregator-folder</env-entry-name>
     43        <env-entry-type>java.lang.String</env-entry-type>
     44        <env-entry-value>fcsAggregator</env-entry-value>
     45    </env-entry>
     46   
    547    <listener>
    648        <description>ZK listener for session cleanup</description>
    749        <listener-class>org.zkoss.zk.ui.http.HttpSessionListener</listener-class>
    850    </listener>
     51   
    952    <servlet>
    1053        <description>ZK loader for ZUML pages</description>
     
    61104        <welcome-file>index.htm</welcome-file>
    62105    </welcome-file-list>
     106   
    63107</web-app>
Note: See TracChangeset for help on using the changeset viewer.