source: vlo/trunk/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/FacetLinkPanel.java @ 3134

Last change on this file since 3134 was 3134, checked in by keeloo, 11 years ago

Fixed problems with theming: instead of the session level, the data representing the theme was stored in the web application class.

File size: 1.2 KB
Line 
1package eu.clarin.cmdi.vlo.pages;
2
3import eu.clarin.cmdi.vlo.VloWebApplication.ThemedSession;
4import org.apache.solr.client.solrj.response.FacetField.Count;
5import org.apache.wicket.PageParameters;
6import org.apache.wicket.markup.html.basic.Label;
7import org.apache.wicket.markup.html.link.BookmarkablePageLink;
8import org.apache.wicket.markup.html.link.Link;
9import org.apache.wicket.model.IModel;
10
11public class FacetLinkPanel extends BasePanel {
12
13    private static final long serialVersionUID = 1L;
14
15    public FacetLinkPanel(String id, IModel<Count> model, final SearchPageQuery query) {
16        super(id, model);
17
18        Count count = model.getObject();
19        SearchPageQuery q = query.getShallowCopy();
20        q.setFilterQuery(count);
21        PageParameters params = q.getPageParameters();
22
23//      params = webApp.reflectPersistentParameters(params);
24        params = ((ThemedSession)getSession()).reflectPersistentParameters(params);
25       
26        Link<Count> facetLink = new BookmarkablePageLink("facetLink", FacetedSearchPage.class, params);
27        facetLink.add(new Label("facetLinkLabel", model.getObject().getName()));
28        add(facetLink);
29        add(new Label("facetCount", "" + model.getObject().getCount()));
30    }
31
32}
Note: See TracBrowser for help on using the repository browser.