Search in sources :

Example 1 with DashboardTimeLog

use of net.sourceforge.processdash.log.time.DashboardTimeLog in project processdash by dtuma.

the class DashController method startTimingImpl.

private static void startTimingImpl() {
    DashboardTimeLog tl = (DashboardTimeLog) dash.getTimeLog();
    tl.getTimeLoggingModel().startTiming();
}
Also used : DashboardTimeLog(net.sourceforge.processdash.log.time.DashboardTimeLog)

Example 2 with DashboardTimeLog

use of net.sourceforge.processdash.log.time.DashboardTimeLog in project processdash by dtuma.

the class DashController method stopTimingImpl.

private static void stopTimingImpl() {
    DashboardTimeLog tl = (DashboardTimeLog) dash.getTimeLog();
    tl.getTimeLoggingModel().stopTiming();
}
Also used : DashboardTimeLog(net.sourceforge.processdash.log.time.DashboardTimeLog)

Example 3 with DashboardTimeLog

use of net.sourceforge.processdash.log.time.DashboardTimeLog in project processdash by dtuma.

the class TaskStatusApi method getTargetPath.

/** Retrieve the target path from the incoming HTTP request */
private String getTargetPath() {
    // use the prefix, if one was supplied in the request
    String result = getPrefix();
    // selected task
    if (!StringUtils.hasValue(result)) {
        DashboardContext ctx = getDashboardContext();
        DashboardTimeLog tl = (DashboardTimeLog) ctx.getTimeLog();
        TimeLoggingModel tlm = tl.getTimeLoggingModel();
        result = tlm.getActiveTaskModel().getPath();
    }
    // verify that the named path exists and is a leaf task
    DashHierarchy hier = getPSPProperties();
    PropertyKey key = hier.findExistingKey(result);
    if (key == null)
        throw new WebApiException("no-such-task", 404, "The task '" + result + "' was not found.");
    else if (hier.getNumChildren(key) != 0)
        throw new WebApiException("not-leaf-task", 400, "The item '" + result + "' is not a leaf task.");
    return result;
}
Also used : DashboardContext(net.sourceforge.processdash.DashboardContext) DashboardTimeLog(net.sourceforge.processdash.log.time.DashboardTimeLog) TimeLoggingModel(net.sourceforge.processdash.log.time.TimeLoggingModel) DashHierarchy(net.sourceforge.processdash.hier.DashHierarchy) PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 4 with DashboardTimeLog

use of net.sourceforge.processdash.log.time.DashboardTimeLog in project processdash by dtuma.

the class SizeMetricApiDispatcher method getTargetPath.

/** Retrieve the target path from the incoming HTTP request */
private String getTargetPath() {
    // use the prefix, if one was supplied in the request
    String result = getPrefix();
    // selected task
    if (!StringUtils.hasValue(result)) {
        DashboardContext ctx = getDashboardContext();
        DashboardTimeLog tl = (DashboardTimeLog) ctx.getTimeLog();
        TimeLoggingModel tlm = tl.getTimeLoggingModel();
        result = tlm.getActiveTaskModel().getPath();
    }
    return result;
}
Also used : DashboardContext(net.sourceforge.processdash.DashboardContext) DashboardTimeLog(net.sourceforge.processdash.log.time.DashboardTimeLog) TimeLoggingModel(net.sourceforge.processdash.log.time.TimeLoggingModel)

Example 5 with DashboardTimeLog

use of net.sourceforge.processdash.log.time.DashboardTimeLog in project processdash by dtuma.

the class DisplayState method writeTimingState.

private void writeTimingState() {
    DashboardContext ctx = getDashboardContext();
    DashboardTimeLog tl = (DashboardTimeLog) ctx.getTimeLog();
    TimeLoggingModel tlm = tl.getTimeLoggingModel();
    String path = tlm.getActiveTaskModel().getPath();
    String isTiming = tlm.isPaused() ? "false" : "true";
    out.write("Content-Type: text/plain\r\n\r\n");
    out.write("activeTask=" + path + "\r\n");
    out.write("isTiming=" + isTiming + "\r\n");
    out.flush();
}
Also used : DashboardContext(net.sourceforge.processdash.DashboardContext) DashboardTimeLog(net.sourceforge.processdash.log.time.DashboardTimeLog) TimeLoggingModel(net.sourceforge.processdash.log.time.TimeLoggingModel)

Aggregations

DashboardTimeLog (net.sourceforge.processdash.log.time.DashboardTimeLog)6 DashboardContext (net.sourceforge.processdash.DashboardContext)3 TimeLoggingModel (net.sourceforge.processdash.log.time.TimeLoggingModel)3 DashHierarchy (net.sourceforge.processdash.hier.DashHierarchy)2 PropertyKey (net.sourceforge.processdash.hier.PropertyKey)1 TimeLoggingApprover (net.sourceforge.processdash.log.time.TimeLoggingApprover)1 TimeLogEditor (net.sourceforge.processdash.log.ui.TimeLogEditor)1