use of org.olat.core.gui.control.ChiefController in project OpenOLAT by OpenOLAT.
the class CourseRuntimeController method addCustomCSS.
private void addCustomCSS(UserRequest ureq) {
ICourse course = CourseFactory.loadCourse(getRepositoryEntry());
CustomCSS customCSS = CourseFactory.getCustomCourseCss(ureq.getUserSession(), course.getCourseEnvironment());
ChiefController cc = getWindowControl().getWindowBackOffice().getChiefController();
if (cc != null) {
if (customCSS == null) {
cc.removeCurrentCustomCSSFromView();
} else {
cc.addCurrentCustomCSSToView(customCSS);
}
}
setCustomCSS(customCSS);
}
use of org.olat.core.gui.control.ChiefController in project OpenOLAT by OpenOLAT.
the class OAuthDispatcher method redirectImplicitWorkflow.
private void redirectImplicitWorkflow(UserRequest ureq) {
ChiefController msgcc = new JSRedirectWindowController(ureq);
msgcc.getWindow().dispatchRequest(ureq, true);
}
use of org.olat.core.gui.control.ChiefController in project OpenOLAT by OpenOLAT.
the class LayoutMain3ColsController method setAsFullscreen.
public void setAsFullscreen(UserRequest ureq) {
ChiefController cc = getWindowControl().getWindowBackOffice().getChiefController();
if (cc != null) {
thebaseChief = cc;
thebaseChief.getScreenMode().setMode(Mode.full);
} else {
Windows.getWindows(ureq).setFullScreen(Boolean.TRUE);
}
fullScreen = true;
}
use of org.olat.core.gui.control.ChiefController in project OpenOLAT by OpenOLAT.
the class ValidatingVisitor method doDispatchToComponent.
/**
* @param ureq
* @return true if the event was indeed dispatched to the component, false
* otherwise (reasons: no component found with given id, or component
* disabled)
*/
private DispatchResult doDispatchToComponent(UserRequest ureq, StringBuilder debugMsg) {
String s_compID = ureq.getComponentID();
if (s_compID == null) {
return NO_DISPATCHRESULT;
}
List<Component> foundPath = new ArrayList<Component>(10);
// OLAT-1973
Component target = ComponentHelper.findDescendantOrSelfByID(getContentPane(), s_compID, foundPath);
if (target == null) {
// there was a component id given, but no matching target could be found
fireEvent(ureq, COMPONENTNOTFOUND);
return NO_DISPATCHRESULT;
// do not dispatch; which means just rerender later; good if
// the
// gui tree was changed by another thread in the meantime.
// do not throw an exception here, because this can happen if the gui
// tree was changed by another thread in the meantime
}
if (!target.isVisible()) {
throw new OLATRuntimeException(Window.class, "target with name: '" + target.getComponentName() + "', was invisible, but called to dispatch", null);
}
boolean toDispatch = true;
boolean incTimestamp = false;
for (Iterator<Component> iter = foundPath.iterator(); iter.hasNext(); ) {
Component curComp = iter.next();
if (!curComp.isEnabled()) {
toDispatch = false;
break;
}
}
if (toDispatch) {
latestDispatchComponentInfo = target.getComponentName() + " :" + target.getExtendedDebugInfo();
latestDispatchedComp = target;
// dispatch
wbackofficeImpl.fireCycleEvent(Window.ABOUT_TO_DISPATCH);
target.dispatchRequest(ureq);
List<Component> ancestors = ComponentHelper.findAncestorsOrSelfByID(getContentPane(), target);
for (Component ancestor : ancestors) {
incTimestamp |= ancestor.isSilentlyDynamicalCmp();
}
// after dispatching, commit (docu)
DBFactory.getInstance().commit();
// add the new URL to the browser history, but not if the klick resulted in a new browser window (a href .. target=...) or in a download (excel or such)
wbackofficeImpl.fireCycleEvent(END_OF_DISPATCH_CYCLE);
// if loglevel is set accordingly, collect anonymous controller usage statistics.
if (debugMsg != null) {
appendDispatchDebugInfos(target, debugMsg);
} else {
// no debug level, consume the left over event (for minor memory reasons)
target.getAndClearLatestFiredEvent();
}
// we do not want to keep a reference which could be old.
// in case we do not reach the next line because of an exception in dispatch(), we clear the value in the exceptionwindowcontroller's error handling
latestDispatchedComp = null;
}
ChiefController chief = wbackofficeImpl.getChiefController();
boolean reload = chief == null ? false : chief.wishReload(ureq, true);
return new DispatchResult(toDispatch, incTimestamp, reload);
}
use of org.olat.core.gui.control.ChiefController in project OpenOLAT by OpenOLAT.
the class AuthenticatedDispatcher method processBusinessPath.
private void processBusinessPath(String businessPath, UserRequest ureq, UserSession usess) {
ChiefController chiefController = Windows.getWindows(usess).getChiefController();
if (chiefController == null) {
if (usess.isAuthenticated()) {
AuthHelper.createAuthHome(ureq).getWindow();
chiefController = Windows.getWindows(usess).getChiefController();
} else {
redirectToDefaultDispatcher(ureq.getHttpReq(), ureq.getHttpResp());
return;
}
}
WindowBackOffice windowBackOffice = chiefController.getWindow().getWindowBackOffice();
if (chiefController.isLoginInterceptionInProgress()) {
Window w = windowBackOffice.getWindow();
// renderOnly
w.dispatchRequest(ureq, true);
} else {
String wSettings = (String) usess.removeEntryFromNonClearedStore(WINDOW_SETTINGS);
if (wSettings != null) {
WindowSettings settings = WindowSettings.parse(wSettings);
windowBackOffice.setWindowSettings(settings);
}
try {
BusinessControl bc = null;
String historyPointId = ureq.getHttpReq().getParameter("historyPointId");
if (StringHelper.containsNonWhitespace(historyPointId)) {
HistoryPoint point = ureq.getUserSession().getHistoryPoint(historyPointId);
bc = BusinessControlFactory.getInstance().createFromContextEntries(point.getEntries());
}
if (bc == null) {
bc = BusinessControlFactory.getInstance().createFromString(businessPath);
}
WindowControl wControl = windowBackOffice.getChiefController().getWindowControl();
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, wControl);
NewControllerFactory.getInstance().launch(ureq, bwControl);
// render the window
Window w = windowBackOffice.getWindow();
// renderOnly
w.dispatchRequest(ureq, true);
} catch (Exception e) {
// try to render something
try {
Window w = windowBackOffice.getWindow();
// renderOnly
w.dispatchRequest(ureq, true);
} catch (Exception e1) {
redirectToDefaultDispatcher(ureq.getHttpReq(), ureq.getHttpResp());
}
log.error("", e);
}
}
}
Aggregations