use of org.olat.admin.landingpages.model.Rule in project openolat by klemens.
the class LandingPagesAdminController method formOK.
@Override
protected void formOK(UserRequest ureq) {
int rowCount = model.getRowCount();
List<Rule> ruleList = new ArrayList<Rule>(rowCount);
for (int i = 0; i < rowCount; i++) {
ruleList.add(model.getObject(i).save());
}
Rules rules = new Rules();
rules.setRules(ruleList);
lpModule.setRules(rules);
}
use of org.olat.admin.landingpages.model.Rule in project openolat by klemens.
the class RuleWrapper method save.
public Rule save() {
Rule sRule = new Rule();
if (roleEl.isOneSelected()) {
sRule.setRole(roleEl.getSelectedKey());
}
if (attrNameEl.isOneSelected()) {
sRule.setUserAttributeKey(attrNameEl.getSelectedKey());
sRule.setUserAttributeValue(attrValueEl.getValue());
}
sRule.setLandingPath(landingPageEl.getValue());
return sRule;
}
use of org.olat.admin.landingpages.model.Rule in project OpenOLAT by OpenOLAT.
the class LandingPagesAdminController method deleteRow.
private void deleteRow(RuleWrapper row) {
List<RuleWrapper> rows = model.getObjects();
rows.remove(row);
if (rows.isEmpty()) {
Rule rule = new Rule();
rows.add(initRuleWrapper(1, rule, flc));
}
model.setObjects(reOrder(rows));
}
use of org.olat.admin.landingpages.model.Rule in project OpenOLAT by OpenOLAT.
the class LandingPagesAdminController method formOK.
@Override
protected void formOK(UserRequest ureq) {
int rowCount = model.getRowCount();
List<Rule> ruleList = new ArrayList<Rule>(rowCount);
for (int i = 0; i < rowCount; i++) {
ruleList.add(model.getObject(i).save());
}
Rules rules = new Rules();
rules.setRules(ruleList);
lpModule.setRules(rules);
}
use of org.olat.admin.landingpages.model.Rule in project OpenOLAT by OpenOLAT.
the class LandingPagesAdminController method addRow.
private void addRow(RuleWrapper row) {
List<RuleWrapper> rows = model.getObjects();
int currentIndex = rows.indexOf(row);
RuleWrapper newRule = initRuleWrapper(1, new Rule(), flc);
if (currentIndex >= 0 && currentIndex < rows.size() - 1) {
rows.add(currentIndex + 1, newRule);
} else {
rows.add(newRule);
}
model.setObjects(reOrder(rows));
}
Aggregations