use of net.sourceforge.processdash.log.time.TimeLog in project processdash by dtuma.
the class TimeLogPhaseWaterfallChart method getTimeLogEntries.
private List getTimeLogEntries() {
String path = getPrefix();
TimeLog tl = getDashboardContext().getTimeLog();
List result;
try {
result = Collections.list(tl.filter(path, null, null));
Collections.sort(result);
} catch (IOException e) {
e.printStackTrace();
result = Collections.EMPTY_LIST;
}
return result;
}
use of net.sourceforge.processdash.log.time.TimeLog 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.log.time.TimeLog in project processdash by dtuma.
the class TimeLogReport method getTimeLogEntries.
private List getTimeLogEntries() throws IOException {
// ensure the user has permission to view time log entries
UserFilter privacyFilt = GroupPermission.getGrantedMembers(PERMISSION);
noPermission = (privacyFilt == null);
someEntriesBlocked = false;
if (noPermission)
return Collections.EMPTY_LIST;
TimeLog tl = null;
List l = null;
String type = getParameter("type");
if ("rollup".equals(type)) {
// permission to view time logs from "Everyone," block the data.
if (!UserGroup.isEveryone(privacyFilt)) {
someEntriesBlocked = true;
return Collections.EMPTY_LIST;
} else {
tl = new RolledUpTimeLog.FromResultSet(getDashboardContext(), getPrefix(), parameters);
}
} else if ("db".equals(type)) {
l = queryDatabaseForTimeLogEntries(privacyFilt);
} else {
tl = getDashboardContext().getTimeLog();
}
if (tl != null)
l = Collections.list(tl.filter(getPrefix(), null, null));
Collections.sort(l);
return l;
}
use of net.sourceforge.processdash.log.time.TimeLog in project processdash by dtuma.
the class EVCalculatorData method recalculate.
public void recalculate() {
resetData();
recalcBaselineData(taskRoot);
scheduleStartDate = schedule.getStartDate();
reorderCompletedTasks = Settings.getBool("ev.sortCompletedTasks", true);
rezeroAtStartDate = getBoolSetting(EVMetadata.REZERO_ON_START_DATE, true);
pruneNodes(taskRoot, false);
double levelOfEffort = calculateLevelOfEffort(taskRoot);
// System.out.println("total level of effort = " + (levelOfEffort*100));
taskRoot.recalcPlanTimes();
taskRoot.recalcDateCompleted();
completionDate = taskRoot.dateCompleted;
effectiveDate = getEffectiveDate();
evLeaves = new LinkedList();
getEVLeaves(taskRoot);
if (containsTaskOrdinals(taskRoot))
assignTaskOrdinals(taskRoot, 1);
sortEVLeafList(evLeaves);
// debugEVLeafList(evLeaves);
// clean up the schedule
schedule.setLevelOfEffort(levelOfEffort);
schedule.cleanUp();
schedule.recalcCumPlanTimes();
// find time logged to tasks before the start of the schedule.
TimeLog log = timeLog;
try {
if (rezeroAtStartDate)
saveActualPreTime(log);
} catch (IOException ioe) {
ioe.printStackTrace();
schedule.getMetrics().addError("Unable to retrieve time log data.", taskRoot);
}
// calculate planned and actual earned values, planned dates, and
// planned and actual cumulative earned values
calcTaskValues(evLeaves);
saveCompletedTaskValues(evLeaves);
// reset the EVMetrics object
schedule.setEffectiveDate(effectiveDate);
schedule.getMetrics().reset(scheduleStartDate, effectiveDate, schedule.getPeriodStart(effectiveDate), schedule.getPeriodEnd(effectiveDate));
schedule.getMetrics().loadBaselineData(taskRoot);
// record actual time spent on tasks.
try {
saveActualScheduleTime(log);
} catch (IOException ioe) {
ioe.printStackTrace();
schedule.getMetrics().addError("Unable to retrieve time log data.", taskRoot);
}
schedule.recalcCumActualTimes();
// recalculate the EVMetrics object
taskRoot.checkForNodeErrors(schedule.getMetrics(), 0, new ArrayList(), new ArrayList(), false);
recalcMetrics(taskRoot, schedule.getMetrics());
schedule.getMetrics().recalcScheduleTime(schedule);
// create confidence intervals for cost and time
createCostConfidenceInterval();
createTimeErrConfidenceInterval();
replanDateCalculator.calculateForecastDates(taskRoot, schedule, schedule.getMetrics(), evLeaves);
forecastDateCalculator.calculateForecastDates(taskRoot, schedule, schedule.getMetrics(), evLeaves);
taskList.scanForMilestoneErrors(evLeaves);
recalculateTaskHierarchy(taskRoot);
saveCompletedTaskCosts(evLeaves);
// create confidence interval for schedule
createScheduleConfidenceInterval();
schedule.getMetrics().recalcComplete(schedule);
schedule.firePreparedEvents();
}
use of net.sourceforge.processdash.log.time.TimeLog in project processdash by dtuma.
the class OpenTimeLogEditor method showRollupTimeLog.
private void showRollupTimeLog() {
// ensure the user has permission to view time logs for everyone
if (!UserGroup.isEveryone(GroupPermission.getGrantedMembers(PERMISSION))) {
Component parent = null;
if (getDashboardContext() instanceof Component)
parent = (Component) getDashboardContext();
JOptionPane.showMessageDialog(parent, TimeLogEditor.resources.getStrings("Team_Forbidden.Message"), TimeLogEditor.resources.getString("Team_Forbidden.Title"), JOptionPane.ERROR_MESSAGE);
return;
}
TimeLog tl = new RolledUpTimeLog.FromResultSet(getDashboardContext(), getPrefix(), parameters);
TimeLogEditor e = new TimeLogEditor(tl, getAugmentedHierarchy(), null, null);
if (parameters.containsKey(RolledUpTimeLog.FromResultSet.MERGE_PREFIXES_PARAM))
try {
e.narrowToPath(getPrefix());
} catch (IllegalArgumentException iae) {
// this will be thrown if we attempt to narrow to a prefix that
// does not exist. It's best to ignore the error and proceed.
}
String displayPrefix = AnalysisPage.localizePrefix(getPrefix());
String title = TimeLogEditor.resources.format("Time_Log_Viewer_Window_Title_FMT", displayPrefix);
e.setTitle(title);
}
Aggregations