use of org.olat.core.gui.control.WindowBackOffice in project OpenOLAT by OpenOLAT.
the class OlatMinimalTopNavController method event.
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source == closeLink) {
// close window (a html page which calls Window.close onLoad
ureq.getDispatchResult().setResultingMediaResource(new RedirectMediaResource(StaticMediaDispatcher.createStaticURIFor("closewindow.html")));
// release all resources and close window
WindowBackOffice wbo = getWindowControl().getWindowBackOffice();
Window w = wbo.getWindow();
Windows.getWindows(ureq).deregisterWindow(w);
wbo.dispose();
}
}
use of org.olat.core.gui.control.WindowBackOffice in project OpenOLAT by OpenOLAT.
the class FormUIFactory method addRichTextElementForStringData.
/**
* Add a rich text formattable element that offers simple formatting
* functionality and loads the data form the given string value. Use
* item.getEditorConfiguration() to add more editor features if you need
* them
*
* @param name
* Name of the form item
* @param i18nLabel
* The i18n key of the label or NULL when no label is used
* @param initialValue
* The initial value or NULL if no initial value is available
* @param rows
* The number of lines the editor should offer. Use -1 to
* indicate no specific height
* @param cols
* The number of characters width the editor should offer. Use -1
* to indicate no specific width
* @param externalToolbar
* true: use an external toolbar that is only visible when the
* user clicks into the text area; false: use the static toolbar
* @param fullProfile
* false: load only the necessary plugins; true: load all plugins
* from the full profile
* @param baseContainer
* The VFS container where to load resources from (images etc) or
* NULL to not allow embedding of media files at all
* @param formLayout
* The form item container where to add the richt text element
* @param customLinkTreeModel A custom link tree model or NULL not not use a
* custom model
* @param formLayout The form item container where to add the rich
* text element
* @param usess The user session that dispatches the images
* @param wControl the current window controller
* @param wControl
* the current window controller
* @return The rich text element instance
*/
public RichTextElement addRichTextElementForStringData(String name, String i18nLabel, String initialHTMLValue, int rows, int cols, boolean fullProfile, VFSContainer baseContainer, CustomLinkTreeModel customLinkTreeModel, FormItemContainer formLayout, UserSession usess, WindowControl wControl) {
// Create richt text element with bare bone configuration
WindowBackOffice backoffice = wControl.getWindowBackOffice();
RichTextElement rte = new RichTextElementImpl(name, initialHTMLValue, rows, cols, formLayout.getRootForm(), formLayout.getTranslator().getLocale());
setLabelIfNotNull(i18nLabel, rte);
// Now configure editor
Theme theme = backoffice.getWindow().getGuiTheme();
rte.getEditorConfiguration().setConfigProfileFormEditor(fullProfile, usess, theme, baseContainer, customLinkTreeModel);
// Add to form and finish
formLayout.add(rte);
return rte;
}
use of org.olat.core.gui.control.WindowBackOffice in project OpenOLAT by OpenOLAT.
the class BaseFullWebappController method doDispose.
@Override
protected void doDispose() {
// deregister for chief global sticky messages events
GlobalStickyMessage.deregisterForGlobalStickyMessage(this);
if (dtabs != null) {
for (DTab tab : dtabs) {
tab.dispose();
}
for (BornSiteInstance bornSite : siteToBornSite.values()) {
bornSite.dispose();
}
dtabs = null;
dtabsControllers = null;
sites = null;
siteToBornSite = null;
siteToBusinessPath = null;
dtabToBusinessPath = null;
}
// clear the DTabs Service
WindowBackOffice wbackOffice = getWindowControl().getWindowBackOffice();
wbackOffice.getWindow().setDTabs(null);
wbackOffice.removeCycleListener(this);
if (jsServerC != null) {
jsServerC.dispose();
jsServerC = null;
}
if (debugC != null) {
debugC.dispose();
debugC = null;
}
if (inlineTranslationC != null) {
inlineTranslationC.dispose();
inlineTranslationC = null;
}
if (developmentC != null) {
developmentC.dispose();
developmentC = null;
}
// deregister for assessment mode
CoordinatorManager.getInstance().getCoordinator().getEventBus().deregisterFor(this, AssessmentModeNotificationEvent.ASSESSMENT_MODE_NOTIFICATION);
}
use of org.olat.core.gui.control.WindowBackOffice in project openolat by klemens.
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);
}
}
}
use of org.olat.core.gui.control.WindowBackOffice in project openolat by klemens.
the class OlatMinimalTopNavController method event.
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source == closeLink) {
// close window (a html page which calls Window.close onLoad
ureq.getDispatchResult().setResultingMediaResource(new RedirectMediaResource(StaticMediaDispatcher.createStaticURIFor("closewindow.html")));
// release all resources and close window
WindowBackOffice wbo = getWindowControl().getWindowBackOffice();
Window w = wbo.getWindow();
Windows.getWindows(ureq).deregisterWindow(w);
wbo.dispose();
}
}
Aggregations