Changeset 4499


Ignore:
Timestamp:
02/12/14 09:54:23 (11 years ago)
Author:
twagoo
Message:

changed model for facetpanel: gets selection + context as 'facet status'

Location:
vlo/branches/vlo-3.0/vlo-web-app/src
Files:
1 added
5 edited

Legend:

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

    r4477 r4499  
    2727            <a href="#" class="expandfacet"><span>expand</span></a>
    2828            <a href="#" class="collapsefacet"><span>collapse</span></a>
    29             <h1><a href="#"><wicket:container wicket:id="facet.name">[TITLE]</wicket:container></a></h1>
     29            <h1><a href="#"><wicket:container wicket:id="selection.facet.name">[TITLE]</wicket:container></a></h1>
    3030            <a href class="filtertoggle"><span>filter</span></a>
    3131            <form class="filterform">
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/components/FacetPanel.java

    r4481 r4499  
    1717package eu.clarin.cmdi.vlo.components;
    1818
    19 import eu.clarin.cmdi.vlo.pojo.FacetSelection;
     19import eu.clarin.cmdi.vlo.pojo.FacetStatus;
    2020import org.apache.wicket.markup.html.basic.Label;
    2121import org.apache.wicket.markup.html.panel.Panel;
     
    2929public class FacetPanel extends Panel {
    3030
    31     public FacetPanel(String id, IModel<FacetSelection> model) {
     31    public FacetPanel(String id, IModel<FacetStatus> model) {
    3232        super(id, model);
    33         setDefaultModel(new CompoundPropertyModel<FacetSelection>(model));
     33        setDefaultModel(new CompoundPropertyModel<FacetStatus>(model));
    3434       
    35         add(new Label("facet.name"));
     35        add(new Label("selection.facet.name"));
    3636    }
    3737
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/components/FacetsPanel.java

    r4481 r4499  
    1717package eu.clarin.cmdi.vlo.components;
    1818
    19 import eu.clarin.cmdi.vlo.pojo.FacetSelection;
     19import eu.clarin.cmdi.vlo.pojo.FacetStatus;
    2020import org.apache.wicket.markup.html.list.ListItem;
    2121import org.apache.wicket.markup.html.list.ListView;
     
    2929public class FacetsPanel extends Panel {
    3030
    31     public FacetsPanel(String id, ListModel<FacetSelection> model) {
     31    public FacetsPanel(String id, ListModel<FacetStatus> model) {
    3232        super(id, model);
    33         add(new ListView<FacetSelection>("facets", model) {
     33        add(new ListView<FacetStatus>("facets", model) {
    3434
    3535            @Override
    36             protected void populateItem(ListItem<FacetSelection> item) {
     36            protected void populateItem(ListItem<FacetStatus> item) {
    3737                //TODO: Check whether a value has been selected or not
    3838                item.add(new FacetPanel("facet", item.getModel()));
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/pages/FacetedSearchPage.java

    r4481 r4499  
    44import eu.clarin.cmdi.vlo.pojo.Facet;
    55import eu.clarin.cmdi.vlo.pojo.FacetSelection;
     6import eu.clarin.cmdi.vlo.pojo.FacetStatus;
    67import java.util.Arrays;
     8import java.util.Collection;
    79import java.util.Collections;
    810import org.apache.wicket.request.mapper.parameter.PageParameters;
     
    1618    public FacetedSearchPage(final PageParameters parameters) {
    1719        super(parameters);
    18 
    19         add(new FacetsPanel("facets", new ListModel<FacetSelection>(Arrays.asList(
    20                 new FacetSelection(new Facet("Language"), Collections.singleton("Dutch")),
    21                 new FacetSelection(new Facet("Resource type"), Collections.singleton("Text"))
    22         ))));
     20        final FacetSelection languageSelection = new FacetSelection(new Facet("Language"), Collections.singleton("Dutch"));
     21        final FacetSelection typeSelection = new FacetSelection(new Facet("Resource type"), Collections.<String>emptySet());
     22        final Collection<FacetSelection> context = Arrays.asList(languageSelection,typeSelection);
     23       
     24        add(new FacetsPanel("facets", new ListModel<FacetStatus>(Arrays.asList(
     25                new FacetStatus(languageSelection, context),
     26                new FacetStatus(typeSelection, context)))));
    2327    }
    2428}
  • vlo/branches/vlo-3.0/vlo-web-app/src/test/java/eu/clarin/cmdi/vlo/Start.java

    r4469 r4499  
    1919        connector.setMaxIdleTime(timeout);
    2020        connector.setSoLingerTime(-1);
    21         connector.setPort(8080);
     21        connector.setPort(8090);
    2222        server.addConnector(connector);
    2323
Note: See TracChangeset for help on using the changeset viewer.