use of org.olat.core.gui.media.MediaResource in project OpenOLAT by OpenOLAT.
the class OAuthAuthenticationController method redirect.
private void redirect(UserRequest ureq, OAuthSPI provider) {
HttpSession session = ureq.getHttpReq().getSession();
MediaResource redirectResource = new OAuthResource(provider, session);
ureq.getDispatchResult().setResultingMediaResource(redirectResource);
}
use of org.olat.core.gui.media.MediaResource in project OpenOLAT by OpenOLAT.
the class TableOfContentController method doExportBinderAsPdf.
private void doExportBinderAsPdf(UserRequest ureq) {
MediaResource resource = new ExportBinderAsPDFResource(binder, ureq, getLocale());
ureq.getDispatchResult().setResultingMediaResource(resource);
}
use of org.olat.core.gui.media.MediaResource in project OpenOLAT by OpenOLAT.
the class MembersExportManager method getXlsMediaResource.
public MediaResource getXlsMediaResource(boolean showOwners, boolean showCoaches, boolean showParticipants, boolean showWaiting, List<Identity> owners, List<Identity> coaches, List<Identity> participants, List<Identity> waiting, Translator translator, List<UserPropertyHandler> userPropertyHandlers, RepositoryEntry repoEntry, BusinessGroup businessGroup) {
// TODO
Map<Long, BusinessGroupMembership> groupmemberships;
Map<Long, RepositoryEntryMembership> repomemberships;
if (repoEntry == null) {
List<BusinessGroup> groups = new ArrayList<>();
groups.add(businessGroup);
groupmemberships = getGroupMembershipMap(groups);
repomemberships = new HashMap<>();
} else {
repomemberships = getRepoMembershipMap(repoEntry);
List<BusinessGroup> groups = businessGroupService.findBusinessGroups(null, repoEntry, 0, -1);
groupmemberships = getGroupMembershipMap(groups);
}
List<List<Identity>> roleMembers = new ArrayList<>();
if (showOwners) {
roleMembers.add(owners);
}
if (showCoaches) {
roleMembers.add(coaches);
}
if (showParticipants) {
roleMembers.add(participants);
}
if (showWaiting) {
roleMembers.add(waiting);
}
Translator repoTranslator = Util.createPackageTranslator(Member.class, translator.getLocale());
Translator groupTranslator = Util.createPackageTranslator(GroupMembersRunController.class, translator.getLocale());
Map<Identity, StringBuilder> membersMap = new HashMap<>();
List<Identity> rows = new ArrayList<>();
for (List<Identity> membersList : roleMembers) {
for (Identity member : membersList) {
Long memberKey = member.getKey();
if (repomemberships != null && !repomemberships.isEmpty() && repomemberships.containsKey(memberKey)) {
RepositoryEntryMembership repomembership = repomemberships.get(memberKey);
if (repomembership.isOwner()) {
putRoleToMember(rows, membersMap, member, "owners", repoTranslator);
}
if (repomembership.isCoach()) {
putRoleToMember(rows, membersMap, member, "coaches", repoTranslator);
}
if (repomembership.isParticipant()) {
putRoleToMember(rows, membersMap, member, "participants", repoTranslator);
}
}
if (groupmemberships != null && !groupmemberships.isEmpty() && groupmemberships.containsKey(memberKey)) {
BusinessGroupMembership groupmembership = groupmemberships.get(memberKey);
if (groupmembership.isOwner()) {
putRoleToMember(rows, membersMap, member, "coaches", groupTranslator);
}
if (groupmembership.isParticipant()) {
putRoleToMember(rows, membersMap, member, "participants", groupTranslator);
}
if (groupmembership.isWaiting()) {
putRoleToMember(rows, membersMap, member, "waiting", groupTranslator);
}
}
}
}
Translator handlerTranslator = userManager.getPropertyHandlerTranslator(translator);
XlsMembersExport exporter = new XlsMembersExport();
MediaResource resource = exporter.export(rows, membersMap, handlerTranslator, userPropertyHandlers);
return resource;
}
use of org.olat.core.gui.media.MediaResource in project OpenOLAT by OpenOLAT.
the class MembersAvatarDisplayRunController method doExport.
private void doExport(UserRequest ureq) {
MediaResource resource = exportManager.getXlsMediaResource(showOwners, showCoaches, showParticipants, showWaiting, owners, coaches, participants, waiting, getTranslator(), userPropertyHandlers, repoEntry, businessGroup);
ureq.getDispatchResult().setResultingMediaResource(resource);
}
use of org.olat.core.gui.media.MediaResource in project OpenOLAT by OpenOLAT.
the class MembersListDisplayRunController method doExport.
private void doExport(UserRequest ureq) {
MediaResource resource = exportManager.getXlsMediaResource(showOwners, showCoaches, showParticipants, showWaiting, owners, coaches, participants, waiting, getTranslator(), userPropertyHandlers, repoEntry, businessGroup);
ureq.getDispatchResult().setResultingMediaResource(resource);
}
Aggregations