return;
}
// 1. check for direct launch urls, see org.olat.core.dispatcher.jumpin.JumpinConfig
if (!ureq.isValidDispatchURI()) {
JumpInReceptionist jh = JumpInManager.getInstance().getJumpInReceptionist(ureq);
if (jh == null) {
// found no JumpInManager => try with new 5.1 JumpIn-Resource URL
String uri = ureq.getNonParsedUri();
if (uri.startsWith(JumpInManager.CONST_EXTLINK)) {
String resourceUrl = ureq.getParameter(JumpInManager.CONST_RESOURCE_URL);
if (resourceUrl != null) {
// attach the launcher data
BusinessControl bc = BusinessControlFactory.getInstance().createFromString(resourceUrl);
try {
// get main window and dynamic tabs
// brasato:: ChiefController cc = Windows.getWindows(usess).getWindowManager().getMainChiefController();
ChiefController cc = (ChiefController) Windows.getWindows(usess).getAttribute(AUTHCHIEFCONTROLLER);
// brasato:: todo: cc = Windows.getWindows(usess).getRegisteredJumpChiefController();
WindowControl wControl = cc.getWindowControl();
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, wControl);
NewControllerFactory.getInstance().launch(ureq, bwControl);
// render the window
Window w = cc.getWindow();
w.dispatchRequest(ureq, true); // renderOnly
return;
} catch (Exception ex) {
// sendNotFound
}
}
}
DispatcherAction.sendNotFound(request.getRequestURI(), response);
return;
}
// handler found e.g. for repo/go or cata/go or alike
OLATResourceable ores = jh.getOLATResourceable();
String title = jh.getTitle();
// get main window and dynamic tabs
// brasato:: ChiefController cc = Windows.getWindows(usess).getMainOlatChiefController();
ChiefController cc = (ChiefController) Windows.getWindows(usess).getAttribute(AUTHCHIEFCONTROLLER);
if (cc == null) throw new AssertException("logged in, but no window/Chiefcontroller 'olatmain' found!");
WindowControl wControl = cc.getWindowControl();
// add to tabs
DTabs dts = (DTabs)wControl.getWindowBackOffice().getWindow().getAttribute(D_TABS);
synchronized (dts) { //o_clusterok per:fj user session
DTab dt = dts.getDTab(ores);
if (dt == null) {
// no dynamic tab found, lets see if the ores implements the SiteInstance interface.
boolean isSiteInstance;
try {
// try to load class from ores resource type name and try to cast it to SiteInstance
Class site = ores.getClass().getClassLoader().loadClass(ores.getResourceableTypeName());
site.asSubclass(SiteInstance.class);
// ok, casting did not fail, must be a site then
isSiteInstance = true;
} catch (Exception e) {
// casting failed, not a site
isSiteInstance = false;
}
if (isSiteInstance) {
// case A) is a site: create view identifyer for this jump in to the site
JumpInResult jres = jh.createJumpInResult(ureq, cc.getWindowControl());
dts.activateStatic(ureq, ores.getResourceableTypeName(), jres.getInitialViewIdentifier());
} else {
// case B) no site and no opened tab -> create and add
dt = dts.createDTab(ores, title);
if (dt == null) { // tabs are full
//create dtabs already issues a warning message
} else {
JumpInResult jres = jh.createJumpInResult(ureq, dt.getWindowControl());
Controller resC = jres.getController();
if (resC == null) { // the resource was not found or user is not
// allowed to start the resource
DispatcherAction.sendNotFound(request.getRequestURI(), response);
return;
}
dt.setController(resC);
dts.addDTab(dt);
dts.activate(ureq, dt, null); // null: do not activate controller
}
}
} else {
// case C) opened dyn tab found, activate the dyn tab
dts.activate(ureq, dt, jh.extractActiveViewId(ureq));
}
}
// render the window
Window w = cc.getWindow();
w.dispatchRequest(ureq, true); // renderOnly