1 | package eu.clarin.cmdi.vlo.wicket.pages; |
---|
2 | |
---|
3 | import eu.clarin.cmdi.vlo.wicket.components.FacetsPanel; |
---|
4 | import eu.clarin.cmdi.vlo.pojo.QueryFacetsSelection; |
---|
5 | import eu.clarin.cmdi.vlo.wicket.components.SearchForm; |
---|
6 | import eu.clarin.cmdi.vlo.wicket.components.SearchResultsPanel; |
---|
7 | import java.util.Collection; |
---|
8 | import java.util.Collections; |
---|
9 | import java.util.HashMap; |
---|
10 | import org.apache.wicket.request.mapper.parameter.PageParameters; |
---|
11 | import org.apache.wicket.markup.html.WebPage; |
---|
12 | import org.apache.wicket.model.Model; |
---|
13 | |
---|
14 | /** |
---|
15 | * The main search page showing a search form, facets, and search results |
---|
16 | * |
---|
17 | * @author twagoo |
---|
18 | */ |
---|
19 | public class FacetedSearchPage extends WebPage { |
---|
20 | |
---|
21 | private static final long serialVersionUID = 1L; |
---|
22 | |
---|
23 | public FacetedSearchPage(final PageParameters parameters) { |
---|
24 | super(parameters); |
---|
25 | |
---|
26 | final QueryFacetsSelection selection = new QueryFacetsSelection( |
---|
27 | new HashMap<String, Collection<String>>() { |
---|
28 | { |
---|
29 | // put("language", Collections.singleton("Dutch")); |
---|
30 | put("continent", Collections.<String>emptyList()); |
---|
31 | } |
---|
32 | }); |
---|
33 | final Model<QueryFacetsSelection> queryModel = new Model<QueryFacetsSelection>(selection); |
---|
34 | |
---|
35 | add(new FacetsPanel("facets", queryModel)); |
---|
36 | |
---|
37 | add(new SearchForm("search", queryModel)); |
---|
38 | |
---|
39 | add(new SearchResultsPanel("searchResults", queryModel)); |
---|
40 | } |
---|
41 | } |
---|