changes in keyword data provider to match new params
This commit is contained in:
parent
a29ca62bae
commit
e21b6c7039
@ -5,6 +5,7 @@ import java.util.Iterator;
|
|||||||
import org.apache.wicket.spring.injection.annot.SpringBean;
|
import org.apache.wicket.spring.injection.annot.SpringBean;
|
||||||
|
|
||||||
import se.su.dsv.scipro.data.dao.interfaces.Dao;
|
import se.su.dsv.scipro.data.dao.interfaces.Dao;
|
||||||
|
import se.su.dsv.scipro.data.dao.interfaces.Dao.SortableParams.Sort;
|
||||||
import se.su.dsv.scipro.dataproviders.SortSpecifier;
|
import se.su.dsv.scipro.dataproviders.SortSpecifier;
|
||||||
import se.su.dsv.scipro.dataproviders.SortableDataProvider;
|
import se.su.dsv.scipro.dataproviders.SortableDataProvider;
|
||||||
import se.su.dsv.scipro.match.dao.interfaces.KeywordDao;
|
import se.su.dsv.scipro.match.dao.interfaces.KeywordDao;
|
||||||
@ -15,29 +16,34 @@ public class KeywordsDataProvider extends SortableDataProvider<Keyword>{
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private KeywordType keywordType = null;
|
|
||||||
|
|
||||||
@SpringBean
|
@SpringBean
|
||||||
protected KeywordDao keywordDao;
|
protected KeywordDao keywordDao;
|
||||||
|
private KeywordDao.Params params;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Dao<Keyword> getDao() {
|
protected Dao<Keyword> getDao() {
|
||||||
return keywordDao;
|
return keywordDao;
|
||||||
}
|
}
|
||||||
|
|
||||||
public KeywordsDataProvider(final SortSpecifier sortSpecifier, KeywordType keywordType) {
|
public KeywordsDataProvider(KeywordType keywordType, boolean includeDeleted) {
|
||||||
|
this(null, keywordType, includeDeleted);
|
||||||
|
}
|
||||||
|
|
||||||
|
public KeywordsDataProvider(final SortSpecifier sortSpecifier, KeywordType keywordType, boolean includeDeleted) {
|
||||||
super(sortSpecifier, Keyword.class);
|
super(sortSpecifier, Keyword.class);
|
||||||
this.keywordType = keywordType;
|
params = new KeywordDao.Params();
|
||||||
|
params.setIncludeDeleted(includeDeleted);
|
||||||
|
params.setType(keywordType);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Iterator<Keyword> iterator(int first, int count) {
|
public Iterator<Keyword> iterator(int first, int count) {
|
||||||
Iterator<Keyword> iter = keywordDao.getKeywords(keywordType, true).iterator();
|
Iterator<Keyword> iter = keywordDao.getKeywordList(params).iterator();
|
||||||
return iter;
|
return iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int size() {
|
public int size() {
|
||||||
return keywordDao.getKeywords(keywordType, true).size();
|
return keywordDao.getKeywordList(params).size();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user