Changeset 4584
- Timestamp:
- 02/27/14 16:42:37 (10 years ago)
- Location:
- vlo/branches/vlo-3.0
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/vlo-3.0/vlo-commons/src/main/java/eu/clarin/cmdi/vlo/config/VloConfig.java
r4565 r4584 44 44 private int solrTimeOut = 0; 45 45 46 @XmlElementWrapper(name ="dataRoots")47 @XmlElement(name ="DataRoot")46 @XmlElementWrapper(name = "dataRoots") 47 @XmlElement(name = "DataRoot") 48 48 private List<DataRoot> dataRoot; 49 49 … … 106 106 @XmlElementWrapper(name = "facetFields") 107 107 private List<String> facetField = new ArrayList<String>(); 108 109 private String collectionFacet; 108 110 109 111 // test related parameters … … 707 709 708 710 /** 711 * 712 * @return the name of the facet that represents the collection a resource 713 * belongs to 714 */ 715 public String getCollectionFacet() { 716 return collectionFacet; 717 } 718 719 /** 720 * 721 * @param collectionFacet the name of the facet that represents the 722 * collection a resource belongs to 723 */ 724 public void setCollectionFacet(String collectionFacet) { 725 this.collectionFacet = collectionFacet; 726 } 727 728 /** 709 729 * Get the value of the languageFields parameter<br><br> 710 730 * -
vlo/branches/vlo-3.0/vlo-commons/src/main/resources/VloConfig.xml
r4507 r4584 23 23 <printMapping>false</printMapping> 24 24 25 <dataRoots length="3">25 <dataRoots> 26 26 <DataRoot> 27 27 <originName>MPI IMDI Archive</originName> … … 67 67 <nationalProjectMapping>/nationalProjectsMapping.xml</nationalProjectMapping> 68 68 69 <facetFields length="13"> 70 <facetField>collection</facetField> 69 <collectionFacet>collection</collectionFacet> 70 71 <facetFields> 71 72 <facetField>language</facetField> 72 73 <facetField>resourceClass</facetField> … … 83 84 </facetFields> 84 85 85 <languageFilters length="3"> 86 <collectionFacet>collection</collectionFacet> 87 88 <languageFilters> 86 89 <languageFilter>filterOne</languageFilter> 87 90 <languageFilter>filterTwo</languageFilter> -
vlo/branches/vlo-3.0/vlo-commons/src/test/java/eu/clarin/cmdi/vlo/config/DefaultVloConfigFactoryTest.java
r4565 r4584 680 680 681 681 List<String> expResult = Arrays.asList( 682 "collection", 683 "language", 684 "resourceClass", 685 "modality", 686 "continent", 687 "genre", 688 "country", 689 "subject", 690 "organisation", 691 "format", 692 "dataProvider", 693 "nationalProject", 694 "keywords"); 682 "language", 683 "resourceClass", 684 "modality", 685 "continent", 686 "genre", 687 "country", 688 "subject", 689 "organisation", 690 "format", 691 "dataProvider", 692 "nationalProject", 693 "keywords"); 695 694 696 695 List<String> result = config.getFacetFields(); … … 708 707 709 708 List<String> expResult = Arrays.asList( 710 "collection", 711 "language", 712 "resourceClass", 713 "modality", 714 "continent", 715 "genre", 716 "country", 717 "subject", 718 "organisation", 719 "format", 720 "dataProvider", 721 "nationalProject", 722 "keywords"); 709 "language", 710 "resourceClass", 711 "modality", 712 "continent", 713 "genre", 714 "country", 715 "dataProvider", 716 "nationalProject", 717 "keywords"); 723 718 724 719 config.setFacetFields(expResult); … … 945 940 assertEquals(param, result); 946 941 } 942 943 @Test 944 public void testGetCollectionFacet() { 945 final String result = config.getCollectionFacet(); 946 assertEquals("collection", result); 947 } 947 948 } -
vlo/branches/vlo-3.0/vlo-commons/src/test/java/eu/clarin/cmdi/vlo/config/VloConfigMarshallerTest.java
r4565 r4584 56 56 assertEquals("http://localhost:8080/vlo_solr/", config.getSolrUrl()); 57 57 assertEquals(3, config.getDataRoots().size()); 58 assertEquals(1 3, config.getFacetFields().size());58 assertEquals(12, config.getFacetFields().size()); 59 59 } 60 60 -
vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/config/VloSpringConfig.java
r4583 r4584 80 80 final ArrayList<String> facets = Lists.newArrayList(vloConfig().getFacetFields()); 81 81 //TODO: get collections facet from config 82 facets.add( "collection");82 facets.add(vloConfig().getCollectionFacet()); 83 83 84 84 return new SolrFacetQueryFactoryImpl(facets); -
vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/FacetedSearchPage.java
r4582 r4584 41 41 final Model<QueryFacetsSelection> queryModel = new Model<QueryFacetsSelection>(selection); 42 42 43 final FacetFieldModel collectionFacetFieldModel = new FacetFieldModel(facetFieldsService, "collection", queryModel);43 final FacetFieldModel collectionFacetFieldModel = new FacetFieldModel(facetFieldsService, vloConfig.getCollectionFacet(), queryModel); 44 44 final FacetSelectionModel collectionSelectionModel = new FacetSelectionModel(collectionFacetFieldModel, queryModel); 45 45 add(new FacetPanel("collectionsFacet", collectionSelectionModel));
Note: See TracChangeset
for help on using the changeset viewer.