Search in sources :

Example 76 with NodeEditController

use of org.olat.course.editor.NodeEditController in project openolat by klemens.

the class OpenMeetingsCourseNode method createEditController.

@Override
public TabbableController createEditController(UserRequest ureq, WindowControl wControl, BreadcrumbPanel stackPanel, ICourse course, UserCourseEnvironment userCourseEnv) {
    updateModuleConfigDefaults(false);
    CourseNode chosenNode = course.getEditorTreeModel().getCourseNode(userCourseEnv.getCourseEditorEnv().getCurrentCourseNodeId());
    // create edit controller
    OpenMeetingsEditController childTabCntrllr = new OpenMeetingsEditController(ureq, wControl, this, course, userCourseEnv);
    NodeEditController nodeEditCtr = new NodeEditController(ureq, wControl, course.getEditorTreeModel(), course, chosenNode, userCourseEnv, childTabCntrllr);
    nodeEditCtr.addControllerListener(childTabCntrllr);
    return nodeEditCtr;
}
Also used : NodeEditController(org.olat.course.editor.NodeEditController) OpenMeetingsEditController(org.olat.course.nodes.openmeetings.OpenMeetingsEditController)

Example 77 with NodeEditController

use of org.olat.course.editor.NodeEditController in project openolat by klemens.

the class PortfolioCourseNode method createEditController.

@Override
public TabbableController createEditController(UserRequest ureq, WindowControl wControl, BreadcrumbPanel stackPanel, ICourse course, UserCourseEnvironment euce) {
    PortfolioCourseNodeEditController childTabCntrllr = new PortfolioCourseNodeEditController(ureq, wControl, stackPanel, course, this, getModuleConfiguration(), euce);
    updateModuleConfigDefaults(false);
    CourseNode chosenNode = course.getEditorTreeModel().getCourseNode(euce.getCourseEditorEnv().getCurrentCourseNodeId());
    return new NodeEditController(ureq, wControl, course.getEditorTreeModel(), course, chosenNode, euce, childTabCntrllr);
}
Also used : NodeEditController(org.olat.course.editor.NodeEditController) PortfolioCourseNodeEditController(org.olat.course.nodes.portfolio.PortfolioCourseNodeEditController) PortfolioCourseNodeEditController(org.olat.course.nodes.portfolio.PortfolioCourseNodeEditController)

Example 78 with NodeEditController

use of org.olat.course.editor.NodeEditController in project openolat by klemens.

the class STCourseNodeEditController method event.

/**
 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
 */
public void event(UserRequest ureq, Controller source, Event event) {
    if (source instanceof NodeEditController) {
        if (combiLinkCtr != null && combiLinkCtr.isDoProposal()) {
            combiLinkCtr.setRelFilePath(CourseEditorHelper.createUniqueRelFilePathFromShortTitle(stNode, courseFolderContainer));
        }
    } else if (source == accessibilityCondContr) {
        if (event == Event.CHANGED_EVENT) {
            Condition cond = accessibilityCondContr.getCondition();
            stNode.setPreConditionAccess(cond);
            fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == deliveryOptionsCtrl) {
        deliveryOptions = deliveryOptionsCtrl.getDeliveryOptions();
        stNode.getModuleConfiguration().set(CONFIG_KEY_DELIVERYOPTIONS, deliveryOptions);
        fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
    } else if (source == combiLinkCtr) {
        if (event == Event.DONE_EVENT) {
            chosenFile = VFSManager.getRelativeItemPath(combiLinkCtr.getFile(), courseFolderContainer, null);
            stNode.getModuleConfiguration().set(CONFIG_KEY_FILE, chosenFile);
            fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
            if (!myTabbedPane.containsTab(deliveryOptionsCtrl.getInitialComponent())) {
                myTabbedPane.addTab(translate(PANE_TAB_DELIVERYOPTIONS), deliveryOptionsCtrl.getInitialComponent());
            }
            configvc.contextPut("editorEnabled", combiLinkCtr.isEditorEnabled());
        }
    } else if (source == securitySettingForm) {
        if (event == Event.DONE_EVENT) {
            boolean allowRelativeLinks = securitySettingForm.getAllowRelativeLinksConfig();
            stNode.getModuleConfiguration().set(CONFIG_KEY_ALLOW_RELATIVE_LINKS, allowRelativeLinks);
            stNode.getModuleConfiguration().set(CONFIG_KEY_ALLOW_COACH_EDIT, securitySettingForm.getAllowCoachEditConfig());
            combiLinkCtr.setAllowEditorRelativeLinks(allowRelativeLinks);
            fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == nodeDisplayConfigFormController) {
        if (event == Event.DONE_EVENT) {
            // update the module configuration
            ModuleConfiguration moduleConfig = stNode.getModuleConfiguration();
            nodeDisplayConfigFormController.updateModuleConfiguration(moduleConfig);
            allowRelativeLinks = moduleConfig.getBooleanSafe(CONFIG_KEY_ALLOW_RELATIVE_LINKS);
            // update some class vars
            if (CONFIG_VALUE_DISPLAY_FILE.equals(moduleConfig.getStringValue(CONFIG_KEY_DISPLAY_TYPE))) {
                editorEnabled = true;
                addCustomFileConfigToView(ureq);
            } else {
                // user generated overview
                editorEnabled = false;
                removeCustomFileConfigFromView();
            }
            fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    } else if (source == scoreEasyForm) {
        if (event == Event.DONE_EVENT) {
            // show warning if the score might be wrong because of the invalid nodes used for calculation
            List<String> testElemWithNoResource = scoreEasyForm.getInvalidNodeDescriptions();
            String msg = getWarningMessage(testElemWithNoResource);
            if (msg != null) {
                showWarning(msg);
            }
            ScoreCalculator sc = scoreEasyForm.getScoreCalulator();
            /*
				 * OLAT-1144 bug fix if Calculation Score -> NO and Calculate passing
				 * score -> NO we get a ScoreCalculator == NULL !
				 */
            if (sc != null) {
                sc.setPassedExpression(sc.getPassedExpressionFromEasyModeConfiguration());
                sc.setScoreExpression(sc.getScoreExpressionFromEasyModeConfiguration());
            }
            // ..setScoreCalculator(sc) can handle NULL values!
            stNode.setScoreCalculator(sc);
            // reload form, remove deleted nodes
            initScoreEasyForm(ureq);
            fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
            updateHighscoreTab();
        } else if (event == Event.CANCELLED_EVENT) {
            // reload form
            initScoreEasyForm(ureq);
        }
    } else if (source == scoreExpertForm) {
        if (event == Event.DONE_EVENT) {
            // show warning if the score might be wrong because of the invalid nodes used for calculation
            List<String> testElemWithNoResource = scoreExpertForm.getInvalidNodeDescriptions();
            String msg = getWarningMessage(testElemWithNoResource);
            if (msg != null) {
                getWindowControl().setWarning(msg);
            }
            ScoreCalculator sc = scoreExpertForm.getScoreCalulator();
            /*
				 * OLAT-1144 bug fix if a ScoreCalculator == NULL !
				 */
            if (sc != null) {
                sc.clearEasyMode();
            }
            // ..setScoreCalculator(sc) can handle NULL values!
            stNode.setScoreCalculator(sc);
            fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
            updateHighscoreTab();
        } else if (event == Event.CANCELLED_EVENT) {
            // reload form
            initScoreExpertForm(ureq);
        }
    } else if (source == highScoreNodeConfigController) {
        if (event == Event.DONE_EVENT) {
            fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
        }
    }
}
Also used : Condition(org.olat.course.condition.Condition) NodeEditController(org.olat.course.editor.NodeEditController) ModuleConfiguration(org.olat.modules.ModuleConfiguration) ScoreCalculator(org.olat.course.run.scoring.ScoreCalculator) List(java.util.List)

Aggregations

NodeEditController (org.olat.course.editor.NodeEditController)78 TabbableController (org.olat.core.gui.control.generic.tabbable.TabbableController)10 AbstractAccessableCourseNode (org.olat.course.nodes.AbstractAccessableCourseNode)8 CourseNode (org.olat.course.nodes.CourseNode)8 IQEditController (org.olat.course.nodes.iq.IQEditController)6 Condition (org.olat.course.condition.Condition)4 FeedNodeEditController (org.olat.course.nodes.feed.FeedNodeEditController)4 InfoCourseNodeEditController (org.olat.course.nodes.info.InfoCourseNodeEditController)4 ChecklistEditController (de.bps.course.nodes.cl.ChecklistEditController)2 DENEditController (de.bps.course.nodes.den.DENEditController)2 LLEditController (de.bps.course.nodes.ll.LLEditController)2 NoProviderController (de.bps.course.nodes.vc.NoProviderController)2 VCConfiguration (de.bps.course.nodes.vc.VCConfiguration)2 VCEditController (de.bps.course.nodes.vc.VCEditController)2 VCProvider (de.bps.course.nodes.vc.provider.VCProvider)2 List (java.util.List)2 DeliveryOptions (org.olat.core.gui.control.generic.iframe.DeliveryOptions)2 TabbableDefaultController (org.olat.core.gui.control.generic.tabbable.TabbableDefaultController)2 LTIEditController (org.olat.course.nodes.basiclti.LTIEditController)2 BCCourseNodeEditController (org.olat.course.nodes.bc.BCCourseNodeEditController)2