Examples of QueryString


Examples of org.apache.myfaces.portlet.faces.util.QueryString

        .append(mode)
        .toString();
    }
    else
    {
      QueryString qs = new QueryString(viewId.substring(queryStart + 1), "UTF8");
      qs.setParameter(Bridge.PORTLET_MODE_PARAMETER, mode);
      return sb.append(viewId.substring(0, queryStart + 1)).append(qs.toString()).toString();
    }
  }
View Full Code Here

Examples of org.apache.myfaces.portlet.faces.util.QueryString

    // do it then even if we subsequently don't need it because its not a
    // Faces resource.
   
    // Determine if there is a target viewId
    String viewId = null, path = null;
    QueryString queryStr = null;
    int queryStart = -1;

    // First: split URL into path and query string
    // Hold onto QueryString for later processing
    queryStart = url.indexOf('?');

    if (queryStart != -1)
    {
      // Get the query string
      queryStr = new QueryString(url.substring(queryStart + 1), "UTF8");
      path = url.substring(0, queryStart);
    }
    else
    {
      path = url;
      // construct an empty queryString to hold the viewId
      queryStr = new QueryString("UTF8");
    }
   
    // Now remove up through the ContextPath as we don't want it
    String ctxPath = getRequestContextPath();
    int i = path.indexOf(ctxPath);
    if (i != -1)
    {
      path = path.substring(i + ctxPath.length());
    }
   
    // Determine the viewId by inspecting the URL
    // Can't be relative by the time we get here so don't check
    viewId = getViewIdFromPath(path);
   
    // TODO: Handle the case where this is a nonFaces (inprotocol) resource
    // I.e. viewId is null here.  Should we do something similar to
    // nonFaces support from 1.0?  I.e. bridge isn't expecting to handle?

    if (viewId != null)
    {
      // This is a Faces resource
      // put the viewId in the QueryStr.
      queryStr.addParameter(JSF_RESOURCE_TARGET_VIEWID_RENDER_PARAMETER, viewId);
      queryStr.removeParameter(Bridge.PORTLET_MODE_PARAMETER);
      queryStr.removeParameter(Bridge.PORTLET_WINDOWSTATE_PARAMETER);
    }
   

    // Encode the URL
   
    ResourceURL resource = ((MimeResponse) mPortletResponse).createResourceURL();
    resource.setResourceID(path);
   
    // Walk through the queryStr Params and add as resourceParams
    // remove any attempt to set Mode/WindowState/etc. as
    // not feasible here
    // Add parameters so they don't get lost
    Enumeration<String> list = queryStr.getParameterNames();
    while (list.hasMoreElements())
    {
      String param = list.nextElement().toString();
      if (param.equals(Bridge.PORTLET_MODE_PARAMETER))
      {
        // do nothing -- just ignore -- can't encode in a resourceURL
      }
      else if (param.equals(Bridge.PORTLET_WINDOWSTATE_PARAMETER))
      {
        // do nothing -- just ignore -- can't encode in a resourceURL
      }
      else if (param.equals(Bridge.PORTLET_SECURE_PARAMETER))
      {
        try
        {
          resource.setSecure(Boolean.getBoolean(queryStr.getParameter(param)));
        }
        catch (Exception e)
        {
          ; // do nothing -- just ignore
        }
      }
      else
      {
        resource.setParameter(param, queryStr.getParameter(param));
      }
    }

    return portletURLToString(resource, isStrictXhtmlEncoded);
  }
View Full Code Here

Examples of org.apache.myfaces.portlet.faces.util.QueryString

    // Some viewId may have query string, so handle that here
    // (e.g., TaskFlow has the following viewId:
    // /adf.task-flow?_document=/WEB-INF/task-flow.xml&_id=task1

    int queryStart = viewId.indexOf('?');
    QueryString queryStr = null;

    if (queryStart != -1)
    {
      // parse the query string and add the parameters to internal maps
      // delay the creation of ParameterMap and ParameterValuesMap until
      // they are needed/called by the client
      queryStr = new QueryString(viewId.substring(queryStart + 1), "UTF8");

      // TODO: Constants
      // We store these into a temporary Map until a client calls the corresponding
      // ExternalContext public api to get the request parameter map(s).  In those
      // methods we use these temp maps to build the overall Map that is returned.
      // This roundabout technique is used to delay accessing request parameters until the
      // client first requests them.
      mTempExtraRequestParameterMap = new HashMap<String, String>(5);
      mTempExtraRequestParameterValuesMap = new HashMap<String, String[]>(5);
      // Clear any existing Request ParameterMap to ensure reconstruction
      // with these new extra entries.
      mRequestParameterMap = null;
      mRequestParameterValuesMap = null;

      Enumeration<String> list = queryStr.getParameterNames();
      while (list.hasMoreElements())
      {
        String param = list.nextElement();
        mTempExtraRequestParameterMap.put(param, queryStr.getParameter(param));
       
        // Now deal with the multiValue case
        Enumeration<String> e = queryStr.getParameterValues(param);
        ArrayList<String> l = new ArrayList(5);
        while (e.hasMoreElements())
        {
          l.add(e.nextElement());        
        }
View Full Code Here

Examples of org.docx4j.model.sdt.QueryString

      } catch (Exception e1) {
        log.error(e1.getMessage(), e1);
      }
    }
   
    QueryString qs = new QueryString();
    HashMap<String, String> map = qs.parseQueryString(tag, true);
   
    String xpathId = map.get(OpenDoPEHandler.BINDING_ROLE_XPATH);
   
    log.info("Looking for xpath by id: " + xpathId);
 
View Full Code Here

Examples of org.springframework.data.gemfire.repository.query.QueryString

   * (non-Javadoc)
   * @see org.springframework.data.gemfire.repository.GemfireRepository.sort(:org.springframework.data.domain.Sort)
   */
  @Override
  public Iterable<T> findAll(final Sort sort) {
    QueryString query = new QueryString("SELECT * FROM /RegionPlaceholder")
      .forRegion(entityInformation.getJavaType(), template.getRegion())
      .orderBy(sort);

    SelectResults<T> selectResults = template.find(query.toString());

    return selectResults.asList();
  }
View Full Code Here

Examples of org.switchyard.component.camel.common.QueryString

        Configuration modelConfiguration = getModelConfiguration();
        List<Configuration> children = modelConfiguration.getChildren();

        String baseUri = NETTY + ":" + getProtocol() + "://" + getHost() + ":" + getPort();

        QueryString queryStr = new QueryString();
        traverseConfiguration(children, queryStr, HOST, PORT);

        return URI.create(baseUri + queryStr.toString());
    }
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.