Examples of QueryString


Examples of com.braintreegateway.util.QueryString

        elements.put(name, value);
        return this;
    }
   
    public String toQueryString() {
        QueryString queryString = new QueryString();
        for (Map.Entry<String, String> entry : topLevelElements.entrySet()) {
            queryString.append(StringUtils.underscore(entry.getKey()), entry.getValue());
        }
        for (Map.Entry<String, Object> entry : elements.entrySet()) {
            queryString.append(parentBracketChildString(StringUtils.underscore(parent), StringUtils.underscore(entry.getKey())), entry.getValue());
        }
        return queryString.toString();
    }
View Full Code Here

Examples of com.ocpsoft.pretty.faces.url.QueryString

      if (url != null)
      {
         List<UIParameter> uiParams = new ArrayList<UIParameter>();

         QueryString qs = QueryString.build("");
         if (url.contains("?"))
         {
            qs.addParameters(url);

            QueryString mappingViewQueryString = QueryString.build(mapping.getViewId());
            for (String mappingViewParam : mappingViewQueryString.getParameterMap().keySet()) {
               qs.removeParameter(mappingViewParam);
            }

            // remove own own metadata
            qs.removeParameter("com.ocpsoft.mappingId");
View Full Code Here

Examples of com.ocpsoft.pretty.faces.url.QueryString

      }
      return result;
   }

   private boolean evaluateOutbound(String outboundURL) {
      QueryString outboundQueryString = new QueryString();
      if (outboundURL.contains("?")) {
         outboundQueryString.addParameters(outboundURL);
      }
      String cachedMappingId = outboundQueryString.getParameter(REWRITE_MAPPING_ID_KEY);
      if (cachedMappingId != null)
      {
         return mapping.getId().equals(Decoder.query(cachedMappingId));
      }

      String outboundPath = outboundURL;
      String mappingViewId = mapping.getViewId();
      int outboundQueryStringStart = outboundPath.indexOf("?");
      if (outboundQueryStringStart != -1)
      {
         outboundPath = outboundPath.substring(0, outboundQueryStringStart);
      }
      int mappingViewQueryStringStart = mappingViewId.indexOf("?");
      if (mappingViewQueryStringStart != -1)
      {
         mappingViewId = mappingViewId.substring(0, mappingViewQueryStringStart);
      }

      if (!mappingViewId.equals(outboundPath))
      {
         return false;
      }

      QueryString mappingViewQueryString = new QueryString();
      if (mapping.getViewId().contains("?")) {
         mappingViewQueryString.addParameters(mapping.getViewId());
      }

      for (Entry<String, String[]> mappingViewParam : mappingViewQueryString.getParameterMap().entrySet())
      {
         for (String mappingViewParamValue : mappingViewParam.getValue())
         {
            boolean found = false;
            for (Entry<String, String[]> outboundParam : outboundQueryString.getParameterMap().entrySet())
View Full Code Here

Examples of com.ocpsoft.pretty.faces.url.QueryString

      URL url = context.getRequestURL();
      if (config.isURLMapped(url))
      {
         List<PathParameter> params = context.getCurrentMapping().getPatternParser().parse(url);
         QueryString query = QueryString.build(params);

         return query.getParameterMap();
      }
      return null;
   }
View Full Code Here

Examples of com.ocpsoft.pretty.faces.url.QueryString

   private void injectQueryParams(final FacesContext context, final UrlMapping mapping,
            final PrettyContext prettyContext)
   {
      boolean isPostback = FacesStateUtils.isPostback(context);
      List<QueryParameter> params = mapping.getQueryParams();
      QueryString queryString = prettyContext.getRequestQueryString();
      for (QueryParameter param : params)
      {
         // check if to skip this QueryParameter due to onPostback attribute
         if (!param.isOnPostback() && isPostback)
         {
            continue;
         }

         String el = param.getExpression().getELExpression();
         if ((el != null) && !"".equals(el.trim()))
         {
            String name = param.getName();
            if (queryString.getParameterMap().containsKey(name))
            {
               try
               {
                  if (elUtils.getExpectedType(context, el).isArray())
                  {
                     String[] values = queryString.getParameterValues(name);
                     elUtils.setValue(context, el, values);
                  }
                  else
                  {

                     String valueAsString = queryString.getParameter(name);

                     // get the type of the referenced property and try to obtain a converter for it
                     Class<?> expectedType = elUtils.getExpectedType(context, el);
                     Converter converter = context.getApplication().createConverter(expectedType);
View Full Code Here

Examples of com.ocpsoft.pretty.faces.url.QueryString

         }
         viewId = FacesNavigationURLCanonicalizer.normalizeRequestURI(context, viewId);

         URL url = new URL(viewId);
         url.getMetadata().setLeadingSlash(true);
         QueryString qs = QueryString.build("");
         if (viewId.contains("?"))
         {
            qs.addParameters(viewId);
         }
         qs.addParameters("?" + PrettyFacesWrappedResponse.REWRITE_MAPPING_ID_KEY + "=" + mapping.getId());

         viewId = url.toString() + qs.toQueryString();

         NavigationCase navigationCase = parent.getNavigationCase(context, fromAction, viewId);
         return navigationCase;
      }
      else
View Full Code Here

Examples of com.ocpsoft.pretty.faces.url.QueryString

      return result;
   }

   public QueryString buildQueryString(final UrlMapping mapping)
   {
      QueryString result = new QueryString();

      String expression = "";
      Object value = null;
      try
      {
View Full Code Here

Examples of com.ocpsoft.pretty.faces.url.QueryString

         /*
          * First build an empty query string. We will add the parameters
          * only if the URL contains a ? character in the next step
          */
         final QueryString queryString = QueryString.build("");

         /*
          * Try to identify the mapping for this URL. Remove the metadata
          * from the URL if it exists.
          */
         String mappingId = null;
         if (strippedUrl.contains("?")) {
            queryString.addParameters(strippedUrl);
            mappingId = queryString.getParameter(REWRITE_MAPPING_ID_KEY);
            queryString.removeParameter(REWRITE_MAPPING_ID_KEY);
         }

         if (mappingId != null)
         {
            matches.add(prettyConfig.getMappingById(mappingId));
         }
         else
         {
            for (UrlMapping m : prettyConfig.getMappings())
            {
               if (!"".equals(m.getViewId()) && strippedUrl.startsWith(m.getViewId()))
               {
                  matches.add(m);
               }
            }
         }

         Collections.sort(matches, ORDINAL_COMPARATOR);

         Iterator<UrlMapping> iterator = matches.iterator();
         while (iterator.hasNext())
         {
            UrlMapping m = iterator.next();

            if (m.isOutbound())
            {
               List<UIParameter> uiParams = new ArrayList<UIParameter>();

               Map<String, String[]> queryParams = queryString.getParameterMap();

               List<PathParameter> pathParams = m.getPatternParser().getPathParameters();

               int pathParamsFound = 0;
               for (PathParameter p : pathParams)
View Full Code Here

Examples of com.ocpsoft.pretty.faces.url.QueryString

         ExternalContext externalContext = context.getExternalContext();
         String contextPath = prettyContext.getContextPath();
         if (PrettyContext.PRETTY_PREFIX.equals(action) && prettyContext.isPrettyRequest())
         {
            URL url = prettyContext.getRequestURL();
            QueryString query = prettyContext.getRequestQueryString();

            String target = contextPath + url.encode() + query.toQueryString();
            log.trace("Refreshing requested page [" + url + "]");
            encodeURL(externalContext, config, target);
            return true;
         }
         else if (isPrettyNavigationCase(prettyContext, action))
View Full Code Here

Examples of com.ocpsoft.pretty.faces.url.QueryString

      {
         String strippedUrl = stripContextPath(url);

         List<UrlMapping> matches = new ArrayList<UrlMapping>();

         QueryString queryString = QueryString.build(strippedUrl);
         String mappingId = queryString.getParameter("com.ocpsoft.mappingId");
         if (mappingId != null)
         {
            matches.add(prettyConfig.getMappingById(mappingId));
         }
         else
         {
            for (UrlMapping m : prettyConfig.getMappings())
            {
               if (!"".equals(m.getViewId()) && strippedUrl.startsWith(m.getViewId()))
               {
                  matches.add(m);
               }
            }
         }

         Collections.sort(matches, ORDINAL_COMPARATOR);

         Iterator<UrlMapping> iterator = matches.iterator();
         while (iterator.hasNext())
         {
            UrlMapping m = iterator.next();

            if (m.isOutbound())
            {
               List<UIParameter> uiParams = new ArrayList<UIParameter>();

               QueryString qs = QueryString.build("");
               if (url.contains("?"))
               {
                  qs.addParameters(url);

                  // remove own own metadata
                  qs.removeParameter("com.ocpsoft.mappingId");
               }
               Map<String, String[]> queryParams = qs.getParameterMap();

               List<PathParameter> pathParams = m.getPatternParser().getPathParameters();

               int pathParamsFound = 0;
               for (PathParameter p : pathParams)
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.