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.1 KB
|
Line | |
---|
1 | package eu.clarin.cmdi.vlo.pages; |
---|
2 | |
---|
3 | import eu.clarin.cmdi.vlo.FacetConstants; |
---|
4 | import eu.clarin.cmdi.vlo.VloWebApplication.ThemedSession; |
---|
5 | import org.apache.solr.common.SolrDocument; |
---|
6 | import org.apache.wicket.markup.html.basic.Label; |
---|
7 | import org.apache.wicket.markup.html.link.BookmarkablePageLink; |
---|
8 | import org.apache.wicket.markup.html.panel.Panel; |
---|
9 | import org.apache.wicket.model.IModel; |
---|
10 | |
---|
11 | public class DocumentLinkPanel extends Panel { |
---|
12 | |
---|
13 | private static final long serialVersionUID = 1L; |
---|
14 | |
---|
15 | public DocumentLinkPanel(String id, IModel<SolrDocument> model, SearchPageQuery query) { |
---|
16 | super(id, model); |
---|
17 | SolrDocument doc = model.getObject(); |
---|
18 | BookmarkablePageLink<ShowResultPage> docLink = ShowResultPage.createBookMarkableLink("docLink", query, doc.getFieldValue( |
---|
19 | FacetConstants.FIELD_ID).toString(), (ThemedSession)getSession()); |
---|
20 | add(docLink); |
---|
21 | Object nameValue = doc.getFirstValue(FacetConstants.FIELD_NAME); |
---|
22 | String name = "<no name>"; |
---|
23 | if (nameValue != null) { |
---|
24 | name = nameValue.toString(); |
---|
25 | } |
---|
26 | docLink.add(new Label("docLabel", name)); |
---|
27 | } |
---|
28 | |
---|
29 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.