Changeset 5040
- Timestamp:
- 04/24/14 09:59:52 (10 years ago)
- Location:
- SRUAggregator/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
SRUAggregator/trunk/pom.xml
r5034 r5040 68 68 <groupId>eu.clarin.weblicht</groupId> 69 69 <artifactId>wlfxb</artifactId> 70 <version>1.2. 2</version>70 <version>1.2.9</version> 71 71 </dependency> 72 72 <dependency> -
SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/app/Aggregator.java
r5039 r5040 25 25 26 26 /** 27 * Main component of the Aggregator application. 27 * Main component of the Aggregator application intended to provide 28 * users access to CLARIN-FCS resources. 29 * 30 * The webapp base URL corresponds to the default behavior of displaying 31 * the main aggregator page, where the user can enter query, select the 32 * resources of CQL endpoints (as specified in the Clarin center registry), 33 * and search in these resources. The endpoints/resources selection is 34 * optional, by default all the endpoints root resources are selected. 35 * 36 * If invoked with 'x-aggregation-context' and 'query' parameter, 37 * the aggregator will pre-select provided resources and fill in the query field. 38 * This mechanism is currently used by VLO. 39 * Example: 40 * POST http://weblicht.sfs.uni-tuebingen.de/Aggregator HTTP/1.1 41 * operation = searchRetrieve & 42 * version = 1.2 & 43 * query = bellen & 44 * x-aggregation-context = {"http://fedora.clarin-d.uni-saarland.de/sru/":["hdl:11858/00-246C-0000-0008-5F2A-0"]} 45 * 46 * 47 * Additionally, if run with the a URL query string parameter 'mode', the 48 * special behavior of the aggregator is triggered: 49 * 50 * /?mode=testing 51 * corresponds to the mode where the CQL endpoints are taken not from Clarin 52 * center repository, but from a hard-coded endpoints list; this functionality 53 * is useful for testing the development instances of endpoints, before they 54 * are moved to production. Was done to meet the request from MPI. 55 * 56 * /?mode=search 57 * corresponds to the mode where the aggregator page is requested with the 58 * already known query and (optionally) resources to search in, and if the 59 * immediate search is desired. In this case the aggregator search results 60 * page is displayed and search results of the provided query start to fill 61 * 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 63 * contacted us). 28 64 * 29 65 * @author Yana Panchenko … … 85 121 private static final String WEBLICHT_URL = 86 122 "https://weblicht.sfs.uni-tuebingen.de/WebLicht-4/?input="; 123 124 public static final String MODE_PARAM = "mode"; 125 public static final String MODE_PARAM_VALUE_TEST = "testing"; 126 public static final String MODE_PARAM_VALUE_SEARCH = "search"; 127 public static final String MODE_PARAM_VALUE_LIVE = "live"; 128 87 129 88 130 … … 92 134 processParameters(); 93 135 searchOptionsComposer = (SearchOptions) soDiv.getChildren().get(0).getChildren().get(0).getAttribute("$" + SearchOptions.class.getSimpleName()); 136 searchOptionsComposer.setAggregatorController(this); 94 137 searchResultsComposer = (SearchResults) srDiv.getChildren().get(0).getChildren().get(0).getAttribute("$" + SearchResults.class.getSimpleName()); 95 138 pagesVisibility = new PagesVisibility(aboutDiv, aboutLabel, soDiv, soLabel, srDiv, srLabel, helpDiv, helpLabel); … … 364 407 startHit + "-" + endHit); 365 408 } 409 366 410 } -
SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/app/SearchOptions.java
r5039 r5040 49 49 50 50 /** 51 * Class representing Search Options page. Displays and let's user select corpora, 52 * languages, number of records per page to be displayed, etc. 51 * Class representing Search Options view of the Aggregator. Displays and lets 52 * users select corpora, languages, number of records per page to be displayed, 53 * etc. 53 54 * 54 55 * @author Yana Panchenko … … 79 80 80 81 private ScanCache cache; 82 83 private Aggregator aggregatorController; 81 84 82 85 @Override … … 91 94 languages = (Languages) Executions.getCurrent().getDesktop().getWebApp().getAttribute(WebAppListener.LANGUAGES); 92 95 languageSelect.setSelectedItem(anyLanguage); 96 } 97 98 99 void setAggregatorController(Aggregator aggregatorController) { 100 this.aggregatorController = aggregatorController; 93 101 } 94 102 … … 141 149 @Listen(ZulEvents.ON_AFTER_RENDER + "=#tree") 142 150 public void onAfterRenderCorporaTree(Event ev) { 143 if (this.xAggregationContext == null) { 151 loadLanguages(); 152 if (isSearchOn() && (xAggregationContext == null || xAggregationContext.isEmpty())) { 153 onSelectAll(null); 154 } else if (this.xAggregationContext == null) { 144 155 onSelectAll(null); 145 156 } else { 146 157 selectCorpora(xAggregationContext); 147 158 } 148 loadLanguages(); 159 if (isSearchOn()) { 160 this.aggregatorController.onExecuteSearch(null); 161 } 149 162 } 150 163 … … 262 275 } 263 276 264 private boolean isTestingOn() {265 boolean testingOn = false;266 String[] paramValue = Executions.getCurrent().getParameterMap().get("mode");267 if (paramValue != null) {268 String mode = paramValue[0].trim();269 if (mode.equals("testing")) {270 testingOn = true;271 }272 }273 return testingOn;274 }275 277 276 278 private void setUpAggerationContext() { … … 364 366 } 365 367 } 368 369 370 private boolean isTestingOn() { 371 boolean testingOn = false; 372 String[] paramValue = Executions.getCurrent().getParameterMap().get(Aggregator.MODE_PARAM); 373 if (paramValue != null) { 374 String mode = paramValue[0].trim(); 375 LOGGER.log(Level.INFO, "Received parameter: {0}[{1}]", new String[]{Aggregator.MODE_PARAM, mode}); 376 if (mode.equals(Aggregator.MODE_PARAM_VALUE_TEST)) { 377 testingOn = true; 378 } 379 } 380 return testingOn; 381 } 382 383 private boolean isSearchOn() { 384 boolean searchOn = false; 385 String[] paramValue = Executions.getCurrent().getParameterMap().get(Aggregator.MODE_PARAM); 386 if (paramValue != null) { 387 String mode = paramValue[0].trim(); 388 LOGGER.log(Level.INFO, "Received parameter: {0}[{1}]", new String[]{Aggregator.MODE_PARAM, mode}); 389 if (mode.equals(Aggregator.MODE_PARAM_VALUE_SEARCH)) { 390 searchOn = true; 391 } 392 } 393 return searchOn; 394 } 366 395 367 396 } -
SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/app/WebAppListener.java
r5039 r5040 71 71 webapp.setAttribute(LANGUAGES, languages); 72 72 73 setUpScanCache(webapp);74 //setUpScanCacheForReadOnly(webapp);73 //setUpScanCache(webapp); 74 setUpScanCacheForReadOnly(webapp); 75 75 76 76 setUpTokenizers(webapp); … … 92 92 93 93 private String getScanDirectory() { 94 //File aggregatorDir = new File(System.getProperty("user.home"), "/." + AGGREGATOR_DIR_NAME);94 File aggregatorDir = new File(System.getProperty("user.home"), "/." + AGGREGATOR_DIR_NAME); 95 95 //File aggregatorDir = new File("/var/www", "/." + AGGREGATOR_DIR_NAME); 96 File aggregatorDir = new File("/data/fcsAggregator");96 //File aggregatorDir = new File("/data/fcsAggregator"); 97 97 98 98 if (!aggregatorDir.exists()) {
Note: See TracChangeset
for help on using the changeset viewer.