Changeset 4597
- Timestamp:
- 02/28/14 12:37:17 (10 years ago)
- Location:
- vlo/branches/vlo-3.0
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/vlo-3.0/vlo-commons/src/main/java/eu/clarin/cmdi/vlo/config/VloConfig.java
r4584 r4597 697 697 698 698 /** 699 * 700 * @return all facet fields, including collection facet (arbitrary order unspecified) 701 * @see #getFacetFields() 702 * @see #getCollectionFacet() 703 */ 704 public List<String> getAllFacetFields() { 705 final ArrayList<String> allFacets = new ArrayList<String>(facetField); 706 allFacets.add(getCollectionFacet()); 707 return allFacets; 708 } 709 710 /** 699 711 * Set the value of the FacetFields parameter<br><br> 700 712 * -
vlo/branches/vlo-3.0/vlo-commons/src/test/java/eu/clarin/cmdi/vlo/config/DefaultVloConfigFactoryTest.java
r4584 r4597 6 6 import java.util.ArrayList; 7 7 import java.util.Arrays; 8 import java.util.HashSet; 8 9 import java.util.List; 10 import java.util.Set; 11 import static org.hamcrest.CoreMatchers.hasItems; 9 12 import static org.junit.Assert.*; 10 13 import org.junit.Before; … … 698 701 } 699 702 703 @Test 704 public void testGetAllFacetsField() { 705 final String[] expItems = new String[]{ 706 "language", 707 "resourceClass", 708 "modality", 709 "continent", 710 "genre", 711 "country", 712 "subject", 713 "organisation", 714 "format", 715 "dataProvider", 716 "nationalProject", 717 "keywords", 718 "collection"}; 719 List<String> result = config.getAllFacetFields(); 720 721 //order is not important in this case 722 assertThat(result, hasItems(expItems)); 723 } 724 700 725 /** 701 726 * Test of setFacetFields method, of class VloConfig -
vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/config/VloSpringConfig.java
r4584 r4597 78 78 @Bean 79 79 public SolrFacetQueryFactory facetQueryFactory() { 80 final ArrayList<String> facets = Lists.newArrayList(vloConfig().getFacetFields()); 81 //TODO: get collections facet from config 82 facets.add(vloConfig().getCollectionFacet()); 83 84 return new SolrFacetQueryFactoryImpl(facets); 80 return new SolrFacetQueryFactoryImpl(vloConfig().getAllFacetFields()); 85 81 } 86 82 -
vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/impl/SolrDaoImpl.java
r4572 r4597 55 55 // present the facets from the config file as a list to a new set 56 56 Set<String> facetsDefined; 57 facetsDefined = new HashSet<String>(config.get FacetFields());57 facetsDefined = new HashSet<String>(config.getAllFacetFields()); 58 58 59 59 // check the filters in the query by name
Note: See TracChangeset
for help on using the changeset viewer.