Changeset 4880
- Timestamp:
- 04/02/14 13:19:44 (11 years ago)
- Location:
- vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SearchResultItemCollapsedPanel.html
r4875 r4880 27 27 [DESCRIPTION] 28 28 </p> 29 <div class="searchresultresources">29 <div wicket:id="resources" class="searchresultresources"> 30 30 Resources: 31 31 <ul> -
vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SearchResultItemCollapsedPanel.java
r4873 r4880 27 27 import java.util.Locale; 28 28 import org.apache.solr.common.SolrDocument; 29 import org.apache.wicket.markup.html.WebMarkupContainer; 29 30 import org.apache.wicket.markup.html.basic.Label; 30 31 import org.apache.wicket.markup.html.link.Link; … … 64 65 // wrap with a count provider 65 66 final ResouceTypeCountDataProvider countProvider = new ResouceTypeCountDataProvider(resourcesModel, countingService); 66 // view that shows provided counts 67 // TODO: hide if no resources 68 add(new ResourceCountDataView("resourceCount", countProvider)); 67 68 // add a container for the resource type counts (only visible if there are actual resources) 69 add(new WebMarkupContainer("resources") { 70 { 71 // view that shows provided counts 72 add(new ResourceCountDataView("resourceCount", countProvider)); 73 } 74 75 @Override 76 protected void onConfigure() { 77 super.onConfigure(); 78 setVisible(countProvider.size() > 0); 79 } 80 }); 69 81 } 70 82 -
vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SearchResultItemExpandedPanel.html
r4879 r4880 30 30 <wicket:container wicket:id="documentProperties">[PROPERTIES TABLE]</wicket:container> 31 31 <p class="moredocumentproperties"><a wicket:id="recordLink">More</a></p> 32 <h3>Resources</h3> 33 <ul class="searchresultresources"> 34 <li wicket:id="resource"> 35 <a wicket:id="resourceLink" href=""> 36 <wicket:container wicket:id="resourceName"></wicket:container> 37 </a> 38 </li> 39 </ul> 32 <wicket:container wicket:id="resources"> 33 <h3>Resources</h3> 34 <ul class="searchresultresources"> 35 <li wicket:id="resource"> 36 <a wicket:id="resourceLink" href=""> 37 <wicket:container wicket:id="resourceName"></wicket:container> 38 </a> 39 </li> 40 </ul> 41 </wicket:container> 40 42 </div> 41 43 </wicket:panel> -
vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/SearchResultItemExpandedPanel.java
r4879 r4880 31 31 import java.util.List; 32 32 import org.apache.solr.common.SolrDocument; 33 import org.apache.wicket.Component; 33 34 import org.apache.wicket.behavior.AttributeAppender; 35 import org.apache.wicket.markup.html.WebMarkupContainer; 34 36 import org.apache.wicket.markup.html.basic.Label; 35 37 import org.apache.wicket.markup.html.link.ExternalLink; … … 37 39 import org.apache.wicket.markup.html.list.ListView; 38 40 import org.apache.wicket.markup.html.panel.GenericPanel; 41 import org.apache.wicket.markup.html.panel.Panel; 39 42 import org.apache.wicket.model.IModel; 40 43 import org.apache.wicket.model.PropertyModel; … … 63 66 add(new FieldsTablePanel("documentProperties", new DocumentFieldsProvider(documentModel, basicPropertiesFilter))); 64 67 65 createResourcesList("resource"); 68 final SolrFieldModel<String> resourceModel = new SolrFieldModel<String>(getModel(), FacetConstants.FIELD_RESOURCE); 69 70 // add a container for the resources (only visible if there are actual resources) 71 add(new WebMarkupContainer("resources") { 72 { 73 add(createResourcesList("resource", resourceModel)); 74 } 75 76 @Override 77 protected void onConfigure() { 78 super.onConfigure(); 79 setVisible(resourceModel.getObject() != null); 80 } 81 82 }); 66 83 } 67 84 68 private void createResourcesList(String id) {85 private Component createResourcesList(String id, SolrFieldModel<String> resourceModel) { 69 86 // list of resources in this record 70 87 // TODO: limit number of resources shown here? 71 final SolrFieldModel<String> resourceModel = new SolrFieldModel<String>(getModel(), FacetConstants.FIELD_RESOURCE);72 88 final IModel<List<String>> resourceListModel = new CollectionListModel<String>(resourceModel); 73 add(new ListView<String>(id, resourceListModel) {89 return new ListView<String>(id, resourceListModel) { 74 90 75 91 @Override … … 84 100 // add a tooltip showing resource type and mime type 85 101 final StringResourceModel tooltipModel 86 = new StringResourceModel("resource.tooltip", SearchResultItemExpandedPanel.this, resourceModel,102 = new StringResourceModel("resource.tooltip", SearchResultItemExpandedPanel.this, null, 87 103 new Object[]{ 88 104 new PropertyModel(resourceInfoModel, "resourceType"), … … 96 112 item.add(resourceLink); 97 113 } 98 } );114 }; 99 115 } 100 116
Note: See TracChangeset
for help on using the changeset viewer.