}
// render initial state of new window by redirecting (302) to the new
// window id. needed for asyncronous data like images loaded
// todo maybe better delegate window registry to the windowbackoffice?
URLBuilder ubu = new URLBuilder(uriPrefix, resWindow.getInstanceId(), String.valueOf(resWindow.timestamp), resWindow.wbackofficeImpl);
StringOutput sout = new StringOutput(30);
ubu.buildURI(sout, null, null);
mr = new RedirectMediaResource(sout.toString());
ServletUtil.serveResource(request, response, mr);
if (isDebugLog) {
long diff = System.currentTimeMillis() - debug_start;
debugMsg.append("rdirnw:").append(diff).append(LOG_SEPARATOR);
Tracing.logDebug(debugMsg.toString(), Window.class);
}
return;
}
}
if (inline) {
// do inline rendering.
Container top = getContentPane();
// validate prior to rendering, but only if the timestamp was not null
// /
// the component just got dispatched
if (validate) { // do not validate if a previous validate lead to a
// redirect; validating makes no sense here
//long t1 = System.currentTimeMillis();
ValidatingVisitor vv = new ValidatingVisitor(gsettings, jsAndCssAdder);
ComponentTraverser ct = new ComponentTraverser(vv, top, false);
ct.visitAll(ureq);
wbackofficeImpl.fireCycleEvent(Window.AFTER_VALIDATING);
ValidationResult vr = vv.getValidationResult();
String newModUri = vr.getNewModuleURI();
vr.getJsAndCSSAdder().finishAndCheckChange(); // ignore the return value since we are just about rendering anyway
if (newModUri != null) {
// send 302 redirect without dispatching, but just rerender
// inline.
// set window id to cur id, timestamp to current timestamp,
// component id to -1 -> indicates rerender
String uri = buildURIForRedirect(newModUri);
MediaResource mrr = new RedirectMediaResource(uri);
// set this only for the first request (the .html request), but clear it afterwards for asyncmedia
validatingCausedRerendering = true;
ServletUtil.serveResource(request, response, mrr);
if (isDebugLog) {
long diff = System.currentTimeMillis() - debug_start;
debugMsg.append("rdirva:").append(diff).append(LOG_SEPARATOR);
Tracing.logDebug(debugMsg.toString(), Window.class);
}
return;
}
}
wbackofficeImpl.fireCycleEvent(BEFORE_INLINE_RENDERING);
String result;
synchronized(render_mutex) { //o_clusterOK by:fj
// render now
if (incTimestamp) timestamp++;
String newTimestamp = String.valueOf(timestamp);
// add the businesscontrol path for bookmarking:
// each url has a part in it (the so called business path), which, in case of an invalid url or invalidated
// session, can be used as a bookmark. that is, urls from our framework are bookmarkable, but require some little
// coding effort: setting an appropriate business path and launching for each controller.
// note: the businesspath may also be used as a easy (but of course not perfect) back-button-solution:
// if the timestamp of a request is outdated, simply jump to its bookmarked business control path.
URLBuilder ubu = new URLBuilder(uriPrefix, getInstanceId(), newTimestamp, wbackofficeImpl);
RenderResult renderResult = new RenderResult();
// if we have an around-component-interception
// set the handler for this render cycle
InterceptHandler interceptHandler = wbackofficeImpl.getInterceptHandler();