Search in sources :

Example 1 with GoToMeetingRunController

use of org.olat.modules.gotomeeting.ui.GoToMeetingRunController in project OpenOLAT by OpenOLAT.

the class GoToMeetingCourseNode method createNodeRunConstructionResult.

@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    updateModuleConfigDefaults(false);
    Controller controller;
    Roles roles = ureq.getUserSession().getRoles();
    if (roles.isGuestOnly()) {
        Translator trans = Util.createPackageTranslator(GoToMeetingEditController.class, ureq.getLocale());
        String title = trans.translate("guestnoaccess.title");
        String message = trans.translate("guestnoaccess.message");
        controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else {
        // check if user is moderator of the virtual classroom
        boolean admin = roles.isOLATAdmin();
        boolean moderator = admin;
        RepositoryEntry re = userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
        if (!admin) {
            RepositoryManager rm = RepositoryManager.getInstance();
            if (re != null) {
                admin = rm.isOwnerOfRepositoryEntry(ureq.getIdentity(), re) || rm.isInstitutionalRessourceManagerFor(ureq.getIdentity(), roles, re);
                moderator = admin || rm.isIdentityInTutorSecurityGroup(ureq.getIdentity(), re) || isCoach(re, ureq.getIdentity());
            }
        }
        // create run controller
        RepositoryEntry courseEntry = userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
        controller = new GoToMeetingRunController(ureq, wControl, courseEntry, getIdent(), null, admin, moderator, userCourseEnv.isCourseReadOnly());
    }
    Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, controller, this, "o_gotomeeting_icon");
    return new NodeRunConstructionResult(ctrl);
}
Also used : Translator(org.olat.core.gui.translator.Translator) GoToMeetingRunController(org.olat.modules.gotomeeting.ui.GoToMeetingRunController) Roles(org.olat.core.id.Roles) RepositoryManager(org.olat.repository.RepositoryManager) RepositoryEntry(org.olat.repository.RepositoryEntry) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) GoToMeetingPeekViewController(org.olat.course.nodes.gotomeeting.GoToMeetingPeekViewController) GoToMeetingEditController(org.olat.course.nodes.gotomeeting.GoToMeetingEditController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) GoToMeetingRunController(org.olat.modules.gotomeeting.ui.GoToMeetingRunController) ConditionEditController(org.olat.course.condition.ConditionEditController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 2 with GoToMeetingRunController

use of org.olat.modules.gotomeeting.ui.GoToMeetingRunController in project openolat by klemens.

the class GoToMeetingCourseNode method createNodeRunConstructionResult.

@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    updateModuleConfigDefaults(false);
    Controller controller;
    Roles roles = ureq.getUserSession().getRoles();
    if (roles.isGuestOnly()) {
        Translator trans = Util.createPackageTranslator(GoToMeetingEditController.class, ureq.getLocale());
        String title = trans.translate("guestnoaccess.title");
        String message = trans.translate("guestnoaccess.message");
        controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else {
        // check if user is moderator of the virtual classroom
        boolean admin = roles.isOLATAdmin();
        boolean moderator = admin;
        RepositoryEntry re = userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
        if (!admin) {
            RepositoryManager rm = RepositoryManager.getInstance();
            if (re != null) {
                admin = rm.isOwnerOfRepositoryEntry(ureq.getIdentity(), re) || rm.isInstitutionalRessourceManagerFor(ureq.getIdentity(), roles, re);
                moderator = admin || rm.isIdentityInTutorSecurityGroup(ureq.getIdentity(), re) || isCoach(re, ureq.getIdentity());
            }
        }
        // create run controller
        RepositoryEntry courseEntry = userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
        controller = new GoToMeetingRunController(ureq, wControl, courseEntry, getIdent(), null, admin, moderator, userCourseEnv.isCourseReadOnly());
    }
    Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, controller, this, "o_gotomeeting_icon");
    return new NodeRunConstructionResult(ctrl);
}
Also used : Translator(org.olat.core.gui.translator.Translator) GoToMeetingRunController(org.olat.modules.gotomeeting.ui.GoToMeetingRunController) Roles(org.olat.core.id.Roles) RepositoryManager(org.olat.repository.RepositoryManager) RepositoryEntry(org.olat.repository.RepositoryEntry) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) GoToMeetingPeekViewController(org.olat.course.nodes.gotomeeting.GoToMeetingPeekViewController) GoToMeetingEditController(org.olat.course.nodes.gotomeeting.GoToMeetingEditController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) GoToMeetingRunController(org.olat.modules.gotomeeting.ui.GoToMeetingRunController) ConditionEditController(org.olat.course.condition.ConditionEditController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Aggregations

Controller (org.olat.core.gui.control.Controller)2 TabbableController (org.olat.core.gui.control.generic.tabbable.TabbableController)2 Translator (org.olat.core.gui.translator.Translator)2 Roles (org.olat.core.id.Roles)2 ConditionEditController (org.olat.course.condition.ConditionEditController)2 NodeEditController (org.olat.course.editor.NodeEditController)2 GoToMeetingEditController (org.olat.course.nodes.gotomeeting.GoToMeetingEditController)2 GoToMeetingPeekViewController (org.olat.course.nodes.gotomeeting.GoToMeetingPeekViewController)2 NodeRunConstructionResult (org.olat.course.run.navigation.NodeRunConstructionResult)2 GoToMeetingRunController (org.olat.modules.gotomeeting.ui.GoToMeetingRunController)2 RepositoryEntry (org.olat.repository.RepositoryEntry)2 RepositoryManager (org.olat.repository.RepositoryManager)2