Search in sources :

Example 1 with LectureStatisticsSearchParameters

use of org.olat.modules.lecture.model.LectureStatisticsSearchParameters in project OpenOLAT by OpenOLAT.

the class LecturesSearchController method doSearch.

private void doSearch(UserRequest ureq) {
    LectureStatisticsSearchParameters params = searchForm.getSearchParameters();
    List<UserPropertyHandler> userPropertyHandlers = searchForm.getUserPropertyHandlers();
    List<LectureBlockIdentityStatistics> statistics = lectureService.getLecturesStatistics(params, userPropertyHandlers, getIdentity(), admin);
    Set<Long> identities = statistics.stream().map(LectureBlockIdentityStatistics::getIdentityKey).collect(Collectors.toSet());
    Controller ctrl;
    if (identities.size() <= 1) {
        listCtrl = new LecturesListController(ureq, getWindowControl(), statistics, userPropertyHandlers, LecturesSearchFormController.PROPS_IDENTIFIER, true, true);
        listenTo(listCtrl);
        ctrl = listCtrl;
    } else {
        multipleUsersCtrl = new LecturesListSegmentController(ureq, getWindowControl(), statistics, userPropertyHandlers, LecturesSearchFormController.PROPS_IDENTIFIER);
        listenTo(multipleUsersCtrl);
        ctrl = multipleUsersCtrl;
    }
    stackPanel.popUpToRootController(ureq);
    stackPanel.pushController(translate("results"), ctrl);
}
Also used : LectureStatisticsSearchParameters(org.olat.modules.lecture.model.LectureStatisticsSearchParameters) LectureBlockIdentityStatistics(org.olat.modules.lecture.model.LectureBlockIdentityStatistics) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController) LectureRepositoryAdminController(org.olat.modules.lecture.ui.LectureRepositoryAdminController) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler)

Example 2 with LectureStatisticsSearchParameters

use of org.olat.modules.lecture.model.LectureStatisticsSearchParameters in project OpenOLAT by OpenOLAT.

the class LecturesSearchFormController method getSearchParameters.

public LectureStatisticsSearchParameters getSearchParameters() {
    LectureStatisticsSearchParameters params = new LectureStatisticsSearchParameters();
    String type = dateTypesEl.getSelectedKey();
    if ("none".equals(type)) {
        params.setStartDate(null);
        params.setEndDate(null);
        params.setLifecycle(null);
    } else if ("public".equals(type)) {
        params.setStartDate(null);
        params.setEndDate(null);
        if (publicDatesEl.isOneSelected() && StringHelper.isLong(publicDatesEl.getSelectedKey())) {
            RepositoryEntryLifecycle lifecycle = lifecycleDao.loadById(new Long(publicDatesEl.getSelectedKey()));
            params.setLifecycle(lifecycle);
        } else {
            params.setLifecycle(null);
        }
    } else if ("private".equals(type)) {
        params.setStartDate(startDateEl.getDate());
        params.setEndDate(endDateEl.getDate());
        params.setLifecycle(null);
    }
    params.setLogin(getLogin());
    params.setBulkIdentifiers(getBulkIdentifiers());
    params.setUserProperties(getSearchProperties());
    return params;
}
Also used : RepositoryEntryLifecycle(org.olat.repository.model.RepositoryEntryLifecycle) LectureStatisticsSearchParameters(org.olat.modules.lecture.model.LectureStatisticsSearchParameters)

Example 3 with LectureStatisticsSearchParameters

use of org.olat.modules.lecture.model.LectureStatisticsSearchParameters in project openolat by klemens.

the class LecturesSearchController method doSearch.

private void doSearch(UserRequest ureq) {
    LectureStatisticsSearchParameters params = searchForm.getSearchParameters();
    List<UserPropertyHandler> userPropertyHandlers = searchForm.getUserPropertyHandlers();
    List<LectureBlockIdentityStatistics> statistics = lectureService.getLecturesStatistics(params, userPropertyHandlers, getIdentity(), admin);
    Set<Long> identities = statistics.stream().map(LectureBlockIdentityStatistics::getIdentityKey).collect(Collectors.toSet());
    Controller ctrl;
    if (identities.size() <= 1) {
        listCtrl = new LecturesListController(ureq, getWindowControl(), statistics, userPropertyHandlers, LecturesSearchFormController.PROPS_IDENTIFIER, true, true);
        listenTo(listCtrl);
        ctrl = listCtrl;
    } else {
        multipleUsersCtrl = new LecturesListSegmentController(ureq, getWindowControl(), statistics, userPropertyHandlers, LecturesSearchFormController.PROPS_IDENTIFIER);
        listenTo(multipleUsersCtrl);
        ctrl = multipleUsersCtrl;
    }
    stackPanel.popUpToRootController(ureq);
    stackPanel.pushController(translate("results"), ctrl);
}
Also used : LectureStatisticsSearchParameters(org.olat.modules.lecture.model.LectureStatisticsSearchParameters) LectureBlockIdentityStatistics(org.olat.modules.lecture.model.LectureBlockIdentityStatistics) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController) LectureRepositoryAdminController(org.olat.modules.lecture.ui.LectureRepositoryAdminController) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler)

Example 4 with LectureStatisticsSearchParameters

use of org.olat.modules.lecture.model.LectureStatisticsSearchParameters in project openolat by klemens.

the class LecturesSearchFormController method getSearchParameters.

public LectureStatisticsSearchParameters getSearchParameters() {
    LectureStatisticsSearchParameters params = new LectureStatisticsSearchParameters();
    String type = dateTypesEl.getSelectedKey();
    if ("none".equals(type)) {
        params.setStartDate(null);
        params.setEndDate(null);
        params.setLifecycle(null);
    } else if ("public".equals(type)) {
        params.setStartDate(null);
        params.setEndDate(null);
        if (publicDatesEl.isOneSelected() && StringHelper.isLong(publicDatesEl.getSelectedKey())) {
            RepositoryEntryLifecycle lifecycle = lifecycleDao.loadById(new Long(publicDatesEl.getSelectedKey()));
            params.setLifecycle(lifecycle);
        } else {
            params.setLifecycle(null);
        }
    } else if ("private".equals(type)) {
        params.setStartDate(startDateEl.getDate());
        params.setEndDate(endDateEl.getDate());
        params.setLifecycle(null);
    }
    params.setLogin(getLogin());
    params.setBulkIdentifiers(getBulkIdentifiers());
    params.setUserProperties(getSearchProperties());
    return params;
}
Also used : RepositoryEntryLifecycle(org.olat.repository.model.RepositoryEntryLifecycle) LectureStatisticsSearchParameters(org.olat.modules.lecture.model.LectureStatisticsSearchParameters)

Aggregations

LectureStatisticsSearchParameters (org.olat.modules.lecture.model.LectureStatisticsSearchParameters)4 Controller (org.olat.core.gui.control.Controller)2 BasicController (org.olat.core.gui.control.controller.BasicController)2 LectureBlockIdentityStatistics (org.olat.modules.lecture.model.LectureBlockIdentityStatistics)2 LectureRepositoryAdminController (org.olat.modules.lecture.ui.LectureRepositoryAdminController)2 RepositoryEntryLifecycle (org.olat.repository.model.RepositoryEntryLifecycle)2 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)2