Search in sources :

Example 1 with ModifiableTimeLog

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);
}
Also used : ModifiableTimeLog(net.sourceforge.processdash.log.time.ModifiableTimeLog)

Example 2 with ModifiableTimeLog

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);
        }
    }
}
Also used : ModifiableTimeLog(net.sourceforge.processdash.log.time.ModifiableTimeLog) TimeLogEntry(net.sourceforge.processdash.log.time.TimeLogEntry) Iterator(java.util.Iterator) TimeLogEntryVO(net.sourceforge.processdash.log.time.TimeLogEntryVO) Date(java.util.Date) HashSet(java.util.HashSet)

Example 3 with ModifiableTimeLog

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);
}
Also used : ModifiableTimeLog(net.sourceforge.processdash.log.time.ModifiableTimeLog)

Aggregations

ModifiableTimeLog (net.sourceforge.processdash.log.time.ModifiableTimeLog)3 Date (java.util.Date)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 TimeLogEntry (net.sourceforge.processdash.log.time.TimeLogEntry)1 TimeLogEntryVO (net.sourceforge.processdash.log.time.TimeLogEntryVO)1