Examples of PageComponentInfo


Examples of org.apache.wicket.request.mapper.info.PageComponentInfo

    UrlInfo urlInfo = parseRequest(request);

    // check if the URL is long enough and starts with the proper segments
    if (urlInfo != null)
    {
      PageComponentInfo info = urlInfo.getPageComponentInfo();
      Class<? extends IRequestablePage> pageClass = urlInfo.getPageClass();
      PageParameters pageParameters = urlInfo.getPageParameters();

      if (info == null || info.getPageInfo().getPageId() == null)
      {
        // if there are is no page instance information (only page map name - optionally)
        // then this is a simple bookmarkable URL
        return processBookmarkable(pageClass, pageParameters);
      }
      else if (info.getPageInfo().getPageId() != null && info.getComponentInfo() == null)
      {
        // if there is page instance information in the URL but no component and listener
        // interface then this is a hybrid URL - we need to try to reuse existing page
        // instance
        return processHybrid(info.getPageInfo(), pageClass, pageParameters, null);
      }
      else if (info.getComponentInfo() != null)
      {
        // with both page instance and component+listener this is a listener interface URL
        return processListener(info, pageClass, pageParameters);
      }
    }
View Full Code Here

Examples of org.apache.wicket.request.mapper.info.PageComponentInfo

      {
        return null;
      }

      PageInfo info = new PageInfo();
      UrlInfo urlInfo = new UrlInfo(new PageComponentInfo(info, null),
        handler.getPageClass(), handler.getPageParameters());

      return buildUrl(urlInfo);
    }
    else if (requestHandler instanceof RenderPageRequestHandler)
    {
      // possibly hybrid URL - bookmarkable URL with page instance information
      // but only allowed if the page was created by bookamarkable URL

      RenderPageRequestHandler handler = (RenderPageRequestHandler)requestHandler;

      if (!checkPageClass(handler.getPageClass()))
      {
        return null;
      }

      if (handler.getPageProvider().isNewPageInstance())
      {
        // no existing page instance available, don't bother creating new page instance
        PageInfo info = new PageInfo();
        UrlInfo urlInfo = new UrlInfo(new PageComponentInfo(info, null),
          handler.getPageClass(), handler.getPageParameters());

        return buildUrl(urlInfo);
      }

      IRequestablePage page = handler.getPage();

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

        UrlInfo urlInfo = new UrlInfo(pageComponentInfo, page.getClass(),
          handler.getPageParameters());
        return buildUrl(urlInfo);
      }
      else
      {
        return null;
      }

    }
    else if (requestHandler instanceof BookmarkableListenerInterfaceRequestHandler)
    {
      // listener interface URL with page class information
      BookmarkableListenerInterfaceRequestHandler handler = (BookmarkableListenerInterfaceRequestHandler)requestHandler;
      IRequestablePage page = handler.getPage();

      if (!checkPageClass(page.getClass()))
      {
        return null;
      }

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

      PageInfo pageInfo = new PageInfo(page);
      ComponentInfo componentInfo = new ComponentInfo(renderCount,
        requestListenerInterfaceToString(handler.getListenerInterface()),
        handler.getComponent().getPageRelativePath(), handler.getBehaviorIndex());

      UrlInfo urlInfo = new UrlInfo(new PageComponentInfo(pageInfo, componentInfo),
        page.getClass(), handler.getPageParameters());
      return buildUrl(urlInfo);
    }

    return null;
View Full Code Here

Examples of org.apache.wicket.request.mapper.info.PageComponentInfo

  {
    Url url = request.getUrl();
    if (url.getSegments().size() >= 1 && urlStartsWith(url, mountPath))
    {
      // try to extract page and component information from URL
      PageComponentInfo info = getPageComponentInfo(url);

      // load the page class
      String className = url.getSegments().get(1);
      String fullyQualifiedClassName = packageName.getName() + '.' + className;
      Class<? extends IRequestablePage> pageClass = getPageClass(fullyQualifiedClassName);
View Full Code Here

Examples of org.apache.wicket.request.mapper.info.PageComponentInfo

    if (url.getSegments().size() >= 3 &&
      urlStartsWith(url, getContext().getNamespace(),
        getContext().getBookmarkableIdentifier()))
    {
      // try to extract page and component information from URL
      PageComponentInfo info = getPageComponentInfo(url);

      // load the page class
      String className = url.getSegments().get(2);
      Class<? extends IRequestablePage> pageClass = getPageClass(className);
View Full Code Here

Examples of org.apache.wicket.request.mapper.info.PageComponentInfo

    }
    // check if the URL starts with the proper segments
    else if (urlStartsWith(url, mountSegments))
    {
      // try to extract page and component information from URL
      PageComponentInfo info = getPageComponentInfo(url);
      Class<? extends IRequestablePage> pageClass = getPageClass();
      PageParameters pageParameters = extractPageParameters(request, url);

      return new UrlInfo(info, pageClass, pageParameters);
    }
View Full Code Here

Examples of org.apache.wicket.request.mapper.info.PageComponentInfo

    UrlInfo urlInfo = parseRequest(request);

    // check if the URL is long enough and starts with the proper segments
    if (urlInfo != null)
    {
      PageComponentInfo info = urlInfo.getPageComponentInfo();
      Class<? extends IRequestablePage> pageClass = urlInfo.getPageClass();
      PageParameters pageParameters = urlInfo.getPageParameters();

      if (info == null || info.getPageInfo().getPageId() == null)
      {
        // if there are is no page instance information (only page map name - optionally)
        // then this is a simple bookmarkable URL
        return processBookmarkable(pageClass, pageParameters);
      }
      else if (info.getPageInfo().getPageId() != null && info.getComponentInfo() == null)
      {
        // if there is page instance information in the URL but no component and listener
        // interface then this is a hybrid URL - we need to try to reuse existing page
        // instance
        return processHybrid(info.getPageInfo(), pageClass, pageParameters, null);
      }
      else if (info.getComponentInfo() != null)
      {
        // with both page instance and component+listener this is a listener interface URL
        return processListener(info, pageClass, pageParameters);
      }
    }
View Full Code Here

Examples of org.apache.wicket.request.mapper.info.PageComponentInfo

      {
        return null;
      }

      PageInfo info = new PageInfo();
      UrlInfo urlInfo = new UrlInfo(new PageComponentInfo(info, null),
        handler.getPageClass(), handler.getPageParameters());

      return buildUrl(urlInfo);
    }
    else if (requestHandler instanceof RenderPageRequestHandler)
    {
      // possibly hybrid URL - bookmarkable URL with page instance information
      // but only allowed if the page was created by bookmarkable URL

      RenderPageRequestHandler handler = (RenderPageRequestHandler)requestHandler;

      if (!checkPageClass(handler.getPageClass()))
      {
        return null;
      }

      if (handler.getPageProvider().isNewPageInstance())
      {
        // no existing page instance available, don't bother creating new page instance
        PageInfo info = new PageInfo();
        UrlInfo urlInfo = new UrlInfo(new PageComponentInfo(info, null),
          handler.getPageClass(), handler.getPageParameters());

        return buildUrl(urlInfo);
      }

      IRequestablePage page = handler.getPage();

      if (!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
      {
        return null;
      }

    }
    else if (requestHandler instanceof BookmarkableListenerInterfaceRequestHandler)
    {
      // listener interface URL with page class information
      BookmarkableListenerInterfaceRequestHandler handler = (BookmarkableListenerInterfaceRequestHandler)requestHandler;
      Class<? extends IRequestablePage> pageClass = handler.getPageClass();

      if (!checkPageClass(pageClass))
      {
        return null;
      }

      Integer renderCount = null;
      if (handler.getListenerInterface().isIncludeRenderCount())
      {
        renderCount = handler.getRenderCount();
      }

      PageInfo pageInfo = new PageInfo(handler.getPageId());
      ComponentInfo componentInfo = new ComponentInfo(renderCount,
        requestListenerInterfaceToString(handler.getListenerInterface()),
        handler.getComponentPath(), handler.getBehaviorIndex());

      UrlInfo urlInfo = new UrlInfo(new PageComponentInfo(pageInfo, componentInfo),
        pageClass, handler.getPageParameters());
      return buildUrl(urlInfo);
    }

    return null;
View Full Code Here

Examples of org.apache.wicket.request.mapper.info.PageComponentInfo

    {
      for (QueryParameter queryParameter : url.getQueryParameters())
      {
        if (Strings.isEmpty(queryParameter.getValue()))
        {
          PageComponentInfo pageComponentInfo = PageComponentInfo.parse(queryParameter.getName());
          if (pageComponentInfo != null)
          {
            return pageComponentInfo;
          }
        }
View Full Code Here

Examples of org.apache.wicket.request.mapper.info.PageComponentInfo

    if (matches(request))
    {
      Url url = request.getUrl();

      // try to extract page and component information from URL
      PageComponentInfo info = getPageComponentInfo(url);

      List<String> segments = url.getSegments();

      // load the page class
      String className;
View Full Code Here

Examples of org.apache.wicket.request.mapper.info.PageComponentInfo

    UrlInfo urlInfo = parseRequest(request);

    // check if the URL is long enough and starts with the proper segments
    if (urlInfo != null)
    {
      PageComponentInfo info = urlInfo.getPageComponentInfo();
      Class<? extends IRequestablePage> pageClass = urlInfo.getPageClass();
      PageParameters pageParameters = urlInfo.getPageParameters();

      if (info == null)
      {
        // if there are is no page instance information (only page map name - optionally)
        // then this is a simple bookmarkable URL
        return processBookmarkable(pageClass, pageParameters);
      }
      else if (info.getPageInfo().getPageId() != null && info.getComponentInfo() == null)
      {
        // if there is page instance information in the URL but no component and listener
        // interface then this is a hybrid URL - we need to try to reuse existing page
        // instance
        return processHybrid(info.getPageInfo(), pageClass, pageParameters, null);
      }
      else if (info.getComponentInfo() != null)
      {
        // with both page instance and component+listener this is a listener interface URL
        return processListener(info, pageClass, pageParameters);
      }
      else if (info.getPageInfo().getPageId() == null)
      {
        return processBookmarkable(pageClass, pageParameters);
      }

    }
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.