Changeset 5020


Ignore:
Timestamp:
04/22/14 14:46:14 (10 years ago)
Author:
Twan Goosen
Message:

replaced 'language' facet with 'languages', which includes a link to the language info page

Location:
vlo/branches/vlo-3.0
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • vlo/branches/vlo-3.0/vlo-commons/src/main/resources/VloConfig.xml

    r4935 r5020  
    9797        <searchResultField>name</searchResultField>
    9898        <searchResultField>country</searchResultField>
    99         <searchResultField>language</searchResultField>
     99        <searchResultField>languages</searchResultField>
    100100        <searchResultField>modality</searchResultField>
    101101        <searchResultField>subject</searchResultField>
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/config/VloSpringConfig.java

    r4987 r5020  
    210210            FacetConstants.FIELD_DESCRIPTION,
    211211            FacetConstants.FIELD_COLLECTION,
    212             FacetConstants.FIELD_LANGUAGE,
     212            FacetConstants.FIELD_LANGUAGES,
    213213            FacetConstants.FIELD_MODALITY,
    214214            FacetConstants.FIELD_CONTINENT,
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/FieldsTablePanel.java

    r5013 r5020  
    1717package eu.clarin.cmdi.vlo.wicket.panels.record;
    1818
     19import com.google.common.collect.ImmutableSet;
     20import eu.clarin.cmdi.vlo.FacetConstants;
    1921import eu.clarin.cmdi.vlo.config.VloConfig;
    2022import eu.clarin.cmdi.vlo.pojo.DocumentField;
     
    2426import eu.clarin.cmdi.vlo.wicket.model.SolrFieldNameModel;
    2527import eu.clarin.cmdi.vlo.wicket.pages.FacetedSearchPage;
     28import java.util.Collection;
    2629import java.util.Collections;
    2730import java.util.List;
     
    4649public class FieldsTablePanel extends Panel {
    4750
     51    /**
     52     * List of fields that should be rendered unescaped, {@literal i.e.} HTML
     53     * contained in the field should be preserved
     54     */
     55    private final static Collection<String> UNESCAPED_VALUE_FIELDS = ImmutableSet.of(FacetConstants.FIELD_LANGUAGES);
     56
    4857    @SpringBean
    4958    private VloConfig vloConfig;
     
    6675                    @Override
    6776                    protected void populateItem(final ListItem fieldValueItem) {
    68                         fieldValueItem.add(new Label("value", fieldValueItem.getModel()));
     77                        // add a label for the facet value
     78                        final Label fieldLabel = new Label("value", fieldValueItem.getModel());
     79                        // some selected fields may have HTML that needs to be preserved...
     80                        fieldLabel.setEscapeModelStrings(!UNESCAPED_VALUE_FIELDS.contains(fieldNameModel.getObject()));
     81                        fieldValueItem.add(fieldLabel);
     82
     83                        // add a link for selecting the value in the search
    6984                        fieldValueItem.add(createFacetSelectLink("facetSelect", fieldNameModel, fieldValueItem.getModel()));
    7085                    }
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/resources/fieldNames.properties

    r4992 r5020  
    1818field.name=Name
    1919field.language=Language
     20field.languages=Language
    2021field.genre=Genre
    2122field.description=Description
Note: See TracChangeset for help on using the changeset viewer.