Index: /SRUAggregator/trunk/nbproject/build-impl.xml
===================================================================
--- /SRUAggregator/trunk/nbproject/build-impl.xml	(revision 2096)
+++ /SRUAggregator/trunk/nbproject/build-impl.xml	(revision 2097)
@@ -976,4 +976,5 @@
     <target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest">
         <copyfiles files="${libs.zk.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+        <copyfiles files="${libs.SRUCQLClient.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
         <mkdir dir="${build.web.dir}/META-INF"/>
         <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
@@ -981,4 +982,5 @@
     <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
         <copyfiles files="${libs.zk.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
+        <copyfiles files="${libs.SRUCQLClient.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
     </target>
     <target depends="init" if="dist.ear.dir" name="-clean-webinf-lib">
Index: /SRUAggregator/trunk/nbproject/genfiles.properties
===================================================================
--- /SRUAggregator/trunk/nbproject/genfiles.properties	(revision 2096)
+++ /SRUAggregator/trunk/nbproject/genfiles.properties	(revision 2097)
@@ -1,8 +1,8 @@
-build.xml.data.CRC32=e938706e
+build.xml.data.CRC32=1ca8f689
 build.xml.script.CRC32=e9ec94ca
 build.xml.stylesheet.CRC32=651128d4@1.38.1.1
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=e938706e
-nbproject/build-impl.xml.script.CRC32=14072480
+nbproject/build-impl.xml.data.CRC32=1ca8f689
+nbproject/build-impl.xml.script.CRC32=1ad9793f
 nbproject/build-impl.xml.stylesheet.CRC32=4e9cae83@1.38.1.1
Index: /SRUAggregator/trunk/nbproject/private/private.xml
===================================================================
--- /SRUAggregator/trunk/nbproject/private/private.xml	(revision 2096)
+++ /SRUAggregator/trunk/nbproject/private/private.xml	(revision 2097)
@@ -3,3 +3,8 @@
     <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
     <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
+    <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/1">
+        <file>file:/Users/zastrow/Documents/ClarinD/schrauber/Aggregator/trunk/src/java/clarind/fcs/Harvester.java</file>
+        <file>file:/Users/zastrow/Documents/ClarinD/schrauber/Aggregator/trunk/src/java/clarind/fcs/Aggregator.java</file>
+        <file>file:/Users/zastrow/Documents/ClarinD/schrauber/Aggregator/trunk/web/index.zul</file>
+    </open-files>
 </project-private>
Index: /SRUAggregator/trunk/nbproject/project.properties
===================================================================
--- /SRUAggregator/trunk/nbproject/project.properties	(revision 2096)
+++ /SRUAggregator/trunk/nbproject/project.properties	(revision 2097)
@@ -36,5 +36,6 @@
 jar.compress=false
 javac.classpath=\
-    ${libs.zk.classpath}
+    ${libs.zk.classpath}:\
+    ${libs.SRUCQLClient.classpath}
 # Space-separated list of extra javac options
 javac.compilerargs=
Index: /SRUAggregator/trunk/nbproject/project.xml
===================================================================
--- /SRUAggregator/trunk/nbproject/project.xml	(revision 2096)
+++ /SRUAggregator/trunk/nbproject/project.xml	(revision 2097)
@@ -9,4 +9,8 @@
                 <library dirs="200">
                     <file>${libs.zk.classpath}</file>
+                    <path-in-war>WEB-INF/lib</path-in-war>
+                </library>
+                <library dirs="200">
+                    <file>${libs.SRUCQLClient.classpath}</file>
                     <path-in-war>WEB-INF/lib</path-in-war>
                 </library>
Index: /SRUAggregator/trunk/src/java/clarind/fcs/Aggregator.java
===================================================================
--- /SRUAggregator/trunk/src/java/clarind/fcs/Aggregator.java	(revision 2096)
+++ /SRUAggregator/trunk/src/java/clarind/fcs/Aggregator.java	(revision 2097)
@@ -16,4 +16,5 @@
 import org.zkoss.zul.Groupbox;
 import org.zkoss.zul.Separator;
+import org.zkoss.zul.Label;
 
 public class Aggregator extends SelectorComposer<Component> {
@@ -27,7 +28,6 @@
     @Wire
     private Checkbox ids1;
-     @Wire
+    @Wire
     private Groupbox allCorpora;
-    
 
     @Override
@@ -35,17 +35,32 @@
         super.doAfterCompose(comp); //wire variables and event listners
         //do whatever you want (you could access wired variables here)
-        CenterRegistry cr = new CenterRegistry();
-        ArrayList<Endpoint> ep = cr.getEndpoints();
+        Harvester harv = new Harvester();
+        ArrayList<Endpoint> ep = harv.getEndpoints();
 
-        int i;
+        int i, i2;
 
         for (i = 0; i < ep.size(); i++) {
-            Checkbox cb = new Checkbox();
-            cb.setLabel("LABEL: " +  ep.get(i).getInstitution());
-            Row r = new Row();
-            
-            System.out.println(ep.get(i).getInstitution() + " " + ep.get(i).getUrl());
-            allCorpora.getChildren().add(cb);
-            allCorpora.getChildren().add(new Separator());
+
+            System.out.println("Calling corpora ...: " + ep.get(i).getUrl());
+            ArrayList<String> corpora = harv.getCorporaOfAnEndpoint(ep.get(i).getUrl());
+
+            if (corpora.size() == 0) {
+                Checkbox cb = new Checkbox();
+                cb.setLabel(ep.get(i).getUrl());
+                allCorpora.getChildren().add(cb);
+                allCorpora.getChildren().add(new Separator());
+            } else {
+                Label l = new Label(ep.get(i).getUrl() + ":");
+
+                allCorpora.getChildren().add(l);
+                allCorpora.getChildren().add(new Separator());
+                for (i2 = 0; i2 < corpora.size(); i2++) {
+                    Checkbox cb = new Checkbox();
+                    cb.setLabel(corpora.get(i2));
+                    
+                    allCorpora.getChildren().add(cb);
+                    allCorpora.getChildren().add(new Separator());
+                } // for i2 ...
+            } // if corpora.size else
         } // for i ...
     }
@@ -73,14 +88,12 @@
 
             for (i = 0; i < allCorpora.getChildren().size(); i++) {
-                    if(allCorpora.getChildren().get(i) instanceof Checkbox){
+                if (allCorpora.getChildren().get(i) instanceof Checkbox) {
                     Checkbox cb = (Checkbox) allCorpora.getChildren().get(i);
                     if (cb.isChecked()) {
+                        // now execute the search:
                         display = display + cb.getLabel() + "\n";
                     }
-                    }
+                }
             } // for i ...
-
-
-          
 
             Messagebox.show(display);
Index: UAggregator/trunk/src/java/clarind/fcs/CenterRegistry.java
===================================================================
--- /SRUAggregator/trunk/src/java/clarind/fcs/CenterRegistry.java	(revision 2096)
+++ 	(revision )
@@ -1,93 +1,0 @@
-package clarind.fcs;
-
-import java.io.InputStream;
-import java.net.URL;
-import java.util.*;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-import org.w3c.dom.NodeList;
-
-public class CenterRegistry {
-
-    final String crStartpoint = "http://130.183.206.32/restxml/";
-
-     private NodeList evaluateXPath(String statement, org.w3c.dom.Document domtree){
-        NodeList result = null;
-
-        XPath xpath = XPathFactory.newInstance().newXPath();
-        try {
-            result = (NodeList) xpath.evaluate(statement, domtree, XPathConstants.NODESET);
-        } catch (XPathExpressionException ex) {
-            System.out.println(ex.getMessage());
-        }
-        return result;
-    }
-     
-     public String evaluateXPathToString(String statement, org.w3c.dom.Document domtree) {
-        String result = null;
-
-        XPath xpath = XPathFactory.newInstance().newXPath();
-        try {
-            result = (String) xpath.evaluate(statement, domtree, XPathConstants.STRING);
-        } catch (XPathExpressionException ex) {
-            System.out.println(ex.getMessage());
-        }
-        return result;
-    }
-    
-    
-    public  ArrayList<Endpoint> getEndpoints() throws Exception {
-        ArrayList<Endpoint> ep = new ArrayList<Endpoint>();
-
-        URL u = new URL(crStartpoint);
-        InputStream is = u.openStream();
-        
-        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-        DocumentBuilder builder = factory.newDocumentBuilder();
-        org.w3c.dom.Document document = builder.parse(is);
-
-        is.close();
-        String instituteName = evaluateXPathToString("//Name", document);
-        
-        NodeList institutionsUrls = evaluateXPath("//Center_id_link", document);
-        
-        int i, i2;
-        
-        for(i=0; i<institutionsUrls.getLength();i++){             
-             u = new URL(institutionsUrls.item(i).getTextContent());
-             is = u.openStream();
-             
-             org.w3c.dom.Document doc = builder.parse(is);
-             is.close();
-             ////WebReference[./Description[text()="CQL"]]/Website                         
-             
-             NodeList endpointsUrls = evaluateXPath("//WebReference[./Description[text()=\"CQL\"]]/Website", doc);
-             
-             for(i2=0; i2<endpointsUrls.getLength();i2++){
-                 String epUrl = endpointsUrls.item(i2).getTextContent();                 
-                 ep.add(new Endpoint(instituteName, epUrl));
-             } // for i2
-                          
-        } // for i ...
-        
-
-        return ep;
-    } //getEndpoints
-    
-    public static void main (String[] args) throws Exception {
-        CenterRegistry cr = new CenterRegistry();
-        ArrayList<Endpoint> ep = cr.getEndpoints();
-        
-        int i;
-        
-        for(i=0; i<ep.size();i++){
-            System.out.println(ep.get(i).getInstitution() + " " + ep.get(i).getUrl());
-        } // for i ...
-        
-        
-    }
-}
Index: /SRUAggregator/trunk/src/java/clarind/fcs/Harvester.java
===================================================================
--- /SRUAggregator/trunk/src/java/clarind/fcs/Harvester.java	(revision 2097)
+++ /SRUAggregator/trunk/src/java/clarind/fcs/Harvester.java	(revision 2097)
@@ -0,0 +1,126 @@
+package clarind.fcs;
+
+import java.io.InputStream;
+import java.net.URL;
+import java.util.*;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class Harvester {
+
+    final String crStartpoint = "http://130.183.206.32/restxml/";
+
+     private NodeList evaluateXPath(String statement, org.w3c.dom.Document domtree){
+        NodeList result = null;
+
+        XPath xpath = XPathFactory.newInstance().newXPath();
+        try {
+            result = (NodeList) xpath.evaluate(statement, domtree, XPathConstants.NODESET);
+        } catch (XPathExpressionException ex) {
+            System.out.println(ex.getMessage());
+        }
+        return result;
+    }
+     
+     public String evaluateXPathToString(String statement, org.w3c.dom.Document domtree) {
+        String result = null;
+
+        XPath xpath = XPathFactory.newInstance().newXPath();
+        try {
+            result = (String) xpath.evaluate(statement, domtree, XPathConstants.STRING);
+        } catch (XPathExpressionException ex) {
+            System.out.println(ex.getMessage());
+        }
+        return result;
+    }
+    
+    
+    public  ArrayList<Endpoint> getEndpoints() throws Exception {
+        ArrayList<Endpoint> ep = new ArrayList<Endpoint>();
+
+        URL u = new URL(crStartpoint);
+        InputStream is = u.openStream();
+        
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder builder = factory.newDocumentBuilder();
+        org.w3c.dom.Document document = builder.parse(is);
+
+        is.close();
+        String instituteName = evaluateXPathToString("//Name", document);
+        
+        NodeList institutionsUrls = evaluateXPath("//Center_id_link", document);
+        
+        int i, i2;
+        
+        for(i=0; i<institutionsUrls.getLength();i++){             
+             u = new URL(institutionsUrls.item(i).getTextContent());
+             is = u.openStream();
+             
+             org.w3c.dom.Document doc = builder.parse(is);
+             is.close();
+             ////WebReference[./Description[text()="CQL"]]/Website                         
+             
+             NodeList endpointsUrls = evaluateXPath("//WebReference[./Description[text()=\"CQL\"]]/Website", doc);
+             
+             for(i2=0; i2<endpointsUrls.getLength();i2++){
+                 String epUrl = endpointsUrls.item(i2).getTextContent();                 
+                 ep.add(new Endpoint(epUrl, instituteName));
+             } // for i2
+                          
+        } // for i ...
+        
+
+        return ep;
+    } //getEndpoints
+    
+    
+    public ArrayList<String> getCorporaOfAnEndpoint(String endpointUrl) throws Exception {
+        System.out.println("getCorporaOfAnEndpoint: " + endpointUrl);
+        ArrayList<String> corpora = new ArrayList<String>();
+        
+        URL u = new URL(endpointUrl + "?operation=scan&scanClause=fcs.resource");
+        InputStream is = u.openStream();
+        
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder builder = factory.newDocumentBuilder();
+        org.w3c.dom.Document document = builder.parse(is);
+
+        is.close();
+        
+        //http://clarinws.informatik.uni-leipzig.de:8080/CQL?
+        
+        NodeList corporaNodes = evaluateXPath("//*[local-name()='term']/*[local-name()='value']", document);
+      
+        int i, i2;
+        
+        for(i=0; i<corporaNodes.getLength();i++){
+          corpora.add(corporaNodes.item(i).getTextContent());
+            
+        } // for i ...
+        return corpora;
+    }  // getCorporaOfAnEndpoint
+    
+    
+    public static void main (String[] args) throws Exception {
+        Harvester cr = new Harvester();
+        ArrayList<Endpoint> ep = cr.getEndpoints();
+        
+        int i;
+        
+        for(i=0; i<ep.size();i++){
+            System.out.println(ep.get(i).getInstitution() + " " + ep.get(i).getUrl());
+        } // for i ...
+        
+        
+    }
+    
+    
+    
+    
+}
Index: /SRUAggregator/trunk/web/index.zul
===================================================================
--- /SRUAggregator/trunk/web/index.zul	(revision 2096)
+++ /SRUAggregator/trunk/web/index.zul	(revision 2097)
@@ -22,5 +22,5 @@
                         <separator />
                         <label>Language:</label>
-                        <combobox id="languageSelect" width="150px">
+                        <combobox id="languageSelect" width="150px">                            
                             <!--<template name="model"> -->
                             <comboitem label="German" />
@@ -34,5 +34,5 @@
                         
                         <groupbox mold="3d" id="allCorpora">
-
+                        <caption>All Corpora</caption>
                            
                         </groupbox>
