Search in sources :

Example 1 with LecturesSearchController

use of org.olat.modules.lecture.ui.coach.LecturesSearchController in project OpenOLAT by OpenOLAT.

the class CoachMainController method selectMenuItem.

private Activateable2 selectMenuItem(UserRequest ureq, String cmd) {
    Controller selectedCtrl = null;
    if ("members".equalsIgnoreCase(cmd) || "students".equalsIgnoreCase(cmd)) {
        if (studentListCtrl == null) {
            OLATResourceable ores = OresHelper.createOLATResourceableInstance("Members", 0l);
            ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
            WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
            studentListCtrl = new StudentListController(ureq, bwControl, content);
            listenTo(studentListCtrl);
        }
        selectedCtrl = studentListCtrl;
    } else if ("groups".equalsIgnoreCase(cmd)) {
        if (groupListCtrl == null) {
            OLATResourceable ores = OresHelper.createOLATResourceableInstance("Groups", 0l);
            ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
            WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
            groupListCtrl = new GroupListController(ureq, bwControl, content);
            listenTo(groupListCtrl);
        }
        selectedCtrl = groupListCtrl;
    } else if ("courses".equalsIgnoreCase(cmd)) {
        if (courseListCtrl == null) {
            OLATResourceable ores = OresHelper.createOLATResourceableInstance("Courses", 0l);
            ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
            WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
            courseListCtrl = new CourseListController(ureq, bwControl, content);
            listenTo(courseListCtrl);
        }
        selectedCtrl = courseListCtrl;
    } else if ("lectures".equalsIgnoreCase(cmd)) {
        if (lecturesSearchCtrl == null) {
            OLATResourceable ores = OresHelper.createOLATResourceableInstance("Lectures", 0l);
            ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
            WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
            lecturesSearchCtrl = new LecturesSearchController(ureq, bwControl, content);
            listenTo(lecturesSearchCtrl);
        }
        selectedCtrl = lecturesSearchCtrl;
    } else if ("search".equalsIgnoreCase(cmd)) {
        if (userSearchCtrl == null) {
            OLATResourceable ores = OresHelper.createOLATResourceableInstance("Search", 0l);
            ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
            WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
            userSearchCtrl = new UserSearchController(ureq, bwControl, content);
            listenTo(userSearchCtrl);
        }
        selectedCtrl = userSearchCtrl;
    }
    if (selectedCtrl != null) {
        TreeNode selTreeNode = TreeHelper.findNodeByUserObject(cmd, menu.getTreeModel().getRootNode());
        if (selTreeNode != null && !selTreeNode.getIdent().equals(menu.getSelectedNodeId())) {
            menu.setSelectedNodeId(selTreeNode.getIdent());
        }
        content.rootController(selTreeNode.getTitle(), selectedCtrl);
        addToHistory(ureq, selectedCtrl);
    }
    return (Activateable2) selectedCtrl;
}
Also used : LecturesSearchController(org.olat.modules.lecture.ui.coach.LecturesSearchController) Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) OLATResourceable(org.olat.core.id.OLATResourceable) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode) LecturesSearchController(org.olat.modules.lecture.ui.coach.LecturesSearchController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) Controller(org.olat.core.gui.control.Controller) MainLayoutBasicController(org.olat.core.gui.control.controller.MainLayoutBasicController) WindowControl(org.olat.core.gui.control.WindowControl)

Example 2 with LecturesSearchController

use of org.olat.modules.lecture.ui.coach.LecturesSearchController in project openolat by klemens.

the class CoachMainController method selectMenuItem.

private Activateable2 selectMenuItem(UserRequest ureq, String cmd) {
    Controller selectedCtrl = null;
    if ("members".equalsIgnoreCase(cmd) || "students".equalsIgnoreCase(cmd)) {
        if (studentListCtrl == null) {
            OLATResourceable ores = OresHelper.createOLATResourceableInstance("Members", 0l);
            ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
            WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
            studentListCtrl = new StudentListController(ureq, bwControl, content);
            listenTo(studentListCtrl);
        }
        selectedCtrl = studentListCtrl;
    } else if ("groups".equalsIgnoreCase(cmd)) {
        if (groupListCtrl == null) {
            OLATResourceable ores = OresHelper.createOLATResourceableInstance("Groups", 0l);
            ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
            WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
            groupListCtrl = new GroupListController(ureq, bwControl, content);
            listenTo(groupListCtrl);
        }
        selectedCtrl = groupListCtrl;
    } else if ("courses".equalsIgnoreCase(cmd)) {
        if (courseListCtrl == null) {
            OLATResourceable ores = OresHelper.createOLATResourceableInstance("Courses", 0l);
            ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
            WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
            courseListCtrl = new CourseListController(ureq, bwControl, content);
            listenTo(courseListCtrl);
        }
        selectedCtrl = courseListCtrl;
    } else if ("lectures".equalsIgnoreCase(cmd)) {
        if (lecturesSearchCtrl == null) {
            OLATResourceable ores = OresHelper.createOLATResourceableInstance("Lectures", 0l);
            ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
            WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
            lecturesSearchCtrl = new LecturesSearchController(ureq, bwControl, content);
            listenTo(lecturesSearchCtrl);
        }
        selectedCtrl = lecturesSearchCtrl;
    } else if ("search".equalsIgnoreCase(cmd)) {
        if (userSearchCtrl == null) {
            OLATResourceable ores = OresHelper.createOLATResourceableInstance("Search", 0l);
            ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
            WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
            userSearchCtrl = new UserSearchController(ureq, bwControl, content);
            listenTo(userSearchCtrl);
        }
        selectedCtrl = userSearchCtrl;
    }
    if (selectedCtrl != null) {
        TreeNode selTreeNode = TreeHelper.findNodeByUserObject(cmd, menu.getTreeModel().getRootNode());
        if (selTreeNode != null && !selTreeNode.getIdent().equals(menu.getSelectedNodeId())) {
            menu.setSelectedNodeId(selTreeNode.getIdent());
        }
        content.rootController(selTreeNode.getTitle(), selectedCtrl);
        addToHistory(ureq, selectedCtrl);
    }
    return (Activateable2) selectedCtrl;
}
Also used : LecturesSearchController(org.olat.modules.lecture.ui.coach.LecturesSearchController) Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) OLATResourceable(org.olat.core.id.OLATResourceable) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode) LecturesSearchController(org.olat.modules.lecture.ui.coach.LecturesSearchController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) Controller(org.olat.core.gui.control.Controller) MainLayoutBasicController(org.olat.core.gui.control.controller.MainLayoutBasicController) WindowControl(org.olat.core.gui.control.WindowControl)

Aggregations

LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)2 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)2 TreeNode (org.olat.core.gui.components.tree.TreeNode)2 Controller (org.olat.core.gui.control.Controller)2 WindowControl (org.olat.core.gui.control.WindowControl)2 MainLayoutBasicController (org.olat.core.gui.control.controller.MainLayoutBasicController)2 Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)2 OLATResourceable (org.olat.core.id.OLATResourceable)2 LecturesSearchController (org.olat.modules.lecture.ui.coach.LecturesSearchController)2