Search in sources :

Example 11 with EVTaskList

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);
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) BufferedWriter(java.io.BufferedWriter) TimeLog(net.sourceforge.processdash.log.time.TimeLog) TimeLogEntry(net.sourceforge.processdash.log.time.TimeLogEntry) CompletionStatus(net.sourceforge.processdash.tool.export.mgr.CompletionStatus) Iterator(java.util.Iterator) EVTaskList(net.sourceforge.processdash.ev.EVTaskList) RobustFileWriter(net.sourceforge.processdash.util.RobustFileWriter) PrintWriter(java.io.PrintWriter) HashSet(java.util.HashSet)

Example 12 with EVTaskList

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;
}
Also used : DefaultTaskLabeler(net.sourceforge.processdash.ev.DefaultTaskLabeler) TaskLabeler(net.sourceforge.processdash.ev.TaskLabeler) EVTaskListData(net.sourceforge.processdash.ev.EVTaskListData) EVTaskListRollup(net.sourceforge.processdash.ev.EVTaskListRollup) ArrayList(java.util.ArrayList) EVTaskList(net.sourceforge.processdash.ev.EVTaskList) EVTaskListMerged(net.sourceforge.processdash.ev.EVTaskListMerged) DefaultTaskLabeler(net.sourceforge.processdash.ev.DefaultTaskLabeler)

Example 13 with EVTaskList

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;
}
Also used : EVDependencyCalculator(net.sourceforge.processdash.ev.EVDependencyCalculator) Iterator(java.util.Iterator) EVTaskList(net.sourceforge.processdash.ev.EVTaskList) EVTaskListMerged(net.sourceforge.processdash.ev.EVTaskListMerged) TreeMap(java.util.TreeMap) Map(java.util.Map) TreeMap(java.util.TreeMap)

Example 14 with EVTaskList

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();
}
Also used : Entry(java.util.Map.Entry) Entry(java.util.Map.Entry) Iterator(java.util.Iterator) EVTaskList(net.sourceforge.processdash.ev.EVTaskList) OutputStreamWriter(java.io.OutputStreamWriter) Map(java.util.Map) Writer(java.io.Writer) OutputStreamWriter(java.io.OutputStreamWriter)

Example 15 with EVTaskList

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));
    }
}
Also used : EVTaskListFilter(net.sourceforge.processdash.ev.EVTaskListFilter) EVTaskListGroupFilter(net.sourceforge.processdash.ev.EVTaskListGroupFilter) EVSchedule(net.sourceforge.processdash.ev.EVSchedule) UserFilter(net.sourceforge.processdash.team.group.UserFilter) EVTaskList(net.sourceforge.processdash.ev.EVTaskList)

Aggregations

EVTaskList (net.sourceforge.processdash.ev.EVTaskList)26 EVTaskListRollup (net.sourceforge.processdash.ev.EVTaskListRollup)8 EVTaskListGroupFilter (net.sourceforge.processdash.ev.EVTaskListGroupFilter)7 UserFilter (net.sourceforge.processdash.team.group.UserFilter)7 ArrayList (java.util.ArrayList)5 EVSchedule (net.sourceforge.processdash.ev.EVSchedule)5 EVTask (net.sourceforge.processdash.ev.EVTask)5 EVTaskListFilter (net.sourceforge.processdash.ev.EVTaskListFilter)5 Iterator (java.util.Iterator)4 TreePath (javax.swing.tree.TreePath)4 Date (java.util.Date)3 HashSet (java.util.HashSet)3 DefaultTaskLabeler (net.sourceforge.processdash.ev.DefaultTaskLabeler)3 EVDependencyCalculator (net.sourceforge.processdash.ev.EVDependencyCalculator)3 EVTaskListData (net.sourceforge.processdash.ev.EVTaskListData)3 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 Set (java.util.Set)2 EVTaskFilter (net.sourceforge.processdash.ev.EVTaskFilter)2