Search in sources :

Example 26 with NodeRunConstructionResult

use of org.olat.course.run.navigation.NodeRunConstructionResult in project openolat by klemens.

the class PodcastCourseNode method createNodeRunConstructionResult.

/**
 * @see org.olat.course.nodes.AbstractAccessableCourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.control.WindowControl,
 *      org.olat.course.run.userview.UserCourseEnvironment,
 *      org.olat.course.run.userview.NodeEvaluation, java.lang.String)
 */
@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl control, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    RepositoryEntry entry = getReferencedRepositoryEntry();
    // create business path courseID:nodeID
    // userCourseEnv.getCourseEnvironment().getCourseResourceableId();
    // getIdent();
    Long courseId = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
    String nodeId = this.getIdent();
    boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
    boolean isGuest = ureq.getUserSession().getRoles().isGuestOnly();
    boolean isOwner = RepositoryManager.getInstance().isOwnerOfRepositoryEntry(ureq.getIdentity(), entry);
    FeedSecurityCallback callback;
    if (userCourseEnv.isCourseReadOnly()) {
        callback = new FeedReadOnlySecurityCallback();
    } else {
        callback = new FeedNodeSecurityCallback(ne, isAdmin, isOwner, isGuest);
    }
    SubscriptionContext subsContext = CourseModule.createSubscriptionContext(userCourseEnv.getCourseEnvironment(), this);
    callback.setSubscriptionContext(subsContext);
    ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrap(this));
    FeedMainController podcastCtr = PodcastUIFactory.getInstance(ureq.getLocale()).createMainController(entry.getOlatResource(), ureq, control, callback, courseId, nodeId);
    List<ContextEntry> entries = BusinessControlFactory.getInstance().createCEListFromResourceType(nodecmd);
    podcastCtr.activate(ureq, entries, null);
    Controller wrapperCtrl = TitledWrapperHelper.getWrapper(ureq, control, podcastCtr, this, "o_podcast_icon");
    NodeRunConstructionResult result = new NodeRunConstructionResult(wrapperCtrl);
    return result;
}
Also used : FeedMainController(org.olat.modules.webFeed.ui.FeedMainController) FeedSecurityCallback(org.olat.modules.webFeed.FeedSecurityCallback) RepositoryEntry(org.olat.repository.RepositoryEntry) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) FeedMainController(org.olat.modules.webFeed.ui.FeedMainController) PodcastNodeEditController(org.olat.course.nodes.feed.podcast.PodcastNodeEditController) FeedNodeEditController(org.olat.course.nodes.feed.FeedNodeEditController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) FeedPeekviewController(org.olat.course.nodes.feed.FeedPeekviewController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult) ContextEntry(org.olat.core.id.context.ContextEntry) FeedNodeSecurityCallback(org.olat.course.nodes.feed.FeedNodeSecurityCallback) SubscriptionContext(org.olat.core.commons.services.notifications.SubscriptionContext) FeedReadOnlySecurityCallback(org.olat.modules.webFeed.FeedReadOnlySecurityCallback)

Example 27 with NodeRunConstructionResult

use of org.olat.course.run.navigation.NodeRunConstructionResult in project openolat by klemens.

the class DialogCourseNode method createNodeRunConstructionResult.

/**
 * @see org.olat.course.nodes.GenericCourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.control.WindowControl,
 *      org.olat.course.run.userview.UserCourseEnvironment,
 *      org.olat.course.run.userview.NodeEvaluation, java.lang.String)
 */
@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    DialogCourseNodeRunController ctrl = new DialogCourseNodeRunController(ureq, wControl, this, userCourseEnv, ne);
    Controller wrappedCtrl = TitledWrapperHelper.getWrapper(ureq, wControl, ctrl, this, "o_dialog_icon");
    return new NodeRunConstructionResult(wrappedCtrl);
}
Also used : DialogCourseNodeRunController(org.olat.course.nodes.dialog.ui.DialogCourseNodeRunController) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) DialogCourseNodeRunController(org.olat.course.nodes.dialog.ui.DialogCourseNodeRunController) DialogCourseNodeEditController(org.olat.course.nodes.dialog.ui.DialogCourseNodeEditController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 28 with NodeRunConstructionResult

use of org.olat.course.run.navigation.NodeRunConstructionResult in project openolat by klemens.

the class EdubaseCourseNode method createNodeRunConstructionResult.

@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    updateModuleConfigDefaults(false);
    Controller runCtrl;
    if (userCourseEnv.isCourseReadOnly()) {
        Translator trans = Util.createPackageTranslator(EdubaseCourseNode.class, ureq.getLocale());
        String title = trans.translate("freezenoaccess.title");
        String message = trans.translate("freezenoaccess.message");
        runCtrl = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else if (userCourseEnv.getIdentityEnvironment().getRoles().isGuestOnly()) {
        Translator trans = Util.createPackageTranslator(EdubaseCourseNode.class, ureq.getLocale());
        String title = trans.translate("guestnoaccess.title");
        String message = trans.translate("guestnoaccess.message");
        runCtrl = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else {
        runCtrl = new EdubaseRunController(ureq, wControl, this.getModuleConfiguration());
    }
    Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, runCtrl, this, "o_edubase_icon");
    return new NodeRunConstructionResult(ctrl);
}
Also used : EdubaseRunController(org.olat.course.nodes.edubase.EdubaseRunController) Translator(org.olat.core.gui.translator.Translator) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) EdubaseRunController(org.olat.course.nodes.edubase.EdubaseRunController) EdubaseEditController(org.olat.course.nodes.edubase.EdubaseEditController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) EdubasePeekViewController(org.olat.course.nodes.edubase.EdubasePeekViewController) ConditionEditController(org.olat.course.condition.ConditionEditController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 29 with NodeRunConstructionResult

use of org.olat.course.run.navigation.NodeRunConstructionResult in project openolat by klemens.

the class ScormCourseNode method createNodeRunConstructionResult.

/**
 * @see org.olat.course.nodes.CourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.control.WindowControl,
 *      org.olat.course.run.userview.UserCourseEnvironment,
 *      org.olat.course.run.userview.NodeEvaluation)
 */
@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    updateModuleConfigDefaults(false);
    ScormRunController cprunC = new ScormRunController(getModuleConfiguration(), ureq, userCourseEnv, wControl, this, false);
    Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, cprunC, this, "o_scorm_icon");
    // no inline-in-olat-menu integration possible: no display configuration option
    return new NodeRunConstructionResult(ctrl);
}
Also used : ScormRunController(org.olat.course.nodes.scorm.ScormRunController) ScormEditController(org.olat.course.nodes.scorm.ScormEditController) CPEditController(org.olat.course.nodes.cp.CPEditController) NodeEditController(org.olat.course.editor.NodeEditController) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) IdentityListCourseNodeController(org.olat.course.assessment.ui.tool.IdentityListCourseNodeController) AssessmentCourseNodeController(org.olat.course.assessment.ui.tool.AssessmentCourseNodeController) Controller(org.olat.core.gui.control.Controller) ScormRunController(org.olat.course.nodes.scorm.ScormRunController) ScormResultDetailsController(org.olat.modules.scorm.assessment.ScormResultDetailsController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 30 with NodeRunConstructionResult

use of org.olat.course.run.navigation.NodeRunConstructionResult in project openolat by klemens.

the class VideoCourseNode method createNodeRunConstructionResult.

@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    NodeRunConstructionResult ncr;
    updateModuleConfigDefaults(false);
    VideoRunController cprunC = new VideoRunController(getModuleConfiguration(), wControl, ureq, userCourseEnv, this);
    ncr = cprunC.createNodeRunConstructionResult(ureq);
    return ncr;
}
Also used : NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult) VideoRunController(org.olat.course.nodes.video.VideoRunController)

Aggregations

NodeRunConstructionResult (org.olat.course.run.navigation.NodeRunConstructionResult)72 Controller (org.olat.core.gui.control.Controller)62 NodeEditController (org.olat.course.editor.NodeEditController)62 TabbableController (org.olat.core.gui.control.generic.tabbable.TabbableController)60 Translator (org.olat.core.gui.translator.Translator)36 Roles (org.olat.core.id.Roles)36 ConditionEditController (org.olat.course.condition.ConditionEditController)22 AssessmentCourseNodeController (org.olat.course.assessment.ui.tool.AssessmentCourseNodeController)20 RepositoryEntry (org.olat.repository.RepositoryEntry)18 PackageTranslator (org.olat.core.gui.translator.PackageTranslator)12 OLATResourceable (org.olat.core.id.OLATResourceable)10 IdentityListCourseNodeController (org.olat.course.assessment.ui.tool.IdentityListCourseNodeController)8 SubscriptionContext (org.olat.core.commons.services.notifications.SubscriptionContext)6 ICourse (org.olat.course.ICourse)6 AssessmentManager (org.olat.course.assessment.AssessmentManager)6 CourseIQSecurityCallback (org.olat.course.nodes.iq.CourseIQSecurityCallback)6 IQEditController (org.olat.course.nodes.iq.IQEditController)6 RepositoryManager (org.olat.repository.RepositoryManager)6 BusinessControl (org.olat.core.id.context.BusinessControl)4 BusinessControlFactory (org.olat.core.id.context.BusinessControlFactory)4