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();
}
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;
}
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;
}
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();
}
}
Aggregations