Examples of RenderResult


Examples of org.olat.core.gui.render.RenderResult

                throw new AssertException("cannot replace as dom fragment:"+toRender.getComponentName()+" ("+toRender.getClass().getName()+"),"+toRender.getExtendedDebugInfo());
              }
             
              Panel wrapper = new Panel("renderpanel");
              wrapper.setDomReplaceable(false); // to omit <div> around the render helper panel
              RenderResult renderResult = null;
              StringOutput jsol = new StringOutput();
              StringOutput hdr = new StringOutput();
              String result = null;
              try {
                toRender.setDomReplaceable(false);
                wrapper.setContent(toRender);
                String newTimestamp = String.valueOf(timestamp);
                URLBuilder ubu = new URLBuilder(uriPrefix,getInstanceId(), newTimestamp,wbackofficeImpl);

                renderResult = new RenderResult();

                // if we have an around-component-interception
                // set the handler for this render cycle
                InterceptHandler interceptHandler = wbackofficeImpl.getInterceptHandler();
                if (interceptHandler != null) {
                  InterceptHandlerInstance dhri = interceptHandler.createInterceptHandlerInstance();
                  renderResult.setInterceptHandlerRenderInstance(dhri);
                }

                Renderer fr = Renderer.getInstance(wrapper,null, ubu, renderResult, gsettings);

                jsol = new StringOutput();
                fr.renderBodyOnLoadJSFunctionCall(jsol,toRender);

                hdr = new StringOutput();
                fr.renderHeaderIncludes(hdr, toRender);

                long pstart = 0;
                if (isDebugLog) {
                  pstart = System.currentTimeMillis();
                }
                result = fr.render(toRender).toString();
                if (isDebugLog) {
                  long pstop = System.currentTimeMillis();
                  debugMsg.append(toRender.getComponentName()).append(":").append((pstop - pstart));
                  if (i < dCnt - 1)
                    debugMsg.append(",");
                }
              } catch (Exception e) {
                throw new OLATRuntimeException(Window.class,renderResult.getLogMsg(), renderResult.getRenderException());
              } finally {
                toRender.setDomReplaceable(true);
              }
              if (renderResult.getRenderException() != null) throw new OLATRuntimeException(Window.class, renderResult.getLogMsg(),
                  renderResult.getRenderException());
             
              AsyncMediaResponsible curAmr = renderResult.getAsyncMediaResponsible();
              if (curAmr != null) {
                if (amr != null) {
                  throw new AssertException("can set amr only once in a screen!");
                } else {
                  amr = curAmr;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.