Creates a query String build from this search parameters for HTML links.<p>

@return a query String build from this search parameters for HTML links
344383
public String toQueryString() {

        StringBuffer result = new StringBuffer(128);
        result.append("?action=search");
        if (getParsedQuery() != null) {
            result.append("&parsedQuery=");
            result.append(CmsEncoder.encodeParameter(getParsedQuery()));
        } else {
            result.append("&query=");
            result.append(CmsEncoder.encodeParameter(getQuery()));
        }

        result.append("&matchesPerPage=");
        result.append(getMatchesPerPage());
        result.append("&displayPages=");
        result.append(getDisplayPages());
        result.append("&index=");
        result.append(CmsEncoder.encodeParameter(getIndex()));

        Sort sort = getSort();
        if (sort != CmsSearchParameters.SORT_DEFAULT) {
            result.append("&sort=");
            if (sort == CmsSearchParameters.SORT_TITLE) {
                result.append("title");
            } else if (sort == CmsSearchParameters.SORT_DATE_CREATED) {
                result.append("date-created");
            } else if (sort == CmsSearchParameters.SORT_DATE_LASTMODIFIED) {
                result.append("date-lastmodified");
            }
        }

        if ((getCategories() != null) && (getCategories().size() > 0)) {
            result.append("&category=");
            Iterator<String> it = getCategories().iterator();
            while (it.hasNext()) {
                result.append(it.next());
                if (it.hasNext()) {
                    result.append(',');
                }
            }
        }

        if (getMinDateCreated() > Long.MIN_VALUE) {
            result.append("&minDateCreated=");
            result.append(getMinDateCreated());
        }
        if (getMinDateLastModified() > Long.MIN_VALUE) {
            result.append("&minDateLastModified=");
            result.append(getMinDateLastModified());
        }
        if (getMaxDateCreated() < Long.MAX_VALUE) {
            result.append("&maxDateCreated=");
            result.append(getMaxDateCreated());
        }
        if (getMaxDateLastModified() < Long.MAX_VALUE) {
            result.append("&maxDateLastModified=");
            result.append(getMaxDateLastModified());
        }

        if ((getRoots() != null) && (getRoots().size() > 0)) {
            result.append("&searchRoots=");
            Iterator<String> it = getRoots().iterator();
            while (it.hasNext()) {
                result.append(CmsEncoder.encode(it.next()));
                if (it.hasNext()) {
                    result.append(',');
                }
            }
        }

        if (isExcerptOnlySearchedFields()) {
            result.append("&excerptOnlySearchedFields=true");
        }

        return result.toString();
    }
1060291
private void buildQueryString() throws MalformedURLException {
		StringBuilder builder = new StringBuilder();

		// Put the query parameters on the URL before issuing the request
		if (!query.isEmpty()) {
			for (Map.Entry<String, String> param : query.entrySet()) {
				builder.append(param.getKey());
				builder.append("=");
				builder.append(param.getValue());
				builder.append("&");
			}
			builder.deleteCharAt(builder.lastIndexOf("&")); // Remove the trailing ampersand
		}

		if (builder.length() > 0) {
			// If there was any query string at all, begin it with the question mark
			builder.insert(0, "?");
		}

		url = new URL(url.toString() + builder.toString());
	}
1153413
public static String buildParam(String paramName, List<String> paramArgs)
      throws IOException {
    StringBuilder sb = new StringBuilder();
    for (String arg : paramArgs) {
      if (sb.length() > 0) {
        sb.append("&");
      }
      sb.append(paramName).append("=").append(URLEncoder.encode(arg, "UTF-8"));
    }
    return sb.toString();
  }
1091202
public String defaultActionHtml() {

        String params = allParamsAsRequest();
        String titleUri = CmsEncoder.escapeXml(getJsp().getRequest().getParameter(PARAM_TITLE_URI));
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(titleUri)) {
            titleUri = CmsToolManager.ADMINVIEW_ROOT_LOCATION + "/list-title.jsp";
        }
        String titleSrc = getFrameSource("tool_title", getJsp().link(titleUri + "?" + params));
        String contentSrc = getFrameSource(
            "tool_content",
            getJsp().link(CmsToolManager.ADMINVIEW_ROOT_LOCATION + "/list-explorer.jsp") + "?" + params);
        StringBuffer html = new StringBuffer(1024);
        html.append("<!DOCTYPE html>\n");
        html.append("<html>\n");
        html.append("\t<head>\n");
        html.append("\t\t<meta HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=\"").append(
            getEncoding()).append("\">\n");
        String uplink = "/opencms_a/opencms/system/workplace/views/admin/admin-main.jsp?path=/projects/files&action=initial&projectid=fa9f561f-be30-11e2-bac3-21ebf444feef&showexplorer=true";
        html.append(
            "<script type='text/javascript'>var uplink = \""
                + CmsStringUtil.escapeJavaScript(uplink)
                + "\";</script>\n");
        html.append("\t\t<title>\n");
        html.append(
            "\t\t\t").append(
                key(
                    org.opencms.workplace.Messages.GUI_LABEL_WPTITLE_1,
                    new Object[] {getSettings().getUser().getFullName()})).append("\n");
        html.append("\t\t</title>\n");
        html.append("\t</head>\n");
        html.append("\t<frameset rows='57,*' border='0' frameborder='0' framespacing='0'>\n");
        html.append("\t\t<frame ").append(titleSrc).append(" frameborder='0' border='0' noresize scrolling='no'>\n");
        html.append("\t\t<frame ").append(contentSrc).append(
            " frameborder='0' border='0' noresize scrolling='auto' framespacing='0' marginheight='2' marginwidth='2' >\n");
        html.append("\t</frameset>\n");
        html.append("</html>\n");
        return html.toString();
    }
1080231
private Query getNamedOrCreateQuery(String queryString) {
    if (queryString.charAt(0) == '@') return getSession().getNamedQuery(queryString.substring(1));
    else return getSession().createQuery(queryString);
  }
272755
public String buildDialogForm() {

        StringBuffer result = new StringBuffer(16384);
        Iterator<CmsResource> i = getImages().iterator();

        result.append("<div style=\"height: 450px; padding: 4px; overflow: auto;\">");

        while (i.hasNext()) {
            CmsResource res = i.next();
            String imageName = res.getName();
            String propertySuffix = "" + imageName.hashCode();
            result.append(dialogBlockStart(imageName));
            result.append("<table border=\"0\">\n");
            result.append("<tr>\n\t<td style=\"vertical-align: top;\">");
            // create image tag
            result.append("<img src=\"");
            StringBuffer link = new StringBuffer(256);
            link.append(getCms().getSitePath(res));
            link.append(getImageScaler().toRequestParam());
            result.append(getJsp().link(link.toString()));
            result.append("\" border=\"0\" alt=\"\" width=\"");
            result.append(getImageScaler().getWidth());
            result.append("\" height=\"");
            result.append(getImageScaler().getHeight());
            result.append("\">");

            result.append("</td>\n");
            result.append("\t<td class=\"maxwidth\" style=\"vertical-align: top;\">\n");

            result.append("\t\t<table border=\"0\">\n");

            // build title property input row
            String title = "";
            try {
                title = getCms().readPropertyObject(res, CmsPropertyDefinition.PROPERTY_TITLE, false).getValue();
            } catch (CmsException e) {
                // log, should never happen
                if (LOG.isErrorEnabled()) {
                    LOG.error(e.getLocalizedMessage(getLocale()));
                }
            }
            result.append("\t\t<tr>\n\t\t\t<td style=\"white-space: nowrap;\" unselectable=\"on\">");
            result.append(key(Messages.GUI_LABEL_TITLE_0));
            result.append(":</td>\n\t\t\t<td class=\"maxwidth\">");
            result.append("<input type=\"text\" class=\"maxwidth\" name=\"");
            result.append(PREFIX_TITLE);
            result.append(propertySuffix);
            result.append("\" value=\"");
            if (CmsStringUtil.isNotEmpty(title)) {
                result.append(CmsEncoder.escapeXml(title));
            }
            result.append("\">");
            result.append("</td>\n\t\t</tr>\n");

            // build description property input row
            String description = "";
            try {
                description = getCms().readPropertyObject(
                    res,
                    CmsPropertyDefinition.PROPERTY_DESCRIPTION,
                    false).getValue();
            } catch (CmsException e) {
                // log, should never happen
                if (LOG.isErrorEnabled()) {
                    LOG.error(e.getLocalizedMessage(getLocale()));
                }
            }
            result.append(
                "\t\t<tr>\n\t\t\t<td style=\"white-space: nowrap; vertical-align: top;\" unselectable=\"on\">");
            result.append(key(Messages.GUI_LABEL_DESCRIPTION_0));
            result.append(":</td>\n\t\t\t<td style=\"vertical-align: top; height: 110px;\">");
            result.append("<textarea rows=\"8\" class=\"maxwidth\" style=\"overflow: auto;\" name=\"");
            result.append(PREFIX_DESCRIPTION);
            result.append(propertySuffix);
            result.append("\">");
            if (CmsStringUtil.isNotEmpty(description)) {
                result.append(CmsEncoder.escapeXml(description));
            }
            result.append("</textarea>");
            result.append("</td>\n\t\t</tr>\n");

            result.append("\t\t</table>\n");

            result.append("</td>\n</tr>\n");
            result.append("</table>\n");
            result.append(dialogBlockEnd());

            if (i.hasNext()) {
                // append spacer if another entry follows
                result.append(dialogSpacer());
            }
        }

        result.append("</div>");

        return result.toString();
    }
297584
public WebQuery buildQuery()
	{
		Map<String, List<String>> map = new HashMap<>(constraints);

		applyDefault(WQUriControlField.FETCH, map, defaultFetch);
		applyDefault(WQUriControlField.EXPAND, map, defaultExpand);
		applyDefault(WQUriControlField.ORDER, map, defaultOrder);
		applyDefault(WQUriControlField.OFFSET, map, "0");
		applyDefault(WQUriControlField.LIMIT, map, Integer.toString(defaultLimit));

		return new WebQuery().decode(map);
	}
843069
private String createQueryString() {
        QueryChunk[] chunks = query.getChunks();
		if ((chunks == null) || (chunks.length == 0)) {
			// no query chunks
			return "";
		}

		StringBuffer sb = new StringBuffer();
        QueryChunk chunk = null;
        int position = 1;
        for (int i = 0; i < chunks.length; i++) {
			chunk = chunks[i];
			//System.out.println("chunk = " + chunk);
			switch (chunk.getType()) {
				case QueryChunk.PARAMETER_TYPE: {
                    position++;
                    String paramName = chunk.getText();
					QueryParameter param = parameters.get(paramName);					
					if (QueryParameter.MULTIPLE_SELECTION.equals(param.getSelection())) {
						if (QueryUtil.isProcedureCall(query.getText())) {		
							sb.append("?");
						} else {
							Object[] paramValue = (Object[]) parameterValues.get(paramName);						
							sb.append('(');
							for (int j = 0; j < paramValue.length; j++) {
								if (j > 0) {
									sb.append(',');
								}
								sb.append('?');
							}
							sb.append(')');
						}
					} else {
						sb.append("?");
					}
					break;
				}
				case QueryChunk.TEXT_TYPE:
                    if (chunk.getText().contains("?")) {
                        outputParameterPosition = position;                        
                    }
                default: {
					sb.append(chunk.getText());
					break;
				}
			}
		}        
        return sb.toString();
	}
1050081
public String buildRequestUrl() {
    StringBuilder sb = new StringBuilder();
    sb.append(buildServletPath());
    if (null != pathInfo) {
      sb.append(pathInfo);
    }
    if (null != queryString) {
      sb.append('?').append(queryString);
    }
    return sb.toString();
  }
406450
public String getQueryString(){
        StringBuilder sb = new StringBuilder();
        for (Entry<String, Object> parameter : parameters.entrySet()){
            if (sb.length() > 0){
                sb.append("&");
            }
            sb.append(parameter.getKey());
            sb.append("=");
            sb.append(parameter.getValue().toString());
        }
        for (Entry<String, List> customTrackingParameter : customTrackingParameters.entrySet()){
            for (Object o : customTrackingParameter.getValue()){
                if (sb.length() > 0){
                    sb.append("&");
                }
                sb.append(customTrackingParameter.getKey());
                sb.append("=");
                sb.append(o.toString());
            }
        }
        
        return sb.toString();
    }
71218
function buildQueryString(params) {
    var querystring = '';
    for(param in params) {
        querystring += '&' + param + '=' + params[param];
    }
    return querystring;
}
1269453
protected String buildParamsQuery(final Map<String, String> params)
			throws UnsupportedEncodingException {
		StringBuilder builder = new StringBuilder();
		if (params.isEmpty()) {
			return builder.toString();
		}

		String sep = "";
		for (Map.Entry<String, String> entry : params.entrySet()) {
			builder.append(sep);
			builder.append(urlencode(entry.getKey()));
			builder.append("=");
			builder.append(urlencode(entry.getValue()));
			sep = "&";
		}

		return builder.toString();
	}
1313918
public String toQueryString() {
		final StringBuffer buf = new StringBuffer();
		final Object value1 = this.values.get(0);
		buf.append(this.column.getName());
		switch (this.type) {
		case STARTS_WIDTH:
			buf.append(" like '" + value1 + "%'");
			break;
		case CONTAINS:
			buf.append(" like '%" + value1 + "%'");
			break;
		case ENDS_WITH:
			buf.append(" like '%" + value1 + "'");
			break;
		case DOESNOT_CONTAINS:
			buf.append(" not like '%" + value1 + "%'");
			break;
		case MORE_THAN:
			buf.append(" > '" + value1 + "'");
			break;
		case LESS_THAN:
			buf.append(" < '" + value1 + "'");
			break;
		}
		return buf.toString();
	}
117466
private static String linkToHtml( Link l ){
		if( l == null ) {
			return "null";
		}

		StringBuilder result = new StringBuilder();

		result.append("<div class=\"Link\"><b class=\"Link\">Link:</b>" +
				l.getType() + ": \"" +
				convertTags( l.getText() )+ "\" -> \"" + convertTags( l.getTarget() ) +"\"");

		if( l.getParameters().size() != 0 ){
			for( String parameter: l.getParameters() ) {
				result.append("<br>\nPARAMETER: \""+convertTags( parameter )+"\"");
			}
		}

		result.append("</div>\n");

		return result.toString();
	}
240433
public function makelink()
    {
        /*
         * If link set directly that forces using it rather than build
         */
        if ($this->link) {
            return $this->link;
        }

        $pageid = static::makeParameterId($this->for);
        $parameters = $this->app['request']->query->all();
        if (array_key_exists($pageid, $parameters)) {
            unset($parameters[$pageid]);
        } else {
            unset($parameters['page']);
        }

        $parameters[$pageid] = '';
        $link = '?' . http_build_query($parameters);

        return $link;
    }
728593
public Query<T> build() {
    QueryBean<T> queryBean = new QueryBean<T>();
    queryBean.setStatement(genStatement());
    queryBean.setParams(getParams());
    if (null != limit) {
      queryBean.setLimit(new PageLimit(limit.getPageIndex(), limit.getPageSize()));
    }
    queryBean.setCountStatement(genCountStatement());
    queryBean.setCacheable(cacheable);
    queryBean.setLang(getLang());
    return queryBean;
  }
501618
function _buildQuery(){

            var url         = data.url;
            var cache       = typeof data.cache !== 'undefined' ? !!data.cache : true;
            var queryString = data.queryString || '';
            var _data       = data.data;

            //add a cache buster
            if(cache === false){
                queryString += '&ajabuster=' + new Date().getTime();
            }

            url = appendQueryString(url, queryString);

            if(_data && !_dataInBody()){
                url =  appendQueryString(url, _data);
            }
            return url;
        }