Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/pom.xml
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/pom.xml	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/pom.xml	(revision 6755)
@@ -7,5 +7,5 @@
         <groupId>eu.clarin.cmdi</groupId>
         <artifactId>vlo</artifactId>
-        <version>3.3-SNAPSHOT</version>
+        <version>3.4-SNAPSHOT</version>
     </parent>
     
@@ -14,11 +14,11 @@
     <artifactId>vlo-web-app</artifactId>
     <packaging>war</packaging>
-    <version>3.3-SNAPSHOT</version>
+    <version>3.4-SNAPSHOT</version>
     <name>VLO Web Application</name>
     <description></description>
 
     <properties>
-        <wicket.version>6.19.0</wicket.version>
-        <spring.version>3.2.13.RELEASE</spring.version>
+        <wicket.version>7.0.0</wicket.version>
+        <spring.version>4.2.0.RELEASE</spring.version>
         <jetty.version>8.1.17.v20150415</jetty.version>
         <!-- selects the appender for the log4j root logger -->
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/JavaScriptResources.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/JavaScriptResources.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/JavaScriptResources.java	(revision 6755)
@@ -21,4 +21,5 @@
 import org.apache.wicket.request.resource.CssResourceReference;
 import org.apache.wicket.request.resource.JavaScriptResourceReference;
+import org.apache.wicket.request.resource.ResourceReference;
 
 /**
@@ -32,8 +33,10 @@
     private final static JavaScriptResourceReference VLO_SYNTAX_HELP = new JavaScriptResourceReference(VloBasePage.class, "vlo-syntax-help.js");
     private final static JavaScriptResourceReference VLO_FACETS = new JavaScriptResourceReference(VloBasePage.class, "vlo-facets.js");
+    private final static JavaScriptResourceReference SEARCH_FORM = new JavaScriptResourceReference(VloBasePage.class, "vlo-searchform.js");
+    private final static JavaScriptResourceReference FIELDS_TABLE = new JavaScriptResourceReference(RecordPage.class, "vlo-fields-table.js");
     private final static JavaScriptResourceReference JQUERY_UI = new JavaScriptResourceReference(VloBasePage.class, "jquery-ui-1.11.4.custom/jquery-ui.min.js");
     private final static CssResourceReference JQUERY_UI_CSS = new CssResourceReference(VloBasePage.class, "jquery-ui-1.11.4.custom/jquery-ui.min.css");
     private final static JavaScriptResourceReference JQUERY_WATERMARK = new JavaScriptResourceReference(VloBasePage.class, "jquery.watermark-3.1.4/jquery.watermark.min.js");
-    private final static JavaScriptResourceReference HIGHLIGHT = new JavaScriptResourceReference(RecordPage.class, "searchhi.js");
+    private final static JavaScriptResourceReference HIGHLIGHT = new JavaScriptResourceReference(RecordPage.class, "jquery.highlight.js");
 
     public static JavaScriptResourceReference getVloFrontJS() {
@@ -66,4 +69,12 @@
         return VLO_SYNTAX_HELP;
     }
+    
+    public static JavaScriptResourceReference getSearchFormJS() {
+        return SEARCH_FORM;
+    }
 
+    public static ResourceReference getFieldsTableJS() {
+        return FIELDS_TABLE;
+    }
+    
 }
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/solr/impl/AbstractSolrQueryFactory.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/solr/impl/AbstractSolrQueryFactory.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/solr/impl/AbstractSolrQueryFactory.java	(revision 6755)
@@ -32,5 +32,5 @@
 public abstract class AbstractSolrQueryFactory {
 
-    protected static final String SOLR_SEARCH_ALL = null;
+    protected static final String SOLR_SEARCH_ALL = "*:*";
 
     protected final void addQueryFacetParameters(final SolrQuery query, QueryFacetsSelection queryFacetsSelections, boolean includeFilterQueries) {
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/solr/impl/SolrDaoImpl.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/solr/impl/SolrDaoImpl.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/solr/impl/SolrDaoImpl.java	(revision 6755)
@@ -11,4 +11,5 @@
 import org.apache.solr.common.SolrDocument;
 import org.apache.solr.common.SolrDocumentList;
+import org.apache.solr.common.SolrException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -83,4 +84,7 @@
             logger.trace("Response: {}", response);
             return response;
+        } catch(SolrException e) {
+            logger.error("Error getting data:", e);
+            throw new RuntimeException(e);
         } catch (SolrServerException e) {
             logger.error("Error getting data:", e);
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/solr/impl/SolrDocumentQueryFactoryImpl.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/solr/impl/SolrDocumentQueryFactoryImpl.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/solr/impl/SolrDocumentQueryFactoryImpl.java	(revision 6755)
@@ -62,4 +62,6 @@
         // make a query to look up a specific document by its ID
         final SolrQuery query = getDefaultDocumentQuery();
+        // we can use the 'fast' request handler here, document ranking is of no interest
+        query.setRequestHandler(FacetConstants.SOLR_REQUEST_HANDLER_FAST);
         // consider all documents
         query.setQuery(SOLR_SEARCH_ALL);
@@ -73,5 +75,5 @@
                 .build();
         query.addFilterQuery(createFilterOrQuery(idOrQueryMap));
-        
+
         // one result max
         query.setRows(1);
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/solr/impl/SolrFacetQueryFactoryImpl.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/solr/impl/SolrFacetQueryFactoryImpl.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/solr/impl/SolrFacetQueryFactoryImpl.java	(revision 6755)
@@ -17,4 +17,5 @@
 package eu.clarin.cmdi.vlo.service.solr.impl;
 
+import eu.clarin.cmdi.vlo.FacetConstants;
 import eu.clarin.cmdi.vlo.service.solr.SolrFacetQueryFactory;
 import eu.clarin.cmdi.vlo.pojo.QueryFacetsSelection;
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/HighlightSearchTermBehavior.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/HighlightSearchTermBehavior.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/HighlightSearchTermBehavior.java	(revision 6755)
@@ -23,4 +23,7 @@
 import org.apache.wicket.markup.head.JavaScriptHeaderItem;
 import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
+import org.apache.wicket.request.Request;
+import org.apache.wicket.util.string.StringValue;
+import org.apache.wicket.util.string.Strings;
 
 /**
@@ -33,5 +36,5 @@
 public class HighlightSearchTermBehavior extends Behavior {
 
-    private static final String HIGHLIGHT_FUNCTION = "searchhi.init()";
+    private final HighlightSearchTermScriptFactory scriptFactory = new HighlightSearchTermScriptFactory();
 
     @Override
@@ -39,6 +42,24 @@
         // include highlight script
         response.render(JavaScriptHeaderItem.forReference(JavaScriptResources.getHighlightJS()));
-        // after load, highlight 
-        response.render(OnDomReadyHeaderItem.forScript(HIGHLIGHT_FUNCTION));
+
+        final String words = getWordList(component);
+        if (!Strings.isEmpty(words)) {
+            String selector = getComponentSelector(component.getMarkupId());
+            // after load, highlight 
+            response.render(OnDomReadyHeaderItem.forScript(scriptFactory.createScript(selector, words)));
+        }
+    }
+
+    protected String getComponentSelector(String componentId) {
+        return "#" + componentId;
+    }
+
+    protected String getWordList(Component component) {
+        Request request = component.getPage().getRequestCycle().getRequest();
+        return request.getQueryParameters().getParameterValue(getQueryParam()).toString();
+    }
+
+    protected String getQueryParam() {
+        return "q";
     }
 
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/HighlightSearchTermScriptFactory.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/HighlightSearchTermScriptFactory.java	(revision 6755)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/HighlightSearchTermScriptFactory.java	(revision 6755)
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2015 CLARIN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package eu.clarin.cmdi.vlo.wicket;
+
+import com.google.common.collect.ImmutableSet;
+import java.io.Serializable;
+import java.util.Collection;
+
+/**
+ *
+ * @author Twan Goosen <twan.goosen@mpi.nl>
+ */
+public class HighlightSearchTermScriptFactory implements Serializable {
+
+    public static final String HIGHLIGHT_FUNCTION = "$('%s').highlight(%s, {className:'%s', wordsOnly: %s})";
+
+    public static final Collection<String> DEFAULT_EXCLUDE_WORDS = ImmutableSet.of("and", "or", "not", "to");
+
+    public static final String DEFAULT_CSS_CLASS = "searchword";
+
+    public String createScript(String componentSelector, final String words) {
+        return createScript(componentSelector, words, DEFAULT_CSS_CLASS);
+    }
+
+    public String createScript(String componentSelector, final String words, String cssClass) {
+        return String.format(HIGHLIGHT_FUNCTION,
+                componentSelector,
+                makeWordListArray(words),
+                cssClass,
+                matchWordsOnly(words)
+        );
+    }
+
+    protected boolean matchWordsOnly(String query) {
+        // string with asterixes or question marks should match by character
+        return !query.matches(".*[\\*\\?].*");
+    }
+
+    /**
+     *
+     * @param wordList string of whitespace separated words
+     * @return a string representing a sanitised javascript array of words
+     */
+    private CharSequence makeWordListArray(String wordList) {
+        final StringBuilder sb = new StringBuilder("[");
+        final String[] words = wordList.split("\\s");
+        for (int i = 0; i < words.length; i++) {
+            final String word = sanitise(words[i]); //remove white space and quotes at beginning or end
+            // is on exclude list?
+            if (!getExcludeWords().contains(word.toLowerCase())) {
+                // wrap in quotes
+                sb.append("'").append(word).append("'");
+                if (i + 1 < words.length) {
+                    // prepare to append next
+                    sb.append(",");
+                }
+            }
+        }
+        return sb.append("]");
+    }
+
+    private String sanitise(String word) {
+        //remove everything up to first colon and strip off quotation marks and white space
+        return word.replaceAll(
+                //match beginning 
+                "^("
+                //case with colon (also strip quotes + optional whitespace after quotes)
+                + "[^:\"']+:(['\"])?"
+                //or case without colon (strip quotes and white space)
+                + "|['\"]+"
+                + ")"
+                //match end
+                + "|("
+                //quotes
+                + "['\"]+"
+                //or boosting values
+                + "|['\"]?\\^.*"
+                + ")$"
+                //also remove wildcard characters
+                + "|[\\?\\*]",
+                //replace with empty string
+                "");
+    }
+
+    /**
+     *
+     * @return Words not to highlight
+     */
+    protected Collection<String> getExcludeWords() {
+        return DEFAULT_EXCLUDE_WORDS;
+    }
+}
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/ResourceTypeCssBehaviour.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/ResourceTypeCssBehaviour.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/ResourceTypeCssBehaviour.java	(revision 6755)
@@ -19,6 +19,6 @@
 import eu.clarin.cmdi.vlo.pojo.ResourceInfo;
 import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.migrate.StringResourceModelMigration;
 import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.StringResourceModel;
 
 /**
@@ -35,5 +35,5 @@
                 // to one of the properties in resourceTypeClass.properties file
                 // (defaults to "")
-                new StringResourceModel("resourcetype.${resourceType}.class", resourceInfoModel, "", new Object[0]));
+                StringResourceModelMigration.of("resourcetype.${resourceType}.class", resourceInfoModel, "", new Object[0]));
         // separate CSS classes with a space
         setSeparator(" ");
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/components/AjaxFallbackLinkLabel.html
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/components/AjaxFallbackLinkLabel.html	(revision 6755)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/components/AjaxFallbackLinkLabel.html	(revision 6755)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<!--
+Copyright (C) 2014 CLARIN
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org" xml:lang="en">
+    <head>
+        <title>facet panel</title>
+        <meta charset="UTF-8">
+    </head>
+    <body>
+        <wicket:panel>
+            <a wicket:id="link"><wicket:container wicket:id="content">[content]</wicket:container></a>
+        </wicket:panel>
+    </body>
+
+</html>
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/components/AjaxFallbackLinkLabel.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/components/AjaxFallbackLinkLabel.java	(revision 6755)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/components/AjaxFallbackLinkLabel.java	(revision 6755)
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2015 CLARIN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package eu.clarin.cmdi.vlo.wicket.components;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxFallbackLink;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+
+/**
+ *
+ * @author Twan Goosen <twan.goosen@mpi.nl>
+ */
+public abstract class AjaxFallbackLinkLabel<T> extends Panel {
+
+    public AjaxFallbackLinkLabel(String id, IModel<T> model, IModel<?> contentModel) {
+        this(id, model, contentModel, true);
+    }
+
+    public AjaxFallbackLinkLabel(String id, IModel<T> linkModel, IModel<?> contentModel, boolean indicator) {
+        super(id);
+        final Link link;
+        if (indicator) {
+            link = new IndicatingAjaxFallbackLink<T>("link", linkModel) {
+
+                @Override
+                public void onClick(AjaxRequestTarget target) {
+                    AjaxFallbackLinkLabel.this.onClick(target);
+                }
+            };
+        } else {
+            link = new AjaxFallbackLink<T>("link", linkModel) {
+
+                @Override
+                public void onClick(AjaxRequestTarget target) {
+                    AjaxFallbackLinkLabel.this.onClick(target);
+                }
+            };
+        }
+        add(link);
+
+        link.add(new Label("content", contentModel));
+    }
+
+    protected abstract void onClick(AjaxRequestTarget target);
+
+}
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/model/SolrDocumentModel.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/model/SolrDocumentModel.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/model/SolrDocumentModel.java	(revision 6755)
@@ -39,5 +39,9 @@
     public SolrDocumentModel(SolrDocument document) {
         super(document);
-        this.docId = Model.of((String) document.getFieldValue(FacetConstants.FIELD_ID));
+        if (document == null) {
+            this.docId = null;
+        } else {
+            this.docId = Model.of((String) document.getFieldValue(FacetConstants.FIELD_ID));
+        }
     }
 
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/model/SolrFieldNameModel.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/model/SolrFieldNameModel.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/model/SolrFieldNameModel.java	(revision 6755)
@@ -20,7 +20,7 @@
 import org.apache.wicket.Application;
 import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
 import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.model.StringResourceModel;
-import org.apache.wicket.settings.def.ResourceSettings;
 
 /**
@@ -41,7 +41,6 @@
     
     public SolrFieldNameModel(IModel<String> model) {
-        super("field.${}",
-                model,
-                model.getObject()); // default to internal field name)
+        super("field.${}", model);
+        setDefaultValue(Model.of(model.getObject())); //TODO: check if this is necessary, added on migration to Wicket 7
     }
 
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.html
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.html	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.html	(revision 6755)
@@ -51,5 +51,5 @@
                 <div id="recorddetails">
                     <a wicket:id="landingPageLink" target="_blank" id="recordlandingpage">Show this record in its original context</a>
-                    <wicket:container wicket:id="documentProperties">[PROPERTIES TABLE]</wicket:container>
+                    <div id="recordProperties" wicket:id="documentProperties">[PROPERTIES TABLE]</div>
                 </div>
 
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.java	(revision 6755)
@@ -20,4 +20,5 @@
 import eu.clarin.cmdi.vlo.FacetConstants;
 import eu.clarin.cmdi.vlo.VloWebAppParameters;
+import eu.clarin.cmdi.vlo.config.VloConfig;
 import eu.clarin.cmdi.vlo.pojo.QueryFacetsSelection;
 import eu.clarin.cmdi.vlo.pojo.SearchContext;
@@ -86,4 +87,6 @@
     @SpringBean(name = "documentFieldOrder")
     private List<String> fieldOrder;
+    @SpringBean
+    private VloConfig config;
 
     private final IModel<SearchContext> navigationModel;
@@ -127,5 +130,4 @@
 
         addComponents();
-        add(new HighlightSearchTermBehavior());
     }
 
@@ -135,14 +137,17 @@
 
         final WebMarkupContainer topNavigation = new WebMarkupContainer("topnavigation");
-        topNavigation.setOutputMarkupId(true);
-        add(topNavigation);
-
-        topNavigation.add(new BreadCrumbPanel("breadcrumbs", selectionModel));
-        topNavigation.add(createPermalink("permalink", topNavigation));
+        add(topNavigation
+                .add(new BreadCrumbPanel("breadcrumbs", selectionModel))
+                .add(createPermalink("permalink", topNavigation))
+                .setOutputMarkupId(true)
+        );
 
         // General information section
         add(new SolrFieldLabel("name", getModel(), FacetConstants.FIELD_NAME, getString("recordpage.unnamedrecord")));
         add(createLandingPageLink("landingPageLink"));
-        add(new FieldsTablePanel("documentProperties", new DocumentFieldsProvider(getModel(), basicPropertiesFilter, fieldOrder)));
+        
+        final FieldsTablePanel fieldsTable = new FieldsTablePanel("documentProperties", new DocumentFieldsProvider(getModel(), basicPropertiesFilter, fieldOrder));
+        fieldsTable.add(new HighlightSearchTermBehavior());
+        add(fieldsTable);
 
         // Resources section
@@ -153,5 +158,18 @@
         add(createTechnicalDetailsPanel("technicalProperties"));
 
-        add(createHierarchyPanel("recordtree"));
+        if (config.isProcessHierarchies()) {
+            // show hierarchy if applicable
+            add(createHierarchyPanel("recordtree"));
+        } else {
+            // invisible stub
+            add(new WebMarkupContainer("recordtree") {
+
+                @Override
+                public boolean isVisible() {
+                    return false;
+                }
+
+            });
+        }
 
         createSearchLinks("searchlinks");
@@ -213,10 +231,10 @@
 
     private void createSearchLinks(String id) {
-        final SolrFieldModel<String> searchPageModel = new SolrFieldModel<String>(getModel(), FacetConstants.FIELD_SEARCHPAGE);
-        final SolrFieldModel<String> searchServiceModel = new SolrFieldModel<String>(getModel(), FacetConstants.FIELD_SEARCH_SERVICE);
+        final SolrFieldModel<String> searchPageModel = new SolrFieldModel<>(getModel(), FacetConstants.FIELD_SEARCHPAGE);
+        final SolrFieldModel<String> searchServiceModel = new SolrFieldModel<>(getModel(), FacetConstants.FIELD_SEARCH_SERVICE);
         add(new WebMarkupContainer(id) {
             {
                 //Add search page links (can be multiple)
-                add(new ListView<String>("searchPage", new CollectionListModel<String>(searchPageModel)) {
+                add(new ListView<String>("searchPage", new CollectionListModel<>(searchPageModel)) {
 
                     @Override
@@ -227,5 +245,5 @@
 
                 // We assume there can be multiple content search endpoints too
-                add(new ListView<String>("contentSearch", new CollectionListModel<String>(searchServiceModel)) {
+                add(new ListView<String>("contentSearch", new CollectionListModel<>(searchServiceModel)) {
 
                     @Override
@@ -305,6 +323,6 @@
         // Put the name of the record in the page title
         return new StringResourceModel("recordpage.title",
-                new NullFallbackModel(new SolrFieldStringModel(getModel(), FacetConstants.FIELD_NAME), getString("recordpage.unnamedrecord")),
-                DEFAULT_PAGE_TITLE);
+                new NullFallbackModel(new SolrFieldStringModel(getModel(), FacetConstants.FIELD_NAME), getString("recordpage.unnamedrecord")))
+                .setDefaultValue(DEFAULT_PAGE_TITLE);
     }
 
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/SimpleSearchPage.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/SimpleSearchPage.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/SimpleSearchPage.java	(revision 6755)
@@ -21,4 +21,5 @@
 import eu.clarin.cmdi.vlo.pojo.QueryFacetsSelection;
 import eu.clarin.cmdi.vlo.service.solr.FacetFieldsService;
+import eu.clarin.cmdi.vlo.wicket.model.PermaLinkModel;
 import eu.clarin.cmdi.vlo.wicket.panels.search.SearchFormPanel;
 import eu.clarin.cmdi.vlo.wicket.panels.SingleFacetPanel;
@@ -64,10 +65,6 @@
 
         // add an updatable container for breadcrumbs and top links
-        navigation = new WebMarkupContainer("navigation");
-        navigation.setOutputMarkupId(true);
+        navigation = createNavigation("navigation");
         add(navigation);
-
-        navigation.add(new BookmarkablePageLink("breadcrumb", getApplication().getHomePage()));
-        navigation.add(new TopLinksPanel("topLinks", null));
 
         // add a persistenet panel for selection of a value for the collection facet
@@ -88,4 +85,21 @@
         browse = new SimpleSearchBrowsePanel("browse", getModel());
         add(browse);
+    }
+
+    private WebMarkupContainer createNavigation(String id) {
+        final WebMarkupContainer container = new WebMarkupContainer(id);
+        container.setOutputMarkupId(true);
+        container.add(new BookmarkablePageLink("breadcrumb", getApplication().getHomePage()));
+        container.add(new TopLinksPanel("topLinks", new PermaLinkModel(getPageClass(), getModel())) {
+
+            @Override
+            protected void onChange(AjaxRequestTarget target) {
+                if (target != null) {
+                    target.add(container);
+                }
+            }
+
+        });
+        return container;
     }
 
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/VloBasePage.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/VloBasePage.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/VloBasePage.java	(revision 6755)
@@ -33,7 +33,7 @@
 import org.apache.wicket.markup.html.link.ExternalLink;
 import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.migrate.StringResourceModelMigration;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
-import org.apache.wicket.model.StringResourceModel;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
 import org.apache.wicket.request.resource.CssResourceReference;
@@ -155,5 +155,5 @@
      */
     public IModel<String> getPageDescriptionModel() {
-        return new StringResourceModel("vloDescription", null, (Object[]) null);
+        return StringResourceModelMigration.of("vloDescription", null, (Object[]) null);
     }
 
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/FieldsTablePanel.html
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/FieldsTablePanel.html	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/FieldsTablePanel.html	(revision 6755)
@@ -28,5 +28,5 @@
                     <tr wicket:id="documentField">
                         <td class="attribute">
-                            <div wicket:id="fieldName">Description</div>
+                            <div class="fieldName" wicket:id="fieldName">Description</div>
                         </td><td class="attributeValue">
                             <ul class="attributeValues">
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/FieldsTablePanel.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/FieldsTablePanel.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/FieldsTablePanel.java	(revision 6755)
@@ -20,4 +20,5 @@
 import com.google.common.collect.ImmutableSet;
 import eu.clarin.cmdi.vlo.FacetConstants;
+import eu.clarin.cmdi.vlo.JavaScriptResources;
 import eu.clarin.cmdi.vlo.config.VloConfig;
 import eu.clarin.cmdi.vlo.pojo.DocumentField;
@@ -28,4 +29,5 @@
 import eu.clarin.cmdi.vlo.wicket.components.SmartLinkFieldValueLabel;
 import eu.clarin.cmdi.vlo.wicket.model.HandleLinkModel;
+import eu.clarin.cmdi.vlo.wicket.model.SolrFieldDescriptionModel;
 import eu.clarin.cmdi.vlo.wicket.model.SolrFieldNameModel;
 import eu.clarin.cmdi.vlo.wicket.pages.FacetedSearchPage;
@@ -35,5 +37,9 @@
 import org.apache.wicket.AttributeModifier;
 import org.apache.wicket.Component;
+import org.apache.wicket.behavior.AttributeAppender;
 import org.apache.wicket.extensions.markup.html.basic.SmartLinkMultiLineLabel;
+import org.apache.wicket.markup.head.CssHeaderItem;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.JavaScriptHeaderItem;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.link.Link;
@@ -89,5 +95,7 @@
                 final PropertyModel<String> fieldNameModel = new PropertyModel<String>(fieldModel, "fieldName");
                 final SolrFieldNameModel friendlyFieldNameModel = new SolrFieldNameModel(fieldNameModel);
-                item.add(new Label("fieldName", friendlyFieldNameModel));
+                final Label fieldName = new Label("fieldName", friendlyFieldNameModel);
+                item.add(fieldName);
+                fieldName.add(new AttributeAppender("title", new SolrFieldDescriptionModel(fieldNameModel)));
                 final PropertyModel<List> valuesModel = new PropertyModel<List>(fieldModel, "values");
                 item.add(new ListView("values", valuesModel) {
@@ -160,4 +168,12 @@
         return true;
     }
+    
+//    re-enable for 'fancy' popups for the field descriptions
+//    @Override
+//    public void renderHead(IHeaderResponse response) {
+//        // JQuery UI for tooltips
+//        response.render(CssHeaderItem.forReference(JavaScriptResources.getJQueryUICSS()));
+//        response.render(JavaScriptHeaderItem.forReference(JavaScriptResources.getFieldsTableJS()));
+//    }
 
 }
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/HierarchyPanel.html
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/HierarchyPanel.html	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/HierarchyPanel.html	(revision 6755)
@@ -38,5 +38,7 @@
                 <a wicket:id="showAll">Show all... (<span wicket:id="itemCount">999</span>)</a>
             </div>
-            <div id="tree" wicket:id="tree">[TREE]</div>
+            <div wicket:id="treeContainer">
+                <div id="tree" wicket:id="tree">[TREE]</div>
+            </div>
         </wicket:panel>
     </body>
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/HierarchyPanel.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/HierarchyPanel.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/HierarchyPanel.java	(revision 6755)
@@ -21,12 +21,16 @@
 import eu.clarin.cmdi.vlo.FacetConstants;
 import eu.clarin.cmdi.vlo.service.solr.SolrDocumentService;
+import eu.clarin.cmdi.vlo.wicket.components.AjaxFallbackLinkLabel;
 import eu.clarin.cmdi.vlo.wicket.components.IndicatingNestedTree;
 import eu.clarin.cmdi.vlo.wicket.components.NamedRecordPageLink;
 import eu.clarin.cmdi.vlo.wicket.model.SolrDocumentModel;
+import java.io.Serializable;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
+import java.util.Objects;
 import org.apache.solr.common.SolrDocument;
 import org.apache.wicket.Component;
+import org.apache.wicket.MarkupContainer;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.behavior.AttributeAppender;
@@ -58,4 +62,5 @@
      */
     public static final int INITIAL_PARENTS_SHOWN = 5;
+    public static final int INITIAL_CHILRDEN_SHOWN = 50;
 
     @SpringBean
@@ -63,5 +68,6 @@
 
     private final IDataProvider<SolrDocument> parentsProvider;
-    private final AbstractTree<SolrDocument> tree;
+    private final MarkupContainer treeContainer;
+    private final AbstractTree<ModelWrapper<SolrDocument>> tree;
     private final IModel<SolrDocument> pageDocumentModel;
 
@@ -75,5 +81,9 @@
 
         tree = createTree("tree");
-        add(tree);
+
+        treeContainer = new WebMarkupContainer("treeContainer");
+        treeContainer.setOutputMarkupId(true);
+        treeContainer.add(tree);
+        add(treeContainer);
 
         setOutputMarkupId(true);
@@ -97,5 +107,5 @@
                         // tree root up one level, expand root for traceability by user
                         HierarchyPanel.this.setModel(item.getModel());
-                        tree.expand(item.getModelObject());
+                        tree.expand(new ModelWrapper<>(item.getModel()));
                         if (target != null) {
                             target.add(HierarchyPanel.this);
@@ -103,5 +113,5 @@
                     }
                 });
-                
+
                 item.add(new Behavior() {
 
@@ -148,16 +158,29 @@
     }
 
-    private AbstractTree<SolrDocument> createTree(String id) {
-        final AbstractTree<SolrDocument> result = new IndicatingNestedTree<SolrDocument>(id, new HierarchyTreeProvider()) {
-
-            @Override
-            protected Component newContentComponent(String id, final IModel<SolrDocument> node) {
-                return new NamedRecordPageLink(id, node) {
-
-                    @Override
-                    protected void onConfigure() {
-                        setEnabled(!node.equals(pageDocumentModel));
-                    }
-                };
+    private AbstractTree createTree(String id) {
+        final HierarchyTreeProvider treeProvider = new HierarchyTreeProvider();
+        final AbstractTree<ModelWrapper<SolrDocument>> result = new IndicatingNestedTree<ModelWrapper<SolrDocument>>(id, treeProvider) {
+
+            @Override
+            protected Component newContentComponent(String id, final IModel<ModelWrapper<SolrDocument>> node) {
+                if (node.getObject().isLimit()) {
+                    return new AjaxFallbackLinkLabel(id, node, Model.of("Show all... (" + node.getObject().getCount() + ")")) {
+
+                        @Override
+                        public void onClick(AjaxRequestTarget target) {
+                            treeProvider.setChildrenShown(null);
+                            target.add(treeContainer);
+                        }
+
+                    };
+                } else {
+                    return new NamedRecordPageLink(id, node.getObject().getModel()) {
+
+                        @Override
+                        protected void onConfigure() {
+                            setEnabled(!node.equals(pageDocumentModel));
+                        }
+                    };
+                }
             }
 
@@ -184,32 +207,62 @@
     }
 
-    private class HierarchyTreeProvider extends SortableTreeProvider<SolrDocument, Object> {
-
-        @Override
-        public Iterator<? extends SolrDocument> getRoots() {
-            return Iterators.singletonIterator(HierarchyPanel.this.getModel().getObject());
-        }
-
-        @Override
-        public boolean hasChildren(SolrDocument node) {
-            Object partCount = node.getFieldValue(FacetConstants.FIELD_HAS_PART_COUNT);
-            return (partCount instanceof Number) && ((Number) partCount).intValue() > 0;
-        }
-
-        @Override
-        public Iterator<? extends SolrDocument> getChildren(SolrDocument node) {
-            final Collection<Object> parts = node.getFieldValues(FacetConstants.FIELD_HAS_PART);
-            return Iterators.transform(parts.iterator(), new Function<Object, SolrDocument>() {
-
-                @Override
-                public SolrDocument apply(Object childId) {
-                    return documentService.getDocument(childId.toString());
-                }
-            });
-        }
-
-        @Override
-        public IModel<SolrDocument> model(SolrDocument object) {
-            return new SolrDocumentModel(object);
+    private class HierarchyTreeProvider extends SortableTreeProvider<ModelWrapper<SolrDocument>, Object> {
+
+        private Integer childrenShown = INITIAL_CHILRDEN_SHOWN;
+
+        public void setChildrenShown(Integer childrenShown) {
+            this.childrenShown = childrenShown;
+        }
+
+        @Override
+        public Iterator<? extends ModelWrapper<SolrDocument>> getRoots() {
+            return Iterators.singletonIterator(
+                    new ModelWrapper<>(
+                            HierarchyPanel.this.getModel()));
+        }
+
+        @Override
+        public boolean hasChildren(ModelWrapper<SolrDocument> node) {
+            if (node.isLimit()) {
+                return false;
+            } else {
+                final Object partCount = node.getModelObject().getFieldValue(FacetConstants.FIELD_HAS_PART_COUNT);
+                return (partCount instanceof Number) && ((Number) partCount).intValue() > 0;
+            }
+        }
+
+        @Override
+        public Iterator<? extends ModelWrapper<SolrDocument>> getChildren(ModelWrapper<SolrDocument> node) {
+            if (node.isLimit()) {
+                return Collections.emptyIterator();
+            } else {
+                final Collection<Object> parts = node.getModelObject().getFieldValues(FacetConstants.FIELD_HAS_PART);
+                final Iterator<Object> objectIterator;
+                if (childrenShown == null) {
+                    // unlimited
+                    objectIterator = parts.iterator();
+                } else {
+                    objectIterator = Iterators.limit(parts.iterator(), childrenShown);
+                }
+                final Iterator<ModelWrapper<SolrDocument>> iterator = Iterators.transform(objectIterator, new Function<Object, ModelWrapper<SolrDocument>>() {
+
+                    @Override
+                    public ModelWrapper<SolrDocument> apply(Object childId) {
+                        final SolrDocument document = documentService.getDocument(childId.toString());
+                        return new ModelWrapper<>(new SolrDocumentModel(document));
+                    }
+                });
+                if (childrenShown != null && parts.size() > childrenShown) {
+                    return Iterators.concat(iterator, // add empty model wrapper to indicate "end of page"
+                            Iterators.singletonIterator(new ModelWrapper<SolrDocument>(parts.size())));
+                } else {
+                    return iterator;
+                }
+            }
+        }
+
+        @Override
+        public IModel<ModelWrapper<SolrDocument>> model(ModelWrapper<SolrDocument> object) {
+            return object;
         }
     }
@@ -269,3 +322,94 @@
     }
 
+    private class ModelWrapper<T> extends AbstractReadOnlyModel<ModelWrapper<T>> implements Serializable {
+
+        /**
+         * Limit reached?
+         */
+        private final boolean limit;
+
+        /**
+         * Total number of items (if beyond the limit)
+         */
+        private final int count;
+
+        /**
+         * Inner model
+         */
+        private final IModel<T> model;
+
+        public ModelWrapper(int count) {
+            this.limit = true;
+            this.count = count;
+            this.model = null;
+        }
+
+        public ModelWrapper(IModel<T> model) {
+            this.limit = false;
+            this.count = -1;
+            this.model = model;
+        }
+
+        public boolean isLimit() {
+            return limit;
+        }
+
+        public IModel<T> getModel() {
+            return model;
+        }
+
+        public int getCount() {
+            return count;
+        }
+
+        public T getModelObject() {
+            if (model == null) {
+                return null;
+            } else {
+                return model.getObject();
+            }
+        }
+
+        // as IModel<T>
+        @Override
+        public void detach() {
+            if (model != null) {
+                model.detach();
+            }
+        }
+
+        // as IModel<T>
+        @Override
+        public ModelWrapper<T> getObject() {
+            return this;
+        }
+
+        @Override
+        public int hashCode() {
+            int hash = 5;
+            hash = 41 * hash + (this.limit ? 1 : 0);
+            hash = 41 * hash + Objects.hashCode(this.model);
+            return hash;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            final ModelWrapper<?> other = (ModelWrapper<?>) obj;
+            if (this.limit != other.limit) {
+                return false;
+            }
+            if (!Objects.equals(this.model, other.model)) {
+                return false;
+            }
+            return true;
+        }
+
+    }
+
 }
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/RecordNavigationPanel.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/RecordNavigationPanel.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/RecordNavigationPanel.java	(revision 6755)
@@ -22,8 +22,8 @@
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.panel.GenericPanel;
+import org.apache.wicket.migrate.StringResourceModelMigration;
 import org.apache.wicket.model.AbstractReadOnlyModel;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.PropertyModel;
-import org.apache.wicket.model.StringResourceModel;
 
 /**
@@ -38,6 +38,8 @@
         super(id, model);
 
+        
+        
         // Add a label 'record X of Y'
-        add(new Label("recordIndex", new StringResourceModel("record.navigation.index", this, model,
+        add(new Label("recordIndex", StringResourceModelMigration.of("record.navigation.index", this, model,
                 new Object[]{
                     // These values get inserted into the string
@@ -45,5 +47,5 @@
                     new ShiftedIndexModel(new PropertyModel<Long>(model, "index"), +1),
                     // Second: total result count, unmodified
-                    new PropertyModel<Integer>(model, "resultCount")
+                    new PropertyModel<>(model, "resultCount")
                 }
         )));
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/ResourceLinkDetailsPanel.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/ResourceLinkDetailsPanel.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/ResourceLinkDetailsPanel.java	(revision 6755)
@@ -20,7 +20,7 @@
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.migrate.StringResourceModelMigration;
 import org.apache.wicket.model.CompoundPropertyModel;
 import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.StringResourceModel;
 
 /**
@@ -34,7 +34,7 @@
     public ResourceLinkDetailsPanel(String id, IModel<ResourceInfo> model) {
         super(id, model);
-        setDefaultModel(new CompoundPropertyModel<ResourceInfo>(model));
+        setDefaultModel(new CompoundPropertyModel<>(model));
         // get the friendly name of the resource type dynamically from the resource bundle
-        add(new Label("resourceType", new StringResourceModel("resourcetype.${resourceType}.singular", model, model.getObject().getResourceType())));
+        add(new Label("resourceType", StringResourceModelMigration.of("resourcetype.${resourceType}.singular", model, model.getObject().getResourceType())));
         add(new Label("fileName"));
         add(new Label("mimeType"));
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/ResourceLinksPanel.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/ResourceLinksPanel.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/ResourceLinksPanel.java	(revision 6755)
@@ -25,5 +25,4 @@
 import java.util.Collection;
 import java.util.List;
-import org.apache.wicket.Component;
 import org.apache.wicket.MarkupContainer;
 import org.apache.wicket.ajax.AjaxRequestTarget;
@@ -62,5 +61,5 @@
 
         // list view that shows all resources as links that show a resource details panel when clicked
-        final ResourcesListView resourceListing = new ResourcesListView("resource", new CollectionListModel<String>(model));
+        final ResourcesListView resourceListing = new ResourcesListView("resource", new CollectionListModel<>(model));
         add(resourceListing);
 
@@ -90,5 +89,5 @@
     private class ResourcesListView extends PageableListView<String> {
 
-        public ResourcesListView(String id, IModel<? extends List<? extends String>> model) {
+        public ResourcesListView(String id, IModel<? extends List<String>> model) {
             super(id, model, ITEMS_PER_PAGE);
             setReuseItems(true);
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/AdvancedSearchOptionsPanel.html
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/AdvancedSearchOptionsPanel.html	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/AdvancedSearchOptionsPanel.html	(revision 6755)
@@ -31,5 +31,5 @@
                             <label for="onlyfcs">Only include resources that support content search</label>
                         </li>
-                        <li>
+                        <li wicket:id="collectionsSection">
                             <input wicket:id="collection" type="checkbox" id="onlycollections"/>
                             <label for="onlycollections">Only include collection resources</label>
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/AdvancedSearchOptionsPanel.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/AdvancedSearchOptionsPanel.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/AdvancedSearchOptionsPanel.java	(revision 6755)
@@ -19,4 +19,5 @@
 import com.google.common.collect.ImmutableSet;
 import eu.clarin.cmdi.vlo.FacetConstants;
+import eu.clarin.cmdi.vlo.config.VloConfig;
 import eu.clarin.cmdi.vlo.pojo.ExpansionState;
 import eu.clarin.cmdi.vlo.pojo.FacetSelection;
@@ -27,10 +28,13 @@
 import eu.clarin.cmdi.vlo.wicket.panels.ExpandablePanel;
 import java.util.Collection;
+import org.apache.wicket.MarkupContainer;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.form.OnChangeAjaxBehavior;
+import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.form.CheckBox;
 import org.apache.wicket.markup.html.form.Form;
 import org.apache.wicket.model.IModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
 
 /**
@@ -45,4 +49,7 @@
 public abstract class AdvancedSearchOptionsPanel extends ExpandablePanel<QueryFacetsSelection> {
 
+    @SpringBean
+    private VloConfig config;
+    
     /**
      * The fields that this panel provides options for
@@ -58,6 +65,11 @@
         final CheckBox fcsCheck = createFieldNotEmptyOption("fcs", FacetConstants.FIELD_SEARCH_SERVICE);
         options.add(fcsCheck);
+        
+        final MarkupContainer collectionsSection = new WebMarkupContainer("collectionsSection");
         final CheckBox collectionCheck = createFieldNotEmptyOption("collection", FacetConstants.FIELD_HAS_PART_COUNT);
-        options.add(collectionCheck);
+        collectionsSection.add(collectionCheck);
+        collectionsSection.setVisible(config.isProcessHierarchies());
+        options.add(collectionsSection);
+        
         
         add(options);
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/AllFacetValuesPanel.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/AllFacetValuesPanel.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/AllFacetValuesPanel.java	(revision 6755)
@@ -131,10 +131,10 @@
 
     private DataView<FacetField.Count> createValuesView(String id) {
-        final IModel<String> fieldNameModel = new PropertyModel<String>(getModel(), "name");
+        final IModel<String> fieldNameModel = new PropertyModel<>(getModel(), "name");
         return new DataView<FacetField.Count>(id, valuesProvider, ITEMS_PER_PAGE) {
 
             @Override
             protected void populateItem(final Item<FacetField.Count> item) {
-                item.setDefaultModel(new CompoundPropertyModel<FacetField.Count>(item.getModel()));
+                item.setDefaultModel(new CompoundPropertyModel<>(item.getModel()));
 
                 // link to select an individual facet value
@@ -170,5 +170,5 @@
         options.add(sortSelect);
 
-        final TextField filterField = new TextField<String>("filter", new PropertyModel(filterModel, "name"));
+        final TextField filterField = new TextField<>("filter", new PropertyModel(filterModel, "name"));
         filterField.add(new AjaxFormComponentUpdatingBehavior("keyup") {
 
@@ -202,11 +202,11 @@
 
         // Model that holds the actual number of occurences filtered on
-        final IModel<Integer> minOccurenceModel = new PropertyModel<Integer>(filterModel, "minimalOccurence");
+        final IModel<Integer> minOccurenceModel = new PropertyModel<>(filterModel, "minimalOccurence");
         // Model that represents the filter state ('bridge' between filter and selection)
         final IModel<Boolean> bridgeStateModel = Model.of(false);
         // Model that represents the *selected* number of minimal occurences (passes it on if not decoupled)
-        final IModel<Integer> minOccurenceSelectModel = new BridgeOuterModel<Integer>(minOccurenceModel, bridgeStateModel, 2);
+        final IModel<Integer> minOccurenceSelectModel = new BridgeOuterModel<>(minOccurenceModel, bridgeStateModel, 2);
         // Model that links the actual filter, selection and bridge (object opens and closes it)
-        final IModel<Boolean> minOccurenceCheckBoxModel = new BridgeModel<Integer>(minOccurenceModel, minOccurenceSelectModel, bridgeStateModel, 0);
+        final IModel<Boolean> minOccurenceCheckBoxModel = new BridgeModel<>(minOccurenceModel, minOccurenceSelectModel, bridgeStateModel, 0);
 
         // checkbox to open and close the 'bridge'
@@ -216,5 +216,5 @@
 
         // Dropdown to select a value (which is applied to the filter if the 'bridge' is open)
-        final DropDownChoice<Integer> minOccurence = new DropDownChoice<Integer>("minOccurences", minOccurenceSelectModel, ImmutableList.of(2, 5, 10, 100, 1000));
+        final DropDownChoice<Integer> minOccurence = new DropDownChoice<>("minOccurences", minOccurenceSelectModel, ImmutableList.of(2, 5, 10, 100, 1000));
         minOccurence.add(new UpdateOptionsFormBehavior(options) {
 
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/FacetValuesPanel.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/FacetValuesPanel.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/FacetValuesPanel.java	(revision 6755)
@@ -77,4 +77,5 @@
     @SpringBean
     private FieldValueConverterProvider fieldValueConverterProvider;
+
     /**
      * Creates a new panel with selectable values for a single facet
@@ -133,5 +134,5 @@
     private Form createFilterForm(String id) {
         final Form filterForm = new Form(id);
-        final TextField<String> filterField = new TextField<String>("filterText",
+        final TextField<String> filterField = new TextField<>("filterText",
                 new PropertyModel<String>(filterModel, "name"));
         // make field update 
@@ -155,5 +156,5 @@
      */
     private DataView createValuesView(String id) {
-        final FacetFieldValuesProvider valuesProvider = new FacetFieldValuesProvider(getModel(), MAX_NUMBER_OF_FACETS_TO_SHOW, LOW_PRIORITY_VALUES, fieldValueConverterProvider){
+        final FacetFieldValuesProvider valuesProvider = new FacetFieldValuesProvider(getModel(), MAX_NUMBER_OF_FACETS_TO_SHOW, LOW_PRIORITY_VALUES, fieldValueConverterProvider) {
 
             @Override
@@ -164,16 +165,16 @@
         };
         // partition the values according to the specified partition size
-        final PartitionedDataProvider<Count, FieldValuesOrder> partitionedValuesProvider = new PartitionedDataProvider<FacetField.Count, FieldValuesOrder>(valuesProvider, subListSize);
+        final PartitionedDataProvider<Count, FieldValuesOrder> partitionedValuesProvider = new PartitionedDataProvider<>(valuesProvider, subListSize);
 
         // create the view for the partitions
-        final DataView<List<? extends Count>> valuesView = new DataView<List<? extends Count>>(id, partitionedValuesProvider) {
-
-            @Override
-            protected void populateItem(Item<List<? extends Count>> item) {
+        final DataView<List<Count>> valuesView = new DataView<List<Count>>(id, partitionedValuesProvider) {
+
+            @Override
+            protected void populateItem(Item<List<Count>> item) {
                 // create a list view for the values in this partition
-                item.add(new ListView<Count>("facetValues", item.getModel()) {
+                item.add(new ListView("facetValues", item.getModel()) {
 
                     @Override
-                    protected void populateItem(ListItem<Count> item) {
+                    protected void populateItem(ListItem item) {
                         addFacetValue("facetSelect", item);
                     }
@@ -191,5 +192,5 @@
      */
     private void addFacetValue(String id, final ListItem<Count> item) {
-        item.setDefaultModel(new CompoundPropertyModel<Count>(item.getModel()));
+        item.setDefaultModel(new CompoundPropertyModel<>(item.getModel()));
 
         // link to select an individual facet value
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/FacetsPanel.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/FacetsPanel.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/FacetsPanel.java	(revision 6755)
@@ -74,5 +74,4 @@
                 // making it dynamic in case the selection and therefore
                 // set of available values changes
-                // TODO: Limit to number of items shown while keeping 'more' function?
                 item.add(
                         new FacetPanel("facet", 
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SearchFormPanel.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SearchFormPanel.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SearchFormPanel.java	(revision 6755)
@@ -21,5 +21,8 @@
 import eu.clarin.cmdi.vlo.service.solr.AutoCompleteService;
 import java.util.Iterator;
+import org.apache.wicket.Component;
 import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.attributes.AjaxCallListener;
+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
 import org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton;
 import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteTextField;
@@ -43,4 +46,5 @@
     private AutoCompleteService autoCompleteDao;
 
+    //private final AjaxIndicatorAppender indicatorAppender = new AjaxIndicatorAppender();
     public SearchFormPanel(String id, IModel<QueryFacetsSelection> model) {
         super(id, model);
@@ -65,4 +69,26 @@
                 SearchFormPanel.this.onSubmit(target);
             }
+
+            @Override
+            protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
+                super.updateAjaxAttributes(attributes);
+
+                // listener to start/stop indicating progress
+                AjaxCallListener listener = new AjaxCallListener() {
+
+                    @Override
+                    public CharSequence getBeforeHandler(Component component) {
+                        return ("startSearch();");
+                    }
+
+                    @Override
+                    public CharSequence getCompleteHandler(Component component) {
+                        return ("endSearch();");
+                    }
+
+                };
+                attributes.getAjaxCallListeners().add(listener);
+            }
+
         }
         );
@@ -70,5 +96,5 @@
         add(form);
     }
-
+   
     protected abstract void onSubmit(AjaxRequestTarget target);
 
@@ -79,4 +105,5 @@
         response.render(JavaScriptHeaderItem.forReference(JavaScriptResources.getJQueryUIJS()));
         response.render(JavaScriptHeaderItem.forReference(JavaScriptResources.getSyntaxHelpJS()));
+        response.render(JavaScriptHeaderItem.forReference(JavaScriptResources.getSearchFormJS()));
     }
 }
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SearchResultItemCollapsedPanel.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SearchResultItemCollapsedPanel.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SearchResultItemCollapsedPanel.java	(revision 6755)
@@ -33,4 +33,5 @@
 import org.apache.wicket.markup.repeater.data.DataView;
 import org.apache.wicket.markup.repeater.data.IDataProvider;
+import org.apache.wicket.migrate.StringResourceModelMigration;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.StringResourceModel;
@@ -59,5 +60,5 @@
 
         // get model for resources
-        final SolrFieldModel<String> resourcesModel = new SolrFieldModel<String>(documentModel, FacetConstants.FIELD_RESOURCE);
+        final SolrFieldModel<String> resourcesModel = new SolrFieldModel<>(documentModel, FacetConstants.FIELD_RESOURCE);
         // wrap with a count provider
         final ResouceTypeCountDataProvider countProvider = new ResouceTypeCountDataProvider(resourcesModel, countingService);
@@ -112,7 +113,7 @@
             // first create a string model that provides the type of resources 
             // in the right number (plural or singular, conveniently supplied by ResourceTypeCount)
-            final StringResourceModel resourceTypeModel = new StringResourceModel("resourcetype.${resourceType}.${number}", resourceTypeCountModel, "?");
+            final StringResourceModel resourceTypeModel = StringResourceModelMigration.of("resourcetype.${resourceType}.${number}", resourceTypeCountModel, "?");
             // inject this into the resource string that combines it with count
-            return new StringResourceModel("resources.typecount", this, resourceTypeCountModel, resourceTypeModel);
+            return StringResourceModelMigration.of("resources.typecount", this, resourceTypeCountModel, resourceTypeModel);
         }
     }
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SearchResultItemExpandedPanel.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SearchResultItemExpandedPanel.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SearchResultItemExpandedPanel.java	(revision 6755)
@@ -37,5 +37,4 @@
 import org.apache.solr.common.SolrDocument;
 import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.extensions.markup.html.basic.SmartLinkLabel;
 import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.basic.Label;
@@ -44,9 +43,9 @@
 import org.apache.wicket.markup.html.list.PageableListView;
 import org.apache.wicket.markup.html.panel.GenericPanel;
+import org.apache.wicket.migrate.StringResourceModelMigration;
 import org.apache.wicket.model.AbstractReadOnlyModel;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
 import org.apache.wicket.model.PropertyModel;
-import org.apache.wicket.model.StringResourceModel;
 import org.apache.wicket.spring.injection.annot.SpringBean;
 
@@ -94,5 +93,5 @@
 
     private WebMarkupContainer createResourcesView(String id, final IModel<SearchContext> selectionModel) {
-        final SolrFieldModel<String> resourceModel = new SolrFieldModel<String>(getModel(), FacetConstants.FIELD_RESOURCE);
+        final SolrFieldModel<String> resourceModel = new SolrFieldModel<>(getModel(), FacetConstants.FIELD_RESOURCE);
         // create a container for the list view that is only visible if there actually are resources
         final WebMarkupContainer container = new WebMarkupContainer(id) {
@@ -119,5 +118,5 @@
         };
         // add a record page link that shows the number of resources not shown
-        moreLink.add(new Label("moreLabel", new StringResourceModel("resources.more", new AbstractReadOnlyModel<Integer>() {
+        moreLink.add(new Label("moreLabel", StringResourceModelMigration.of("resources.more", new AbstractReadOnlyModel<Integer>() {
 
             @Override
@@ -134,5 +133,5 @@
     private PageableListView createResourcesList(String id, SolrFieldModel<String> resourceModel) {
         // list of resources in this record
-        final IModel<List<String>> resourceListModel = new CollectionListModel<String>(resourceModel);
+        final IModel<List<String>> resourceListModel = new CollectionListModel<>(resourceModel);
         // use a a pageable view so that the number of resources actually shown is limited
         return new PageableListView<String>(id, resourceListModel, MAX_RESOURCES_TO_SHOW) {
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SearchResultItemPanel.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SearchResultItemPanel.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SearchResultItemPanel.java	(revision 6755)
@@ -21,4 +21,5 @@
 import eu.clarin.cmdi.vlo.pojo.ExpansionState;
 import eu.clarin.cmdi.vlo.pojo.SearchContext;
+import eu.clarin.cmdi.vlo.wicket.HighlightSearchTermScriptFactory;
 import eu.clarin.cmdi.vlo.wicket.components.RecordPageLink;
 import eu.clarin.cmdi.vlo.wicket.components.SolrFieldLabel;
@@ -35,4 +36,5 @@
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.apache.wicket.util.string.Strings;
 
 /**
@@ -44,8 +46,9 @@
     @SpringBean
     private VloConfig config;
-    
+
     private final Panel collapsedDetails;
     private final Panel expandedDetails;
     private final IModel<ExpansionState> expansionStateModel;
+    private final IModel<SearchContext> selectionModel;
 
     /**
@@ -61,4 +64,5 @@
         super(id, documentModel);
         this.expansionStateModel = expansionStateModel;
+        this.selectionModel = selectionModel;
 
         final Link recordLink = new RecordPageLink("recordLink", documentModel, selectionModel);
@@ -100,4 +104,12 @@
                     // parial update (just this search result item)
                     target.add(SearchResultItemPanel.this);
+
+                    // in case of a query, update highlight matching search terms after collapse/expand
+                    final String query = selectionModel.getObject().getSelection().getQuery();
+                    if (!Strings.isEmpty(query)) {
+                        final HighlightSearchTermScriptFactory scriptFactory = new HighlightSearchTermScriptFactory();
+                        final String selector = "#" + SearchResultItemPanel.this.getMarkupId();
+                        target.appendJavaScript(scriptFactory.createScript(selector, query));
+                    }
                 }
             }
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SearchResultsPanel.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SearchResultsPanel.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SearchResultsPanel.java	(revision 6755)
@@ -18,4 +18,6 @@
 
 import eu.clarin.cmdi.vlo.pojo.QueryFacetsSelection;
+import eu.clarin.cmdi.vlo.wicket.HighlightSearchTermBehavior;
+import eu.clarin.cmdi.vlo.wicket.HighlightSearchTermScriptFactory;
 import eu.clarin.cmdi.vlo.wicket.model.SearchContextModel;
 import eu.clarin.cmdi.vlo.wicket.model.SearchResultExpansionStateModel;
@@ -26,4 +28,6 @@
 import java.util.Set;
 import org.apache.solr.common.SolrDocument;
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
@@ -41,4 +45,5 @@
 import org.apache.wicket.model.Model;
 import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.util.string.StringValue;
 
 /**
@@ -93,4 +98,18 @@
         //For Ajax updating of search results
         setOutputMarkupId(true);
+        
+        add(new HighlightSearchTermBehavior(){
+
+            @Override
+            protected String getComponentSelector(String componentId) {
+                return ".searchresultitem"; //"h3, .searchresultdescription"
+            }
+
+            @Override
+            protected String getWordList(Component component) {
+                return selectionModel.getObject().getQuery();
+            }
+            
+        });
     }
     
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SimpleSearchBrowsePanel.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SimpleSearchBrowsePanel.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SimpleSearchBrowsePanel.java	(revision 6755)
@@ -29,9 +29,9 @@
 import org.apache.wicket.markup.html.list.ListView;
 import org.apache.wicket.markup.html.panel.GenericPanel;
+import org.apache.wicket.migrate.StringResourceModelMigration;
 import org.apache.wicket.model.AbstractReadOnlyModel;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
 import org.apache.wicket.model.PropertyModel;
-import org.apache.wicket.model.StringResourceModel;
 import org.apache.wicket.spring.injection.annot.SpringBean;
 
@@ -85,5 +85,5 @@
         };
         // set label on basis of string defined in resource bundle that takes the count model as a parameter
-        browseAllLink.add(new Label("recordCount", new StringResourceModel("simplesearch.allrecords", documentCountModel, new Object[]{})));
+        browseAllLink.add(new Label("recordCount", StringResourceModelMigration.of("simplesearch.allrecords", documentCountModel, new Object[]{})));
         add(browseAllLink);
 
@@ -113,5 +113,5 @@
          * Model that holds the currently selected facet
          */
-        private final IModel<String> selectedFacetModel = new Model<String>(null);
+        private final IModel<String> selectedFacetModel = new Model<>(null);
         private final IModel<QueryFacetsSelection> selectionModel;
 
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/provider/FacetFieldValuesProvider.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/provider/FacetFieldValuesProvider.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/provider/FacetFieldValuesProvider.java	(revision 6755)
@@ -88,5 +88,5 @@
      */
     public FacetFieldValuesProvider(IModel<FacetField> model, int max, Collection<String> lowPriorityValues, FieldValueConverterProvider fieldValueConverterProvider) {
-        this(model, max, lowPriorityValues, new SortParam<FieldValuesOrder>(FieldValuesOrder.COUNT, false), fieldValueConverterProvider);
+        this(model, max, lowPriorityValues, new SortParam<>(FieldValuesOrder.COUNT, false), fieldValueConverterProvider);
     }
 
@@ -122,5 +122,5 @@
 
     @Override
-    public Iterator<? extends FacetField.Count> iterator(long first, long count) {
+    public Iterator<FacetField.Count> iterator(long first, long count) {
         // return iterator starting at specified offset
         return getList().listIterator((int) first);
@@ -128,5 +128,5 @@
 
     @Override
-    public List<? extends FacetField.Count> getList() {
+    public List<FacetField.Count> getList() {
         final Iterable<Count> filteredValues = getFilteredValues();
         // sort what remains
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/provider/ListProvider.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/provider/ListProvider.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/provider/ListProvider.java	(revision 6755)
@@ -26,5 +26,5 @@
 public interface ListProvider<T> {
 
-    List<? extends T> getList();
+    List<T> getList();
     
 }
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/provider/PartitionedDataProvider.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/provider/PartitionedDataProvider.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/provider/PartitionedDataProvider.java	(revision 6755)
@@ -17,4 +17,5 @@
 package eu.clarin.cmdi.vlo.wicket.provider;
 
+import com.google.common.base.Functions;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterators;
@@ -34,7 +35,7 @@
  * @param <S> the type of the sorting parameter
  */
-public class PartitionedDataProvider<T, S> implements ISortableDataProvider<List<? extends T>, S> {
+public class PartitionedDataProvider<T, S> implements ISortableDataProvider<List<T>, S> {
 
-    private final ISortableDataProvider<? extends T, S> provider;
+    private final ISortableDataProvider<T, S> provider;
     private final int partitionSize;
 
@@ -51,14 +52,17 @@
 
     @Override
-    public Iterator<? extends List<? extends T>> iterator(long first, long count) {
+    public Iterator<? extends List<T>> iterator(long first, long count) {
         if (partitionSize > 0) {
             // translate first, count to item level
             final long itemsFirst = first * partitionSize;
             final long itemsCount = count * partitionSize;
+            // reduce wildcard to upper bound (i.e. remove "? extends")
+            final Iterator<T> iterator
+                    = Iterators.transform(provider.iterator(itemsFirst, itemsCount), Functions.<T>identity());
             // split up values 
-            return Iterators.partition(provider.iterator(itemsFirst, itemsCount), partitionSize);
+            return Iterators.partition(iterator, partitionSize);
         } else {
             // return a single list (wrapped in a singleton iterator)
-            final List<? extends T> valuesList;
+            final List<T> valuesList;
             if (provider instanceof ListProvider) {
                 // get list straight out of provider, prevent double wrapping
@@ -91,5 +95,5 @@
 
     @Override
-    public IModel<List<? extends T>> model(List<? extends T> object) {
+    public IModel<List<T>> model(List<T> object) {
         // Iterators.partition sometimes returns lists that are not deeply serializable, 
         // so we need to copy this into a serializable list here :(
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/js/eu/clarin/cmdi/vlo/wicket/pages/jquery.highlight.js
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/js/eu/clarin/cmdi/vlo/wicket/pages/jquery.highlight.js	(revision 6755)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/js/eu/clarin/cmdi/vlo/wicket/pages/jquery.highlight.js	(revision 6755)
@@ -0,0 +1,108 @@
+/*
+ * jQuery Highlight plugin
+ *
+ * Based on highlight v3 by Johann Burkard
+ * http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html
+ *
+ * Code a little bit refactored and cleaned (in my humble opinion).
+ * Most important changes:
+ *  - has an option to highlight only entire words (wordsOnly - false by default),
+ *  - has an option to be case sensitive (caseSensitive - false by default)
+ *  - highlight element tag and class names can be specified in options
+ *
+ * Usage:
+ *   // wrap every occurrance of text 'lorem' in content
+ *   // with <span class='highlight'> (default options)
+ *   $('#content').highlight('lorem');
+ *
+ *   // search for and highlight more terms at once
+ *   // so you can save some time on traversing DOM
+ *   $('#content').highlight(['lorem', 'ipsum']);
+ *   $('#content').highlight('lorem ipsum');
+ *
+ *   // search only for entire word 'lorem'
+ *   $('#content').highlight('lorem', { wordsOnly: true });
+ *
+ *   // don't ignore case during search of term 'lorem'
+ *   $('#content').highlight('lorem', { caseSensitive: true });
+ *
+ *   // wrap every occurrance of term 'ipsum' in content
+ *   // with <em class='important'>
+ *   $('#content').highlight('ipsum', { element: 'em', className: 'important' });
+ *
+ *   // remove default highlight
+ *   $('#content').unhighlight();
+ *
+ *   // remove custom highlight
+ *   $('#content').unhighlight({ element: 'em', className: 'important' });
+ *
+ *
+ * Copyright (c) 2009 Bartek Szopka
+ *
+ * Licensed under MIT license.
+ *
+ */
+
+jQuery.extend({
+    highlight: function (node, re, nodeName, className) {
+        if (node.nodeType === 3) {
+            var match = node.data.match(re);
+            if (match) {
+                var highlight = document.createElement(nodeName || 'span');
+                highlight.className = className || 'highlight';
+                var wordNode = node.splitText(match.index);
+                wordNode.splitText(match[0].length);
+                var wordClone = wordNode.cloneNode(true);
+                highlight.appendChild(wordClone);
+                wordNode.parentNode.replaceChild(highlight, wordNode);
+                return 1; //skip added node in parent
+            }
+        } else if ((node.nodeType === 1 && node.childNodes) && // only element nodes that have children
+                !/(script|style)/i.test(node.tagName) && // ignore script and style nodes
+                !(node.tagName === nodeName.toUpperCase() && node.className === className)) { // skip if already highlighted
+            for (var i = 0; i < node.childNodes.length; i++) {
+                i += jQuery.highlight(node.childNodes[i], re, nodeName, className);
+            }
+        }
+        return 0;
+    }
+});
+
+jQuery.fn.unhighlight = function (options) {
+    var settings = { className: 'highlight', element: 'span' };
+    jQuery.extend(settings, options);
+
+    return this.find(settings.element + "." + settings.className).each(function () {
+        var parent = this.parentNode;
+        parent.replaceChild(this.firstChild, this);
+        parent.normalize();
+    }).end();
+};
+
+jQuery.fn.highlight = function (words, options) {
+    var settings = { className: 'highlight', element: 'span', caseSensitive: false, wordsOnly: false };
+    jQuery.extend(settings, options);
+    
+    if (words.constructor === String) {
+        words = [words];
+    }
+    words = jQuery.grep(words, function(word, i){
+      return word != '';
+    });
+    words = jQuery.map(words, function(word, i) {
+      return word.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
+    });
+    if (words.length == 0) { return this; };
+
+    var flag = settings.caseSensitive ? "" : "i";
+    var pattern = "(" + words.join("|") + ")";
+    if (settings.wordsOnly) {
+        pattern = "\\b" + pattern + "\\b";
+    }
+    var re = new RegExp(pattern, flag);
+    
+    return this.each(function () {
+        jQuery.highlight(this, re, settings.element, settings.className);
+    });
+};
+
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/js/eu/clarin/cmdi/vlo/wicket/pages/searchhi.js
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/js/eu/clarin/cmdi/vlo/wicket/pages/searchhi.js	(revision 6754)
+++ 	(revision )
@@ -1,155 +1,0 @@
-/* http://www.kryogenix.org/code/browser/searchhi/ */
-/* Modified 20021006 to fix query string parsing and add case insensitivity */
-/* Modified 20070316 to stop highlighting inside nosearchhi nodes */
-/* Modified 20081217 to do in-page searching and wrap up in an object */
-/* Modified 20081218 to scroll to first hit like 
- http://www.woolyss.free.fr/js/searchhi_Woolyss.js and say when not found */
-/* Modified 20120112 to use the URL instead of referrer */
-/* Modified 20140522 <twan@clarin.eu> replaced unescape() with decodeURIComponent() */
-/* Modified 20150618 <twan@clarin.eu> added list of terms to exclude from highlighting */
-
-// list of words to exclude from highlighting (must be lower case)
-var excludeWords = [
-    "and",
-    "or",
-    "not",
-    "to"
-];
-
-searchhi = {
-    highlightWord: function(node, word) {
-        // Iterate into this nodes childNodes
-        if (node.hasChildNodes) {
-            for (var hi_cn = 0; hi_cn < node.childNodes.length; hi_cn++) {
-                searchhi.highlightWord(node.childNodes[hi_cn], word);
-            }
-        }
-
-        // And do this node itself
-        if (node.nodeType == 3) { // text node
-            tempNodeVal = node.nodeValue.toLowerCase();
-            tempWordVal = word.toLowerCase();
-            if (tempNodeVal.indexOf(tempWordVal) != -1) {
-                var pn = node.parentNode;
-                // check if we're inside a "nosearchhi" zone
-                var checkn = pn;
-                while (checkn.nodeType != 9 &&
-                        checkn.nodeName.toLowerCase() != 'body') {
-                    // 9 = top of doc
-                    if (checkn.className.match(/\bnosearchhi\b/)) {
-                        return;
-                    }
-                    checkn = checkn.parentNode;
-                }
-                if (pn.className != "searchword") {
-                    // word has not already been highlighted!
-                    var nv = node.nodeValue;
-                    var ni = tempNodeVal.indexOf(tempWordVal);
-                    // Create a load of replacement nodes
-                    var before = document.createTextNode(nv.substr(0, ni));
-                    var docWordVal = nv.substr(ni, word.length);
-                    var after = document.createTextNode(nv.substr(ni + word.length));
-                    var hiwordtext = document.createTextNode(docWordVal);
-                    var hiword = document.createElement("span");
-                    hiword.className = "searchword";
-                    hiword.appendChild(hiwordtext);
-                    pn.insertBefore(before, node);
-                    pn.insertBefore(hiword, node);
-                    pn.insertBefore(after, node);
-                    pn.removeChild(node);
-                    searchhi.found += 1;
-                    if (searchhi.found == 1)
-                        pn.scrollIntoView();
-                }
-            }
-        }
-    },
-    googleSearchHighlight: function() {
-        var ref = document.URL;
-        if (ref.indexOf('?') == -1)
-            return;
-        var qs = ref.substr(ref.indexOf('?') + 1);
-        var qsa = qs.split('&');
-        for (var i = 0; i < qsa.length; i++) {
-            var qsip = qsa[i].split('=');
-            if (qsip.length == 1)
-                continue;
-            if (qsip[0] == 'q' || qsip[0] == 'p') { // q= for Google, p= for Yahoo
-                var wordstring = decodeURIComponent(qsip[1].replace(/\+/g, ' '));
-                searchhi.process(wordstring);
-            }
-        }
-    },
-    process: function(wordstring) {
-        searchhi.found = 0;
-        var words = wordstring.split(/\s+/);
-        for (w = 0; w < words.length; w++) {
-            if(excludeWords.indexOf(words[w].toLowerCase()) < 0) {
-                searchhi.highlightWord(document.getElementsByTagName("body")[0], words[w]);
-
-            }
-        }
-        if (searchhi.found === 0) {
-            searchhi.nohits();
-        }
-    },
-    nohits: function() {
-    },
-    init: function() {
-        if (!document.createElement || !document.getElementsByTagName)
-            return;
-        // hook up forms of type searchhi
-        var frms = document.getElementsByTagName("form");
-        for (var i = 0; i < frms.length; i++) {
-            if (frms[i].className.match(/\bsearchhi\b/)) {
-                frms[i].onsubmit = function() {
-                    var inps = this.getElementsByTagName("input");
-                    for (var j = 0; j < inps.length; j++) {
-                        if (inps[j].type == "text") {
-                            searchhi.process(inps[j].value);
-                            return false;
-                        }
-                    }
-                };
-            }
-        }
-        // highlight search engine referrer results
-        searchhi.googleSearchHighlight();
-    }
-};
-//
-//(function(i) {
-//    var u = navigator.userAgent;
-//    var e = /*@cc_on!@*/false;
-//    var st =
-//            setTimeout;
-//    if (/webkit/i.test(u)) {
-//        st(function() {
-//            var dr = document.readyState;
-//            if (dr == "loaded" || dr == "complete") {
-//                i()
-//            } else {
-//                st(arguments.callee, 10);
-//            }
-//        }, 10);
-//    }
-//    else if ((/mozilla/i.test(u) && !/(compati)/.test(u)) || (/opera/i.test(u))) {
-//        document.addEventListener("DOMContentLoaded", i, false);
-//    } else if (e) {
-//        (
-//                function() {
-//                    var t = document.createElement('doc:rdy');
-//                    try {
-//                        t.doScroll('left');
-//                        i();
-//                        t = null;
-//                    } catch (e) {
-//                        st(arguments.callee, 0);
-//                    }
-//                })();
-//    } else {
-//        window.onload = i;
-//    }
-//})
-//
-//(searchhi.init);
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/js/eu/clarin/cmdi/vlo/wicket/pages/vlo-fields-table.js
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/js/eu/clarin/cmdi/vlo/wicket/pages/vlo-fields-table.js	(revision 6755)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/js/eu/clarin/cmdi/vlo/wicket/pages/vlo-fields-table.js	(revision 6755)
@@ -0,0 +1,29 @@
+/* 
+ * Copyright (C) 2015 CLARIN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+//$(function () {
+$(document).ready(function() {
+    $("td div.fieldName").tooltip(
+            {
+                show: {
+                    delay: 300
+                }
+            }
+    );
+});
+
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/js/eu/clarin/cmdi/vlo/wicket/pages/vlo-searchform.js
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/js/eu/clarin/cmdi/vlo/wicket/pages/vlo-searchform.js	(revision 6755)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/js/eu/clarin/cmdi/vlo/wicket/pages/vlo-searchform.js	(revision 6755)
@@ -0,0 +1,41 @@
+/* 
+ * Copyright (C) 2015 CLARIN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+var interval;
+
+function startSearch() {
+    // after a short while start animating the search button
+    var element = $('form#search #searchbutton');
+    element.prop('disabled', true);
+
+    // this will animate (fade in, fade out) the search button
+    interval = setInterval(function () {
+        element.animate({opacity:'-=0.5'}, 500);
+        element.animate({opacity:'+=1'}, 500);
+    }, 500); // delay between 'loops'
+}
+
+function endSearch() {
+    // done searching, clean up
+    var element = $('form#search #searchbutton');
+    element.prop('disabled', false);
+    
+    // stop the animation
+    if(interval !== null) { 
+        clearInterval(interval);
+    }
+}
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/less/eu/clarin/cmdi/vlo/wicket/pages/inc/vlo-search.less
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/less/eu/clarin/cmdi/vlo/wicket/pages/inc/vlo-search.less	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/less/eu/clarin/cmdi/vlo/wicket/pages/inc/vlo-search.less	(revision 6755)
@@ -143,4 +143,8 @@
 #searchresultitems .searchresultdescription a {
     text-decoration: underline;
+}
+
+.searchresultitem .searchword {
+    font-weight: bold;
 }
 
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/resources/fieldNames.properties
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/resources/fieldNames.properties	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/resources/fieldNames.properties	(revision 6755)
@@ -42,3 +42,4 @@
 field._hierarchyWeight=Hierarchy level
 field._hasPart=Has part(s)
+field._hasPartCount=Child count
 field._isPartOf=Is part of
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/webapp/iframe/vlo-embed-base.html
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/webapp/iframe/vlo-embed-base.html	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/webapp/iframe/vlo-embed-base.html	(revision 6755)
@@ -42,5 +42,5 @@
 			    text-align:left;
 			    max-width:600px;
-			    min-width:270px
+			    min-width:270px;
 			    
 			    margin:8px 15px 2px 20px;
Index: vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/test/java/eu/clarin/cmdi/vlo/service/solr/impl/SolrFacetQueryFactoryImplTest.java
===================================================================
--- vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/test/java/eu/clarin/cmdi/vlo/service/solr/impl/SolrFacetQueryFactoryImplTest.java	(revision 6754)
+++ vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/test/java/eu/clarin/cmdi/vlo/service/solr/impl/SolrFacetQueryFactoryImplTest.java	(revision 6755)
@@ -58,5 +58,5 @@
 
         // default: query selects all values 
-        assertNull(query.getQuery());
+        assertEquals("*:*", query.getQuery());
 
         // no selection -> no filter queries
@@ -82,5 +82,5 @@
 
         // default: query selects all values 
-        assertNull(query.getQuery());
+        assertEquals("*:*", query.getQuery());
 
         // Only empty selections -> no filter queries
@@ -107,5 +107,5 @@
 
         // default: query selects all values 
-        assertNull(query.getQuery());
+        assertEquals("*:*", query.getQuery());
 
         // Expecting three filter queries as three values have been selected in total
