use of net.sourceforge.processdash.ev.EVTaskListRollup 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();
}
}
use of net.sourceforge.processdash.ev.EVTaskListRollup in project processdash by dtuma.
the class TeamProjectSetupWizard method addScheduleToRollup.
protected boolean addScheduleToRollup(String teamScheduleName, String indivSchedPath) {
if (Settings.isReadOnly()) {
logger.fine("Cannot add schedule while in read-only mode.");
return false;
}
EVTaskList rollup = EVTaskList.openExisting(teamScheduleName, getDataRepository(), getPSPProperties(), getObjectCache(), false);
if (!(rollup instanceof EVTaskListRollup)) {
logger.fine("rollup not an EVTaskListRollup");
return false;
}
if (!rollup.addTask(indivSchedPath, getDataRepository(), getPSPProperties(), getObjectCache(), false)) {
logger.fine("addTask failed");
return false;
}
rollup.save();
logger.fine("saved changed task list");
return true;
}
use of net.sourceforge.processdash.ev.EVTaskListRollup in project processdash by dtuma.
the class EVCostConfidenceInterval method getUniqueTaskLists.
private static void getUniqueTaskLists(Object[] taskLists, Map<String, EVTaskList> results) {
for (int i = 0; i < taskLists.length; i++) {
EVTaskList taskList = (EVTaskList) taskLists[i];
if (taskList instanceof EVTaskListRollup) {
EVTaskListRollup rollup = (EVTaskListRollup) taskList;
List subTaskLists = rollup.getSubSchedules();
getUniqueTaskLists(subTaskLists.toArray(), results);
} else {
String key = taskList.getID();
if (!StringUtils.hasValue(key))
key = taskList.getTaskListName();
results.put(key, taskList);
}
}
}
Aggregations