Changeset 4635


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

created a Label extension that reads field names from a resource bundle and shows these instead of the internal field names

Location:
vlo/branches/vlo-3.0/vlo-web-app/src/main
Files:
2 added
4 edited

Legend:

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

    r4626 r4635  
    66import org.apache.wicket.markup.html.WebPage;
    77import org.apache.wicket.protocol.http.WebApplication;
     8import org.apache.wicket.resource.loader.BundleStringResourceLoader;
    89import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
    910import org.springframework.beans.BeansException;
     
    2223    @Autowired
    2324    private SolrDocumentService documentService;
    24    
    25    
     25
    2626    private ApplicationContext applicationContext;
    2727
     
    4343        // this listener will inject any spring beans that need to be autowired
    4444        getComponentInstantiationListeners().add(new SpringComponentInjector(this, applicationContext));
     45        // register the resource of field names (used by eu.clarin.cmdi.vlo.wicket.componentsSolrFieldNameLabel)
     46        getResourceSettings().getStringResourceLoaders().add(new BundleStringResourceLoader("fieldNames"));
    4547    }
    46    
     48
    4749    /**
    48      * 
     50     *
    4951     * @return the active VLO wicket application
    5052     */
     
    6870        return documentService;
    6971    }
    70    
    71    
     72
    7273}
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/components/FacetValuesPanel.html

    r4605 r4635  
    2424    <body>
    2525        <wicket:panel>
    26             <h1><a href="#"><wicket:container wicket:id="name">[TITLE]</wicket:container></a></h1>
     26            <h1><a href="#"><wicket:container wicket:id="title">[TITLE]</wicket:container></a></h1>
    2727            <div class="sbilinks facetvalues">
    2828                <ul>
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/components/FacetValuesPanel.java

    r4540 r4635  
    3131import org.apache.wicket.model.CompoundPropertyModel;
    3232import org.apache.wicket.model.IModel;
     33import org.apache.wicket.model.PropertyModel;
    3334
    3435/**
     
    4344    public FacetValuesPanel(String id, IModel<FacetField> model) {
    4445        super(id, model);
    45         setDefaultModel(new CompoundPropertyModel<FacetField>(model));
    4646
    47         // 'name' field from FacetField
    48         add(new Label("name"));
     47        // add title
     48        add(new SolrFieldNameLabel("title", new PropertyModel<String>(model, "name")));
    4949
    5050        // provider that extracts values and counts from FacetField
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/components/FieldsTablePanel.java

    r4632 r4635  
    4141            protected void populateItem(Item<DocumentField> item) {
    4242                final IModel<DocumentField> fieldModel = item.getModel();
    43                 item.add(new Label("fieldName", new PropertyModel(fieldModel, "fieldName")));
     43                item.add(new SolrFieldNameLabel("fieldName", new PropertyModel(fieldModel, "fieldName")));
    4444                item.add(new ListView("values", new PropertyModel(fieldModel, "values")) {
    4545
Note: See TracChangeset for help on using the changeset viewer.