use of org.olat.core.gui.control.Controller in project openolat by klemens.
the class LLCourseNode method createPeekViewRunController.
/**
* @see org.olat.course.nodes.GenericCourseNode#createPeekViewRunController(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 Controller createPeekViewRunController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne) {
updateModuleConfigDefaults(false);
// Use normal view as peekview
Controller controller = new LLRunController(ureq, wControl, getModuleConfiguration(), this, userCourseEnv, false);
return controller;
}
use of org.olat.core.gui.control.Controller in project openolat by klemens.
the class LLCourseNode method createNodeRunConstructionResult.
/**
* {@inheritDoc}
*/
@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
updateModuleConfigDefaults(false);
Controller controller = new LLRunController(ureq, wControl, getModuleConfiguration(), this, userCourseEnv, true);
controller = TitledWrapperHelper.getWrapper(ureq, wControl, controller, this, "o_ll_icon");
return new NodeRunConstructionResult(controller);
}
use of org.olat.core.gui.control.Controller in project openolat by klemens.
the class VCCourseNode method createNodeRunConstructionResult.
@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
updateModuleConfigDefaults(false);
// check if user is moderator of the virtual classroom
Roles roles = ureq.getUserSession().getRoles();
boolean moderator = roles.isOLATAdmin();
Long key = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
if (!moderator) {
if (roles.isInstitutionalResourceManager() | roles.isAuthor()) {
RepositoryManager rm = RepositoryManager.getInstance();
ICourse course = CourseFactory.loadCourse(key);
RepositoryEntry re = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
if (re != null) {
moderator = rm.isOwnerOfRepositoryEntry(ureq.getIdentity(), re);
if (!moderator) {
moderator = rm.isInstitutionalRessourceManagerFor(ureq.getIdentity(), ureq.getUserSession().getRoles(), re);
}
}
}
}
// load configuration
final String providerId = getModuleConfiguration().getStringValue(CONF_PROVIDER_ID);
VCProvider provider = providerId == null ? VCProviderFactory.createDefaultProvider() : VCProviderFactory.createProvider(providerId);
VCConfiguration config = handleConfig(provider);
// create run controller
Controller runCtr = new VCRunController(ureq, wControl, key + "_" + getIdent(), getShortName(), getLongTitle(), config, provider, moderator, userCourseEnv.isCourseReadOnly());
Controller controller = TitledWrapperHelper.getWrapper(ureq, wControl, runCtr, this, "o_vc_icon");
return new NodeRunConstructionResult(controller);
}
use of org.olat.core.gui.control.Controller in project openolat by klemens.
the class LinkFileCombiCalloutController method doOpenWysiwygEditor.
// ///////////////// helper methods to implement event loop
private void doOpenWysiwygEditor(UserRequest ureq) {
if (relFilPathIsProposal) {
file = VFSManager.resolveOrCreateLeafFromPath(baseContainer, relFilePath);
}
if (file == null) {
// huh? no idea what happend, do nothing and log error
logError("Could not load or create file with relFilePath::" + relFilePath + " in baseContainer::" + VFSManager.getRealPath(baseContainer), null);
return;
}
// Configure editor depending on limitEditorToRelativeFiles flag
// either based on baseContainer or the files direct parent
VFSContainer editorBaseContainer = baseContainer;
String editorRelPath = relFilePath;
if (!allowEditorRelativeLinks && relFilePath.indexOf("/", 1) != 0) {
editorBaseContainer = file.getParentContainer();
editorRelPath = file.getName();
}
// Open HTML editor in dialog
Controller wysiwygCtr = WysiwygFactory.createWysiwygControllerWithInternalLink(ureq, getWindowControl(), editorBaseContainer, editorRelPath, true, customLinkTreeModel);
displayModal(wysiwygCtr);
}
use of org.olat.core.gui.control.Controller in project OpenOLAT by OpenOLAT.
the class BaseFullWebappMinimalLayoutControllerCreator method getFullWebappParts.
/**
* @see org.olat.core.commons.fullWebApp.popup.BaseFullWebappPopupLayout#getFullWebappParts()
*/
@Override
public BaseFullWebappControllerParts getFullWebappParts() {
return new BaseFullWebappControllerParts() {
@Override
public List<SiteInstance> getSiteInstances(UserRequest ureq, WindowControl control) {
// no static sites
return null;
}
@Override
public Controller getContentController(UserRequest ureq, WindowControl wControl) {
// the content for the Pop-up Window
return contentControllerCreator.createController(ureq, wControl);
}
@Override
public LockableController createTopNavController(UserRequest ureq, WindowControl wControl) {
LockableController topnavCtr = null;
// ----------- topnav, optional (e.g. for imprint, logout) ------------------
if (CoreSpringFactory.containsBean("fullWebApp.MinimalTopNavControllerCreator")) {
ControllerCreator topnavControllerCreator = (ControllerCreator) CoreSpringFactory.getBean("fullWebApp.MinimalTopNavControllerCreator");
topnavCtr = (LockableController) topnavControllerCreator.createController(ureq, wControl);
}
return topnavCtr;
}
@Override
public Controller createHeaderController(UserRequest ureq, WindowControl control) {
Controller headerCtr = null;
// ----------- header, optional (e.g. for logo, advertising ) ------------------
if (CoreSpringFactory.containsBean("fullWebApp.MinimalHeaderControllerCreator")) {
ControllerCreator headerControllerCreator = (ControllerCreator) CoreSpringFactory.getBean("fullWebApp.MinimalHeaderControllerCreator");
headerCtr = headerControllerCreator.createController(ureq, control);
}
return headerCtr;
}
@Override
public LockableController createFooterController(UserRequest ureq, WindowControl control) {
Controller footerCtr = null;
// ----------- footer, optional (e.g. for copyright, powerd by) ------------------
if (CoreSpringFactory.containsBean("fullWebApp.MinimalFooterControllerCreator")) {
ControllerCreator footerCreator = (ControllerCreator) CoreSpringFactory.getBean("fullWebApp.MinimalFooterControllerCreator");
footerCtr = footerCreator.createController(ureq, control);
}
return (LockableController) footerCtr;
}
};
}
Aggregations