<%-- The contents of this file are subject to the license and copyright detailed in the LICENSE and NOTICE files at the root of the source tree and available online at http://www.dspace.org/license/ --%> <%-- - fragment JSP to be included in site, community or collection home to show discovery facets - - Attributes required: - discovery.fresults - the facets result to show - discovery.facetsConf - the facets configuration - discovery.searchScope - the search scope --%> <%@page import="org.dspace.discovery.configuration.DiscoverySearchFilterFacet"%> <%@ page import="java.util.HashMap"%> <%@ page import="java.util.Set"%> <%@ page import="java.util.Map"%> <%@ page import="org.dspace.discovery.DiscoverResult.FacetResult"%> <%@ page import="java.util.List"%> <%@ page import="java.net.URLEncoder"%> <%@ page import="org.apache.commons.lang.StringUtils"%> <% boolean brefine = false; Map> mapFacetes = (Map>) request.getAttribute("discovery.fresults"); List facetsConf = (List) request.getAttribute("facetsConfig"); String searchScope = (String) request.getAttribute("discovery.searchScope"); if (searchScope == null) { searchScope = ""; } if (mapFacetes != null) { for (DiscoverySearchFilterFacet facetConf : facetsConf) { String f = facetConf.getIndexFieldName(); List facet = mapFacetes.get(f); if (facet != null && facet.size() > 0) { brefine = true; break; } else { facet = mapFacetes.get(f+".year"); if (facet != null && facet.size() > 0) { brefine = true; break; } } } } if (brefine) { %>

<% for (DiscoverySearchFilterFacet facetConf : facetsConf) { String f = facetConf.getIndexFieldName(); List facet = mapFacetes.get(f); if (facet == null) { facet = mapFacetes.get(f+".year"); } if (facet == null) { continue; } String fkey = "jsp.search.facet.refine."+f; int limit = facetConf.getFacetLimit()+1; %>
<% } %>
<% } %>