Search in sources :

Example 1 with MemberView

use of org.olat.group.ui.main.MemberView in project OpenOLAT by OpenOLAT.

the class MembersTableController method getMembersFromIdentity.

private List<MemberView> getMembersFromIdentity(UserRequest ureq, List<Identity> identities, Map<Long, BusinessGroupMembership> groupmemberships, Map<Long, Date> recentLaunches, Map<Long, Date> initialLaunches) {
    if (!deduplicateList) {
        duplicateCatcher = new HashSet<>();
    }
    List<MemberView> memberList = new ArrayList<>();
    for (Identity identity : identities) {
        MemberView member = new MemberView(identity, userPropertyHandlers, getLocale());
        if (userLastTimeVisible) {
            if (repoEntry == null) {
                BusinessGroupMembership groupmembership = groupmemberships.get(identity.getKey());
                if (groupmembership != null) {
                    member.setFirstTime(groupmembership.getCreationDate());
                    member.setLastTime(groupmembership.getLastModified());
                }
            } else {
                member.setFirstTime(initialLaunches.get(identity.getKey()));
                member.setLastTime(recentLaunches.get(identity.getKey()));
            }
        }
        if (!duplicateCatcher.contains(member)) {
            memberList.add(member);
            if (!identity.equals(ureq.getIdentity())) {
                forgeChatLink(member);
            }
        }
        duplicateCatcher.add(member);
    }
    return memberList;
}
Also used : BusinessGroupMembership(org.olat.group.BusinessGroupMembership) ArrayList(java.util.ArrayList) Identity(org.olat.core.id.Identity) MemberView(org.olat.group.ui.main.MemberView)

Example 2 with MemberView

use of org.olat.group.ui.main.MemberView in project openolat by klemens.

the class MembersTableController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source == membersTable) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            if ("vcard".equals(cmd)) {
                MemberView row = membersModel.getObject(se.getIndex());
                doOpenHomePage(row, ureq);
            } else if ("email".equals(cmd)) {
                MemberView row = membersModel.getObject(se.getIndex());
                doSendEmailToMember(row, ureq);
            }
        }
    } else if (source instanceof FormLink) {
        FormLink link = (FormLink) source;
        String cmd = link.getCmd();
        MemberView row = (MemberView) link.getUserObject();
        if ("im".equals(cmd)) {
            doOpenChat(row, ureq);
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink) MemberView(org.olat.group.ui.main.MemberView)

Example 3 with MemberView

use of org.olat.group.ui.main.MemberView in project OpenOLAT by OpenOLAT.

the class MembersTableController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source == membersTable) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            if ("vcard".equals(cmd)) {
                MemberView row = membersModel.getObject(se.getIndex());
                doOpenHomePage(row, ureq);
            } else if ("email".equals(cmd)) {
                MemberView row = membersModel.getObject(se.getIndex());
                doSendEmailToMember(row, ureq);
            }
        }
    } else if (source instanceof FormLink) {
        FormLink link = (FormLink) source;
        String cmd = link.getCmd();
        MemberView row = (MemberView) link.getUserObject();
        if ("im".equals(cmd)) {
            doOpenChat(row, ureq);
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink) MemberView(org.olat.group.ui.main.MemberView)

Example 4 with MemberView

use of org.olat.group.ui.main.MemberView in project openolat by klemens.

the class MembersTableController method getMembersFromIdentity.

private List<MemberView> getMembersFromIdentity(UserRequest ureq, List<Identity> identities, Map<Long, BusinessGroupMembership> groupmemberships, Map<Long, Date> recentLaunches, Map<Long, Date> initialLaunches) {
    if (!deduplicateList) {
        duplicateCatcher = new HashSet<>();
    }
    List<MemberView> memberList = new ArrayList<>();
    for (Identity identity : identities) {
        MemberView member = new MemberView(identity, userPropertyHandlers, getLocale());
        if (userLastTimeVisible) {
            if (repoEntry == null) {
                BusinessGroupMembership groupmembership = groupmemberships.get(identity.getKey());
                if (groupmembership != null) {
                    member.setFirstTime(groupmembership.getCreationDate());
                    member.setLastTime(groupmembership.getLastModified());
                }
            } else {
                member.setFirstTime(initialLaunches.get(identity.getKey()));
                member.setLastTime(recentLaunches.get(identity.getKey()));
            }
        }
        if (!duplicateCatcher.contains(member)) {
            memberList.add(member);
            if (!identity.equals(ureq.getIdentity())) {
                forgeChatLink(member);
            }
        }
        duplicateCatcher.add(member);
    }
    return memberList;
}
Also used : BusinessGroupMembership(org.olat.group.BusinessGroupMembership) ArrayList(java.util.ArrayList) Identity(org.olat.core.id.Identity) MemberView(org.olat.group.ui.main.MemberView)

Aggregations

MemberView (org.olat.group.ui.main.MemberView)4 ArrayList (java.util.ArrayList)2 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)2 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)2 Identity (org.olat.core.id.Identity)2 BusinessGroupMembership (org.olat.group.BusinessGroupMembership)2