Search in sources :

Example 26 with Activateable2

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

the class HomeMainController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (entries == null || entries.isEmpty())
        return;
    ContextEntry entry = entries.get(0);
    String navKey = entry.getOLATResourceable().getResourceableTypeName();
    if ("HomeSite".equals(navKey)) {
        entries = entries.subList(1, entries.size());
        if (entries.size() > 0) {
            entry = entries.get(0);
            navKey = entry.getOLATResourceable().getResourceableTypeName();
        }
    }
    if (navKey.equals(currentNavKey) && currentCtr instanceof ReusableHomeController) {
        if (currentCtr instanceof Activateable2) {
            ((Activateable2) currentCtr).activate(ureq, entries, entry.getTransientState());
        }
    } else {
        GenericActionExtension gAE = ExtManager.getInstance().getActionExtensioByNavigationKey(HomeMainController.class.getName(), navKey);
        if (gAE != null) {
            currentNavKey = navKey;
            stackPanel.popUpToRootController(ureq);
            currentCtr = createController(gAE, ureq);
            contentCtr = new LayoutMain3ColsController(ureq, getWindowControl(), currentCtr);
            listenTo(contentCtr);
            if (entries.size() >= 1) {
                entries = entries.subList(1, entries.size());
            }
            String actionText = gAE.getActionText(getLocale());
            stackPanel.rootController(actionText, contentCtr);
            if (currentCtr instanceof Activateable2) {
                ((Activateable2) currentCtr).activate(ureq, entries, entry.getTransientState());
            }
        }
    }
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) GenericActionExtension(org.olat.core.extensions.action.GenericActionExtension) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 27 with Activateable2

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

the class CourseRuntimeController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (entries == null || entries.isEmpty()) {
        if (currentToolCtr != null) {
            addToHistory(ureq, currentToolCtr);
        } else {
            Controller runtimeCtrl = getRuntimeController();
            if (runtimeCtrl instanceof Activateable2) {
                ((Activateable2) runtimeCtrl).activate(ureq, entries, state);
            } else {
                addToHistory(ureq, runtimeCtrl);
            }
        }
        return;
    }
    entries = removeRepositoryEntry(entries);
    if (entries != null && entries.size() > 0) {
        String type = entries.get(0).getOLATResourceable().getResourceableTypeName();
        if ("Payment".equalsIgnoreCase(type)) {
            doPostSuccessfullAccess(ureq);
        } else if ("Editor".equalsIgnoreCase(type)) {
            if (!isInEditor() && !RepositoryEntryManagedFlag.isManaged(getRepositoryEntry(), RepositoryEntryManagedFlag.editcontent)) {
                doEdit(ureq);
            }
        } else if ("Catalog".equalsIgnoreCase(type)) {
            doCatalog(ureq);
        } else if ("Infos".equalsIgnoreCase(type)) {
            doDetails(ureq);
        } else if ("EditDescription".equalsIgnoreCase(type) || "Settings".equalsIgnoreCase(type)) {
            doEditSettings(ureq);
        } else if ("Settings".equalsIgnoreCase(type)) {
            doOptions(ureq);
        } else if ("CertificationSettings".equalsIgnoreCase(type)) {
            doCertificatesOptions(ureq);
        } else if ("Certification".equalsIgnoreCase(type)) {
            doEfficiencyStatements(ureq);
        } else if ("Reminders".equalsIgnoreCase(type) || "RemindersLogs".equalsIgnoreCase(type)) {
            doReminders(ureq);
        } else if ("Lectures".equalsIgnoreCase(type)) {
            Activateable2 lectures = doLectures(ureq);
            if (lectures != null) {
                List<ContextEntry> subEntries = entries.subList(1, entries.size());
                lectures.activate(ureq, subEntries, entries.get(0).getTransientState());
            }
        } else if ("LectureBlock".equalsIgnoreCase(type)) {
            Activateable2 lectures = doLectures(ureq);
            if (lectures != null) {
                lectures.activate(ureq, entries, state);
            }
        } else if ("LecturesAdmin".equalsIgnoreCase(type)) {
            Activateable2 lecturesAdmin = doLecturesAdmin(ureq);
            if (lecturesAdmin != null) {
                List<ContextEntry> subEntries = entries.subList(1, entries.size());
                lecturesAdmin.activate(ureq, subEntries, entries.get(0).getTransientState());
            }
        } else if ("MembersMgmt".equalsIgnoreCase(type)) {
            Activateable2 members = doMembers(ureq);
            if (members != null) {
                try {
                    List<ContextEntry> subEntries = entries.subList(1, entries.size());
                    members.activate(ureq, subEntries, entries.get(0).getTransientState());
                } catch (OLATSecurityException e) {
                // the wrong link to the wrong person
                }
            }
        } else if ("assessmentTool".equalsIgnoreCase(type) || "assessmentToolv2".equalsIgnoreCase(type)) {
            // check the security before, the link is perhaps in the wrong hands
            if (reSecurity.isEntryAdmin() || reSecurity.isCourseCoach() || reSecurity.isGroupCoach() || hasCourseRight(CourseRights.RIGHT_ASSESSMENT)) {
                try {
                    Activateable2 assessmentCtrl = doAssessmentTool(ureq);
                    if (assessmentCtrl != null) {
                        List<ContextEntry> subEntries;
                        if (entries.size() > 1 && entries.get(1).getOLATResourceable().getResourceableTypeName().equals(type)) {
                            subEntries = entries.subList(2, entries.size());
                        } else {
                            subEntries = entries.subList(1, entries.size());
                        }
                        assessmentCtrl.activate(ureq, subEntries, entries.get(0).getTransientState());
                    }
                } catch (OLATSecurityException e) {
                // the wrong link to the wrong person
                }
            }
        } else if ("TestStatistics".equalsIgnoreCase(type) || "SurveyStatistics".equalsIgnoreCase(type)) {
            // check the security before, the link is perhaps in the wrong hands
            if (reSecurity.isEntryAdmin() || reSecurity.isCourseCoach() || reSecurity.isGroupCoach() || hasCourseRight(CourseRights.RIGHT_ASSESSMENT)) {
                try {
                    Activateable2 assessmentCtrl = null;
                    if ("TestStatistics".equalsIgnoreCase(type)) {
                        assessmentCtrl = doAssessmentTestStatistics(ureq);
                    } else {
                        assessmentCtrl = doAssessmentSurveyStatistics(ureq);
                    }
                    List<ContextEntry> subEntries;
                    if (entries.size() > 1 && entries.get(1).getOLATResourceable().getResourceableTypeName().equals(type)) {
                        subEntries = entries.subList(2, entries.size());
                    } else {
                        subEntries = entries.subList(1, entries.size());
                    }
                    assessmentCtrl.activate(ureq, subEntries, entries.get(0).getTransientState());
                } catch (OLATSecurityException e) {
                // the wrong link to the wrong person
                }
            }
        } else if (type != null && type.startsWith("path=")) {
            if (reSecurity.isEntryAdmin() || hasCourseRight(CourseRights.RIGHT_COURSEEDITOR)) {
                String path = BusinessControlFactory.getInstance().getPath(entries.get(0));
                FolderRunController folderCtrl = doCourseFolder(ureq);
                if (folderCtrl != null) {
                    folderCtrl.activatePath(ureq, path);
                }
            }
        }
    }
    if (getRunMainController() != null) {
        getRunMainController().activate(ureq, entries, state);
    }
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) FolderRunController(org.olat.core.commons.modules.bc.FolderRunController) OLATSecurityException(org.olat.core.logging.OLATSecurityException) List(java.util.List) LeavingStatusList(org.olat.repository.LeavingStatusList) StatisticCourseNodesController(org.olat.course.statistic.StatisticCourseNodesController) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) StatisticMainController(org.olat.course.statistic.StatisticMainController) CustomDBMainController(org.olat.course.db.CustomDBMainController) SearchInputController(org.olat.search.ui.SearchInputController) LectureRepositoryAdminController(org.olat.modules.lecture.ui.LectureRepositoryAdminController) CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) MembersManagementMainController(org.olat.course.member.MembersManagementMainController) VetoableCloseController(org.olat.core.gui.control.VetoableCloseController) GlossaryMainController(org.olat.core.commons.modules.glossary.GlossaryMainController) CertificateAndEfficiencyStatementController(org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController) AssessmentToolController(org.olat.course.assessment.ui.tool.AssessmentToolController) TeacherOverviewController(org.olat.modules.lecture.ui.TeacherOverviewController) CourseAreasController(org.olat.course.area.CourseAreasController) CourseOptionsController(org.olat.course.config.ui.CourseOptionsController) EditorMainController(org.olat.course.editor.EditorMainController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) FolderRunController(org.olat.core.commons.modules.bc.FolderRunController) CertificatesOptionsController(org.olat.course.certificate.ui.CertificatesOptionsController) CourseGlossaryToolLinkController(org.olat.course.run.glossary.CourseGlossaryToolLinkController) NoteController(org.olat.note.NoteController) ChiefController(org.olat.core.gui.control.ChiefController) ArchiverMainController(org.olat.course.archiver.ArchiverMainController) AssessmentModeListController(org.olat.course.assessment.ui.mode.AssessmentModeListController) CourseCalendarController(org.olat.course.run.calendar.CourseCalendarController) RepositoryEntryRuntimeController(org.olat.repository.ui.RepositoryEntryRuntimeController) RepositoryEntryLifeCycleChangeController(org.olat.repository.ui.RepositoryEntryLifeCycleChangeController) CourseRemindersController(org.olat.course.reminder.ui.CourseRemindersController) Controller(org.olat.core.gui.control.Controller) CourseLayoutGeneratorController(org.olat.course.config.ui.courselayout.CourseLayoutGeneratorController) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 28 with Activateable2

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

the class RunMainController method updateTreeAndContent.

private CourseNode updateTreeAndContent(UserRequest ureq, CourseNode calledCourseNode, String nodecmd, List<ContextEntry> entries, StateEntry state) {
    // might be used in both controllers with the same ID (e.g. the course folder)
    if (currentNodeController != null && !currentNodeController.isDisposed() && !navHandler.isListening(currentNodeController)) {
        currentNodeController.dispose();
    }
    NodeClickedRef nclr = navHandler.evaluateJumpToCourseNode(ureq, getWindowControl(), calledCourseNode, this, nodecmd);
    if (!nclr.isVisible()) {
        // if not root -> fallback to root. e.g. when a direct node jump fails
        if (calledCourseNode != null) {
            nclr = navHandler.evaluateJumpToCourseNode(ureq, getWindowControl(), null, this, null);
        }
        if (!nclr.isVisible()) {
            MessageController msgController = MessageUIFactory.createInfoMessage(ureq, getWindowControl(), translate("course.noaccess.title"), translate("course.noaccess.text"));
            contentP.setContent(msgController.getInitialComponent());
            luTree.setTreeModel(new GenericTreeModel());
            return null;
        }
    }
    treeModel = nclr.getTreeModel();
    luTree.setTreeModel(treeModel);
    String selNodeId = nclr.getSelectedNodeId();
    luTree.setSelectedNodeId(selNodeId);
    luTree.setOpenNodeIds(nclr.getOpenNodeIds());
    // get new run controller.
    currentNodeController = nclr.getRunController();
    addToHistory(ureq, currentNodeController);
    if (currentNodeController instanceof TitledWrapperController) {
        Controller contentcontroller = ((TitledWrapperController) currentNodeController).getContentController();
        addToHistory(ureq, contentcontroller);
        if (contentcontroller instanceof Activateable2) {
            ((Activateable2) contentcontroller).activate(ureq, entries, state);
        }
    } else if (currentNodeController instanceof Activateable2) {
        ((Activateable2) currentNodeController).activate(ureq, entries, state);
    }
    if (currentNodeController != null) {
        contentP.setContent(currentNodeController.getInitialComponent());
    } else {
        MessageController msgCtrl = MessageUIFactory.createWarnMessage(ureq, getWindowControl(), null, translate("msg.nodenotavailableanymore"));
        listenTo(msgCtrl);
        contentP.setContent(msgCtrl.getInitialComponent());
    }
    updateNextPrevious();
    updateCourseDataAttributes(nclr.getCalledCourseNode());
    updateLastUsage(nclr.getCalledCourseNode());
    return nclr.getCalledCourseNode();
}
Also used : MessageController(org.olat.core.gui.control.generic.messages.MessageController) Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) TitledWrapperController(org.olat.core.gui.control.generic.title.TitledWrapperController) GenericTreeModel(org.olat.core.gui.components.tree.GenericTreeModel) NodeClickedRef(org.olat.course.run.navigation.NodeClickedRef) DisposedCourseRestartController(org.olat.course.DisposedCourseRestartController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) MessageController(org.olat.core.gui.control.generic.messages.MessageController) CourseGlossaryToolLinkController(org.olat.course.run.glossary.CourseGlossaryToolLinkController) TitledWrapperController(org.olat.core.gui.control.generic.title.TitledWrapperController) Controller(org.olat.core.gui.control.Controller) GlossaryMarkupItemController(org.olat.core.gui.control.generic.textmarker.GlossaryMarkupItemController) MainLayoutBasicController(org.olat.core.gui.control.controller.MainLayoutBasicController)

Example 29 with Activateable2

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

the class SharedBindersController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (tableEl == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            SharedItemRow row = model.getObject(se.getIndex());
            if ("select".equals(cmd)) {
                Activateable2 activeateable = doSelectBinder(ureq, row);
                if (activeateable != null) {
                    activeateable.activate(ureq, null, null);
                }
            } else if ("leave".equals(cmd)) {
                doConfirmLeaveBinder(ureq, row);
            }
        } else if (event instanceof FlexiTableSearchEvent) {
            FlexiTableSearchEvent se = (FlexiTableSearchEvent) event;
            loadModel(se.getSearch());
        } else if ("ONCLICK".equals(event.getCommand())) {
            String row = ureq.getParameter("select-section");
            String expand = ureq.getParameter("expand-section");
            if (StringHelper.isLong(row)) {
                doSelectSection(ureq);
            } else if (StringHelper.containsNonWhitespace(expand)) {
                doExpandSections(ureq);
            }
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : SharedItemRow(org.olat.modules.portfolio.model.SharedItemRow) Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) FlexiTableSearchEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent)

Example 30 with Activateable2

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

the class UserAdminMainController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (entries == null || entries.isEmpty())
        return;
    GenericTreeModel tm = (GenericTreeModel) olatMenuTree.getTreeModel();
    ContextEntry entry = entries.get(0);
    String entryPoint = entry.getOLATResourceable().getResourceableTypeName();
    if (entryPoint.startsWith("notifications") || entryPoint.startsWith("NewIdentityCreated")) {
        TreeNode node = tm.findNodeByUserObject("created.newUsersNotification");
        selectNode(ureq, node);
    } else if (entryPoint.startsWith("AE")) {
        TreeNode node = tm.findNodeByUserObject("menuqueries");
        int pos = entries.get(0).getOLATResourceable().getResourceableId().intValue();
        if (pos >= 0 && pos < node.getChildCount()) {
            TreeNode childNode = (TreeNode) node.getChildAt(pos);
            selectNode(ureq, childNode);
        }
    } else {
        TreeNode node = tm.findNodeByUserObject(entryPoint);
        if (node != null) {
            selectNode(ureq, node);
            entries = entries.subList(1, entries.size());
            if (contentCtr instanceof Activateable2) {
                ((Activateable2) contentCtr).activate(ureq, entries, entry.getTransientState());
            }
            if (!entries.isEmpty() && userAdminCtr != null) {
                userAdminCtr.activate(ureq, entries, null);
            }
        }
    }
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode) GenericTreeModel(org.olat.core.gui.components.tree.GenericTreeModel) ContextEntry(org.olat.core.id.context.ContextEntry)

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