Package org.apache.wicket.core.request.handler

Examples of org.apache.wicket.core.request.handler.PageProvider


   * @return a {@code IRequestHandler} capable of processing the bookmarkable request.
   */
  protected IRequestHandler processBookmarkable(Class<? extends IRequestablePage> pageClass,
    PageParameters pageParameters)
  {
    PageProvider provider = new PageProvider(pageClass, pageParameters);
    provider.setPageSource(getContext());
    return new RenderPageRequestHandler(provider);
  }
View Full Code Here


   */
  protected IRequestHandler processHybrid(PageInfo pageInfo,
    Class<? extends IRequestablePage> pageClass, PageParameters pageParameters,
    Integer renderCount)
  {
    PageProvider provider = new PageProvider(pageInfo.getPageId(), pageClass, pageParameters,
      renderCount);
    provider.setPageSource(getContext());
    if (provider.isNewPageInstance() &&
      !WebApplication.get().getPageSettings().getRecreateMountedPagesAfterExpiry())
    {
      throw new PageExpiredException(String.format("Bookmarkable page id '%d' has expired.",
        pageInfo.getPageId()));
    }
View Full Code Here

      {
        pageUrl = requestCycle.urlFor(page.getClass(), page.getPageParameters());
      }
      else
      {
        IRequestHandler handler = new RenderPageRequestHandler(new PageProvider(page));
        pageUrl = requestCycle.urlFor(handler);
      }

      appendAssignment(buffer, "settings.src", pageUrl);
    }
View Full Code Here

        Integer renderCount = info.getComponentInfo() != null ? info.getComponentInfo()
          .getRenderCount() : null;

        if (info.getComponentInfo() == null)
        {
          PageProvider provider = new PageProvider(info.getPageInfo().getPageId(),
            renderCount);
          provider.setPageSource(getContext());
          // render page
          return new RenderPageRequestHandler(provider);
        }
        else
        {
          ComponentInfo componentInfo = info.getComponentInfo();

          PageAndComponentProvider provider = new PageAndComponentProvider(
            info.getPageInfo().getPageId(), renderCount,
            componentInfo.getComponentPath());

          provider.setPageSource(getContext());

          // listener interface
          RequestListenerInterface listenerInterface = requestListenerInterfaceFromString(componentInfo.getListenerInterface());

          return new ListenerInterfaceRequestHandler(provider, listenerInterface,
View Full Code Here

   *
   */
  @Test
  public void encode1()
  {
    PageProvider provider = new PageProvider(MockPage.class, new PageParameters());
    provider.setPageSource(context);
    IRequestHandler handler = new BookmarkablePageRequestHandler(provider);
    Url url = encoder.mapHandler(handler);
    assertEquals("wicket/bookmarkable/" + PAGE_CLASS_NAME, url.toString());
  }
View Full Code Here

    PageParameters parameters = new PageParameters();
    parameters.set(0, "i1");
    parameters.set(1, "i2");
    parameters.set("a", "b");
    parameters.set("b", "c");
    PageProvider provider = new PageProvider(MockPage.class, parameters);
    provider.setPageSource(context);
    IRequestHandler handler = new BookmarkablePageRequestHandler(provider);
    Url url = encoder.mapHandler(handler);
    assertEquals("wicket/bookmarkable/" + PAGE_CLASS_NAME + "/i1/i2?a=b&b=c", url.toString());
  }
View Full Code Here

    parameters.set(0, "i1");
    parameters.set(1, "i2");
    parameters.set("a", "b");
    parameters.set("b", "c");

    PageProvider provider = new PageProvider(MockPage.class, parameters);
    provider.setPageSource(context);
    IRequestHandler handler = new BookmarkablePageRequestHandler(provider);
    Url url = encoder.mapHandler(handler);

    assertEquals("wicket/bookmarkable/" + PAGE_CLASS_NAME + "/i1/i2?a=b&b=c", url.toString());
  }
View Full Code Here

    page.getPageParameters().set(1, "i2");
    page.getPageParameters().set("a", "b");
    page.getPageParameters().set("b", "c");
    page.setCreatedBookmarkable(true);

    IPageProvider provider = new PageProvider(page);
    IRequestHandler handler = new RenderPageRequestHandler(provider);
    Url url = encoder.mapHandler(handler);

    assertEquals("wicket/bookmarkable/" + PAGE_CLASS_NAME + "/i1/i2?15&a=b&b=c", url.toString());
  }
View Full Code Here

    page.getPageParameters().set("a", "b");
    page.getPageParameters().set("b", "c");

    page.setCreatedBookmarkable(false);

    IPageProvider provider = new PageProvider(page);
    IRequestHandler handler = new RenderPageRequestHandler(provider);
    Url url = encoder.mapHandler(handler);

    // never allow bookmarkable render url for page that has not been created by bookmarkable
    // URL
View Full Code Here

    MockPage page = new MockPage(15);
    page.setBookmarkable(true);
    page.setCreatedBookmarkable(true);
    page.setPageStateless(true);

    IPageProvider provider = new PageProvider(page);
    IRequestHandler handler = new RenderPageRequestHandler(provider);

    Url url = encoder.mapHandler(handler);

    assertEquals("wicket/bookmarkable/" + PAGE_CLASS_NAME, url.toString());
View Full Code Here

TOP

Related Classes of org.apache.wicket.core.request.handler.PageProvider

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.