use of net.sourceforge.processdash.ev.EVLabelFilter 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;
}
Aggregations