use of net.sourceforge.processdash.ev.EVTaskList in project processdash by dtuma.
the class TextMetricsFileExporter method run.
public void run() {
try {
outWriter = new RobustFileWriter(dest, "UTF-8");
PrintWriter out = new PrintWriter(new BufferedWriter(outWriter));
// Find and print any applicable task lists.
Iterator i = ctx.getData().getKeys();
Set taskListNames = new HashSet();
String name;
int pos;
while (i.hasNext()) {
name = (String) i.next();
pos = name.indexOf(TASK_ORD_PREF);
if (pos != -1 && Filter.matchesFilter(filter, name))
taskListNames.add(name.substring(pos + TASK_ORD_PREF.length()));
}
i = taskListNames.iterator();
String owner = ProcessDashboard.getOwnerName(ctx.getData());
while (i.hasNext()) {
name = (String) i.next();
EVTaskList tl = EVTaskList.openExisting(name, ctx.getData(), ctx.getHierarchy(), ctx.getCache(), false);
if (tl == null)
continue;
tl.recalc();
String xml = tl.getAsXML(false);
name = exportedScheduleDataName(owner, name);
out.write(name + ",");
out.write(StringData.escapeString(xml));
out.println();
}
ctx.getData().dumpRepository(out, filter, DataRepository.DUMP_STYLE_TEXT);
TimeLog tl = ctx.getTimeLog();
Iterator keys = tl.filter(null, null, null);
while (keys.hasNext()) {
TimeLogEntry tle = (TimeLogEntry) keys.next();
if (Filter.matchesFilter(filter, tle.getPath()))
out.println(toAbbrevString(tle));
}
out.println(DefectXmlConstantsv1.DEFECT_START_TOKEN);
DefectExporterXMLv1 exp = new DefectExporterXMLv1();
exp.dumpDefects(ctx.getHierarchy(), filter, out);
out.close();
outWriter = null;
completionStatus = new CompletionStatus(CompletionStatus.SUCCESS, dest, null);
} catch (Exception ioe) {
completionStatus = new CompletionStatus(CompletionStatus.ERROR, dest, ioe);
System.out.println("IOException: " + ioe);
tryCancel();
}
ctx.getData().gc(filter);
}
use of net.sourceforge.processdash.ev.EVTaskList in project processdash by dtuma.
the class DataExtractionScaffold method getEVTaskLists.
private List<EVTaskList> getEVTaskLists(boolean includePersonal, boolean includeRollups) {
String[] taskListNames = EVTaskList.findTaskLists(data);
List<EVTaskList> result = new ArrayList<EVTaskList>(taskListNames.length);
TaskLabeler taskLabeler = null;
for (String taskListName : taskListNames) {
EVTaskList tl = EVTaskList.openExisting(taskListName, data, hierarchy, null, false);
if (tl instanceof EVTaskListData && !includePersonal)
continue;
if (tl instanceof EVTaskListRollup && !includeRollups)
continue;
tl.recalc();
tl = new EVTaskListMerged(tl, false, true, null);
if (taskLabeler == null) {
taskLabeler = new DefaultTaskLabeler(this);
taskLabeler.recalculate();
}
tl.setTaskLabeler(taskLabeler);
result.add(tl);
}
return result;
}
use of net.sourceforge.processdash.ev.EVTaskList in project processdash by dtuma.
the class ArchiveMetricsFileExporter method getEVSchedules.
private Map getEVSchedules(Collection taskListNames) {
Map schedules = new TreeMap();
for (Iterator iter = taskListNames.iterator(); iter.hasNext(); ) {
boolean merged = false;
String taskScheduleName = (String) iter.next();
if (taskScheduleName.startsWith(MERGED_PREFIX)) {
merged = true;
taskScheduleName = taskScheduleName.substring(MERGED_PREFIX.length());
}
EVTaskList tl = EVTaskList.openExisting(taskScheduleName, ctx.getData(), ctx.getHierarchy(), ctx.getCache(), false);
if (tl == null)
continue;
tl.setDependencyCalculator(new EVDependencyCalculator(ctx.getData(), ctx.getHierarchy(), ctx.getCache()));
tl.recalc();
if (merged)
tl = new EVTaskListMerged(tl, false, false, null);
schedules.put(taskScheduleName, tl);
}
return schedules;
}
use of net.sourceforge.processdash.ev.EVTaskList in project processdash by dtuma.
the class EVExporterXMLv1 method export.
public void export(OutputStream outStream, Map schedules) throws IOException {
Writer out = new OutputStreamWriter(outStream, ENCODING);
out.write(XML_HEADER + NEWLINE + NEWLINE);
out.write("<" + DOCUMENT_ELEM + ">" + NEWLINE);
for (Iterator iter = schedules.entrySet().iterator(); iter.hasNext(); ) {
Map.Entry e = (Entry) iter.next();
String taskScheduleName = (String) e.getKey();
EVTaskList tl = (EVTaskList) e.getValue();
String xml = tl.getAsXML(true);
xml = StringUtils.findAndReplace(xml, "\n", NEWLINE + INDENT + INDENT);
out.write(INDENT + "<" + SCHEDULE_ELEM + " " + SCHEDULE_NAME_ATTR + "='");
out.write(XMLUtils.escapeAttribute(taskScheduleName));
out.write("'>" + NEWLINE + INDENT + INDENT);
out.write(xml);
out.write(NEWLINE + INDENT + "</" + SCHEDULE_ELEM + ">" + NEWLINE);
}
out.write("</" + DOCUMENT_ELEM + ">" + NEWLINE);
out.flush();
}
use of net.sourceforge.processdash.ev.EVTaskList in project processdash by dtuma.
the class TimeRatioMemberTrackingChartData method recalc.
public void recalc() {
clearSeries();
// see if the user has permission to view personal data in this chart
UserFilter f = GroupPermission.getGrantedMembers(permissionID);
if (f == null)
return;
EVTaskListFilter pf = new EVTaskListGroupFilter(f);
MemberChartNameHelper nameHelper = new MemberChartNameHelper(rollup);
for (int i = 0; i < rollup.getSubScheduleCount(); i++) {
EVTaskList tl = rollup.getSubSchedule(i);
String personalDataID = tl.getPersonalDataID();
if (personalDataID != null && !pf.include(personalDataID))
continue;
EVSchedule subsched = tl.getSchedule();
String seriesName = nameHelper.get(tl);
maybeAddSeries(subsched.getTimeRatioTrackingChartSeries(seriesName, maxDataPoints));
}
}
Aggregations