package nl.hsleiden.components;

import org.hippoecm.hst.core.parameters.ParametersInfo;

import com.tdclighthouse.prototype.components.MonolithicFacetedOverview;
import com.tdclighthouse.prototype.componentsinfo.FacetedOverviewPageInfo;

@ParametersInfo(type = FacetedOverviewPageInfo.class)
public class FacetedOverview extends MonolithicFacetedOverview {

    @Override
    protected String enhanceQuery(String query) {
        String result;
        if ((query != null) && !query.endsWith("*")) {
            result = query + "*";
        } else {
            result = query;
        }
        return result;
    }
}
@@ -26,16 +26,413 @@
 nents;%0A%0A
+import hslbeans.OverviewPage;%0A%0Aimport org.hippoecm.hst.content.beans.query.HstQuery;%0Aimport org.hippoecm.hst.content.beans.query.exceptions.QueryException;%0Aimport org.hippoecm.hst.content.beans.query.filter.Filter;%0Aimport org.hippoecm.hst.content.beans.standard.HippoBean;%0Aimport org.hippoecm.hst.content.beans.standard.HippoFacetNavigationBean;%0Aimport org.hippoecm.hst.core.component.HstRequest;%0A
 import o
@@ -479,16 +479,16 @@
 rsInfo;%0A
-
 %0Aimport 
@@ -627,16 +627,68 @@
 ageInfo;
+%0Aimport com.tdclighthouse.prototype.utils.BeanUtils;
 %0A%0A@Param
@@ -1032,16 +1032,16 @@
       %7D%0A
-
         
@@ -1061,9 +1061,1051 @@
 ;%0A    %7D%0A
+    %0A    @Override%0A    protected HstQuery getHstQuery(HstRequest request) throws QueryException %7B%0A        %0A        HstQuery query = null;%0A        HippoBean contentBean = request.getRequestContext().getContentBean();%0A        %0A        if(contentBean instanceof OverviewPage)%7B%0A            FacetedOverviewPageInfo parametersInfo = getComponentParametersInfo(request);%0A            HippoBean scope = BeanUtils.getBean(parametersInfo.getContentBeanPath(), request);%0A            %0A            if(scope instanceof HippoFacetNavigationBean)%7B%0A                scope = scope.getParentBean();%0A                query = request.getRequestContext().getQueryManager().createQuery(scope);%0A                %0A                String highlightedUuid = ((OverviewPage )contentBean).getHighLightedItem().getIdentifier();%0A                %0A                Filter globalFilter = query.createFilter();%0A                globalFilter.addNotEqualTo(%22jcr:uuid%22, highlightedUuid);%0A                query.setFilter(globalFilter);%0A            %7D%0A        %7D%0A        return query;%0A    %7D%0A
 %7D

exclude highlighted item from faceted overview