Last change
on this file since 4219 was
4219,
checked in by twagoo, 10 years ago
|
Fixed parameterized links to faceted search page
|
File size:
1.1 KB
|
Rev | Line | |
---|
[719] | 1 | package eu.clarin.cmdi.vlo.pages; |
---|
| 2 | |
---|
[4199] | 3 | import eu.clarin.cmdi.vlo.VloPageParameters; |
---|
[719] | 4 | import org.apache.solr.client.solrj.response.FacetField.Count; |
---|
| 5 | import org.apache.wicket.markup.html.basic.Label; |
---|
[770] | 6 | import org.apache.wicket.markup.html.link.BookmarkablePageLink; |
---|
[719] | 7 | import org.apache.wicket.markup.html.link.Link; |
---|
| 8 | import org.apache.wicket.model.IModel; |
---|
[4199] | 9 | import org.apache.wicket.request.mapper.parameter.PageParameters; |
---|
[719] | 10 | |
---|
[2970] | 11 | public class FacetLinkPanel extends BasePanel { |
---|
[719] | 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 | |
---|
[770] | 18 | Count count = model.getObject(); |
---|
| 19 | SearchPageQuery q = query.getShallowCopy(); |
---|
| 20 | q.setFilterQuery(count); |
---|
[4199] | 21 | PageParameters param = q.getPageParameters(); |
---|
[2954] | 22 | |
---|
[4219] | 23 | Link<Count> facetLink = new BookmarkablePageLink("facetLink", FacetedSearchPage.class, param); |
---|
[719] | 24 | facetLink.add(new Label("facetLinkLabel", model.getObject().getName())); |
---|
| 25 | add(facetLink); |
---|
| 26 | add(new Label("facetCount", "" + model.getObject().getCount())); |
---|
| 27 | } |
---|
| 28 | |
---|
| 29 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.