Search in sources :

Example 1 with FilterRuleSPI

use of org.olat.modules.reminder.FilterRuleSPI in project openolat by klemens.

the class ReminderRuleEngine method filterByRules.

protected void filterByRules(RepositoryEntry entry, List<Identity> identities, List<ReminderRule> ruleList) {
    List<ReminderRule> filterRules = new ArrayList<>(3);
    for (Iterator<ReminderRule> ruleIt = ruleList.iterator(); ruleIt.hasNext(); ) {
        ReminderRule rule = ruleIt.next();
        RuleSPI ruleSpi = reminderModule.getRuleSPIByType(rule.getType());
        if (ruleSpi instanceof FilterRuleSPI) {
            filterRules.add(rule);
            ruleIt.remove();
        }
    }
    for (ReminderRule rule : filterRules) {
        filterByRule(entry, identities, rule);
    }
}
Also used : ReminderRule(org.olat.modules.reminder.ReminderRule) FilterRuleSPI(org.olat.modules.reminder.FilterRuleSPI) RepositoryEntryRoleRuleSPI(org.olat.modules.reminder.rule.RepositoryEntryRoleRuleSPI) UserPropertyRuleSPI(org.olat.modules.reminder.rule.UserPropertyRuleSPI) IdentitiesProviderRuleSPI(org.olat.modules.reminder.IdentitiesProviderRuleSPI) RuleSPI(org.olat.modules.reminder.RuleSPI) RepositoryEntryRuleSPI(org.olat.modules.reminder.RepositoryEntryRuleSPI) BusinessGroupRoleRuleSPI(org.olat.modules.reminder.rule.BusinessGroupRoleRuleSPI) DateRuleSPI(org.olat.modules.reminder.rule.DateRuleSPI) ArrayList(java.util.ArrayList) FilterRuleSPI(org.olat.modules.reminder.FilterRuleSPI)

Example 2 with FilterRuleSPI

use of org.olat.modules.reminder.FilterRuleSPI in project OpenOLAT by OpenOLAT.

the class ReminderRuleEngine method filterByRules.

protected void filterByRules(RepositoryEntry entry, List<Identity> identities, List<ReminderRule> ruleList) {
    List<ReminderRule> filterRules = new ArrayList<>(3);
    for (Iterator<ReminderRule> ruleIt = ruleList.iterator(); ruleIt.hasNext(); ) {
        ReminderRule rule = ruleIt.next();
        RuleSPI ruleSpi = reminderModule.getRuleSPIByType(rule.getType());
        if (ruleSpi instanceof FilterRuleSPI) {
            filterRules.add(rule);
            ruleIt.remove();
        }
    }
    for (ReminderRule rule : filterRules) {
        filterByRule(entry, identities, rule);
    }
}
Also used : ReminderRule(org.olat.modules.reminder.ReminderRule) FilterRuleSPI(org.olat.modules.reminder.FilterRuleSPI) RepositoryEntryRoleRuleSPI(org.olat.modules.reminder.rule.RepositoryEntryRoleRuleSPI) UserPropertyRuleSPI(org.olat.modules.reminder.rule.UserPropertyRuleSPI) IdentitiesProviderRuleSPI(org.olat.modules.reminder.IdentitiesProviderRuleSPI) RuleSPI(org.olat.modules.reminder.RuleSPI) RepositoryEntryRuleSPI(org.olat.modules.reminder.RepositoryEntryRuleSPI) BusinessGroupRoleRuleSPI(org.olat.modules.reminder.rule.BusinessGroupRoleRuleSPI) DateRuleSPI(org.olat.modules.reminder.rule.DateRuleSPI) ArrayList(java.util.ArrayList) FilterRuleSPI(org.olat.modules.reminder.FilterRuleSPI)

Example 3 with FilterRuleSPI

use of org.olat.modules.reminder.FilterRuleSPI in project OpenOLAT by OpenOLAT.

the class ReminderRuleEngine method filterByRule.

public void filterByRule(RepositoryEntry entry, List<Identity> identities, ReminderRule rule) {
    try {
        RuleSPI ruleSpi = reminderModule.getRuleSPIByType(rule.getType());
        if (ruleSpi instanceof FilterRuleSPI) {
            FilterRuleSPI filter = (FilterRuleSPI) ruleSpi;
            filter.filter(entry, identities, rule);
        }
    } catch (Exception e) {
        log.error("", e);
    }
}
Also used : FilterRuleSPI(org.olat.modules.reminder.FilterRuleSPI) RepositoryEntryRoleRuleSPI(org.olat.modules.reminder.rule.RepositoryEntryRoleRuleSPI) UserPropertyRuleSPI(org.olat.modules.reminder.rule.UserPropertyRuleSPI) IdentitiesProviderRuleSPI(org.olat.modules.reminder.IdentitiesProviderRuleSPI) RuleSPI(org.olat.modules.reminder.RuleSPI) RepositoryEntryRuleSPI(org.olat.modules.reminder.RepositoryEntryRuleSPI) BusinessGroupRoleRuleSPI(org.olat.modules.reminder.rule.BusinessGroupRoleRuleSPI) DateRuleSPI(org.olat.modules.reminder.rule.DateRuleSPI) FilterRuleSPI(org.olat.modules.reminder.FilterRuleSPI)

Example 4 with FilterRuleSPI

use of org.olat.modules.reminder.FilterRuleSPI in project openolat by klemens.

the class ReminderRuleEngine method filterByRule.

public void filterByRule(RepositoryEntry entry, List<Identity> identities, ReminderRule rule) {
    try {
        RuleSPI ruleSpi = reminderModule.getRuleSPIByType(rule.getType());
        if (ruleSpi instanceof FilterRuleSPI) {
            FilterRuleSPI filter = (FilterRuleSPI) ruleSpi;
            filter.filter(entry, identities, rule);
        }
    } catch (Exception e) {
        log.error("", e);
    }
}
Also used : FilterRuleSPI(org.olat.modules.reminder.FilterRuleSPI) RepositoryEntryRoleRuleSPI(org.olat.modules.reminder.rule.RepositoryEntryRoleRuleSPI) UserPropertyRuleSPI(org.olat.modules.reminder.rule.UserPropertyRuleSPI) IdentitiesProviderRuleSPI(org.olat.modules.reminder.IdentitiesProviderRuleSPI) RuleSPI(org.olat.modules.reminder.RuleSPI) RepositoryEntryRuleSPI(org.olat.modules.reminder.RepositoryEntryRuleSPI) BusinessGroupRoleRuleSPI(org.olat.modules.reminder.rule.BusinessGroupRoleRuleSPI) DateRuleSPI(org.olat.modules.reminder.rule.DateRuleSPI) FilterRuleSPI(org.olat.modules.reminder.FilterRuleSPI)

Aggregations

FilterRuleSPI (org.olat.modules.reminder.FilterRuleSPI)4 IdentitiesProviderRuleSPI (org.olat.modules.reminder.IdentitiesProviderRuleSPI)4 RepositoryEntryRuleSPI (org.olat.modules.reminder.RepositoryEntryRuleSPI)4 RuleSPI (org.olat.modules.reminder.RuleSPI)4 BusinessGroupRoleRuleSPI (org.olat.modules.reminder.rule.BusinessGroupRoleRuleSPI)4 DateRuleSPI (org.olat.modules.reminder.rule.DateRuleSPI)4 RepositoryEntryRoleRuleSPI (org.olat.modules.reminder.rule.RepositoryEntryRoleRuleSPI)4 UserPropertyRuleSPI (org.olat.modules.reminder.rule.UserPropertyRuleSPI)4 ArrayList (java.util.ArrayList)2 ReminderRule (org.olat.modules.reminder.ReminderRule)2