use of net.sourceforge.processdash.log.time.TimeLogEntryVO in project processdash by dtuma.
the class RestoreIndivDataWorker method restoreTimeLogData.
private void restoreTimeLogData() throws IOException {
// make a list of the time log entries that are already logged against
// the project within the current dashboard.
Set<Date> knownEntries = new HashSet();
ModifiableTimeLog timeLog = (ModifiableTimeLog) ctx.getTimeLog();
Iterator i = timeLog.filter(projectPrefix, null, null);
while (i.hasNext()) {
TimeLogEntry tle = (TimeLogEntry) i.next();
knownEntries.add(tle.getStartTime());
}
// now scan the imported time log entries, and add any missing entries
// to the time log.
i = ImportedTimeLogManager.getInstance().getImportedTimeLogEntries(importPrefix);
while (i.hasNext()) {
TimeLogEntry tle = (TimeLogEntry) i.next();
if (!knownEntries.contains(tle.getStartTime())) {
String importedPath = tle.getPath();
String hierPath = mapPathToHierarchy(importedPath, MapType.KeepExtra);
TimeLogEntryVO newTle = new TimeLogEntryVO(timeLog.getNextID(), hierPath, tle.getStartTime(), tle.getElapsedTime(), tle.getInterruptTime(), tle.getComment(), ChangeFlagged.ADDED);
timeLog.addModification(newTle);
}
}
}
Aggregations