private void addAttributeFilters(JSONObject conditionArgs) { List<String> include = new ArrayList<String>(), exclude = new ArrayList<String>(); getIncludeAndExclude(include, exclude, FilterFactory.ATTRIBUTE_TYPE); String includeSql = Utils.joinStrings(" OR ", include); String excludeSql = Utils.joinStrings(" OR ", exclude); addIfNonempty(conditionArgs, "include_attributes_where", includeSql); addIfNonempty(conditionArgs, "exclude_attributes_where", excludeSql); }
public void addQueryParameters(JSONObject parameters) { for (HeaderField field : getSelectedItems()) { field.addQueryParameters(parameters); } List<String> fixedValues = getFixedValues(); if (fixedValues != null) { JSONObject fixedValuesObject = Utils.setDefaultValue(parameters, "fixed_headers", new JSONObject()).isObject(); fixedValuesObject.put( getSelectedItems().get(0).getSqlName(), Utils.stringsToJSON(fixedValues)); } }
private List<String> getFixedValues() { String valueText = savedFixedValues.trim(); if (valueText.equals("")) { return null; } return Utils.splitListWithSpaces(valueText); }
private void addLabelFilters(JSONObject conditionArgs) { List<String> include = new ArrayList<String>(), exclude = new ArrayList<String>(); getIncludeAndExclude(include, exclude, FilterFactory.LABEL_TYPE); if (!savedShowInvalid) { exclude.add(TestLabelManager.INVALIDATED_LABEL); } if (!include.isEmpty()) { conditionArgs.put("include_labels", Utils.stringsToJSON(include)); } if (!exclude.isEmpty()) { conditionArgs.put("exclude_labels", Utils.stringsToJSON(exclude)); } }
public void addHistoryArguments(Map<String, String> arguments, String name) { List<String> fields = new ArrayList<String>(); for (HeaderField field : getSelectedItems()) { fields.add(field.getSqlName()); } String fieldList = Utils.joinStrings(",", fields); arguments.put(name, fieldList); if (isFixedValuesActive()) { arguments.put(name + HISTORY_FIXED_VALUES, display.getFixedValuesInput().getText()); } headerFields.addHistoryArguments(arguments); }
private String getField(String field) { return Utils.escape(Utils.jsonToString(test.get(field))); }
public void fillDefaultHistoryValues(Map<String, String> arguments) { Utils.setDefaultValue(arguments, "condition", ""); Utils.setDefaultValue(arguments, "show_invalid", Boolean.toString(savedShowInvalid)); }