Changeset 4622
- Timestamp:
- 03/05/14 16:25:29 (10 years ago)
- Location:
- vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket
- Files:
-
- 2 added
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/components/SearchResultItemPanel.html
r4618 r4622 25 25 <wicket:panel> 26 26 <h2> 27 <a wicket:id=" title" href="record1.html">[TITLE]</a>27 <a wicket:id="recordLink" href="record1.html"><wicket:container wicket:id="title" >[TITLE]</wicket:container></a> 28 28 </h2> 29 29 <div class="searchresultitembrief"> -
vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/components/SearchResultItemPanel.java
r4619 r4622 19 19 import eu.clarin.cmdi.vlo.wicket.provider.ResouceTypeCountDataProvider; 20 20 import eu.clarin.cmdi.vlo.FacetConstants; 21 import eu.clarin.cmdi.vlo.pojo.QueryFacetsSelection; 21 22 import eu.clarin.cmdi.vlo.pojo.ResourceTypeCount; 22 23 import eu.clarin.cmdi.vlo.service.ResourceTypeCountingService; … … 43 44 public class SearchResultItemPanel extends Panel { 44 45 46 private final static ResourceTypeCountConverter resourceTypeCountConverter = new ResourceTypeCountConverter(); 47 45 48 @SpringBean 46 49 private ResourceTypeCountingService countingService; 50 private final IModel<QueryFacetsSelection> selectionModel; 51 private final IModel<SolrDocument> documentModel; 47 52 48 public SearchResultItemPanel(String id, IModel<SolrDocument> model) { 49 super(id, model); 50 add(new SolrFieldLabel("title", model, FacetConstants.FIELD_NAME)); 51 add(new SolrFieldLabel("description", model, FacetConstants.FIELD_DESCRIPTION, "<no description>")); 53 public SearchResultItemPanel(String id, IModel<SolrDocument> documentModel, IModel<QueryFacetsSelection> selectionModel) { 54 super(id, documentModel); 55 this.documentModel = documentModel; 56 this.selectionModel = selectionModel; 57 58 final Link recordLink = new RecordPageLink("recordLink", documentModel, selectionModel); 59 recordLink.add(new SolrFieldLabel("title", documentModel, FacetConstants.FIELD_NAME)); 60 add(recordLink); 61 62 add(new SolrFieldLabel("description", documentModel, FacetConstants.FIELD_DESCRIPTION, "<no description>")); 52 63 53 64 // get model for resources 54 final SolrFieldModel<String> resourcesModel = new SolrFieldModel<String>( model, FacetConstants.FIELD_RESOURCE);65 final SolrFieldModel<String> resourcesModel = new SolrFieldModel<String>(documentModel, FacetConstants.FIELD_RESOURCE); 55 66 // wrap with a count provider 56 67 final ResouceTypeCountDataProvider countProvider = new ResouceTypeCountDataProvider(resourcesModel, countingService); … … 58 69 // TODO: hide if no resources 59 70 add(new ResourceCountDataView("resourceCount", countProvider)); 71 } 72 73 @Override 74 public void detachModels() { 75 super.detachModels(); 76 // not passed to super 77 selectionModel.detach(); 60 78 } 61 79 … … 82 100 * {@link ResourceTypeCount} 83 101 */ 84 private static class ResourceCountDataView extends DataView<ResourceTypeCount> { 85 86 private final static ResourceTypeCountConverter resourceTypeCountConverter 87 = new ResourceTypeCountConverter(); 102 private class ResourceCountDataView extends DataView<ResourceTypeCount> { 88 103 89 104 public ResourceCountDataView(String id, IDataProvider<ResourceTypeCount> dataProvider) { … … 93 108 @Override 94 109 protected void populateItem(Item<ResourceTypeCount> item) { 95 final Link resourceLink = new Link("recordLink") { 96 97 @Override 98 public void onClick() { 99 throw new UnsupportedOperationException("Not supported yet."); 100 } 101 }; 110 final Link resourceLink = new RecordPageLink("recordLink", documentModel, selectionModel); 102 111 final Label label = new Label("resourceCountLabel", item.getModel()) { 103 112 -
vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/components/SearchResultsPanel.java
r4579 r4622 53 53 private final DataView<SolrDocument> resultsView; 54 54 55 public SearchResultsPanel(String id, IModel<QueryFacetsSelection> model) {56 super(id, model);57 solrDocumentProvider = new SolrDocumentProvider(documentService, model);55 public SearchResultsPanel(String id, final IModel<QueryFacetsSelection> selectionModel) { 56 super(id, selectionModel); 57 solrDocumentProvider = new SolrDocumentProvider(documentService, selectionModel); 58 58 59 59 // data view for search results … … 63 63 protected void populateItem(Item<SolrDocument> item) { 64 64 // single result item 65 item.add(new SearchResultItemPanel("resultItemDetails", item.getModel() ));65 item.add(new SearchResultItemPanel("resultItemDetails", item.getModel(), selectionModel)); 66 66 } 67 67 }; -
vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.html
r4617 r4622 52 52 <div id="topnavigation"> 53 53 <div id="breadcrumbs"> 54 <a href="index.html">VLO</a> 55 > <a href="index2.html">Search results: democratie</a> 56 > <a href="index3.html">Language: Dutch </a> 57 > "Chinese Democratie en de Transformatie" 54 <wicket:link> 55 <a href="FacetedSearchPage.html">VLO</a> 56 </wicket:link> 57 > <a href="FacetedSearchPage.html">Search results: TODO</a> 58 59 <!-- > <a href="index3.html">Language: Dutch </a> 60 > "Chinese Democratie en de Transformatie"--> 61 58 62 </div> 59 63 <div id="topnavigationlinks"> … … 128 132 <a class="audioresource" href="http://corpus1.mpi.nl/qfs1/media-archive/dobes_data/Ache/Documentaci_n_-_Documentation/Comunidades_-_Communities/Cerro_Moroti/Media/002-djawu_klluu-2011-09-01.wav">002-djawu_klluu-2011-09-01.wav</a> 129 133 <a class="annotationresource" href="http://corpus1.mpi.nl/qfs1/media-archive/dobes_data/Ache/Documentaci_n_-_Documentation/Comunidades_-_Communities/Cerro_Moroti/Annotations/002-djawu_klluu-2011-09-01.eaf">002-djawu_klluu-2011-09-01.eaf</a> 130 134 131 135 <div class="recordresourcedetails"> 132 136 <h2>Bachelorscriptie+Rene+Witteveen+3375005.docx</h2> … … 137 141 </ul> 138 142 </div> 139 143 140 144 </div> 141 145
Note: See TracChangeset
for help on using the changeset viewer.