示例#1
0
  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);
  }
示例#2
0
  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));
    }
  }
示例#3
0
 private List<String> getFixedValues() {
   String valueText = savedFixedValues.trim();
   if (valueText.equals("")) {
     return null;
   }
   return Utils.splitListWithSpaces(valueText);
 }
示例#4
0
  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));
    }
  }
示例#5
0
  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);
  }
示例#6
0
 private String getField(String field) {
   return Utils.escape(Utils.jsonToString(test.get(field)));
 }
示例#7
0
 public void fillDefaultHistoryValues(Map<String, String> arguments) {
   Utils.setDefaultValue(arguments, "condition", "");
   Utils.setDefaultValue(arguments, "show_invalid", Boolean.toString(savedShowInvalid));
 }