Changeset 2107 for SRUAggregator/trunk/src/java/clarind/fcs/Aggregator.java
- Timestamp:
- 08/16/12 14:53:42 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
SRUAggregator/trunk/src/java/clarind/fcs/Aggregator.java
r2097 r2107 17 17 import org.zkoss.zul.Separator; 18 18 import org.zkoss.zul.Label; 19 import org.zkoss.zul.Comboitem; 19 20 20 21 public class Aggregator extends SelectorComposer<Component> { … … 30 31 @Wire 31 32 private Groupbox allCorpora; 33 @Wire 34 private Comboitem german; 32 35 33 36 @Override … … 35 38 super.doAfterCompose(comp); //wire variables and event listners 36 39 //do whatever you want (you could access wired variables here) 40 41 languageSelect.setSelectedItem(german); 42 37 43 Harvester harv = new Harvester(); 38 44 ArrayList<Endpoint> ep = harv.getEndpoints(); … … 43 49 44 50 System.out.println("Calling corpora ...: " + ep.get(i).getUrl()); 45 ArrayList< String> corpora = harv.getCorporaOfAnEndpoint(ep.get(i).getUrl());51 ArrayList<Corpus> corpora = harv.getCorporaOfAnEndpoint(ep.get(i).getUrl()); 46 52 47 53 if (corpora.size() == 0) { 48 54 Checkbox cb = new Checkbox(); 55 cb.setId(ep.get(i).getUrl() + "?operation=searchRetrieve&version=1.2"); 49 56 cb.setLabel(ep.get(i).getUrl()); 57 50 58 allCorpora.getChildren().add(cb); 51 59 allCorpora.getChildren().add(new Separator()); … … 57 65 for (i2 = 0; i2 < corpora.size(); i2++) { 58 66 Checkbox cb = new Checkbox(); 59 cb.setLabel(corpora.get(i2)); 67 68 //http://clarinws.informatik.uni-leipzig.de:8080/CQL?operation=searchRetrieve&version=1.2&query=Boppard&x-context=11858/00-229C-0000-0003-174F-D&maximumRecords=2 69 70 cb.setId(ep.get(i).getUrl() + "?operation=searchRetrieve&version=1.2&x-context=" + corpora.get(i2).getValue()); 71 cb.setLabel(corpora.get(i2).getDisplayTerm()); 60 72 61 73 allCorpora.getChildren().add(cb); … … 77 89 public void onExecuteSearch(Event ev) { 78 90 try { 91 92 if (languageSelect.getText().trim().equals("")){ 93 Messagebox.show("Please select a language."); 94 return; 95 } 96 79 97 String display = "SearchString: " + searchString.getText() + "\n"; 80 98 … … 92 110 if (cb.isChecked()) { 93 111 // now execute the search: 94 display = display + cb.getLabel() + "\n"; 112 String query = cb.getId() + "&maximumRecords=10&query=" + searchString.getText(); 113 display = display + query + "\n"; 95 114 } 96 115 } … … 98 117 99 118 Messagebox.show(display); 100 119 System.out.println(display); 101 120 } catch (Exception ex) { 102 121 System.out.println(ex.getMessage());
Note: See TracChangeset
for help on using the changeset viewer.