Search in sources :

Example 1 with EVTaskListMerged

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

the class EVReport method writeMSProjXml.

/** Generate an XML document in Microsoft Project mspdi format.
     */
public void writeMSProjXml() throws IOException {
    MSProjectXmlWriter writer = new MSProjectXmlWriter();
    EVTaskFilter taskFilter = settings.getEffectiveFilter(evModel);
    EVTaskListMerged mergedModel = new EVTaskListMerged(evModel, false, true, taskFilter);
    writer.setTaskList(mergedModel);
    String taskListID = evModel.getID();
    String metadataPrefix = "/Task-Schedule-MS-Project/" + taskListID;
    writer.setMetadata(getDataRepository().getSubcontext(metadataPrefix));
    if (parameters.containsKey("dateStyle"))
        writer.setDateStyle(getParameter("dateStyle"));
    if (parameters.containsKey("showSaveAs"))
        writeContentDispositionHeader(".xml");
    outStream.write("Content-type: application/xml\r\n\r\n".getBytes(HTTPUtils.DEFAULT_CHARSET));
    writer.write(outStream);
    outStream.flush();
}
Also used : EVTaskFilter(net.sourceforge.processdash.ev.EVTaskFilter) EVTaskListMerged(net.sourceforge.processdash.ev.EVTaskListMerged)

Example 2 with EVTaskListMerged

use of net.sourceforge.processdash.ev.EVTaskListMerged 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 3 with EVTaskListMerged

use of net.sourceforge.processdash.ev.EVTaskListMerged 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 4 with EVTaskListMerged

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

the class EVReport method writeXML.

/** Generate a page of XML data for the Task and Schedule templates.
     */
public void writeXML() throws IOException {
    if (evModel.isEmpty()) {
        out.print("Status: 404 Not Found\r\n\r\n");
        out.flush();
    } else {
        outStream.write("Content-type: application/xml\r\n".getBytes());
        String owner = getOwner();
        if (owner != null)
            outStream.write((CachedURLObject.OWNER_HEADER_FIELD + ": " + owner + "\r\n").getBytes());
        outStream.write("\r\n".getBytes());
        if (evModel instanceof EVTaskListRollup && parameters.containsKey(MERGED_PARAM)) {
            evModel = new EVTaskListMerged(evModel, false, settings.shouldMergePreserveLeaves(), null);
        }
        outStream.write(XML_HEADER.getBytes("UTF-8"));
        outStream.write(evModel.getAsXML(true).getBytes("UTF-8"));
        outStream.flush();
    }
}
Also used : EVTaskListRollup(net.sourceforge.processdash.ev.EVTaskListRollup) EVTaskListMerged(net.sourceforge.processdash.ev.EVTaskListMerged)

Aggregations

EVTaskListMerged (net.sourceforge.processdash.ev.EVTaskListMerged)4 EVTaskList (net.sourceforge.processdash.ev.EVTaskList)2 EVTaskListRollup (net.sourceforge.processdash.ev.EVTaskListRollup)2 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 DefaultTaskLabeler (net.sourceforge.processdash.ev.DefaultTaskLabeler)1 EVDependencyCalculator (net.sourceforge.processdash.ev.EVDependencyCalculator)1 EVTaskFilter (net.sourceforge.processdash.ev.EVTaskFilter)1 EVTaskListData (net.sourceforge.processdash.ev.EVTaskListData)1 TaskLabeler (net.sourceforge.processdash.ev.TaskLabeler)1