Changeset 4654


Ignore:
Timestamp:
03/07/14 16:30:01 (10 years ago)
Author:
Twan Goosen
Message:

ignored and technical fields are now configured through VloConfig?.xml

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  
    55import java.util.ArrayList;
    66import java.util.List;
     7import java.util.Set;
    78import javax.xml.bind.annotation.XmlElement;
    89import javax.xml.bind.annotation.XmlElementWrapper;
     
    9697
    9798    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;
    98118
    99119    /**
     
    698718    /**
    699719     *
    700      * @return all facet fields, including collection facet (arbitrary order unspecified)
     720     * @return all facet fields, including collection facet (arbitrary order
     721     * unspecified)
    701722     * @see #getFacetFields()
    702723     * @see #getCollectionFacet()
     
    738759    }
    739760
     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
    740777    /**
    741778     * Get the value of the languageFields parameter<br><br>
  • vlo/branches/vlo-3.0/vlo-commons/src/main/resources/VloConfig.xml

    r4584 r4654  
    8686    <collectionFacet>collection</collectionFacet>
    8787   
     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   
    88102    <languageFilters>
    89103        <languageFilter>filterOne</languageFilter>
  • vlo/branches/vlo-3.0/vlo-commons/src/test/java/eu/clarin/cmdi/vlo/config/DefaultVloConfigFactoryTest.java

    r4597 r4654  
    971971        assertEquals("collection", result);
    972972    }
     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    }
    973986}
     987
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/config/VloSpringConfig.java

    r4646 r4654  
    2020import eu.clarin.cmdi.vlo.service.impl.InclusiveFieldFilter;
    2121import com.google.common.collect.Sets;
    22 import eu.clarin.cmdi.vlo.FacetConstants;
    2322import eu.clarin.cmdi.vlo.VloWicketApplication;
    2423import eu.clarin.cmdi.vlo.pojo.QueryFacetsSelection;
     
    4039import eu.clarin.cmdi.vlo.service.impl.SolrFacetQueryFactoryImpl;
    4140import java.io.IOException;
    42 import java.util.Set;
    4341import org.apache.solr.client.solrj.SolrServer;
    4442import org.apache.solr.client.solrj.impl.HttpSolrServer;
     
    129127    @Bean(name = "basicPropertiesFilter")
    130128    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()));
    132132    }
    133133
    134134    @Bean(name = "technicalPropertiesFilter")
    135135    public FieldFilter technicalPropertiesFieldFilter() {
    136         return new InclusiveFieldFilter(TECHNICAL_FIELDS);
     136        return new InclusiveFieldFilter(
     137                vloConfig().getTechnicalFields());
    137138    }
    138 
    139     /**
    140      * Fields to be ignored. TODO: read this from config
    141      */
    142     public static final Set<String> IGNORE_FIELDS
    143             = Sets.newHashSet(
    144                     FacetConstants.FIELD_FORMAT);
    145 
    146     /**
    147      * Fields to be included in technical details. TODO: read this from config
    148      */
    149     public static final Set<String> TECHNICAL_FIELDS
    150             = 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);
    158139}
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/impl/SolrDocumentQueryFactoryImpl.java

    r4636 r4654  
    4444        FacetConstants.FIELD_SEARCHPAGE,
    4545        FacetConstants.FIELD_SEARCH_SERVICE,
    46         FacetConstants.FIELD_LAST_SEEN
     46        FacetConstants.FIELD_LAST_SEEN,
     47        FacetConstants.FIELD_CLARIN_PROFILE
    4748    };
    4849
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.java

    r4653 r4654  
    2929import eu.clarin.cmdi.vlo.wicket.provider.DocumentFieldsProvider;
    3030import org.apache.solr.common.SolrDocument;
    31 import org.apache.wicket.markup.html.GenericWebPage;
    3231import org.apache.wicket.markup.html.link.ExternalLink;
    3332import org.apache.wicket.model.IModel;
Note: See TracChangeset for help on using the changeset viewer.