Changeset 5150


Ignore:
Timestamp:
05/08/14 07:06:26 (10 years ago)
Author:
Twan Goosen
Message:

Merged a number of fixes and changes from trunk to 3.0 branch

Location:
vlo/branches/vlo-3.0
Files:
12 deleted
18 edited
6 copied

Legend:

Unmodified
Added
Removed
  • vlo/branches/vlo-3.0/vlo-commons

  • vlo/branches/vlo-3.0/vlo-commons/src/test/java/eu/clarin/cmdi/vlo/config/DefaultVloConfigFactoryTest.java

    r5094 r5150  
    3939    public void testGetDataRoots() {
    4040
    41         ArrayList<DataRoot> dataRoots;
    42         dataRoots = new ArrayList<DataRoot>();
    43 
    44         dataRoots.add(new DataRoot("MPI IMDI Archive",
    45                 new File("/lat/apache/htdocs/oai-harvester/mpi-self-harvest/harvested/results/cmdi/"),
    46                 "http://catalog.clarin.eu/",
    47                 "/lat/apache/htdocs/", false));
    48         dataRoots.add(new DataRoot("CMDI Providers",
    49                 new File("/lat/apache/htdocs/oai-harvester/cmdi-providers/harvested/results/cmdi/"),
    50                 "http://catalog.clarin.eu/",
    51                 "/lat/apache/htdocs/", false));
    52         dataRoots.add(new DataRoot("OLAC Metadata Providers",
    53                 new File("/lat/apache/htdocs/oai-harvester/olac-and-dc-providers/harvested/results/cmdi/"),
    54                 "http://catalog.clarin.eu/",
    55                 "/lat/apache/htdocs/", false));
    56 
    57         System.out.println("getDataRoots");
     41        List<DataRoot> dataRoots = Arrays.asList(
     42                new DataRoot("CLARIN Centres",
     43                        new File("/lat/apache/htdocs/oai-harvester/clarin/results/cmdi/"),
     44                        "http://catalog.clarin.eu/",
     45                        "/lat/apache/htdocs/", false),
     46                new DataRoot("Other",
     47                        new File("/lat/apache/htdocs/oai-harvester/others/results/cmdi"),
     48                        "http://catalog.clarin.eu/",
     49                        "/lat/apache/htdocs/", false));
    5850
    5951        List<DataRoot> rootsReturned = config.getDataRoots();
     
    6759    public void testSetDataRoots() {
    6860
    69         ArrayList<DataRoot> dataRoots = new ArrayList<DataRoot>();
    70 
    71         dataRoots.add(new DataRoot("MPI IMDI Archive",
    72                 new File("/lat/apache/htdocs/oai-harvester/mpi-self-harvest/harvested/results/cmdi/"),
    73                 "http://catalog.clarin.eu/",
    74                 "/lat/apache/htdocs/", false));
    75         dataRoots.add(new DataRoot("CMDI Providers",
    76                 new File("/lat/apache/htdocs/oai-harvester/cmdi-providers/harvested/results/cmdi/"),
    77                 "http://catalog.clarin.eu/",
    78                 "/lat/apache/htdocs/", false));
    79         dataRoots.add(new DataRoot("OLAC Metadata Providers",
    80                 new File("/lat/apache/htdocs/oai-harvester/olac-and-dc-providers/harvested/results/cmdi/"),
    81                 "http://catalog.clarin.eu/",
    82                 "/lat/apache/htdocs/", false));
     61        List<DataRoot> dataRoots = Arrays.asList(
     62                new DataRoot("MPI IMDI Archive",
     63                        new File("/lat/apache/htdocs/oai-harvester/mpi-self-harvest/harvested/results/cmdi/"),
     64                        "http://catalog.clarin.eu/",
     65                        "/lat/apache/htdocs/", false),
     66                new DataRoot("CMDI Providers",
     67                        new File("/lat/apache/htdocs/oai-harvester/cmdi-providers/harvested/results/cmdi/"),
     68                        "http://catalog.clarin.eu/",
     69                        "/lat/apache/htdocs/", false),
     70                new DataRoot("OLAC Metadata Providers",
     71                        new File("/lat/apache/htdocs/oai-harvester/olac-and-dc-providers/harvested/results/cmdi/"),
     72                        "http://catalog.clarin.eu/",
     73                        "/lat/apache/htdocs/", false));
    8374
    8475        System.out.println("setDataRoots");
  • vlo/branches/vlo-3.0/vlo-commons/src/test/java/eu/clarin/cmdi/vlo/config/VloConfigMarshallerTest.java

    r5068 r5150  
    5555        assertNotNull(config);
    5656        assertEquals("http://localhost:8080/vlo-solr/core0/", config.getSolrUrl());
    57         assertEquals(3, config.getDataRoots().size());
     57        assertEquals(2, config.getDataRoots().size());
    5858        assertEquals(12, config.getFacetFields().size());
    5959    }
  • vlo/branches/vlo-3.0/vlo-web-app

  • vlo/branches/vlo-3.0/vlo-web-app/nb-configuration.xml

    r4498 r5150  
    1313        <config-file-groups/>
    1414    </spring-data>
     15    <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
     16        <!--
     17Properties that influence various parts of the IDE, especially code formatting and the like.
     18You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
     19That way multiple projects can share the same settings (useful for formatting rules for example).
     20Any value defined here will override the pom.xml file value but is only applicable to the current project.
     21-->
     22        <org-netbeans-modules-css-prep.less_2e_configured>true</org-netbeans-modules-css-prep.less_2e_configured>
     23    </properties>
    1524</project-shared-configuration>
  • vlo/branches/vlo-3.0/vlo-web-app/pom.xml

    r5087 r5150  
    161161        <!-- JavaMelody for application monitoring -->
    162162        <dependency>
    163                 <groupId>net.bull.javamelody</groupId>
    164                 <artifactId>javamelody-core</artifactId>
    165                 <version>1.50.0</version>
    166                 <exclusions>
    167                     <exclusion>
    168                         <groupId>org.springframework</groupId>
    169                         <artifactId>spring-aop</artifactId>
    170                     </exclusion>
    171                     <exclusion>
    172                         <groupId>org.springframework</groupId>
    173                         <artifactId>spring-context</artifactId>
    174                     </exclusion>
    175                 </exclusions>
     163            <groupId>net.bull.javamelody</groupId>
     164            <artifactId>javamelody-core</artifactId>
     165            <version>1.50.0</version>
     166            <exclusions>
     167                <exclusion>
     168                    <groupId>org.springframework</groupId>
     169                    <artifactId>spring-aop</artifactId>
     170                </exclusion>
     171                <exclusion>
     172                    <groupId>org.springframework</groupId>
     173                    <artifactId>spring-context</artifactId>
     174                </exclusion>
     175            </exclusions>
    176176        </dependency>
    177177    </dependencies>
     
    225225            </plugin>
    226226            <plugin>
     227                <!-- Compiles .less files into .css -->
     228                <groupId>org.lesscss</groupId>
     229                <artifactId>lesscss-maven-plugin</artifactId>
     230                <version>1.3.3</version>
     231                <configuration>
     232                    <sourceDirectory>${project.basedir}/src/main/less</sourceDirectory>
     233                    <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
     234                    <compress>true</compress>
     235                    <force>true</force>
     236                    <excludes>
     237                        <exclude>**/inc/**/*</exclude>
     238                    </excludes>
     239                </configuration>
     240                <executions>
     241                    <execution>
     242                        <goals>
     243                            <goal>compile</goal>
     244                        </goals>
     245                    </execution>
     246                </executions>
     247            </plugin>
     248            <plugin>
    227249                <groupId>org.mortbay.jetty</groupId>
    228250                <artifactId>jetty-maven-plugin</artifactId>
     
    268290                </configuration>
    269291            </plugin>
     292            <plugin>
     293                <groupId>org.codehaus.mojo</groupId>
     294                <artifactId>cobertura-maven-plugin</artifactId>
     295                <version>2.6</version>
     296                <configuration>   
     297                    <formats>
     298                        <format>xml</format>
     299                    </formats>
     300                </configuration>
     301                <executions>
     302                    <execution>
     303                        <phase>site</phase>
     304                        <goals>
     305                            <goal>cobertura</goal>
     306                        </goals>
     307                    </execution>
     308                </executions>
     309            </plugin>
    270310        </plugins>
    271311    </build>
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/FacetedSearchPage.java

    r5031 r5150  
    130130
    131131    private Panel createCollectionsPanel(final String id) {
    132         final FacetPanel panel = new SingleFacetPanel(id, getModel(), vloConfig.getCollectionFacet(), facetFieldsService) {
     132        final FacetPanel panel = new SingleFacetPanel(id, getModel(), vloConfig.getCollectionFacet(), facetFieldsService, 3) {
    133133
    134134            @Override
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.java

    r5082 r5150  
    151151            // Add a panel that shows the index of the current record in the
    152152            // resultset and allows for forward/backward navigation
    153             return new RecordNavigationPanel(id, navigationModel);
     153            return new RecordNavigationPanel(id, navigationModel) {
     154
     155                @Override
     156                protected void onConfigure() {
     157                    final SearchContext context = navigationModel.getObject();
     158                    setVisible(context != null && context.getResultCount() > 1);
     159                }
     160
     161            };
    154162        } else {
    155163            // If no context model is available (i.e. when coming from a bookmark
     
    267275    public IModel<String> getTitleModel() {
    268276        // Put the name of the record in the page title
    269         return new StringResourceModel("recordpage.title", 
     277        return new StringResourceModel("recordpage.title",
    270278                new SolrFieldStringModel(getModel(), FacetConstants.FIELD_NAME),
    271279                DEFAULT_PAGE_TITLE);
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/SimpleSearchPage.java

    r5032 r5150  
    6767
    6868        // add a persistenet panel for selection of a value for the collection facet
    69         collectionsPanel = new SingleFacetPanel("collectionsFacet", model, vloConfig.getCollectionFacet(), facetFieldsService) {
     69        collectionsPanel = new SingleFacetPanel("collectionsFacet", model, vloConfig.getCollectionFacet(), facetFieldsService, 3) {
    7070
    7171            @Override
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/SingleFacetPanel.java

    r4962 r5150  
    1515 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1616 */
    17 
    1817package eu.clarin.cmdi.vlo.wicket.panels;
    1918
     
    3332public abstract class SingleFacetPanel extends FacetPanel {
    3433
    35     public SingleFacetPanel(String id, IModel<QueryFacetsSelection> queryModel, String facetName, FacetFieldsService facetFieldsService) {
     34    public SingleFacetPanel(String id, IModel<QueryFacetsSelection> queryModel, String facetName, FacetFieldsService facetFieldsService, int subListSize) {
    3635        //TODO: Limit to number of items shown while keeping 'more' function?
    37         super(id, new FacetFieldSelectionModel(new FacetFieldModel(facetFieldsService, facetName, queryModel, -1), queryModel), Model.of(ExpansionState.COLLAPSED));
     36        super(id, new FacetFieldSelectionModel(new FacetFieldModel(facetFieldsService, facetName, queryModel, -1), queryModel), Model.of(ExpansionState.COLLAPSED), subListSize);
    3837    }
    3938
     
    4443        return false;
    4544    }
    46    
     45
    4746}
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/TogglePanel.java

    r4986 r5150  
    1919import org.apache.wicket.Component;
    2020import org.apache.wicket.ajax.AjaxRequestTarget;
    21 import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
    2221import org.apache.wicket.behavior.AttributeAppender;
     22import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxFallbackLink;
    2323import org.apache.wicket.markup.html.basic.Label;
    2424import org.apache.wicket.markup.html.link.Link;
     
    5252
    5353        // add the actual toggle link
    54         final Link toggler = new AjaxFallbackLink("toggler") {
     54        final Link toggler = new IndicatingAjaxFallbackLink("toggler") {
    5555
    5656            @Override
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/TopLinksPanel.html

    r5033 r5150  
    2424    <body>
    2525        <wicket:panel>
    26             <wicket:enclosure child="linkrequest">
    27                 <a wicket:id="linkrequest" id="permalink" href="" title="Get a permanent link to this page"><span>Permalink</span></a>
     26            <wicket:enclosure child="linkRequest">
     27                <form id="permalink" wicket:id="linkRequest">
     28                    <input wicket:id="linkRequestButton" type="submit" title="Get a permanent link to this page" value="Permalink" />
     29                </form>
    2830                <input wicket:id="linkfield" type="text" id="permalinkfield"></input>
    2931                |
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/TopLinksPanel.java

    r4987 r5150  
    2323import eu.clarin.cmdi.vlo.service.PageParametersConverter;
    2424import org.apache.solr.common.SolrDocument;
     25import org.apache.wicket.Component;
    2526import org.apache.wicket.Session;
    2627import org.apache.wicket.ajax.AjaxRequestTarget;
     28import org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton;
    2729import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxFallbackLink;
     30import org.apache.wicket.markup.html.form.Form;
    2831import org.apache.wicket.markup.html.form.TextField;
    2932import org.apache.wicket.markup.html.link.ExternalLink;
     
    5558public class TopLinksPanel extends GenericPanel<QueryFacetsSelection> {
    5659
    57     @SpringBean(name="queryParametersConverter")
     60    @SpringBean(name = "queryParametersConverter")
    5861    private PageParametersConverter<QueryFacetsSelection> paramsConverter;
    5962    @SpringBean
     
    8083
    8184        // action to link to request the permalink
    82         add(createPermaLink("linkrequest", linkModel));
     85        add(createPermaLink("linkRequest"));
    8386        // field that holds the actual link
    8487        add(createLinkField("linkfield", linkModel));
     
    99102    }
    100103
    101     private Link<String> createPermaLink(String id, final IModel<String> linkModel) {
    102         return new IndicatingAjaxFallbackLink<String>(id, linkModel) {
     104    private Component createPermaLink(String id) {
     105        // Create a form with a button to toggle permalink rather than an action link
     106        // to prevent people from confusing the link generated by wicket with
     107        // the actual permalink generated by the application
     108        final Form form = new Form(id) {
    103109
    104110            @Override
    105             public void onClick(AjaxRequestTarget target) {
     111            protected void onConfigure() {
     112                super.onConfigure();
     113                setVisible(TopLinksPanel.this.getModel() != null);
     114            }
     115        };
     116
     117        form.add(new AjaxFallbackButton("linkRequestButton", form) {
     118
     119            @Override
     120            protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
    106121                // toggle
    107122                linkVisibilityModel.setObject(!linkVisibilityModel.getObject());
     
    115130            }
    116131
    117             @Override
    118             protected void onConfigure() {
    119                 super.onConfigure();
    120                 setVisible(TopLinksPanel.this.getModel() != null);
    121             }
     132        });
    122133
    123         };
     134        return form;
    124135    }
    125136
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/AllFacetValuesPanel.java

    r5124 r5150  
    2121import eu.clarin.cmdi.vlo.pojo.FieldValuesFilter;
    2222import eu.clarin.cmdi.vlo.pojo.FieldValuesOrder;
     23import eu.clarin.cmdi.vlo.wicket.components.AjaxIndicatingForm;
    2324import eu.clarin.cmdi.vlo.wicket.components.FieldValueOrderSelector;
    2425import eu.clarin.cmdi.vlo.wicket.model.BridgeModel;
     
    154155
    155156    private Form createOptionsForm(String id) {
    156         final Form options = new Form(id);
     157        final Form options = new AjaxIndicatingForm(id);
    157158
    158159        final DropDownChoice<SortParam<FieldValuesOrder>> sortSelect
     
    223224    }
    224225
     226
    225227    private class UpdateOptionsFormBehavior extends OnChangeAjaxBehavior {
    226228
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/FacetPanel.java

    r4976 r5150  
    4747
    4848    public FacetPanel(String id, IModel<FacetFieldSelection> selectionModel, IModel<ExpansionState> expansionState) {
     49        this(id, selectionModel, expansionState, 0);
     50    }
     51
     52    public FacetPanel(String id, IModel<FacetFieldSelection> selectionModel, IModel<ExpansionState> expansionState, int subListSize) {
    4953        super(id, selectionModel, expansionState);
    5054        this.expansionStateModel = expansionState;
    5155
    5256        // panel showing values for selection
    53         facetValuesPanel = createFacetValuesPanel("facetValues");
     57        facetValuesPanel = createFacetValuesPanel("facetValues", subListSize);
    5458        add(facetValuesPanel);
    5559
     
    8589    }
    8690
    87     private FacetValuesPanel createFacetValuesPanel(String id) {
     91    private FacetValuesPanel createFacetValuesPanel(String id, int subListSize) {
    8892        return new FacetValuesPanel(id,
    8993                new PropertyModel<FacetField>(getModel(), "facetField"),
    90                 new PropertyModel<QueryFacetsSelection>(getModel(), "selection")) {
     94                new PropertyModel<QueryFacetsSelection>(getModel(), "selection"), subListSize) {
    9195                    @Override
    9296                    public void onValuesSelected(String facet, FacetSelection value, AjaxRequestTarget target) {
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/FacetValuesPanel.html

    r4958 r5150  
    3030                    <input type="submit" value="Search" class="nonjsfallback" />
    3131                </form>
    32                 <ul wicket:id="valuesContainer">
    33                     <li wicket:id="facetValues"><a wicket:id="facetSelect" href="index3.html"><span wicket:id="name">Dutch</span> (<span wicket:id="count">148167</span>)</a></li>
    34                     <li class="more-link"><a wicket:id="allFacetValuesLink" href="#">more...</a></li>
    35                 </ul>
     32                <wicket:container wicket:id="valuesContainer">
     33                    <ul wicket:id="valuesList">
     34                        <li wicket:id="facetValues"><a wicket:id="facetSelect" href="index3.html"><span wicket:id="name">Dutch</span> (<span wicket:id="count">148167</span>)</a></li>
     35                    </ul>
     36                    <wicket:enclosure>
     37                        <ul>
     38                            <li class="more-link"><a wicket:id="allFacetValuesLink" href="#">more...</a></li>
     39                        </ul>
     40                    </wicket:enclosure>
     41                </wicket:container>
    3642            </div>               
    3743        </wicket:panel>
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/FacetValuesPanel.java

    r5079 r5150  
    2020import eu.clarin.cmdi.vlo.pojo.FacetSelection;
    2121import eu.clarin.cmdi.vlo.pojo.FieldValuesFilter;
     22import eu.clarin.cmdi.vlo.pojo.FieldValuesOrder;
    2223import eu.clarin.cmdi.vlo.pojo.QueryFacetsSelection;
     24import eu.clarin.cmdi.vlo.wicket.provider.PartitionedDataProvider;
    2325import eu.clarin.cmdi.vlo.wicket.model.SolrFieldNameModel;
    2426import eu.clarin.cmdi.vlo.wicket.pages.AllFacetValuesPage;
     
    2628import java.util.Collection;
    2729import java.util.Collections;
     30import java.util.List;
    2831import org.apache.solr.client.solrj.response.FacetField;
    2932import org.apache.solr.client.solrj.response.FacetField.Count;
     
    3740import org.apache.wicket.markup.html.form.TextField;
    3841import org.apache.wicket.markup.html.link.Link;
     42import org.apache.wicket.markup.html.list.ListItem;
     43import org.apache.wicket.markup.html.list.ListView;
    3944import org.apache.wicket.markup.html.panel.GenericPanel;
    4045import org.apache.wicket.markup.repeater.Item;
     
    6065    private final WebMarkupContainer valuesContainer;
    6166    private final IModel<FieldValuesFilter> filterModel;
     67    private final int subListSize;
    6268
    6369    /**
     
    6975     */
    7076    public FacetValuesPanel(String id, final IModel<FacetField> model, final IModel<QueryFacetsSelection> selectionModel) {
     77        this(id, model, selectionModel, 0);
     78    }
     79
     80    /**
     81     * Creates a new panel with selectable values for a single facet
     82     *
     83     * @param id component id
     84     * @param model facet field model for this panel
     85     * @param selectionModel model holding the global query/facet selection
     86     * @param subListSize if large than 0, multiple lists will be generated each
     87     * with a maximum size of this value
     88     */
     89    public FacetValuesPanel(String id, final IModel<FacetField> model, final IModel<QueryFacetsSelection> selectionModel, int subListSize) {
    7190        super(id, model);
    7291        this.selectionModel = selectionModel;
     92        this.subListSize = subListSize;
    7393
    7494        // shared model that holds the string for filtering the values (quick search)
     
    83103
    84104        // create a view for the actual values
    85         valuesContainer.add(createValuesView("facetValues"));
     105        valuesContainer.add(createValuesView("valuesList"));
    86106
    87107        // create a link for showing all values       
     
    122142     * @return data view with value links
    123143     */
    124     private DataView<Count> createValuesView(String id) {
     144    private DataView createValuesView(String id) {
    125145        final FacetFieldValuesProvider valuesProvider = new FacetFieldValuesProvider(getModel(), MAX_NUMBER_OF_FACETS_TO_SHOW, LOW_PRIORITY_VALUES) {
    126146
     
    131151
    132152        };
    133         final DataView<Count> valuesView = new DataView<Count>(id, valuesProvider) {
    134 
    135             @Override
    136             protected void populateItem(final Item<Count> item) {
    137                 addFacetValue("facetSelect", item);
     153        // partition the values according to the specified partition size
     154        final PartitionedDataProvider<Count, FieldValuesOrder> partitionedValuesProvider = new PartitionedDataProvider<FacetField.Count, FieldValuesOrder>(valuesProvider, subListSize);
     155
     156        // create the view for the partitions
     157        final DataView<List<? extends Count>> valuesView = new DataView<List<? extends Count>>(id, partitionedValuesProvider) {
     158
     159            @Override
     160            protected void populateItem(Item<List<? extends Count>> item) {
     161                // create a list view for the values in this partition
     162                item.add(new ListView<Count>("facetValues", item.getModel()) {
     163
     164                    @Override
     165                    protected void populateItem(ListItem<Count> item) {
     166                        addFacetValue("facetSelect", item);
     167                    }
     168                });
    138169            }
    139170        };
     
    147178     * @param item item to add link to
    148179     */
    149     private void addFacetValue(String id, final Item<Count> item) {
     180    private void addFacetValue(String id, final ListItem<Count> item) {
    150181        item.setDefaultModel(new CompoundPropertyModel<Count>(item.getModel()));
    151182
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/provider/FacetFieldValuesProvider.java

    r5126 r5150  
    4747 * @author twagoo
    4848 */
    49 public class FacetFieldValuesProvider extends SortableDataProvider<FacetField.Count, FieldValuesOrder> {
     49public class FacetFieldValuesProvider extends SortableDataProvider<FacetField.Count, FieldValuesOrder> implements ListProvider<FacetField.Count> {
    5050
    5151    private final static Logger logger = LoggerFactory.getLogger(FacetFieldValuesProvider.class);
     
    115115    @Override
    116116    public Iterator<? extends FacetField.Count> iterator(long first, long count) {
    117         final Iterable<Count> filtered = getFilteredValues();
     117        // return iterator starting at specified offset
     118        return getList().listIterator((int) first);
     119    }
     120
     121    @Override
     122    public List<? extends FacetField.Count> getList() {
     123        final Iterable<Count> filteredValues = getFilteredValues();
    118124        // sort what remains
    119         final ImmutableList sorted = getOrdering().immutableSortedCopy(filtered);
     125        final ImmutableList sorted = getOrdering().immutableSortedCopy(filteredValues);
    120126        if (sorted.size() > maxNumberOfItems) {
    121             return sorted.subList(0, maxNumberOfItems).listIterator((int) first);
     127            return sorted.subList(0, maxNumberOfItems);
    122128        } else {
    123129            // return iterator starting at specified offset
    124             return sorted.listIterator((int) first);
     130            return sorted;
    125131        }
    126132    }
Note: See TracChangeset for help on using the changeset viewer.