Changeset 4871 for vlo/branches/vlo-3.0/vlo-web-app/src/main
- Timestamp:
- 04/01/14 12:10:50 (11 years ago)
- Location:
- vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/components/SolrFieldLabel.java
r4625 r4871 19 19 import eu.clarin.cmdi.vlo.wicket.model.NullFallbackModel; 20 20 import eu.clarin.cmdi.vlo.wicket.model.SolrFieldStringModel; 21 import eu.clarin.cmdi.vlo.wicket.model.TruncatingStringModel; 21 22 import org.apache.solr.common.SolrDocument; 22 23 import org.apache.wicket.markup.html.basic.Label; … … 29 30 public class SolrFieldLabel extends Label { 30 31 32 /** 33 * 34 * @param id id of label 35 * @param documentModel model that holds document to show field of 36 * @param fieldName name of field to show value of 37 */ 31 38 public SolrFieldLabel(String id, IModel<SolrDocument> documentModel, String fieldName) { 32 39 super(id, new SolrFieldStringModel(documentModel, fieldName)); 33 40 } 34 41 42 /** 43 * 44 * @param id id of label 45 * @param documentModel model that holds document to show field of 46 * @param fieldName name of field to show value of 47 * @param maxLength maximum length to allow 48 * @param truncatePoint point to truncate if string is too long 49 */ 50 public SolrFieldLabel(String id, IModel<SolrDocument> documentModel, String fieldName, int maxLength, int truncatePoint) { 51 super(id, 52 new TruncatingStringModel( 53 new SolrFieldStringModel(documentModel, fieldName), maxLength, truncatePoint)); 54 } 55 56 /** 57 * 58 * @param id id of label 59 * @param documentModel model that holds document to show field of 60 * @param fieldName name of field to show value of 61 * @param nullFallback string to show if actual value is null 62 */ 35 63 public SolrFieldLabel(String id, IModel<SolrDocument> documentModel, String fieldName, String nullFallback) { 36 64 super(id, new NullFallbackModel(new SolrFieldStringModel(documentModel, fieldName), nullFallback)); 37 65 } 38 66 67 /** 68 * 69 * @param id id of label 70 * @param documentModel model that holds document to show field of 71 * @param fieldName name of field to show value of 72 * @param nullFallback string to show if actual value is null 73 * @param maxLength maximum length to allow 74 * @param truncatePoint point to truncate if string is too long 75 */ 76 public SolrFieldLabel(String id, IModel<SolrDocument> documentModel, String fieldName, String nullFallback, int maxLength, int truncatePoint) { 77 super(id, new NullFallbackModel( 78 new TruncatingStringModel( 79 new SolrFieldStringModel(documentModel, fieldName), maxLength, truncatePoint), nullFallback)); 80 } 81 39 82 } -
vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/SearchResultItemPanel.java
r4686 r4871 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;22 21 import eu.clarin.cmdi.vlo.pojo.ResourceTypeCount; 23 22 import eu.clarin.cmdi.vlo.pojo.SearchContext; … … 46 45 47 46 private final static ResourceTypeCountConverter resourceTypeCountConverter = new ResourceTypeCountConverter(); 47 private static final int MAX_DESCRIPTION_LENGTH = 350; 48 private static final int LONG_DESCRIPTION_TRUNCATE_POINT = 320; 48 49 49 50 @SpringBean … … 61 62 add(recordLink); 62 63 63 add(new SolrFieldLabel("description", documentModel, FacetConstants.FIELD_DESCRIPTION, "<no description>" ));64 add(new SolrFieldLabel("description", documentModel, FacetConstants.FIELD_DESCRIPTION, "<no description>", MAX_DESCRIPTION_LENGTH, LONG_DESCRIPTION_TRUNCATE_POINT)); 64 65 65 66 // get model for resources
Note: See TracChangeset
for help on using the changeset viewer.