Search in sources :

Example 1 with EVHierarchicalFilter

use of net.sourceforge.processdash.ev.EVHierarchicalFilter in project processdash by dtuma.

the class EVReportSettings method getEffectiveFilter.

/** Build a task filter object that should be used to display the report.
     */
public EVTaskFilter getEffectiveFilter(EVTaskList evModel) {
    EVTaskFilter result = null;
    isRollup = evModel instanceof EVTaskListRollup;
    // first, look up any applicable label filter
    String labelFilter = null;
    if (parameters.containsKey(LABEL_FILTER_PARAM))
        labelFilter = getParameter(LABEL_FILTER_PARAM);
    else if (usingCustomizationSettings) {
        SimpleData val = getValue("settings//" + LABEL_FILTER_PARAM);
        labelFilter = (val == null ? null : val.format());
    }
    // if we found a label filter, apply it.
    if (StringUtils.hasValue(labelFilter)) {
        try {
            result = new EVLabelFilter(evModel, labelFilter, data);
        } catch (Exception e) {
        }
    }
    // next, look up any applicable path filter
    String pathFilter = null;
    if (parameters.containsKey(PATH_FILTER_PARAM))
        pathFilter = getParameter(PATH_FILTER_PARAM);
    else if (usingCustomizationSettings) {
        SimpleData val = getValue("settings//" + PATH_FILTER_PARAM);
        pathFilter = (val == null ? null : val.format());
    }
    // if we found a path filter, apply it
    if (StringUtils.hasValue(pathFilter)) {
        EVHierarchicalFilter hf = EVHierarchicalFilter.getFilter(evModel, pathFilter);
        if (hf != null)
            result = hf.appendFilter(result);
    } else {
        // next, look for a merged path filter
        String mergedPathFilter = null;
        if (parameters.containsKey(MERGED_PATH_FILTER_PARAM))
            mergedPathFilter = getParameter(MERGED_PATH_FILTER_PARAM);
        else if (usingCustomizationSettings) {
            SimpleData val = getValue("settings//" + MERGED_PATH_FILTER_PARAM);
            mergedPathFilter = (val == null ? null : val.format());
        }
        // if we found a merged path filter, apply it
        if (StringUtils.hasValue(mergedPathFilter)) {
            EVHierarchicalFilter hf = EVHierarchicalFilter.getFilterForMerged(evModel, mergedPathFilter);
            if (hf != null)
                result = hf.appendFilter(result);
        }
    }
    if (result != null)
        evModel.disableBaselineData();
    return result;
}
Also used : EVTaskFilter(net.sourceforge.processdash.ev.EVTaskFilter) EVLabelFilter(net.sourceforge.processdash.ev.EVLabelFilter) EVHierarchicalFilter(net.sourceforge.processdash.ev.EVHierarchicalFilter) EVTaskListRollup(net.sourceforge.processdash.ev.EVTaskListRollup) SimpleData(net.sourceforge.processdash.data.SimpleData)

Aggregations

SimpleData (net.sourceforge.processdash.data.SimpleData)1 EVHierarchicalFilter (net.sourceforge.processdash.ev.EVHierarchicalFilter)1 EVLabelFilter (net.sourceforge.processdash.ev.EVLabelFilter)1 EVTaskFilter (net.sourceforge.processdash.ev.EVTaskFilter)1 EVTaskListRollup (net.sourceforge.processdash.ev.EVTaskListRollup)1