Examples of IRequestablePage


Examples of org.apache.wicket.request.component.IRequestablePage

          handler.getPageClass(), handler.getPageParameters());

        return buildUrl(urlInfo);
      }

      IRequestablePage page = handler.getPage();

      if (checkPageInstance(page) &&
        (!pageMustHaveBeenCreatedBookmarkable() || page.wasCreatedBookmarkable()))
      {
        PageInfo info = null;
        if (!page.isPageStateless())
        {
          info = new PageInfo(page.getPageId());
        }
        PageComponentInfo pageComponentInfo = info != null ? new PageComponentInfo(info,
          null) : null;

        UrlInfo urlInfo = new UrlInfo(pageComponentInfo, page.getClass(),
          handler.getPageParameters());
        return buildUrl(urlInfo);
      }
      else
      {
View Full Code Here

Examples of org.apache.wicket.request.component.IRequestablePage

  public boolean isNewPageInstance()
  {
    boolean isNew = pageInstance == null;
    if (isNew && pageId != null)
    {
      IRequestablePage storedPageInstance = getStoredPage(pageId);
      if (storedPageInstance != null)
      {
        pageInstance = storedPageInstance;
        isNew = false;
      }
View Full Code Here

Examples of org.apache.wicket.request.component.IRequestablePage

  }

  private void resolvePageInstance(Integer pageId, Class<? extends IRequestablePage> pageClass,
    PageParameters pageParameters, Integer renderCount)
  {
    IRequestablePage page = null;

    boolean freshCreated = false;

    if (pageId != null)
    {
      page = getStoredPage(pageId);
    }

    if (page == null)
    {
      if (pageClass != null)
      {
        PageParameters parameters;
        if (pageId != null)
        {
          // WICKET-4594 - re-creating an expired page. Ignore the parsed parameters for the callback url
          parameters = new PageParameters();
        }
        else
        {
          parameters = pageParameters;
        }
        page = getPageSource().newPageInstance(pageClass, parameters);
        freshCreated = true;
      }
    }

    if (page != null && !freshCreated)
    {
      if (renderCount != null && page.getRenderCount() != renderCount)
      {
        throw new StalePageException(page);
      }
    }
View Full Code Here

Examples of org.apache.wicket.request.component.IRequestablePage

   *            the id of the page to look for.
   * @return the found page instance by id.
   */
  private IRequestablePage getStoredPage(final int pageId)
  {
    IRequestablePage storedPageInstance = getPageSource().getPageInstance(pageId);
    if (storedPageInstance != null)
    {
      if (pageClass == null || pageClass.equals(storedPageInstance.getClass()))
      {
        pageInstance = storedPageInstance;
        pageInstanceIsFresh = false;
        if (renderCount != null && pageInstance.getRenderCount() != renderCount)
        {
View Full Code Here

Examples of org.apache.wicket.request.component.IRequestablePage

  @Override
  public IRequestableComponent getComponent()
  {
    if (component == null)
    {
      IRequestablePage page = getPageInstance();
      component = page.get(componentPath);
      if (component == null)
      {

        /*
         * on stateless pages it is possible that the component may not yet exist because it
         * couldve been created in one of the lifecycle callbacks of this page. Lets invoke
         * the callbacks to give the page a chance to create the missing component.
         */

        // make sure this page instance was just created so the page can be stateless
        if (page.isPageStateless())
        {
          Page p = (Page)page;
          p.internalInitialize();
          p.internalPrepareForRender(false);
          component = page.get(componentPath);
        }
      }
    }
    if (component == null)
    {
View Full Code Here

Examples of org.apache.wicket.request.component.IRequestablePage

   */
  protected BufferedWebResponse renderPage(Url targetUrl, RequestCycle requestCycle)
  {
    // get the page before checking for a scheduled request handler because
    // the page may call setResponsePage in its constructor
    IRequestablePage requestablePage = getPage();

    IRequestHandler scheduled = requestCycle.getRequestHandlerScheduledAfterCurrent();

    if (scheduled != null)
    {
      // no need to render
      return null;
    }

    // keep the original response
    final WebResponse originalResponse = (WebResponse)requestCycle.getResponse();

    // buffered web response for page
    BufferedWebResponse response = new BufferedWebResponse(originalResponse);

    // keep the original base URL
    Url originalBaseUrl = requestCycle.getUrlRenderer().setBaseUrl(targetUrl);

    try
    {
      requestCycle.setResponse(response);
      requestablePage.renderPage();

      if (scheduled == null && requestCycle.getRequestHandlerScheduledAfterCurrent() != null)
      {
        // This is a special case.
        // During page render another request handler got scheduled and will want to
View Full Code Here

Examples of org.apache.wicket.request.component.IRequestablePage

    Args.notNull(handler, "handler");

    Integer pageId = null;
    if (handler.isPageInstanceCreated())
    {
      IRequestablePage page = handler.getPage();

      if (page.isPageStateless() == false)
      {
        pageId = page.getPageId();
      }
    }

    return new PageInfo(pageId);
  }
View Full Code Here

Examples of org.apache.wicket.request.component.IRequestablePage

    if (url == null && requestHandler instanceof ListenerInterfaceRequestHandler &&
      getRecreateMountedPagesAfterExpiry())
    {
      ListenerInterfaceRequestHandler handler = (ListenerInterfaceRequestHandler)requestHandler;
      IRequestablePage page = handler.getPage();
      if (checkPageInstance(page))
      {
        String componentPath = handler.getComponentPath();
        RequestListenerInterface listenerInterface = handler.getListenerInterface();

        Integer renderCount = null;
        if (listenerInterface.isIncludeRenderCount())
        {
          renderCount = page.getRenderCount();
        }

        PageInfo pageInfo = getPageInfo(handler);
        ComponentInfo componentInfo = new ComponentInfo(renderCount,
          requestListenerInterfaceToString(listenerInterface), componentPath,
          handler.getBehaviorIndex());
        PageComponentInfo pageComponentInfo = new PageComponentInfo(pageInfo, componentInfo);
        PageParameters parameters = new PageParameters(page.getPageParameters());
        UrlInfo urlInfo = new UrlInfo(pageComponentInfo, page.getClass(),
          parameters.mergeWith(handler.getPageParameters()));
        url = buildUrl(urlInfo);
      }
    }
View Full Code Here

Examples of org.apache.wicket.request.component.IRequestablePage

   * @see org.apache.wicket.request.IRequestHandler#respond(org.apache.wicket.request.IRequestCycle)
   */
  @Override
  public void respond(final IRequestCycle requestCycle)
  {
    final IRequestablePage page = getPage();
    final boolean freshPage = pageComponentProvider.isPageInstanceFresh();
    final boolean isAjax = ((WebRequest)requestCycle.getRequest()).isAjax();

    IRequestableComponent component;
    try
    {
      component = getComponent();
    }
    catch (ComponentNotFoundException e)
    {
      // either the page is stateless and the component we are looking for is not added in the
      // constructor
      // or the page is stateful+stale and a new instances was created by pageprovider
      // we denote this by setting component to null
      component = null;
    }

    if ((component == null && !freshPage) || (component != null && component.getPage() != page))
    {
      throw new ComponentNotFoundException("Component '" + getComponentPath()
          + "' has been removed from page.");
    }

    if (page instanceof Page)
    {
      // initialize the page to be able to check whether it is stateless
      ((Page)page).internalInitialize();
    }
    final boolean isStateless = page.isPageStateless();

    RedirectPolicy policy = isStateless
      ? RedirectPolicy.NEVER_REDIRECT
      : RedirectPolicy.AUTO_REDIRECT;
    final IPageProvider pageProvider = new PageProvider(page);
View Full Code Here

Examples of org.apache.wicket.request.component.IRequestablePage

          handler.getPageClass(), handler.getPageParameters());

        return buildUrl(urlInfo);
      }

      IRequestablePage page = handler.getPage();

      if (checkPageInstance(page) &&
        (!pageMustHaveBeenCreatedBookmarkable() || page.wasCreatedBookmarkable()))
      {
        PageInfo info = getPageInfo(handler);
        PageComponentInfo pageComponentInfo = new PageComponentInfo(info, null);

        UrlInfo urlInfo = new UrlInfo(pageComponentInfo, page.getClass(),
          handler.getPageParameters());
        return buildUrl(urlInfo);
      }
      else
      {
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.