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

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


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


     *            the current request's non-modified parameters
     * @return all parameters but Wicket internal ones
     */
    private PageParameters cleanPageParameters(final PageParameters originalParameters)
    {
      PageParameters cleanParameters = null;
      if (originalParameters != null)
      {
        cleanParameters = new PageParameters(originalParameters);

        // WICKET-4038: Ajax related parameters are set by wicket-ajax.js when needed.
        // They shouldn't be propagated to the next requests
        cleanParameters.remove(WebRequest.PARAM_AJAX);
        cleanParameters.remove(WebRequest.PARAM_AJAX_BASE_URL);
        cleanParameters.remove(WebRequest.PARAM_AJAX_REQUEST_ANTI_CACHE);

        if (cleanParameters.isEmpty())
        {
          cleanParameters = null;
        }
      }
      return cleanParameters;
View Full Code Here

  public IRequestHandler mapRequest(Request request)
  {
    Url url = request.getUrl();

    // extract the PageParameters from URL if there are any
    PageParameters pageParameters = extractPageParameters(request, url.getSegments().size(),
      pageParametersEncoder);

    if (url.getSegments().size() >= 4 &&
      urlStartsWith(url, getContext().getNamespace(), getContext().getResourceIdentifier()))
    {
View Full Code Here

      segments.add(getContext().getNamespace());
      segments.add(getContext().getResourceIdentifier());
      segments.add(getClassName(reference.getScope()));

      // setup resource parameters
      PageParameters parameters = referenceRequestHandler.getPageParameters();

      if (parameters == null)
      {
        parameters = new PageParameters();
      }
      else
      {
        parameters = new PageParameters(parameters);

        // need to remove indexed parameters otherwise the URL won't be able to decode
        parameters.clearIndexed();
      }
      encodeResourceReferenceAttributes(url, reference);

      StringTokenizer tokens = new StringTokenizer(reference.getName(), "/");

      while (tokens.hasMoreTokens())
      {
        String token = tokens.nextToken();

        // on the last component of the resource path
        if (tokens.hasMoreTokens() == false && Strings.isEmpty(token) == false)
        {
          final IResource resource = reference.getResource();

          // is resource supposed to be cached?
          if (resource instanceof IStaticCacheableResource)
          {
            final IStaticCacheableResource cacheable = (IStaticCacheableResource)resource;
           
            // is caching enabled?
            if(cacheable.isCachingEnabled())
            {
              // apply caching scheme to resource url
              final ResourceUrl resourceUrl = new ResourceUrl(token, parameters);
              getCachingStrategy().decorateUrl(resourceUrl, cacheable);
              token = resourceUrl.getFileName();
 
              if (Strings.isEmpty(token))
              {
                throw new IllegalStateException(
                  "caching strategy returned empty name for " + resource);
              }
            }
          }
        }
        segments.add(token);
      }

      if (parameters.isEmpty() == false)
      {
        url = encodePageParameters(url, parameters, pageParametersEncoder);
      }

      return url;
View Full Code Here

   */
  public String urlFor(Link<?> link)
  {
    Args.notNull(link, "link");

    Url url = Url.parse(link.urlFor(ILinkListener.INTERFACE, new PageParameters()).toString());
    return transform(url).toString();
  }
View Full Code Here

          BookmarkablePageLink.class.getDeclaredField("parameters");
          Method getParametersMethod = BookmarkablePageLink.class.getDeclaredMethod(
            "getPageParameters", (Class<?>[])null);
          getParametersMethod.setAccessible(true);

          PageParameters parameters = (PageParameters)getParametersMethod.invoke(
            bookmarkablePageLink, (Object[])null);

          startPage(bookmarkablePageLink.getPageClass(), parameters);
        }
        catch (Exception e)
View Full Code Here

  public void submitForm(String path)
  {
    Form<?> form = (Form<?>)getComponentFromLastRenderedPage(path);
    Url url = Url.parse(
      form.getRootForm()
        .urlFor(IFormSubmitListener.INTERFACE, new PageParameters())
        .toString(), Charset.forName(request.getCharacterEncoding()));

    // make url absolute
    transform(url);
View Full Code Here

            }
        };
    }

    private CharSequence getViewUrl(FileItem fileItem) {
        PageParameters params = new PageParameters();
        params.set("filename", fileItem.getName());
        CharSequence url = RequestCycle.get().urlFor(new FileManageResourceReference(WicketApplication.BASE_FOLDER), params);
        return url;
    }
View Full Code Here

        return url;
    }


    private CharSequence getDeleteUrl(FileItem fileItem) {
        PageParameters params = new PageParameters();
        params.set("filename", fileItem.getName());
        params.set("delete", true);
        CharSequence url = RequestCycle.get().urlFor(new FileManageResourceReference(WicketApplication.BASE_FOLDER), params);
        return url;
    }
View Full Code Here

    super.bind(component);
    this.calendar = (FullCalendar) component;
  }

  protected final String getUrl(Map<String, Object> parameters) {
    PageParameters params = new PageParameters();
    String url = calendar.urlFor(IBehaviorListener.INTERFACE, params).toString();

    if (parameters != null) {
      for (Map.Entry<String, Object> parameter : parameters.entrySet()) {
        url += "&" + parameter.getKey() + "=" + parameter.getValue();
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.