use of net.sourceforge.processdash.log.time.ModifiableTimeLog in project processdash by dtuma.
the class HierarchyAlterer method renameData.
/** Rename some data.
*/
protected void renameData(PendingDataChange p) {
DashHierarchy newHierarchy = dashboard.getHierarchy();
DefectLogEditor.rename(origHierarchy, newHierarchy, p.oldPrefix, p.newPrefix, dashboard);
ModifiableTimeLog timeLog = (ModifiableTimeLog) dashboard.getTimeLog();
timeLog.addModification(PathRenamer.getRenameModification(p.oldPrefix, p.newPrefix));
dashboard.getData().renameData(p.oldPrefix, p.newPrefix);
}
use of net.sourceforge.processdash.log.time.ModifiableTimeLog 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);
}
}
}
use of net.sourceforge.processdash.log.time.ModifiableTimeLog in project processdash by dtuma.
the class HierarchyEditor method performDataRename.
private void performDataRename(PendingDataChange p) {
DefectLogEditor.rename(oldProps, useProps, p.oldPrefix, p.newPrefix, dashboard);
ModifiableTimeLog timeLog = (ModifiableTimeLog) dashboard.getTimeLog();
timeLog.addModification(PathRenamer.getRenameModification(p.oldPrefix, p.newPrefix));
dashboard.getData().renameData(p.oldPrefix, p.newPrefix);
}
Aggregations