use of net.sourceforge.processdash.tool.redact.EnabledFor in project processdash by dtuma.
the class FilterDataContainingTaskNames method hashRollupTaskListSpec.
@EnabledFor("/Task Lists$")
public String hashRollupTaskListSpec(String value) throws MalformedValueException {
List<String> taskLists = StringData.create(value).asList().asList();
ListData newVal = new ListData();
for (String elem : taskLists) {
elem = taskListMapper.hashTaskListName(elem);
newVal.add(elem);
}
return newVal.saveString().substring(1);
}
use of net.sourceforge.processdash.tool.redact.EnabledFor in project processdash by dtuma.
the class FilterTaskListMetadata method filterMetadata.
@EnabledFor("/Task_List_Metadata$")
public String filterMetadata(String metadata) {
Properties p = new Properties();
try {
String val = StringData.unescapeString(metadata);
p.load(new ByteArrayInputStream(val.getBytes("ISO-8859-1")));
} catch (Exception e) {
return null;
}
boolean madeChange = false;
if (stripComments && p.remove("Schedule_Notes") != null)
madeChange = true;
if (stripTaskLists && p.remove("Forecast.Range.Historical_Data") != null)
madeChange = true;
if (madeChange == false)
return metadata;
if (p.isEmpty())
return null;
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
p.store(out, "task list metadata");
return StringData.escapeString(out.toString("ISO-8859-1"));
} catch (IOException e) {
return null;
}
}
use of net.sourceforge.processdash.tool.redact.EnabledFor in project processdash by dtuma.
the class FilterDataContainingNotes method fixBaselineDescription.
@EnabledFor("Task-Schedule/.*/Snapshot/")
public String fixBaselineDescription(String data) {
int tagEnd = data.indexOf('>') + 1;
String tag = data.substring(0, tagEnd);
try {
String date = RedactFilterUtils.getXmlAttr(tag, "when");
Date ts = new Date(Long.parseLong(date.substring(1)));
String newName = "Baseline saved " + ts;
tag = RedactFilterUtils.replaceXmlAttr(tag, "name", newName);
} catch (Exception e) {
}
tag = RedactFilterUtils.discardXmlAttr(tag, "comment");
return tag + data.substring(tagEnd);
}
use of net.sourceforge.processdash.tool.redact.EnabledFor in project processdash by dtuma.
the class FilterDataContainingTaskNames method scrambleProbeList.
@EnabledFor({ "PROBE_LIST", "Subproject_Path_List" })
public String scrambleProbeList(String value) {
if (value == null || value.length() == 0)
return value;
List<String> list = StringData.create(value).asList().asList();
ListData newVal = new ListData();
for (String elem : list) newVal.add(pathNameMapper.getString(elem));
return newVal.saveString().substring(1);
}
Aggregations