use of org.olat.portfolio.model.EPFilterSettings in project openolat by klemens.
the class EPArtefactPoolRunController method initTPAllView.
private void initTPAllView(UserRequest ureq) {
filterSettings = new EPFilterSettings();
List<AbstractArtefact> artefacts = ePFMgr.getArtefactPoolForUser(getIdentity());
initMultiArtefactCtrl(ureq, artefacts);
initFilterPanel(ureq, Filter.read_only);
setSegmentContent(artCtrl);
addToHistory(ureq, OresHelper.createOLATResourceableType("All"), null);
}
use of org.olat.portfolio.model.EPFilterSettings in project openolat by klemens.
the class PortfolioFilterController method initFilterList.
private void initFilterList(FormItemContainer formLayout) {
List<EPFilterSettings> existingFilters = ePFMgr.getSavedFilterSettings(getIdentity());
for (Iterator<EPFilterSettings> existingFilterIt = existingFilters.iterator(); existingFilterIt.hasNext(); ) {
if (existingFilterIt.next().isFilterEmpty()) {
existingFilterIt.remove();
}
}
int amount = existingFilters.size() + 1;
nonEmptyFilters = new ArrayList<EPFilterSettings>(amount);
String[] theKeys = new String[amount];
String[] theValues = new String[amount];
String presetFilterIndex = theKeys[0] = "0";
theValues[0] = translate("filter.all");
int i = 1;
String presetFilterID = filterSettings.getFilterId();
for (EPFilterSettings epFilterSettings : existingFilters) {
theKeys[i] = epFilterSettings.getFilterId();
theValues[i] = epFilterSettings.getFilterName();
if (presetFilterID != null && presetFilterID.equals(epFilterSettings.getFilterId())) {
presetFilterIndex = epFilterSettings.getFilterId();
}
nonEmptyFilters.add(epFilterSettings);
i++;
}
// don't show anything if no filter exists
if (!nonEmptyFilters.isEmpty()) {
if (formLayout.getFormComponent("filter.select") == null) {
filterSel = uifactory.addDropdownSingleselect("filter.select", formLayout, theKeys, theValues, null);
filterSel.addActionListener(FormEvent.ONCHANGE);
} else {
filterSel.setKeysAndValues(theKeys, theValues, null);
filterSel.setVisible(true);
}
if (presetFilterIndex != null) {
filterSel.select(presetFilterIndex, true);
}
} else if (formLayout.getFormComponent("filter.select") != null) {
formLayout.getFormComponent("filter.select").setVisible(false);
}
}
Aggregations