Package org.apache.wicket.request.mapper.parameter

Examples of org.apache.wicket.request.mapper.parameter.PageParameters


  {
    int[] matchedParameters = getMatchedSegmentSizes(url);
    int total = 0;
    for (int curMatchSize : matchedParameters)
      total += curMatchSize;
    PageParameters pageParameters = extractPageParameters(request, total, pageParametersEncoder);

    int skippedParameters = 0;
    for (int pathSegmentIndex = 0; pathSegmentIndex < pathSegments.size(); pathSegmentIndex++)
    {
      MountPathSegment curPathSegment = pathSegments.get(pathSegmentIndex);
      int matchSize = matchedParameters[pathSegmentIndex] - curPathSegment.getFixedPartSize();
      int optionalParameterMatch = matchSize - curPathSegment.getMinParameters();
      for (int matchSegment = 0; matchSegment < matchSize; matchSegment++)
      {
        if (pageParameters == null)
        {
          pageParameters = new PageParameters();
        }

        int curSegmentIndex = matchSegment + curPathSegment.getSegmentIndex();
        String curSegment = mountSegments[curSegmentIndex];
        String placeholder = getPlaceholder(curSegment);
        String optionalPlaceholder = getOptionalPlaceholder(curSegment);
        // extract the parameter from URL
        if (placeholder != null)
        {
          pageParameters.add(placeholder,
            url.getSegments().get(curSegmentIndex - skippedParameters));
        }
        else if (optionalPlaceholder != null && optionalParameterMatch > 0)
        {
          pageParameters.add(optionalPlaceholder,
            url.getSegments().get(curSegmentIndex - skippedParameters));
          optionalParameterMatch--;
        }
      }
      skippedParameters += curPathSegment.getMaxParameters() - matchSize;
View Full Code Here


    return ret;
  }

  protected PageParameters newPageParameters()
  {
    return new PageParameters();
  }
View Full Code Here

        PageInfo pageInfo = new PageInfo(page.getPageId());
        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);
      }
    }

    return url;
View Full Code Here

    {
      url.getSegments().add(s);
    }
    encodePageComponentInfo(url, info.getPageComponentInfo());

    PageParameters copy = new PageParameters(info.getPageParameters());

    int dropped = 0;
    for (int i = 0; i < mountSegments.length; ++i)
    {
      String placeholder = getPlaceholder(mountSegments[i]);
      String optionalPlaceholder = getOptionalPlaceholder(mountSegments[i]);
      if (placeholder != null)
      {
        url.getSegments().set(i - dropped, copy.get(placeholder).toString(""));
        copy.remove(placeholder);
      }
      else if (optionalPlaceholder != null)
      {
        if (copy.getNamedKeys().contains(optionalPlaceholder))
        {
          url.getSegments().set(i - dropped, copy.get(optionalPlaceholder).toString(""));
          copy.remove(optionalPlaceholder);
        }
        else
        {
          url.getSegments().remove(i - dropped);
          dropped++;
View Full Code Here

  {
    super(null, model);

    if (parameters == null)
    {
      pageParameters = new PageParameters();
    }
    else
    {
      pageParameters = parameters;
    }
View Full Code Here

      CoreLibrariesContributor.contributeAjax(component.getApplication(), response);

      response.render(JavaScriptHeaderItem.forReference(JQueryWicketAtmosphereResourceReference.get()));
      JSONObject options = new JSONObject();
      options.put("url",
        component.urlFor(this, IResourceListener.INTERFACE, new PageParameters())
          .toString());
      response.render(OnDomReadyHeaderItem.forScript("$('#" + component.getMarkupId() +
        "').wicketAtmosphere(" + options.toString() + ")"));
    }
    catch (JSONException e)
View Full Code Here

    {
      // a bit of a hack here..
      Constructor<?> constructor = constructor(pageClass, PageParameters.class);
      if (constructor != null)
      {
        PageParameters pp = new PageParameters();
        return processPage(newPage(constructor, pp), pp);
      }
      else
      {
        throw new WicketRuntimeException("Unable to create page from " + pageClass +
View Full Code Here

    Constructor<?> constructor = constructor(pageClass, PageParameters.class);

    // If we got a PageParameters constructor
    if (constructor != null)
    {
      final PageParameters nullSafeParams = parameters == null ? new PageParameters() : parameters;

      // return new Page(parameters)
      return processPage(newPage(constructor, nullSafeParams), nullSafeParams);
    }
View Full Code Here

    // 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
View Full Code Here

   *            optional argument
   */
  public PageProvider(final int pageId, final Class<? extends IRequestablePage> pageClass,
    Integer renderCount)
  {
    this(pageId, pageClass, new PageParameters(), renderCount);
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.mapper.parameter.PageParameters

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.