Changeset 4989


Ignore:
Timestamp:
04/16/14 10:06:59 (10 years ago)
Author:
Twan Goosen
Message:

reduced number of calls to get document set size by caching it within request

File:
1 edited

Legend:

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

    r4661 r4989  
    3636    private final IModel<QueryFacetsSelection> selectionModel;
    3737
     38    private Long size;
     39
    3840    public SolrDocumentProvider(IModel<QueryFacetsSelection> selection) {
    3941        this.selectionModel = selection;
     
    5052    @Override
    5153    public long size() {
    52         return getDocumentService().getDocumentCount(selectionModel.getObject());
     54        if (size == null) {
     55            size = getDocumentService().getDocumentCount(selectionModel.getObject());
     56        }
     57        return size;
    5358    }
    5459
     
    6166    public void detach() {
    6267        selectionModel.detach();
     68        size = null;
    6369    }
    6470
Note: See TracChangeset for help on using the changeset viewer.