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