Changeset 4654
- Timestamp:
- 03/07/14 16:30:01 (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
r4597 r4654 5 5 import java.util.ArrayList; 6 6 import java.util.List; 7 import java.util.Set; 7 8 import javax.xml.bind.annotation.XmlElement; 8 9 import javax.xml.bind.annotation.XmlElementWrapper; … … 96 97 97 98 private String feedbackFromUrl = ""; 99 /** 100 * A set of fields to be excluded from display<br><br> 101 * 102 * To let JAXB know it has to interpret the element as an array, use the 103 * XmlElementWrapper directive. Use the directive to let JAXB know that the 104 * elements inside 'facetFields' are named 'facetField'. 105 */ 106 @XmlElementWrapper(name = "ignoredFields") 107 private Set<String> ignoredField; 108 /** 109 * An array of fields to be included as technical properties<br><br> 110 * 111 * To let JAXB know it has to interpret the element as an array, use the 112 * XmlElementWrapper directive. Use the directive to let JAXB know that the 113 * elements inside 'facetFields' are named 'facetField'. 114 */ 115 116 @XmlElementWrapper(name = "technicalFields") 117 private Set<String> technicalField; 98 118 99 119 /** … … 698 718 /** 699 719 * 700 * @return all facet fields, including collection facet (arbitrary order unspecified) 720 * @return all facet fields, including collection facet (arbitrary order 721 * unspecified) 701 722 * @see #getFacetFields() 702 723 * @see #getCollectionFacet() … … 738 759 } 739 760 761 public Set<String> getIgnoredFields() { 762 return ignoredField; 763 } 764 765 public void setIgnoredFields(Set<String> ignoredFields) { 766 this.ignoredField = ignoredFields; 767 } 768 769 public Set<String> getTechnicalFields() { 770 return technicalField; 771 } 772 773 public void setTechnicalFields(Set<String> technicalFields) { 774 this.technicalField = technicalFields; 775 } 776 740 777 /** 741 778 * Get the value of the languageFields parameter<br><br> -
vlo/branches/vlo-3.0/vlo-commons/src/main/resources/VloConfig.xml
r4584 r4654 86 86 <collectionFacet>collection</collectionFacet> 87 87 88 <ignoredFields> 89 <ignoredField>format</ignoredField> 90 </ignoredFields> 91 92 <technicalFields> 93 <technicalField>id</technicalField> 94 <technicalField>dataProvider</technicalField> 95 <technicalField>_landingPageRef</technicalField> 96 <technicalField>_searchPageRef</technicalField> 97 <technicalField>_contentSearchRef</technicalField> 98 <technicalField>_lastSeen</technicalField> 99 <technicalField>_componentProfile</technicalField> 100 </technicalFields> 101 88 102 <languageFilters> 89 103 <languageFilter>filterOne</languageFilter> -
vlo/branches/vlo-3.0/vlo-commons/src/test/java/eu/clarin/cmdi/vlo/config/DefaultVloConfigFactoryTest.java
r4597 r4654 971 971 assertEquals("collection", result); 972 972 } 973 974 @Test 975 public void testGetIgnoredFields() { 976 Set<String> result = config.getIgnoredFields(); 977 assertEquals(1, result.size()); 978 } 979 980 981 @Test 982 public void testGetTechnicalFields() { 983 Set<String> result = config.getTechnicalFields(); 984 assertEquals(7, result.size()); 985 } 973 986 } 987 -
vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/config/VloSpringConfig.java
r4646 r4654 20 20 import eu.clarin.cmdi.vlo.service.impl.InclusiveFieldFilter; 21 21 import com.google.common.collect.Sets; 22 import eu.clarin.cmdi.vlo.FacetConstants;23 22 import eu.clarin.cmdi.vlo.VloWicketApplication; 24 23 import eu.clarin.cmdi.vlo.pojo.QueryFacetsSelection; … … 40 39 import eu.clarin.cmdi.vlo.service.impl.SolrFacetQueryFactoryImpl; 41 40 import java.io.IOException; 42 import java.util.Set;43 41 import org.apache.solr.client.solrj.SolrServer; 44 42 import org.apache.solr.client.solrj.impl.HttpSolrServer; … … 129 127 @Bean(name = "basicPropertiesFilter") 130 128 public FieldFilter basicPropertiesFieldFilter() { 131 return new ExclusiveFieldFilter(Sets.union(IGNORE_FIELDS, TECHNICAL_FIELDS)); 129 return new ExclusiveFieldFilter(Sets.union( 130 vloConfig().getIgnoredFields(), 131 vloConfig().getTechnicalFields())); 132 132 } 133 133 134 134 @Bean(name = "technicalPropertiesFilter") 135 135 public FieldFilter technicalPropertiesFieldFilter() { 136 return new InclusiveFieldFilter(TECHNICAL_FIELDS); 136 return new InclusiveFieldFilter( 137 vloConfig().getTechnicalFields()); 137 138 } 138 139 /**140 * Fields to be ignored. TODO: read this from config141 */142 public static final Set<String> IGNORE_FIELDS143 = Sets.newHashSet(144 FacetConstants.FIELD_FORMAT);145 146 /**147 * Fields to be included in technical details. TODO: read this from config148 */149 public static final Set<String> TECHNICAL_FIELDS150 = Sets.newHashSet(151 FacetConstants.FIELD_ID,152 FacetConstants.FIELD_DATA_PROVIDER,153 FacetConstants.FIELD_FORMAT,154 FacetConstants.FIELD_LANDINGPAGE,155 FacetConstants.FIELD_SEARCHPAGE,156 FacetConstants.FIELD_SEARCH_SERVICE,157 FacetConstants.FIELD_LAST_SEEN);158 139 } -
vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/impl/SolrDocumentQueryFactoryImpl.java
r4636 r4654 44 44 FacetConstants.FIELD_SEARCHPAGE, 45 45 FacetConstants.FIELD_SEARCH_SERVICE, 46 FacetConstants.FIELD_LAST_SEEN 46 FacetConstants.FIELD_LAST_SEEN, 47 FacetConstants.FIELD_CLARIN_PROFILE 47 48 }; 48 49 -
vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.java
r4653 r4654 29 29 import eu.clarin.cmdi.vlo.wicket.provider.DocumentFieldsProvider; 30 30 import org.apache.solr.common.SolrDocument; 31 import org.apache.wicket.markup.html.GenericWebPage;32 31 import org.apache.wicket.markup.html.link.ExternalLink; 33 32 import org.apache.wicket.model.IModel;
Note: See TracChangeset
for help on using the changeset viewer.