public String getNativeContent(Component comp, List<NodeInfo> children, Native.Helper helper) { final StringBuffer sb = new StringBuffer(256); getNativeContent( new CreateInfo(((WebAppCtrl) _wapp).getUiFactory(), Executions.getCurrent(), comp.getPage(), null), sb, comp, children, helper); return sb.toString(); }
public PageDefinition getPageDefinition(String uri) { if (uri == null || uri.length() == 0) throw new IllegalArgumentException("uri not specified: " + uri); //Note: we have to go thru UiFactory (so user can override it) uri = toAbsoluteURI(uri, false); final PageDefinition pagedef = ((WebAppCtrl) getDesktop().getWebApp()).getUiFactory() .getPageDefinition(newRequestInfo(uri), uri); if (pagedef == null) throw new UiException("Page not found: " + uri); return pagedef; }
/** Instantiates a composer of the given object. * This method will invoke {@link org.zkoss.zk.ui.sys.UiFactory#newComposer} * to instantiate the composer if page is not null. * @param page the page that the composer will be created for. * Ignored if null. * @param o the composer instance, the class of the composer to instantiate, * or the name of the class of the composer. * If <code>o</code> is an instance of {@link Composer}, it is returned * directly. */ public static Composer newComposer(Page page, Object o) throws Exception { Class cls; if (o instanceof String) { final String clsnm = ((String) o).trim(); if (page != null) return ((WebAppCtrl) page.getDesktop().getWebApp()).getUiFactory().newComposer(page, clsnm); cls = Classes.forNameByThread(clsnm); } else if (o instanceof Class) { cls = (Class) o; if (page != null) return ((WebAppCtrl) page.getDesktop().getWebApp()).getUiFactory().newComposer(page, cls); } else return (Composer) o; return (Composer) cls.newInstance(); }
public PageDefinition getPageDefinitionDirectly(String content, String ext) { //Note: we have to go thru UiFactory (so user can override it) return ((WebAppCtrl) getDesktop().getWebApp()).getUiFactory().getPageDefinitionDirectly(newRequestInfo(null), content, ext); }
public PageDefinition getPageDefinitionDirectly(Reader reader, String ext) throws IOException { //Note: we have to go thru UiFactory (so user can override it) return ((WebAppCtrl) getDesktop().getWebApp()).getUiFactory().getPageDefinitionDirectly(newRequestInfo(null), reader, ext); }
public PageDefinition getPageDefinitionDirectly(Document content, String ext) { //Note: we have to go thru UiFactory (so user can override it) return ((WebAppCtrl) getDesktop().getWebApp()).getUiFactory().getPageDefinitionDirectly(newRequestInfo(null), content, ext); }
final Page page = WebManager.newPage(wappc.getUiFactory(), ri, pagedef, response, path); final Execution exec = new ExecutionImpl(getServletContext(), request, response, desktop, page); final Writer out = compress ? (Writer) new StringWriter() : response.getWriter();
final UiFactory uf = wappc.getUiFactory(); final PageDefinition pagedef = uf.getPageDefinitionDirectly(ri, content, _ext);
final UiFactory uf = ((WebAppCtrl) _wapp).getUiFactory(); for (final String[] imprt : imports) { final String path = imprt[0], dirs = imprt[1];
"No server push defined. Make sure you are using ZK PE or EE, or you have configured your own implementation"); _spush = ((WebAppCtrl) _wapp).getUiFactory().newServerPush(this, cls);
((SessionCtrl) sess).notifyClientRequest(true); final UiFactory uf = wappc.getUiFactory(); if (uf.isRichlet(ri, bRichlet)) { final Richlet richlet = uf.getRichlet(ri, path);
/** Creates an desktop. */ private Desktop newDesktop(Session sess, ServletRequest request, ServletResponse response, String path) { final Locator loc = PageDefinitions.getLocator(_wapp, path); //we have to retrieve locator before setting execution, //since it assumes exec.getDesktop not null //which is true except this moment (before desktop is created) final Execution exec = ExecutionsCtrl.getCurrent(); final TemporaryExecution de = new TemporaryExecution(_ctx, (HttpServletRequest) request, (HttpServletResponse) response, null); ExecutionsCtrl.setCurrent(de); try { Desktop desktop = ((WebAppCtrl) _wapp).getUiFactory() .newDesktop(new RequestInfoImpl(_wapp, sess, null, request, loc), _updateURI, path); return !de.isVoided() ? desktop : null; } finally { ExecutionsCtrl.setCurrent(exec); } }
final Session sess = wappc.getUiFactory().newSession(wapp, navsess, request); wappc.getSessionCache().put(sess);
((SessionCtrl) sess).notifyClientRequest(true); final UiFactory uf = wappc.getUiFactory(); if (uf.isRichlet(ri, bRichlet)) { final Richlet richlet = uf.getRichlet(ri, path);
public void onEvent(Event evt) throws Exception { for (int j = _targets.length; --j >= 0;) _targets[j].removeEventListener(_evtnms[j], this); //one shot only final Execution exec = Executions.getCurrent(); execCreate0( new CreateInfo(((WebAppCtrl) exec.getDesktop().getWebApp()).getUiFactory(), exec, _comp.getPage(), null), //technically sys composer can be used but we don't (to simplify it) _compInfo, _comp, null); if (_uri != null) { final String uri = (String) Evaluators.evaluate(_compInfo.getEvaluator(), _comp, _uri, String.class); if (uri != null) exec.createComponents(uri, _comp, null); } Events.sendEvent(new FulfillEvent(Events.ON_FULFILL, _comp, evt)); //Use sendEvent so onFulfill will be processed before //the event triggers the fulfill (i.e., evt) }
new CreateInfo(((WebAppCtrl) exec.getDesktop().getWebApp()).getUiFactory(), exec, page,
pagedef.init(page, false); final Component[] comps = execCreate(new CreateInfo(((WebAppCtrl) wapp).getUiFactory(), exec, page, null), //technically sys composer can be used but we don't (to make it simple) pagedef, parent, insertBefore); inits.doAfterCompose(page, comps);
((SessionCtrl)sess).notifyClientRequest(true); final UiFactory uf = wappc.getUiFactory(); final Richlet richlet = new MyRichlet(); _page = uf.newPage(ri, richlet, path);
((SessionCtrl) sess).notifyClientRequest(true); final UiFactory uf = wappc.getUiFactory(); final Page page = WebManager.newPage(uf, ri, richlet, response, path); exec = new ExecutionImpl(ctx, request, response, desktop, page);
final PageRenderPatch patch = getRenderPatch(); final Writer out = patch.beforeRender(ri); final UiFactory uf = wappc.getUiFactory(); if (uf.isRichlet(ri, bRichlet)) { final Richlet richlet = uf.getRichlet(ri, path);