Changeset 3933
- Timestamp:
- 11/05/13 10:05:16 (11 years ago)
- Location:
- vlo/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/trunk/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/importer/FacetConceptMapping.java
r3648 r3933 2 2 3 3 import java.util.ArrayList; 4 import java.util.HashMap; 4 5 import java.util.List; 6 import java.util.Map; 5 7 6 8 import org.slf4j.Logger; … … 40 42 } 41 43 44 public Map<String, FacetConcept> getFacetConceptMap() { 45 Map<String, FacetConcept> facetConceptMap = new HashMap<String, FacetConcept>(); 46 for(FacetConcept facet : getFacetConcepts()) 47 facetConceptMap.put(facet.getName(), facet); 48 49 return facetConceptMap; 50 } 51 42 52 public void check() { 43 53 for (FacetConcept facetConcept : getFacetConcepts()) { … … 71 81 @XmlAttribute 72 82 private boolean allowMultipleValues = true; 83 84 @XmlAttribute 85 private String description = ""; 73 86 74 87 @XmlElement(name = "concept") … … 142 155 public boolean isAllowMultipleValues() { 143 156 return allowMultipleValues; 157 } 158 159 public void setDescription(String description) { 160 this.description = description; 161 } 162 163 public String getDescription() { 164 return this.description; 144 165 } 145 166 -
vlo/trunk/vlo_importer/src/main/resources/facetConcepts.xml
r3932 r3933 5 5 <pattern>/c:CMD/c:Header/c:MdSelfLink/text()</pattern> 6 6 </facetConcept> 7 <facetConcept name="collection" >7 <facetConcept name="collection" description="The collection to which the resource belongs"> 8 8 <pattern>/c:CMD/c:Header/c:MdCollectionDisplayName/text()</pattern> 9 9 </facetConcept> 10 <facetConcept name="projectName" >10 <facetConcept name="projectName" description="Projects that were involved in creation and distribution of the resource"> 11 11 <concept>http://www.isocat.org/datcat/DC-2536</concept> 12 12 <concept>http://www.isocat.org/datcat/DC-2537</concept> 13 13 <concept>http://www.isocat.org/datcat/DC-5414</concept> 14 14 </facetConcept> 15 <facetConcept name="name" allowMultipleValues="false" >15 <facetConcept name="name" allowMultipleValues="false" description="Name of the resource"> 16 16 <concept>http://www.isocat.org/datcat/DC-5428</concept> 17 17 <concept>http://www.isocat.org/datcat/DC-5127</concept> … … 33 33 <concept>http://www.isocat.org/datcat/DC-6176</concept> 34 34 </facetConcept> 35 <facetConcept name="continent" >35 <facetConcept name="continent" description="Continent"> 36 36 <concept>http://www.isocat.org/datcat/DC-2531</concept> 37 37 <concept>http://www.isocat.org/datcat/DC-3791</concept> 38 38 </facetConcept> 39 <facetConcept name="country" >39 <facetConcept name="country" description="Country"> 40 40 <concept>http://www.isocat.org/datcat/DC-2532</concept> 41 41 <concept>http://www.isocat.org/datcat/DC-3792</concept> … … 43 43 <pattern>/c:CMD/c:Components/c:OLAC-DcmiTerms/c:coverage[@dcterms-type="ISO3166"]/text()</pattern> 44 44 </facetConcept> 45 <facetConcept name="language" >45 <facetConcept name="language" description="Language"> 46 46 <concept>http://www.isocat.org/datcat/DC-2482</concept> <!-- language code --> 47 47 <concept>http://www.isocat.org/datcat/DC-2484</concept> <!-- language name --> … … 64 64 <pattern>/c:CMD/c:Components/c:LrtInventoryResource/c:LrtCommon/c:Languages/c:ISO639/c:iso-639-3-code/text()</pattern> 65 65 </facetConcept> 66 <facetConcept name="organisation" >66 <facetConcept name="organisation" description="Organisations that were involved in creation and distribution of the resource"> 67 67 <concept>http://www.isocat.org/datcat/DC-2459</concept> 68 68 <concept>http://www.isocat.org/datcat/DC-2979</concept> … … 71 71 <concept>http://www.isocat.org/datcat/DC-6134</concept> 72 72 </facetConcept> 73 <facetConcept name="genre" isCaseInsensitive="true" allowMultipleValues="false" >73 <facetConcept name="genre" isCaseInsensitive="true" allowMultipleValues="false" description="Genre"> 74 74 <concept>http://www.isocat.org/datcat/DC-2470</concept> 75 75 <concept>http://www.isocat.org/datcat/DC-3899</concept> … … 77 77 <pattern>/c:CMD/c:Components/c:mods/c:genre/text()</pattern> 78 78 </facetConcept> 79 <facetConcept name="modality" isCaseInsensitive="true" allowMultipleValues="true" >79 <facetConcept name="modality" isCaseInsensitive="true" allowMultipleValues="true" description="Modality"> 80 80 <concept>http://www.isocat.org/datcat/DC-2490</concept> 81 81 </facetConcept> 82 <facetConcept name="subject" isCaseInsensitive="true" allowMultipleValues="true" >82 <facetConcept name="subject" isCaseInsensitive="true" allowMultipleValues="true" description="Subject"> 83 83 <concept>http://www.isocat.org/datcat/DC-2591</concept> 84 84 <concept>http://purl.org/dc/terms/subject</concept> … … 97 97 <pattern>/c:CMD/c:Components/c:mods/c:abstract/text()</pattern> 98 98 </facetConcept> 99 <facetConcept name="resourceType" >99 <facetConcept name="resourceType" description="Resourcetype"> 100 100 <concept>http://www.isocat.org/datcat/DC-2571</concept> 101 101 <concept>http://purl.org/dc/terms/type</concept> … … 106 106 <pattern>/c:CMD/c:Components/c:mods/c:typeOfResource/text()</pattern> 107 107 </facetConcept> 108 <facetConcept name="nationalProject" >108 <facetConcept name="nationalProject" description="The national project in which this resource is provided"> 109 109 <pattern>/c:CMD/c:Header/c:MdCollectionDisplayName/text()</pattern> 110 110 </facetConcept> … … 115 115 <pattern>/c:CMD/c:Header/c:MdProfile/text()</pattern> 116 116 </facetConcept> 117 <facetConcept name="keywords" >117 <facetConcept name="keywords" description="Keywords that describe the resource"> 118 118 <concept>http://www.isocat.org/datcat/DC-5436</concept> 119 119 <concept>http://www.isocat.org/rest/dc/5436</concept> not an official ISOcat PID - added to support LrtInventoryResource, should be removed in the future -
vlo/trunk/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/FacetBoxPanel.java
r3134 r3933 10 10 import org.apache.solr.client.solrj.response.FacetField.Count; 11 11 import org.apache.wicket.PageParameters; 12 import org.apache.wicket.behavior.SimpleAttributeModifier; 12 13 import org.apache.wicket.markup.html.WebMarkupContainer; 13 14 import org.apache.wicket.markup.html.basic.Label; … … 31 32 private int maxNrOfFacetValues; 32 33 33 public FacetBoxPanel(String id, IModel<FacetField> model ) {34 public FacetBoxPanel(String id, IModel<FacetField> model, String tooltipText) { 34 35 super(id, model); 35 36 setOutputMarkupId(true); 36 37 setMaxNrOfFacetValues(MAX_NR_OF_FACET_VALUES); 38 SimpleAttributeModifier tooltip = new SimpleAttributeModifier("title", tooltipText); 39 add(tooltip); 37 40 } 38 41 -
vlo/trunk/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/FacetedSearchPage.java
r3760 r3933 6 6 import eu.clarin.cmdi.vlo.config.VloConfig; 7 7 import eu.clarin.cmdi.vlo.dao.AutoCompleteDao; 8 import eu.clarin.cmdi.vlo.importer.FacetConceptMapping; 9 import eu.clarin.cmdi.vlo.importer.FacetConceptMapping.FacetConcept; 10 import eu.clarin.cmdi.vlo.importer.VLOMarshaller; 8 11 import fiftyfive.wicket.basic.TruncatedLabel; 9 12 import java.io.UnsupportedEncodingException; … … 13 16 import java.util.Iterator; 14 17 import java.util.List; 18 import java.util.Map; 19 15 20 import org.apache.solr.client.solrj.SolrServerException; 16 21 import org.apache.solr.client.solrj.response.FacetField; … … 40 45 private final SearchPageQuery query; 41 46 private final static AutoCompleteDao autoCompleteDao = new AutoCompleteDao(); 47 private final static Map<String, FacetConcept> facetNameMap = VLOMarshaller.getFacetConceptMapping().getFacetConceptMap(); 42 48 43 49 /** … … 105 111 @Override 106 112 protected void populateItem(Item<FacetField> item) { 107 item.add(new FacetBoxPanel("facetBox", item.getModel()).create(query)); 113 String facetName = ((FacetField)item.getDefaultModelObject()).getName(); 114 String descriptionTooltip = ""; 115 if(facetNameMap.containsKey(facetName)) 116 descriptionTooltip = facetNameMap.get(facetName).getDescription(); 117 item.add(new FacetBoxPanel("facetBox", item.getModel(), descriptionTooltip).create(query)); 108 118 } 109 119 -
vlo/trunk/vlo_web_app/src/test/java/eu/clarin/cmdi/vlo/pages/FacetBoxPanelTest.java
r2768 r3933 29 29 @Test 30 30 public void testCalculateFacetBoxPanel() throws Exception { 31 FacetBoxPanel panel = new FacetBoxPanel("test", null );31 FacetBoxPanel panel = new FacetBoxPanel("test", null, "Tooltip"); 32 32 panel.setMaxNrOfFacetValues(5); 33 33 FacetField facetField = new FacetField("test");
Note: See TracChangeset
for help on using the changeset viewer.