Index: /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/Theme.java
===================================================================
--- /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/Theme.java	(revision 4201)
+++ /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/Theme.java	(revision 4201)
@@ -0,0 +1,137 @@
+
+package eu.clarin.cmdi.vlo;
+
+import eu.clarin.cmdi.vlo.config.VloConfig;
+
+/**
+ *
+ * @author keeloo
+ *
+ * A theme is composed from a page title, a CSS file, two image files, and a
+ * partner link map relating coordinates in the right image to partner links
+ */
+public class Theme {
+
+    public String name, pageTitle, topLeftImage, topRightImage, cssFile,
+            partnerLinkMap;
+
+    /**
+     * Compose a theme<br><br>
+     *
+     * @param name the name of the theme to be composed
+     */
+    public Theme(String themeName) {
+
+        String prefix = VloConfig.getReverseProxyPrefix();
+
+        if (themeName.matches("CLARIN-D")) {
+            // select the CLARIN-D theme's components
+
+            pageTitle = "CLARIN-D Virtual Language Observatory - Resources";
+            topLeftImage = "Images/topleft-clarin-d.png";
+            topRightImage = "Images/topright-clarin-d.png";
+            if (prefix.length() == 0) {
+                cssFile = "css/clarin-d.css";
+            } else {
+                cssFile = prefix + "css/clarin-d.css";
+            }
+            partnerLinkMap = getClarinDPartnerLinkMap();
+            name = "CLARIN-D";
+        } else {
+            // select the default theme elements
+            pageTitle = "CLARIN Virtual Language Observatory - Resources";
+            topLeftImage = "Images/topleftvlo.gif";
+            topRightImage = "Images/toprightvlo.gif";
+
+            if (prefix.length() == 0) {
+                cssFile = "css/main.css";
+            } else {
+                cssFile = prefix + "css/main.css";
+            }
+            partnerLinkMap = getDefaultPartnerLinkMap();
+            name = "defaultTheme";
+        }
+        // remember the theme as a persistent parameter
+        // getPersistentParameters.put("theme", name);
+    }
+
+    /**
+     * Compose a map to be included in the HTML document, designating the
+     * positions of the links to partner web sites
+     * 
+     * @return the map
+     */
+    private String getDefaultPartnerLinkMap() {
+        String map;
+
+        map = "<map name=\"partnerLinks\">\n";
+        map = appendToPartnerLinkMap(map,
+                "114.00,65,167.50,104",
+                "http://www.clarin.eu",
+                "clarin link");
+        map = appendToPartnerLinkMap(map,
+                "177.00,65,214,104",
+                "http://wals.info",
+                "wals link");
+        map = appendToPartnerLinkMap(map,
+                "229,65,279,104",
+                "http://linguistlist.org",
+                "linguistlist link");
+        map = appendToPartnerLinkMap(map,
+                "290,65,320,104",
+                "http://www.elra.info",
+                "elra link");
+        map = appendToPartnerLinkMap(map,
+                "328,65,370,104",
+                "http://www.mpi.nl/dobes",
+                "dobes link");
+        map = appendToPartnerLinkMap(map,
+                "379,65,428,104",
+                "http://www.dfki.de/web",
+                "dfki link");
+        map = appendToPartnerLinkMap(map,
+                "434,65,484,104",
+                "http://www.delaman.org",
+                "deleman link");
+
+        map = map + "</map>";
+
+        return map;
+    }
+
+    /**
+     * Compose a map to be included in the HTML document, designating the
+     * positions of the links to partner web sites
+     *
+     * @return the map
+     */
+    private String getClarinDPartnerLinkMap() {
+        String map;
+
+        map = "<map name=\"partnerLinks\">\n";
+        map = map + "</map>";
+
+        return map;
+    }
+
+    /**
+     * Add a link location to the map indicating the partner links
+     *
+     * @param map
+     * @return
+     */
+    private String appendToPartnerLinkMap(String map, String coordinates,
+            String URL, String alt) {
+
+        if (map == null) {
+            map = "<map name=\"partnerLinks\">\n";
+        } else if (map.equals("")) {
+            map = "<map name=\"partnerLinks\">\n";
+        }
+
+        map = map + "<AREA SHAPE=\"rect\" COORDS=\"" + coordinates + "\" HREF=\""
+                + URL + "\" alt=\"" + alt + "\"/>\n";
+
+        return map;
+    }
+}
Index: /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/VloPageParameters.java
===================================================================
--- /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/VloPageParameters.java	(revision 4201)
+++ /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/VloPageParameters.java	(revision 4201)
@@ -0,0 +1,76 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package eu.clarin.cmdi.vlo;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import org.apache.wicket.Session;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+/**
+ * VLO web page parameters 
+ * 
+ * @author keeloo
+ */
+public class VloPageParameters extends PageParameters {
+    
+    public VloPageParameters (){
+        // needs to be here because of the other constructor
+        super ();
+    }
+    
+    public VloPageParameters (PageParameters parameters){
+        // store the parameters as VloPageParameters
+    }
+    
+    public org.apache.wicket.PageParameters convert (){
+        
+        org.apache.wicket.PageParameters param;
+        
+        // needs to be implemented
+        
+        param = null;
+        
+        return param;
+    }
+
+    /**
+     * 
+     * @param param
+     * @return 
+     */
+    public VloPageParameters convert (org.apache.wicket.PageParameters param){
+        
+        // move page parameters in array of objects
+        Set <Map.Entry<String,Object>> entries;
+        entries = param.entrySet();
+        
+        // iterate over the set, and put entries in new page parameters 
+        VloPageParameters VloPageParameters;
+        VloPageParameters = new VloPageParameters ();
+        for (Iterator<Map.Entry<String, Object>> it = entries.iterator(); it.hasNext();) {
+            Map.Entry<String, Object> entry = it.next();
+            VloPageParameters.add(entry.getKey(), entry.getValue());
+        }
+        
+        return VloPageParameters;
+    }
+
+    /**
+     * Add this, VLO page parameters, to the parameters that are already 
+     * associated with the session
+     * 
+     */
+    public void addToSession() {        
+        
+        // get a themed session from the current thread 
+        VloSession themedSession;
+        themedSession = (VloSession)Session.get();
+        
+        // store the parameters in the session object
+        themedSession.addVloSessionPageParameters (this);
+    }
+}
Index: /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/VloSession.java
===================================================================
--- /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/VloSession.java	(revision 4201)
+++ /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/VloSession.java	(revision 4201)
@@ -0,0 +1,68 @@
+
+package eu.clarin.cmdi.vlo;
+
+import org.apache.wicket.protocol.http.WebSession;
+import org.apache.wicket.request.Request;
+
+/**
+ * Class associating VLO sessions with a VLO theme and VLO page parameters. 
+ * 
+ * While it is never explicitly created, it is always part of a cast, the public
+
+* field of objects of this class seems to hold the expected values.
+ *
+ * @author keeloo
+ */
+public class VloSession extends WebSession {
+
+    /**
+     * Remember the parameters that should persist in URLs to VLO pages
+     * <br><br>
+     */
+    public VloPageParameters vloSessionPageParameters = new VloPageParameters();
+
+    /**
+     *
+     * @return
+     */
+    public VloPageParameters getVloSessionPageParameters() {
+        return vloSessionPageParameters;
+    }
+
+    /**
+     * Add page parameters with the VLO session related ones
+     *
+     * @param parameters a page parameter map
+     *
+     */
+    public void addVloSessionPageParameters(VloPageParameters parameters) {
+        
+        vloSessionPageParameters.mergeWith(parameters);
+    }
+    /**
+     * Theme currently applied in the VLO web application
+     */
+    private Theme currentTheme = new Theme("defaultTheme");
+
+    /**
+     * Constructor with request parameter
+     * 
+     * @param request 
+     */
+    public VloSession(Request request) {
+        // only the parameterless constructors are invoked implicitly
+        super(request);
+    }
+
+    public Theme getCurrentTheme() {
+        return currentTheme;
+    }
+
+    /**
+     * 
+     * @param currentTheme 
+     */
+    public void setCurrentTheme(Theme currentTheme) {
+        this.currentTheme = currentTheme;
+    }
+}
Index: /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/FacetedSearchPage.java
===================================================================
--- /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/FacetedSearchPage.java	(revision 4200)
+++ /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/FacetedSearchPage.java	(revision 4201)
@@ -271,5 +271,5 @@
                 int offset = 0;
                 int fetchSize = 1000;
-                int totalResults = dataProvider.size();
+                int totalResults = (int) dataProvider.size();
                 while (offset < totalResults) {
                     Iterator<SolrDocument> iter = dataProvider.iterator(offset, fetchSize);
Index: /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/SearchPageQuery.java
===================================================================
--- /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/SearchPageQuery.java	(revision 4200)
+++ /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/SearchPageQuery.java	(revision 4201)
@@ -4,4 +4,5 @@
 import eu.clarin.cmdi.vlo.config.VloConfig;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import org.apache.solr.client.solrj.SolrQuery;
@@ -27,7 +28,5 @@
         query = getDefaultQuery();
         
-        StringValue paramVal;
-        paramVal = parameters.get(CommonParams.Q);
-        String queryParam = paramVal.toString();
+        String queryParam = parameters.get(CommonParams.Q).toString();
 
         setSearchQuery(queryParam);
@@ -38,9 +37,12 @@
 
         }
-        String[] filterQueries = parameters.getStringArray(CommonParams.FQ);
-        if (filterQueries != null) {
-            String[] encodedQueries = new String[filterQueries.length];
-            for (int i = 0; i < filterQueries.length; i++) {
-                String fq = filterQueries[i];
+        
+        List<StringValue> filterQueryValues = parameters.getValues(CommonParams.FQ);
+        
+        if (filterQueryValues != null) {
+            String[] encodedQueries = new String[filterQueryValues.size()];
+            
+            for (int i = 0; i < filterQueryValues.size(); i++) {
+                String fq = filterQueryValues.get(i).toString();
                 String[] keyValue = fq.split(":", 2);
                 filterQueryMap.put(keyValue[0], keyValue[1]);
Index: /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/SearchServiceDataProvider.java
===================================================================
--- /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/SearchServiceDataProvider.java	(revision 4200)
+++ /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/SearchServiceDataProvider.java	(revision 4201)
@@ -17,59 +17,60 @@
 
 /**
- * Data provider of all documents with SearchService entry (FCS) based on existing SolrQuery
- * 
+ * Data provider of all documents with SearchService entry (FCS) based on
+ * existing SolrQuery
+ *
  * @author Thomas Eckart
  *
  */
-public class SearchServiceDataProvider extends SortableDataProvider<SolrDocument> {
-	private final static Logger LOG = LoggerFactory.getLogger(SearchServiceDataProvider.class);
-	
-	private static final long serialVersionUID = -5355607690141772113L;
-	private final SolrQuery query;
-	private SolrDocumentList docList;
+public class SearchServiceDataProvider extends SortableDataProvider<SolrDocument, String> {
 
-	public SearchServiceDataProvider(SolrQuery query) {
-		this.query = query;
-		this.query.setFacet(false);
-		this.query.setStart(0);
-		this.query.setRows(10);
-		this.query.setFields(FacetConstants.FIELD_SEARCH_SERVICE, FacetConstants.FIELD_ID);
-		this.query.setQuery(query.getQuery());
-		this.query.addFilterQuery(FacetConstants.FIELD_SEARCH_SERVICE + ":*");
-		LOG.debug("Used query for search services: "+this.query.toString());
-	}
+    private final static Logger LOG = LoggerFactory.getLogger(SearchServiceDataProvider.class);
+    private static final long serialVersionUID = -5355607690141772113L;
+    private final SolrQuery query;
+    private SolrDocumentList docList;
 
-	private SearchResultsDao getSearchResultsDao() {
-		return DaoLocator.getSearchResultsDao();
-	}
+    public SearchServiceDataProvider(SolrQuery query) {
+        this.query = query;
+        this.query.setFacet(false);
+        this.query.setStart(0);
+        this.query.setRows(10);
+        this.query.setFields(FacetConstants.FIELD_SEARCH_SERVICE, FacetConstants.FIELD_ID);
+        this.query.setQuery(query.getQuery());
+        this.query.addFilterQuery(FacetConstants.FIELD_SEARCH_SERVICE + ":*");
+        LOG.debug("Used query for search services: " + this.query.toString());
+    }
 
-	private SolrDocumentList getDocList() {
-		if (docList == null) {
-			docList = getSearchResultsDao().getResults(query);
-		}
-		return docList;
-	}
+    private SearchResultsDao getSearchResultsDao() {
+        return DaoLocator.getSearchResultsDao();
+    }
 
-	@Override
-	public Iterator<SolrDocument> iterator(int first, int count) {
-		if (first != query.getStart().intValue() || count != query.getRows().intValue()) {
-			query.setStart(first).setRows(count);
-			docList = null;
-		}
-		return getDocList().iterator();
-	}
-	
-	public Iterator<SolrDocument> iterator() {
-		return getDocList().iterator();
-	}
+    private SolrDocumentList getDocList() {
+        if (docList == null) {
+            docList = getSearchResultsDao().getResults(query);
+        }
+        return docList;
+    }
 
-	@Override
-	public IModel<SolrDocument> model(SolrDocument solrDocument) {
-		return new Model<SolrDocument>(solrDocument);
-	}
+    @Override
+    public Iterator<SolrDocument> iterator(long first, long count) {
+        if (first != query.getStart().intValue() || count != query.getRows().intValue()) {
+            query.setStart((int) first).setRows((int) count);
+            docList = null;
+        }
+        return getDocList().iterator();
+    }
 
-	@Override
-	public int size() {
-		return (int) getDocList().getNumFound();
-	}
+    public Iterator<SolrDocument> iterator() {
+        return getDocList().iterator();
+    }
+
+    @Override
+    public IModel<SolrDocument> model(SolrDocument solrDocument) {
+        return new Model<SolrDocument>(solrDocument);
+    }
+
+    @Override
+    public long size() {
+        return getDocList().getNumFound();
+    }
 }
Index: /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/ShowAllFacetValuesPage.java
===================================================================
--- /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/ShowAllFacetValuesPage.java	(revision 4200)
+++ /vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/ShowAllFacetValuesPage.java	(revision 4201)
@@ -3,5 +3,5 @@
 import java.util.Map;
 
-import org.apache.wicket.PageParameters;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
 import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.basic.Label;
@@ -25,6 +25,8 @@
 		addOccurrencesFilter(parameters);
 		
-		String selectedFacet = parameters.getString(SELECTED_FACET_PARAM);
-		Integer facetMinOccurs = parameters.getAsInteger(FACET_MIN_OCCURS, 1);
+		String selectedFacet = (parameters.get(SELECTED_FACET_PARAM)).toString();
+                
+                Integer facetMinOccurs = (parameters.get(FACET_MIN_OCCURS)).toInt(1); // take care of 1 as default value
+                
 		add(new Label("category", selectedFacet));
 		SolrFacetFieldDataProvider data = new SolrFacetFieldDataProvider(selectedFacet, query);
