Ignore:
Timestamp:
03/06/14 14:56:48 (10 years ago)
Author:
Twan Goosen
Message:

added field table for record by means of a data provider (of the new DocumentField? pojo interface, plus hybrid model/implementation) with filtering capabilities and a dataview that produces a table

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.java

    r4625 r4632  
    1919import eu.clarin.cmdi.vlo.FacetConstants;
    2020import eu.clarin.cmdi.vlo.pojo.QueryFacetsSelection;
     21import eu.clarin.cmdi.vlo.service.FieldFilter;
     22import eu.clarin.cmdi.vlo.wicket.components.FieldsTablePanel;
    2123import eu.clarin.cmdi.vlo.wicket.components.SolrFieldLabel;
    2224import eu.clarin.cmdi.vlo.wicket.model.SolrFieldStringModel;
     25import eu.clarin.cmdi.vlo.wicket.provider.DocumentFieldsProvider;
     26import java.io.Serializable;
    2327import org.apache.solr.common.SolrDocument;
    2428import org.apache.wicket.markup.html.WebPage;
     
    3236public class RecordPage extends WebPage {
    3337
    34 //    private final IModel<SolrDocument> documentModel;
    3538    private final IModel<QueryFacetsSelection> contextModel;
    3639
    3740    public RecordPage(IModel<SolrDocument> documentModel, IModel<QueryFacetsSelection> contextModel) {
    3841        super(documentModel);
    39 //        this.documentModel = documentModel;
    4042        this.contextModel = contextModel;
    4143
    4244        add(new SolrFieldLabel("name", documentModel, FacetConstants.FIELD_NAME, "Unnamed record"));
    4345        add(createLandingPageLink("landingPageLink", documentModel));
     46        add(new FieldsTablePanel("documentProperties", new DocumentFieldsProvider(documentModel, new BasicPropertiesFieldFilter())));
    4447    }
    4548
     
    6669    }
    6770
     71    private class BasicPropertiesFieldFilter implements FieldFilter, Serializable {
     72
     73        @Override
     74        public boolean allowField(String fieldName) {
     75            return !fieldName.startsWith("_");
     76            //TODO: Exclude excluded fields and technical fields
     77        }
     78    }
     79
    6880}
Note: See TracChangeset for help on using the changeset viewer.