Search in sources :

Example 76 with Activateable2

use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.

the class CoachMainController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (entries == null || entries.isEmpty()) {
        selectMenuItem(ureq, "Members");
    } else {
        ContextEntry currentEntry = entries.get(0);
        String cmd = currentEntry.getOLATResourceable().getResourceableTypeName();
        Activateable2 selectedCtrl = selectMenuItem(ureq, cmd);
        if (selectedCtrl == null) {
            selectMenuItem(ureq, "Members");
        } else {
            List<ContextEntry> subEntries = entries.subList(1, entries.size());
            selectedCtrl.activate(ureq, subEntries, currentEntry.getTransientState());
        }
    }
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 77 with Activateable2

use of org.olat.core.gui.control.generic.dtabs.Activateable2 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)

Example 78 with Activateable2

use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.

the class AssessmentToolController method doSelectUsersView.

private Controller doSelectUsersView(UserRequest ureq, String resName, AssessedIdentityListState state) {
    if (currentCtl != null) {
        stackPanel.popController(currentCtl);
    }
    OLATResourceable ores = OresHelper.createOLATResourceableInstance(resName, 0l);
    WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
    addToHistory(ureq, bwControl);
    Controller treeCtrl = element.createIdentityList(ureq, bwControl, stackPanel, testEntry, assessmentCallback);
    listenTo(treeCtrl);
    stackPanel.pushController(translate("users"), treeCtrl);
    currentCtl = treeCtrl;
    if (treeCtrl instanceof Activateable2) {
        ((Activateable2) treeCtrl).activate(ureq, null, state);
    }
    return currentCtl;
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) OLATResourceable(org.olat.core.id.OLATResourceable) WindowControl(org.olat.core.gui.control.WindowControl) Controller(org.olat.core.gui.control.Controller) MainLayoutBasicController(org.olat.core.gui.control.controller.MainLayoutBasicController)

Aggregations

Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)78 ContextEntry (org.olat.core.id.context.ContextEntry)44 Controller (org.olat.core.gui.control.Controller)28 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)22 TreeNode (org.olat.core.gui.components.tree.TreeNode)16 WindowControl (org.olat.core.gui.control.WindowControl)16 BasicController (org.olat.core.gui.control.controller.BasicController)14 CourseNode (org.olat.course.nodes.CourseNode)12 CollaborationTools (org.olat.collaboration.CollaborationTools)10 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)10 MainLayoutBasicController (org.olat.core.gui.control.controller.MainLayoutBasicController)10 AssessableCourseNode (org.olat.course.nodes.AssessableCourseNode)10 GTACourseNode (org.olat.course.nodes.GTACourseNode)10 FlexiTableSearchEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent)8 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)8 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)6 ChiefController (org.olat.core.gui.control.ChiefController)6 VetoableCloseController (org.olat.core.gui.control.VetoableCloseController)6 BornSiteInstance (org.olat.core.gui.control.navigation.BornSiteInstance)6 OLATResourceable (org.olat.core.id.OLATResourceable)5