Changeset 2097
- Timestamp:
- 08/15/12 13:31:27 (12 years ago)
- Location:
- SRUAggregator/trunk
- Files:
-
- 7 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
SRUAggregator/trunk/nbproject/build-impl.xml
r2075 r2097 976 976 <target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest"> 977 977 <copyfiles files="${libs.zk.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> 978 <copyfiles files="${libs.SRUCQLClient.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> 978 979 <mkdir dir="${build.web.dir}/META-INF"/> 979 980 <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/> … … 981 982 <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir"> 982 983 <copyfiles files="${libs.zk.classpath}" todir="${build.web.dir}/WEB-INF/lib"/> 984 <copyfiles files="${libs.SRUCQLClient.classpath}" todir="${build.web.dir}/WEB-INF/lib"/> 983 985 </target> 984 986 <target depends="init" if="dist.ear.dir" name="-clean-webinf-lib"> -
SRUAggregator/trunk/nbproject/genfiles.properties
r2077 r2097 1 build.xml.data.CRC32= e938706e1 build.xml.data.CRC32=1ca8f689 2 2 build.xml.script.CRC32=e9ec94ca 3 3 build.xml.stylesheet.CRC32=651128d4@1.38.1.1 4 4 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 5 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 nbproject/build-impl.xml.data.CRC32= e938706e7 nbproject/build-impl.xml.script.CRC32=1 40724806 nbproject/build-impl.xml.data.CRC32=1ca8f689 7 nbproject/build-impl.xml.script.CRC32=1ad9793f 8 8 nbproject/build-impl.xml.stylesheet.CRC32=4e9cae83@1.38.1.1 -
SRUAggregator/trunk/nbproject/private/private.xml
r2075 r2097 3 3 <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/> 4 4 <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> 5 <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/1"> 6 <file>file:/Users/zastrow/Documents/ClarinD/schrauber/Aggregator/trunk/src/java/clarind/fcs/Harvester.java</file> 7 <file>file:/Users/zastrow/Documents/ClarinD/schrauber/Aggregator/trunk/src/java/clarind/fcs/Aggregator.java</file> 8 <file>file:/Users/zastrow/Documents/ClarinD/schrauber/Aggregator/trunk/web/index.zul</file> 9 </open-files> 5 10 </project-private> -
SRUAggregator/trunk/nbproject/project.properties
r2075 r2097 36 36 jar.compress=false 37 37 javac.classpath=\ 38 ${libs.zk.classpath} 38 ${libs.zk.classpath}:\ 39 ${libs.SRUCQLClient.classpath} 39 40 # Space-separated list of extra javac options 40 41 javac.compilerargs= -
SRUAggregator/trunk/nbproject/project.xml
r2016 r2097 9 9 <library dirs="200"> 10 10 <file>${libs.zk.classpath}</file> 11 <path-in-war>WEB-INF/lib</path-in-war> 12 </library> 13 <library dirs="200"> 14 <file>${libs.SRUCQLClient.classpath}</file> 11 15 <path-in-war>WEB-INF/lib</path-in-war> 12 16 </library> -
SRUAggregator/trunk/src/java/clarind/fcs/Aggregator.java
r2085 r2097 16 16 import org.zkoss.zul.Groupbox; 17 17 import org.zkoss.zul.Separator; 18 import org.zkoss.zul.Label; 18 19 19 20 public class Aggregator extends SelectorComposer<Component> { … … 27 28 @Wire 28 29 private Checkbox ids1; 29 30 @Wire 30 31 private Groupbox allCorpora; 31 32 32 33 33 @Override … … 35 35 super.doAfterCompose(comp); //wire variables and event listners 36 36 //do whatever you want (you could access wired variables here) 37 CenterRegistry cr = new CenterRegistry();38 ArrayList<Endpoint> ep = cr.getEndpoints();37 Harvester harv = new Harvester(); 38 ArrayList<Endpoint> ep = harv.getEndpoints(); 39 39 40 int i ;40 int i, i2; 41 41 42 42 for (i = 0; i < ep.size(); i++) { 43 Checkbox cb = new Checkbox(); 44 cb.setLabel("LABEL: " + ep.get(i).getInstitution()); 45 Row r = new Row(); 46 47 System.out.println(ep.get(i).getInstitution() + " " + ep.get(i).getUrl()); 48 allCorpora.getChildren().add(cb); 49 allCorpora.getChildren().add(new Separator()); 43 44 System.out.println("Calling corpora ...: " + ep.get(i).getUrl()); 45 ArrayList<String> corpora = harv.getCorporaOfAnEndpoint(ep.get(i).getUrl()); 46 47 if (corpora.size() == 0) { 48 Checkbox cb = new Checkbox(); 49 cb.setLabel(ep.get(i).getUrl()); 50 allCorpora.getChildren().add(cb); 51 allCorpora.getChildren().add(new Separator()); 52 } else { 53 Label l = new Label(ep.get(i).getUrl() + ":"); 54 55 allCorpora.getChildren().add(l); 56 allCorpora.getChildren().add(new Separator()); 57 for (i2 = 0; i2 < corpora.size(); i2++) { 58 Checkbox cb = new Checkbox(); 59 cb.setLabel(corpora.get(i2)); 60 61 allCorpora.getChildren().add(cb); 62 allCorpora.getChildren().add(new Separator()); 63 } // for i2 ... 64 } // if corpora.size else 50 65 } // for i ... 51 66 } … … 73 88 74 89 for (i = 0; i < allCorpora.getChildren().size(); i++) { 75 if(allCorpora.getChildren().get(i) instanceof Checkbox){90 if (allCorpora.getChildren().get(i) instanceof Checkbox) { 76 91 Checkbox cb = (Checkbox) allCorpora.getChildren().get(i); 77 92 if (cb.isChecked()) { 93 // now execute the search: 78 94 display = display + cb.getLabel() + "\n"; 79 95 } 80 96 } 81 97 } // for i ... 82 83 84 85 98 86 99 Messagebox.show(display); -
SRUAggregator/trunk/src/java/clarind/fcs/Harvester.java
r2085 r2097 10 10 import javax.xml.xpath.XPathExpressionException; 11 11 import javax.xml.xpath.XPathFactory; 12 import org.w3c.dom.Node; 12 13 import org.w3c.dom.NodeList; 13 14 14 public class CenterRegistry{15 public class Harvester { 15 16 16 17 final String crStartpoint = "http://130.183.206.32/restxml/"; … … 70 71 for(i2=0; i2<endpointsUrls.getLength();i2++){ 71 72 String epUrl = endpointsUrls.item(i2).getTextContent(); 72 ep.add(new Endpoint( instituteName, epUrl));73 ep.add(new Endpoint(epUrl, instituteName)); 73 74 } // for i2 74 75 … … 79 80 } //getEndpoints 80 81 82 83 public ArrayList<String> getCorporaOfAnEndpoint(String endpointUrl) throws Exception { 84 System.out.println("getCorporaOfAnEndpoint: " + endpointUrl); 85 ArrayList<String> corpora = new ArrayList<String>(); 86 87 URL u = new URL(endpointUrl + "?operation=scan&scanClause=fcs.resource"); 88 InputStream is = u.openStream(); 89 90 DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); 91 DocumentBuilder builder = factory.newDocumentBuilder(); 92 org.w3c.dom.Document document = builder.parse(is); 93 94 is.close(); 95 96 //http://clarinws.informatik.uni-leipzig.de:8080/CQL? 97 98 NodeList corporaNodes = evaluateXPath("//*[local-name()='term']/*[local-name()='value']", document); 99 100 int i, i2; 101 102 for(i=0; i<corporaNodes.getLength();i++){ 103 corpora.add(corporaNodes.item(i).getTextContent()); 104 105 } // for i ... 106 return corpora; 107 } // getCorporaOfAnEndpoint 108 109 81 110 public static void main (String[] args) throws Exception { 82 CenterRegistry cr = new CenterRegistry();111 Harvester cr = new Harvester(); 83 112 ArrayList<Endpoint> ep = cr.getEndpoints(); 84 113 … … 91 120 92 121 } 122 123 124 125 93 126 } -
SRUAggregator/trunk/web/index.zul
r2085 r2097 22 22 <separator /> 23 23 <label>Language:</label> 24 <combobox id="languageSelect" width="150px"> 24 <combobox id="languageSelect" width="150px"> 25 25 <!--<template name="model"> --> 26 26 <comboitem label="German" /> … … 34 34 35 35 <groupbox mold="3d" id="allCorpora"> 36 36 <caption>All Corpora</caption> 37 37 38 38 </groupbox>
Note: See TracChangeset
for help on using the changeset viewer.