Search in sources :

Example 6 with SearchMembersParams

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

the class MemberSearchForm method fireSearchEvent.

private void fireSearchEvent(UserRequest ureq) {
    SearchMembersParams params = new SearchMembersParams();
    // roles
    Collection<String> selectedKeys = rolesEl.getSelectedKeys();
    params.setRepoOwners(selectedKeys.contains("owner"));
    params.setRepoTutors(selectedKeys.contains("tutor"));
    params.setGroupTutors(selectedKeys.contains("tutor"));
    params.setRepoParticipants(selectedKeys.contains("attendee"));
    params.setGroupParticipants(selectedKeys.contains("attendee"));
    params.setGroupWaitingList(selectedKeys.contains("waiting"));
    // origin
    if (!originEl.isOneSelected() || originEl.isSelected(0)) {
        params.setRepoOrigin(true);
        params.setGroupOrigin(true);
    } else if (originEl.isSelected(1)) {
        params.setRepoOrigin(true);
        params.setGroupOrigin(false);
    } else if (originEl.isSelected(2)) {
        params.setRepoOrigin(false);
        params.setGroupOrigin(true);
    }
    String loginVal = login.getValue();
    if (StringHelper.containsNonWhitespace(loginVal)) {
        params.setLogin(loginVal);
    }
    // user properties
    Map<String, String> userPropertiesSearch = new HashMap<String, String>();
    for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
        if (userPropertyHandler == null)
            continue;
        FormItem ui = propFormItems.get(userPropertyHandler.getName());
        String uiValue = userPropertyHandler.getStringValue(ui);
        if (StringHelper.containsNonWhitespace(uiValue)) {
            userPropertiesSearch.put(userPropertyHandler.getName(), uiValue);
        }
    }
    if (!userPropertiesSearch.isEmpty()) {
        params.setUserPropertiesSearch(userPropertiesSearch);
    }
    fireEvent(ureq, params);
}
Also used : HashMap(java.util.HashMap) FormItem(org.olat.core.gui.components.form.flexible.FormItem) SearchMembersParams(org.olat.group.ui.main.SearchMembersParams) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler)

Example 7 with SearchMembersParams

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

the class MembersOverviewController method updateParticipants.

private AbstractMemberListController updateParticipants(UserRequest ureq) {
    if (participantsCtrl == null) {
        OLATResourceable ores = OresHelper.createOLATResourceableInstance(SEG_PARTICIPANTS_MEMBERS, 0l);
        ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
        WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
        SearchMembersParams searchParams = new SearchMembersParams(false, false, true, false, true, false, true);
        String infos = translate("participants.infos");
        participantsCtrl = new MemberListWithOriginFilterController(ureq, bwControl, toolbarPanel, repoEntry, coachCourseEnv, searchParams, infos);
        listenTo(participantsCtrl);
    }
    participantsCtrl.reloadModel();
    participantsCtrl.overrideManaged(ureq, overrideManaged);
    mainVC.put("membersCmp", participantsCtrl.getInitialComponent());
    addToHistory(ureq, participantsCtrl);
    return participantsCtrl;
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) SearchMembersParams(org.olat.group.ui.main.SearchMembersParams) WindowControl(org.olat.core.gui.control.WindowControl)

Example 8 with SearchMembersParams

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

the class MembersOverviewController method updateTutors.

private AbstractMemberListController updateTutors(UserRequest ureq) {
    if (tutorsCtrl == null) {
        OLATResourceable ores = OresHelper.createOLATResourceableInstance(SEG_TUTORS_MEMBERS, 0l);
        ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
        WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
        SearchMembersParams searchParams = new SearchMembersParams(false, true, false, true, false, false, false);
        String infos = translate("tutors.infos");
        tutorsCtrl = new MemberListWithOriginFilterController(ureq, bwControl, toolbarPanel, repoEntry, coachCourseEnv, searchParams, infos);
        listenTo(tutorsCtrl);
    }
    tutorsCtrl.reloadModel();
    tutorsCtrl.overrideManaged(ureq, overrideManaged);
    mainVC.put("membersCmp", tutorsCtrl.getInitialComponent());
    addToHistory(ureq, tutorsCtrl);
    return tutorsCtrl;
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) SearchMembersParams(org.olat.group.ui.main.SearchMembersParams) WindowControl(org.olat.core.gui.control.WindowControl)

Example 9 with SearchMembersParams

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

the class MemberSearchForm method fireSearchEvent.

private void fireSearchEvent(UserRequest ureq) {
    SearchMembersParams params = new SearchMembersParams();
    // roles
    Collection<String> selectedKeys = rolesEl.getSelectedKeys();
    params.setRepoOwners(selectedKeys.contains("owner"));
    params.setRepoTutors(selectedKeys.contains("tutor"));
    params.setGroupTutors(selectedKeys.contains("tutor"));
    params.setRepoParticipants(selectedKeys.contains("attendee"));
    params.setGroupParticipants(selectedKeys.contains("attendee"));
    params.setGroupWaitingList(selectedKeys.contains("waiting"));
    // origin
    if (!originEl.isOneSelected() || originEl.isSelected(0)) {
        params.setRepoOrigin(true);
        params.setGroupOrigin(true);
    } else if (originEl.isSelected(1)) {
        params.setRepoOrigin(true);
        params.setGroupOrigin(false);
    } else if (originEl.isSelected(2)) {
        params.setRepoOrigin(false);
        params.setGroupOrigin(true);
    }
    String loginVal = login.getValue();
    if (StringHelper.containsNonWhitespace(loginVal)) {
        params.setLogin(loginVal);
    }
    // user properties
    Map<String, String> userPropertiesSearch = new HashMap<String, String>();
    for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
        if (userPropertyHandler == null)
            continue;
        FormItem ui = propFormItems.get(userPropertyHandler.getName());
        String uiValue = userPropertyHandler.getStringValue(ui);
        if (StringHelper.containsNonWhitespace(uiValue)) {
            userPropertiesSearch.put(userPropertyHandler.getName(), uiValue);
        }
    }
    if (!userPropertiesSearch.isEmpty()) {
        params.setUserPropertiesSearch(userPropertiesSearch);
    }
    fireEvent(ureq, params);
}
Also used : HashMap(java.util.HashMap) FormItem(org.olat.core.gui.components.form.flexible.FormItem) SearchMembersParams(org.olat.group.ui.main.SearchMembersParams) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler)

Example 10 with SearchMembersParams

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

the class MembersOverviewController method updateAllMembers.

private AbstractMemberListController updateAllMembers(UserRequest ureq) {
    if (allMemberListCtrl == null) {
        OLATResourceable ores = OresHelper.createOLATResourceableInstance(SEG_ALL_MEMBERS, 0l);
        ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
        WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
        SearchMembersParams searchParams = new SearchMembersParams(true, true, true, true, true, false, true);
        allMemberListCtrl = new MemberListWithOriginFilterController(ureq, bwControl, toolbarPanel, repoEntry, coachCourseEnv, searchParams, null);
        listenTo(allMemberListCtrl);
    }
    allMemberListCtrl.reloadModel();
    allMemberListCtrl.overrideManaged(ureq, overrideManaged);
    mainVC.put("membersCmp", allMemberListCtrl.getInitialComponent());
    addToHistory(ureq, allMemberListCtrl);
    return allMemberListCtrl;
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) SearchMembersParams(org.olat.group.ui.main.SearchMembersParams) WindowControl(org.olat.core.gui.control.WindowControl)

Aggregations

SearchMembersParams (org.olat.group.ui.main.SearchMembersParams)12 WindowControl (org.olat.core.gui.control.WindowControl)10 OLATResourceable (org.olat.core.id.OLATResourceable)10 AbstractMemberListController (org.olat.group.ui.main.AbstractMemberListController)4 HashMap (java.util.HashMap)2 FormItem (org.olat.core.gui.components.form.flexible.FormItem)2 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)2