use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project openolat by klemens.
the class CourseRuntimeController method launchGlossary.
private void launchGlossary(UserRequest ureq) {
// start glossary in window
ICourse course = CourseFactory.loadCourse(getRepositoryEntry());
// do not cache cc, not save
final CourseConfig cc = course.getCourseConfig();
final boolean allowGlossaryEditing = reSecurity.isEntryAdmin() || hasCourseRight(CourseRights.RIGHT_GLOSSARY);
// if glossary had been opened from LR as Tab before, warn user:
DTabs dts = Windows.getWindows(ureq).getWindow(ureq).getDTabs();
RepositoryEntry repoEntry = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(cc.getGlossarySoftKey(), false);
DTab dt = dts.getDTab(repoEntry.getOlatResource());
if (dt != null) {
List<ContextEntry> entries = BusinessControlFactory.getInstance().createCEListFromResourceType(allowGlossaryEditing ? "true" : "false");
dts.activate(ureq, dt, entries);
} else {
ControllerCreator ctrlCreator = new ControllerCreator() {
public Controller createController(UserRequest lureq, WindowControl lwControl) {
GlossaryMainController glossaryController = CourseGlossaryFactory.createCourseGlossaryMainRunController(lwControl, lureq, cc, allowGlossaryEditing);
listenTo(glossaryController);
if (glossaryController == null) {
// happens in the unlikely event of a user who is in a course and
// now
// tries to access the glossary
String text = translate("error.noglossary");
return MessageUIFactory.createInfoMessage(lureq, lwControl, null, text);
} else {
// use a one-column main layout
LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, lwControl, glossaryController);
// dispose glossary on layout dispose
layoutCtr.addDisposableChildController(glossaryController);
return layoutCtr;
}
}
};
ControllerCreator layoutCtrlr = BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, ctrlCreator);
// open in new browser window
openInNewBrowserWindow(ureq, layoutCtrlr);
// immediate return after opening new browser window!
return;
}
}
use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project openolat by klemens.
the class CourseRuntimeController method launchPersonalNotes.
private void launchPersonalNotes(UserRequest ureq) {
// will not be disposed on course run dispose, pop up as new browser window
ControllerCreator ctrlCreator = new ControllerCreator() {
@Override
public Controller createController(UserRequest lureq, WindowControl lwControl) {
ICourse course = CourseFactory.loadCourse(getRepositoryEntry());
Controller notesCtr = new NoteController(lureq, course, course.getCourseTitle(), lwControl);
LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, lwControl, notesCtr);
layoutCtr.setCustomCSS(CourseFactory.getCustomCourseCss(lureq.getUserSession(), course.getCourseEnvironment()));
// dispose glossary on layout dispose
layoutCtr.addDisposableChildController(notesCtr);
return layoutCtr;
}
};
// wrap the content controller into a full header layout
ControllerCreator popupLayoutCtr = BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, ctrlCreator);
// open in new browser window
openInNewBrowserWindow(ureq, popupLayoutCtr);
}
use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project openolat by klemens.
the class TURunController method doLaunch.
private void doLaunch(UserRequest ureq) {
boolean iniframe = config.getBooleanSafe(TUConfigForm.CONFIG_IFRAME);
// create the possibility to float
CloneableController controller;
if (iniframe) {
// Do not dispose this controller if the course is closed...
IframeTunnelController ifC = new IframeTunnelController(ureq, getWindowControl(), config);
controller = ifC;
} else {
TunnelController tuC = new TunnelController(ureq, getWindowControl(), config);
controller = tuC;
}
listenTo(controller);
// create clone wrapper layout
CloneLayoutControllerCreatorCallback clccc = new CloneLayoutControllerCreatorCallback() {
public ControllerCreator createLayoutControllerCreator(UserRequest ureq, final ControllerCreator contentControllerCreator) {
return BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, new ControllerCreator() {
@SuppressWarnings("synthetic-access")
public Controller createController(UserRequest lureq, WindowControl lwControl) {
// wrapp in column layout, popup window needs a layout controller
Controller ctr = contentControllerCreator.createController(lureq, lwControl);
LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, lwControl, ctr);
layoutCtr.setCustomCSS(CourseFactory.getCustomCourseCss(lureq.getUserSession(), courseEnv));
layoutCtr.addDisposableChildController(ctr);
return layoutCtr;
}
});
}
};
Controller ctrl = TitledWrapperHelper.getWrapper(ureq, getWindowControl(), controller, courseNode, "o_tu_icon");
if (ctrl instanceof CloneableController) {
cloneC = new CloneController(ureq, getWindowControl(), (CloneableController) ctrl, clccc);
listenTo(cloneC);
main.setContent(cloneC.getInitialComponent());
} else {
throw new AssertException("Controller must be cloneable");
}
}
use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project openolat by klemens.
the class GoToMeetingController method doJoin.
private void doJoin(UserRequest ureq) {
boolean join = false;
GoToError error = new GoToError();
if (registrant == null) {
registrant = meetingMgr.registerTraining(meeting, getIdentity(), error);
}
if (registrant != null) {
String joinUrl = registrant.getJoinUrl();
if (joinUrl != null) {
RedirectMediaResource redirect = new RedirectMediaResource(joinUrl);
ureq.getDispatchResult().setResultingMediaResource(redirect);
join = true;
}
}
if (!join) {
final String errorMessage;
if (error.hasError()) {
if (error.getError() != null) {
errorMessage = translate(error.getError().i18nKey());
} else {
errorMessage = translate("error.code.unkown");
}
} else {
errorMessage = translate("error.code.unkown");
}
ControllerCreator creator = BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, new ControllerCreator() {
@Override
public Controller createController(UserRequest lureq, WindowControl lwControl) {
// Wrap in column layout, popup window needs a layout controller
String title = "";
String text = errorMessage;
Controller ctr = MessageUIFactory.createErrorMessage(lureq, lwControl, title, text);
LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, lwControl, ctr);
layoutCtr.addDisposableChildController(ctr);
return layoutCtr;
}
});
openInNewBrowserWindow(ureq, creator);
}
updateButtons();
}
use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.
the class ImsCPHandler method createLaunchController.
@Override
public MainLayoutController createLaunchController(RepositoryEntry re, RepositoryEntrySecurity reSecurity, UserRequest ureq, WindowControl wControl) {
OLATResource res = re.getOlatResource();
File cpRoot = FileResourceManager.getInstance().unzipFileResource(res);
final LocalFolderImpl vfsWrapper = new LocalFolderImpl(cpRoot);
CPPackageConfig packageConfig = CPManager.getInstance().getCPPackageConfig(res);
final DeliveryOptions deliveryOptions = (packageConfig == null ? null : packageConfig.getDeliveryOptions());
return new CPRuntimeController(ureq, wControl, re, reSecurity, new RuntimeControllerCreator() {
@Override
public Controller create(UserRequest uureq, WindowControl wwControl, TooledStackedPanel toolbarPanel, RepositoryEntry entry, RepositoryEntrySecurity security, AssessmentMode assessmentMode) {
boolean activateFirstPage = true;
String initialUri = null;
CoreSpringFactory.getImpl(UserCourseInformationsManager.class).updateUserCourseInformations(entry.getOlatResource(), uureq.getIdentity());
CPDisplayController cpCtr = new CPDisplayController(uureq, wwControl, vfsWrapper, true, true, activateFirstPage, true, deliveryOptions, initialUri, entry.getOlatResource(), "", false);
MainLayout3ColumnsController ctr = new LayoutMain3ColsController(uureq, wwControl, cpCtr.getMenuComponent(), cpCtr.getInitialComponent(), vfsWrapper.getName());
ctr.addDisposableChildController(cpCtr);
return ctr;
}
});
}
Aggregations