use of org.olat.course.config.CourseConfigEvent in project openolat by klemens.
the class CourseLayoutGeneratorController method formOK.
/**
* @see org.olat.core.gui.components.form.flexible.impl.FormBasicController#formOK(org.olat.core.gui.UserRequest)
*/
@Override
protected void formOK(UserRequest ureq) {
OLATResource courseRes = courseEntry.getOlatResource();
if (CourseFactory.isCourseEditSessionOpen(courseRes.getResourceableId())) {
showWarning("error.editoralreadylocked", new String[] { "???" });
return;
}
String selection = styleSel.getSelectedKey();
ICourse course = CourseFactory.openCourseEditSession(courseRes.getResourceableId());
courseEnvironment = course.getCourseEnvironment();
courseConfig = courseEnvironment.getCourseConfig();
courseConfig.setCssLayoutRef(selection);
if (CourseLayoutHelper.CONFIG_KEY_CUSTOM.equals(selection)) {
Map<String, Map<String, Object>> customConfig = compileCustomConfigFromGuiWrapper();
customCMgr.saveCustomConfigAndCompileCSS(customConfig, courseEnvironment);
persistedCustomConfig = customConfig;
if (!elWithErrorExists)
prepareStyleEditor(customConfig);
}
CourseFactory.setCourseConfig(course.getResourceableId(), courseConfig);
CourseFactory.closeCourseEditSession(course.getResourceableId(), true);
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(new CourseConfigEvent(CourseConfigType.layout, course.getResourceableId()), course);
// inform course-settings-dialog about changes:
fireEvent(ureq, Event.CHANGED_EVENT);
}
Aggregations