* @return editor controller for the given course resourceable; if the editor
* is already locked, it returns a controller with a lock message
*/
public static Controller createEditorController(UserRequest ureq, WindowControl wControl, OLATResourceable olatResource) {
ICourse course = loadCourse(olatResource);
EditorMainController emc = new EditorMainController(ureq, wControl, course);
if (!emc.getLockEntry().isSuccess()) {
// get i18n from the course runmaincontroller to say that this editor is
// already locked by another person
Translator translator = new PackageTranslator(Util.getPackageName(RunMainController.class), ureq.getLocale());
wControl.setWarning(translator.translate("error.editoralreadylocked", new String[] { emc.getLockEntry().getOwner().getName() }));
return null;
//return new MonologController(ureq.getLocale(), translator.translate("error.editoralreadylocked", new String[] { emc.getLockEntry()
// .getOwner().getName() }), null, true);
}
//set the logger if editor is started
//since 5.2 groups / areas can be created from the editor -> should be logged.
emc.addLoggingResourceable(LoggingResourceable.wrap(course));
return emc;
}