Package org.zkoss.zk.ui

Examples of org.zkoss.zk.ui.Page


    final RequestInfo ri = new RequestInfoImpl(
      wapp, sess, desktop, request, PageDefinitions.getLocator(wapp, path));

    final boolean compress = _webctx.shallCompress(request, "zul");
    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();
    wappc.getUiEngine().execNewPage(exec, pagedef, page, out);
View Full Code Here


    if (_meds != null) _meds.expunge();
  }

  public Page getPage(String pageId) {
    //Spec: we allow user to access this method concurrently
    final Page page = getPageIfAny(pageId);
    if (page == null)
      throw new ComponentNotFoundException("Page not found: "+pageId);
    return page;
  }
View Full Code Here

    return page;
  }
  public Page getPageIfAny(String pageId) {
    //Spec: we allow user to access this method concurrently, so
    //synchronized is required
    Page page = null;
    synchronized (_pages) {
      for (Iterator it = _pages.iterator(); it.hasNext();) {
        final Page pg = (Page)it.next();
        if (Objects.equals(pageId, pg.getId()))
          return pg;
        if (Objects.equals(pageId, pg.getUuid()))
          page = pg;
      }
    }
    return page;
  }
View Full Code Here

    if (listen) _piggybackListened = true;
  }
  public void onPiggyback() {
    if (_piggybackListened) {
      for (Iterator it = _pages.iterator(); it.hasNext();) {
        final Page p = (Page)it.next();
        if (Executions.getCurrent().isAsyncUpdate(p)) { //ignore new created pages
          for (Component root = ((Page)it.next()).getFirstRoot();
          root != null; root = root.getNextSibling()) {
            if (Events.isListened(root, Events.ON_PIGGYBACK, false)) //asap+deferrable
              Events.postEvent(new Event(Events.ON_PIGGYBACK, root));
View Full Code Here

    return l;
  }

  public void invalidate() {
    for (Iterator it = _pages.iterator(); it.hasNext();) {
      final Page page = (Page)it.next();
      if (((PageCtrl)page).getOwner() == null)
        page.invalidate();
    }
  }
View Full Code Here

    Desktop desktop = dtrc != null ?
      Utils.beforeService(dtrc, _ctx, sess, request, response, path): null;

    try {
      if (desktop != null) { //recycle
        final Page page = Utils.getMainPage(desktop);
        if (page != null) {
          final Execution exec = new ExecutionImpl(
            _ctx, request, response, desktop, page);
          _webman.setDesktop(request, desktop);
          wappc.getUiEngine().recycleDesktop(exec, page, out);
        } else
          desktop = null; //something wrong (not possible; just in case)
      }
      if (desktop == null) {
        desktop = _webman.getDesktop(sess, request, response, path, true);
        if (desktop == null) //forward or redirect
          return true;

        final RequestInfo ri = new RequestInfoImpl(
          wapp, sess, desktop, request,
          PageDefinitions.getLocator(wapp, path));
        sess.setAttribute(Attributes.GAE_FIX, new Integer(0));
        ((SessionCtrl)sess).notifyClientRequest(true);

        final UiFactory uf = wappc.getUiFactory();
        if (uf.isRichlet(ri, bRichlet)) {
          final Richlet richlet = uf.getRichlet(ri, path);
          if (richlet == null)
            return false; //not found

          final Page page = WebManager.newPage(uf, ri, richlet, response, path);
          final Execution exec = new ExecutionImpl(
            _ctx, request, response, desktop, page);
          wappc.getUiEngine().execNewPage(exec, richlet, page, out);
            //no need to set device type here, since UiEngine will do it later
        } else {
          final PageDefinition pagedef = uf.getPageDefinition(ri, path);
          if (pagedef == null)
            return false; //not found

          final Page page = WebManager.newPage(uf, ri, pagedef, response, path);
          final Execution exec = new ExecutionImpl(
            _ctx, request, response, desktop, page);
          wappc.getUiEngine().execNewPage(exec, pagedef, page, out);
        }
      }
View Full Code Here

      ((SessionCtrl)sess).notifyClientRequest(true);
      final UiFactory uf = wappc.getUiFactory();
      final PageDefinition pagedef =
        uf.getPageDefinitionDirectly(ri, content, _ext);

      final Page page = WebManager.newPage(uf, ri, pagedef, response, path);
      final Execution exec =
        new ExecutionImpl(_ctx, request, response, desktop, page);
      final StringWriter out = new StringWriter(4096*2);
      wappc.getUiEngine().execNewPage(exec, pagedef, page, out);

View Full Code Here

  }
  /** Adds an invalidated component. Once invalidated, all invocations
   * to {@link #addSmartUpdate} are ignored in this execution.
   */
  public void addInvalidate(Component comp) {
    final Page page = comp.getPage();
    if (_recovering || _disabled || page == null
    || !_exec.isAsyncUpdate(page) || isCUDisabled(comp))
      return; //nothing to do
    if (_ending) throw new IllegalStateException("ended");

View Full Code Here

  /** Returns the response map for the specified attribute, or null if
   * nothing to do.
   */
  private Map getAttrRespMap(Component comp) {
    final Page page = comp.getPage();
    if (_recovering || _disabled || page == null || !_exec.isAsyncUpdate(page)
    || _invalidated.contains(comp) || isCUDisabled(comp))
      return null; //nothing to do
    if (_ending) throw new IllegalStateException("ended");

View Full Code Here

      final Object o = it.next();
      if (!(o instanceof Component))
        continue;

      final Component comp = (Component)o;
      final Page page = comp.getPage();
      if (page == null || !_exec.isAsyncUpdate(page)) {
        if (!bResponse) it.remove(); //just in case
        continue;
      }
View Full Code Here

TOP

Related Classes of org.zkoss.zk.ui.Page

Copyright © 2018 www.massapicom. 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.