use of org.olat.group.model.BusinessGroupMembershipChange in project openolat by klemens.
the class BusinessGroupMembersController method addMembers.
private void addMembers(StepsRunContext runContext) {
@SuppressWarnings("unchecked") List<Identity> members = (List<Identity>) runContext.get("members");
MemberPermissionChangeEvent changes = (MemberPermissionChangeEvent) runContext.get("permissions");
// commit all changes to the group memberships
List<BusinessGroupMembershipChange> allModifications = changes.generateBusinessGroupMembershipChange(members);
MailTemplate template = (MailTemplate) runContext.get("mailTemplate");
MailPackage mailing = new MailPackage(template, getWindowControl().getBusinessControl().getAsString(), template != null);
businessGroupService.updateMemberships(getIdentity(), allModifications, mailing);
MailHelper.printErrorsAndWarnings(mailing.getResult(), getWindowControl(), false, getLocale());
}
use of org.olat.group.model.BusinessGroupMembershipChange in project openolat by klemens.
the class MemberPermissionChangeEvent method generateBusinessGroupMembershipChange.
public List<BusinessGroupMembershipChange> generateBusinessGroupMembershipChange(List<Identity> members) {
if (members == null || members.isEmpty()) {
return Collections.emptyList();
}
List<BusinessGroupMembershipChange> grChanges = getGroupChanges();
if (grChanges == null || grChanges.isEmpty()) {
return Collections.emptyList();
}
List<BusinessGroupMembershipChange> allModifications = new ArrayList<BusinessGroupMembershipChange>();
for (BusinessGroupMembershipChange grChange : grChanges) {
for (Identity member : members) {
allModifications.add(new BusinessGroupMembershipChange(member, grChange));
}
}
return allModifications;
}
Aggregations